var delay = "0";  //############# How long before window appears (seconds)
var winw = "400"; //############# How wide should your window be (pixels)
var winh = "300"; //############# How tall should the window be (pixels)
var repeat = "100"; //Do you want visitor to be able to re-open window after closing?

var ie=(document.all);
var ns=(document.layers);
var ns6=(document.getElementById && !ie);
var calculate=ns? "" : "px"

function loadElement(){
		if(!ns && !ie && !ns6) return;
		if(ie) popup=eval('document.all.elementDiv.style');
		else if(ns) popup=eval('document.layers["elementDiv"]');
		else if(ns6) popup=eval('document.getElementById("elementDiv").style');
		if (ie||ns6) popup.visibility="visible";
		else popup.visibility ="show";
		displayElement()
}

function displayElement(){
	var agent=navigator.userAgent.toLowerCase();
	
if (ie){
	documentWidth = (centerElement().offsetWidth)/2+centerElement().scrollLeft-(winw/2);
	documentHeight = (centerElement().offsetHeight)/2+centerElement().scrollTop-(winh/2);
}
else if (ns){
	documentWidth=window.innerWidth/2+window.pageXOffset-(winw/2);
	documentHeight=window.innerHeight/2+window.pageYOffset-(winh/2);
}
else if (ns6){
	documentWidth=self.innerWidth/2+window.pageXOffset-(winw/2);
	documentHeight=self.innerHeight/2+window.pageYOffset-(winh/2);
}
popup.left = documentWidth+calculate;
popup.top = documentHeight+calculate;
setTimeout("displayElement()",100);
}

function centerElement(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function closeElement(){
	if (ie||ns6) { popup.display="none"; } 
	else { popup.visibility ="hide"; }
        if (repeat == 1) { location.replace; }
}