<!--
var rows = new Array(); // Array to keep row status info in
var name = "menucookie"; // cookie name for menu state
var delim = "~"; // delimiter for pseudoarray
var today = new Date();
var expires = new Date(today.getTime() + (56 * 86400000));
function Get_Cookie(name) {
	var start = document.cookie.indexOf(name+"=");
	var len = start+name.length+1;
	if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
	if (start == -1) return null;
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "/") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}
function Delete_Cookie(name,path,domain) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
        ( (path) ? ";path=" + path : "/") +
        ( (domain) ? ";domain=" + domain : "") +
        ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function itemToggle(item) {
	obj=document.getElementById(item);
	if (obj){
		im=document.getElementById("im"+item);
		i = item.substr((item.length-1),1);
		visible=(obj.style.display!="none")
		if (visible){ 
			obj.style.display="none";
			im.src="gfx/plus.gif";
			rows[i]=0;
		} else {
			obj.style.display="block";
			im.src="gfx/minus.gif";
			rows[i]=1;
		}
		if (remember){
			// Write cookie to save menu state
			var val = "";
			for (x in rows){
				if (rows[x]==1)	{ val+=x+delim; }
			}
			val = val.substr(0,val.length-1);
			Delete_Cookie(name);
			Set_Cookie(name,val,expires,"/");
		}
	}
}
function initOpen() {
	if (remember){
		var y = Get_Cookie(name);
		if (y) {
			y = y.split(delim);
			for (x in y) {
				var elem = "nav"+y[x];
				itemToggle(elem);
				rows[x]=1;
			}
		}
	} else {
		itemToggle("nav0");
		Set_Cookie(name,"",expires,"/");
		Delete_Cookie(name);
	}
}
function widgetToggle(item) {
	obj=document.getElementById(item);
	if (obj){
		im=document.getElementById("im"+item);
		visible=(obj.style.display!="none")
		if (visible){ 
			obj.style.display="none";
			if (im){
				im.src="images/plus.gif";
			}
		} else {
			obj.style.display="block";
			if (im){
				alert("yup");
				im.src="images/minus.gif";
			}
		}
	}
}
function doPopup(key) {
	var height=400, width=600;
	x = (640 - width)/2, y = (480 - height)/2;
	if (screen) { y = (screen.availHeight - height)/2; x = (screen.availWidth - width)/2;}
	window.open('popup.php?key='+key,'popup','height='+height+',width='+width+',menubar=no,scrollbars=yes,resizable=yes,screenX='+x+',screenY='+y+',top='+y+',left='+x);
}
function checkForm() {
	var n = document.getElementById("name");
	var e = document.getElementById("email");
	var c = document.getElementById("country");
	if (n.value.length==0){
		alert("Please fill in your name.\nName, email and country are mandatory.");
		n.focus();
		n.style.backgroundColor='#ee9900';
		return false;
	}
	if (c.value.length==0){
		alert("Please fill in your country.\nName, email and country are mandatory.");
		c.focus();
		c.style.backgroundColor='#ee9900';
		return false;
	}
	if (e.value.length==0){
		alert("Please fill in your email address.\nName, email and country are mandatory.");
		e.focus();
		e.style.backgroundColor='#ee9900';
		return false;
	}
	return true;
}
function nPop(id) {
	var height=400, width=600;
	x = (640 - width)/2, y = (480 - height)/2;
	if (screen) { y = (screen.availHeight - height)/2; x = (screen.availWidth - width)/2;}
	window.open('npop.php?id='+id,'npop','height='+height+',width='+width+',menubar=no,scrollbars=yes,resizable=yes,screenX='+x+',screenY='+y+',top='+y+',left='+x);
}
//-->
