function soopaPopSetup() {
	var a;
	for (var i = 0; (a = document.links[i]); i++) {
		if (a.target && a.target.indexOf("_soopaPop") == 0) {
			a.onclick = soopaPop;
		}
		}
}

function soopaPop() {
	var a = this.target.split(":");
	var sFeatures = a[1];
	window.open(this.href, a.length > 2 ? a[2] : String((new Date()).getTime()), sFeatures);
	return false;
	alert("hi")
}

if (window.addEventListener)
window.addEventListener("load", soopaPopSetup, false)
else if (window.attachEvent)
window.attachEvent("onload", soopaPopSetup)
else if (document.getElementById)
window.onload=soopaPopSetup;



/* USAGE:

First, include the library in the head of your document like so:

<script language="javascript" src="soopa-pop.js"></script>

The script is called onload automatically now!

When you would like a link to open in a popup window, 
specify "_soopaPop:sFeatures:sName" for the TARGET attribute of the anchor 
(where sFeatures is the list of window features, and 
sName is an optional name for the new window).

<!--	
	since no name is specified for the first two anchors, 
	new windows will be generated each time they are clicked 
-->
<a href="remote.html" target="_soopaPop:width=300,height=300,resizable">...
<a href="remote2.html" target="_soopaPop:width=375,height=200,resizable">...

<!-- 
	since these two anchors have names specified, they will always 
	target the same windows. detailWindow will only be created once 
-->
<a href="product.asp?id=3421" target="_soopaPop:width=250,height=250:detailWindow">...
<a href="product.asp?id=3425" target="_soopaPop:width=250,height=250:detailWindow">...


*/