var pic = null
var popImg = null  // use this when referring to pop-up image
var imgCount = 0
var imgWinName = "popImg"

function openWindow(picUrl, picName, functions){
window.open(picUrl,picName,functions);
}

function closePopImg(){    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close() 
}

function setStatus(msg){
  status = msg
  return true
}

function PopupPic(sPicURL) {
window.open( "popup.htm?"+sPicURL, "","resizable=1,height=10,width=10");
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
function overlay(e) {
	if (!e)
	{
		var e=window.event;
	}
	if (e.pageX || e.pageY) 	{
		dialogX = e.pageX;
		dialogY = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		dialogX = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		dialogY = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}	
	dialogY = dialogY + 10;
	dialogX = dialogX - 500;
	el = document.getElementById("registration");
	el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
	el.style.top = dialogY + "px";
	el.style.left = dialogX + "px";
	
}
function nowiseeyou(x,y,w) {
	el = document.getElementById('registration');
	el.style.visibility =  "visible";	
	el.style.top = x + "px";
	el.style.left = y + "px";
	el.style.width = w + "px";
}

