How are the links being placed? You could contain them in one container and loop through all the links, and assign an onclick event on each of them:
Code:
<script type="text/javascript">
var ray={
/**
* links array accepts three params
@ param1 - URL you wish to open
@ param2 - name of the window
@ param3 - window preferences
*/
links:
[
['http://www.google.com','window1','width=300,height=300'],
['http://www.yahoo.com','window2','width=500,height=500,top=100,left=100'],
['http://www.dynamicdrive.com','window3','left=500,width=300,height=300'] // No comma
], // Links you wish to open together with the window name and the preferences
loop:function(el)
{
var lnkArr=this.getID(el).getElementsByTagName('a');
for(var i=0;i<lnkArr.length;i++)
{
lnkArr[i].onclick=function()
{
for(var c=0;c<ray.links.length;c++)
window.open(ray.links[c][0],ray.links[c][1],ray.links[c][2]);
}
}
},
getID:function(el)
{
return document.getElementById(el);
}
}
window.onload=function()
{
ray.loop('contain'); // Pass the ID of the container here
}
</script>
<div id="contain">
<a href="#">Top Anchor</a><br>
<a href="http://www.google.com">http://www.google.com</a><br>
<a href="http://www.yahoo.com">http://www.yahoo.com</a><br>
</div>
Hope that helps.
Bookmarks