function nav_global_over( cell, hoverFlag ) {
	if ( hoverFlag ) {
		cell.style.backgroundImage = 'url("../images/nav_global_background.gif")';
		if ( document.getElementsByTagName ) {
			cell.getElementsByTagName( 'a' )[0].style.color = '#FF0';
		}
	} else {
		cell.style.backgroundImage = 'url("")';
		if ( document.getElementsByTagName ) {
			cell.getElementsByTagName( 'a' )[0].style.color = '#FF0';
		}
	}
}

function centeredpopup(url, width, height){
	window.open(url, 'popupwindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,' +
				'width=' + width + ',height=' + height + ', left=' + ((screen.width/2) - (width/2)) + ', top=' + ((screen.height/2) - (height/2)) + '');
}

function centeredpopup_noscroll(url, width, height) {
	window.open(url, 'popupwindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,' +
				'width=' + width + ',height=' + height + ', left=' + ((screen.width/2) - (width/2)) + ', top=' + ((screen.height/2) - (height/2)) + '');
}

function SetCookie (name, value) { 
	var argv = SetCookie.arguments; 
	// alert('argv: ' + argv);
	var argc = SetCookie.arguments.length; 
	// alert('argc: ' + argc);
	var expires = (argc > 2) ? argv[2] : null; 
	// var expDays = 30;
	// var expires = new Date();
	// expires.setTime(expires.getTime() + (expDays*24*60*60*1000));
	// expires = expires.toGMTString();
	// alert('expires: ' + expires);
	var path = (argc > 3) ? argv[3] : null; 
	// alert('path: ' + path);
	var domain = (argc > 4) ? argv[4] : null; 
	// alert('domain: ' + domain);
	var secure = (argc > 5) ? argv[5] : false; 
	// alert('secure: ' + secure);
	document.cookie = name + "=" + escape (value)
	                + ((expires == null) ? "" : ("; expires=" + expires.toGMTString()))
					+ ((path == null) ? "" : ("; path=" + path))
					+ ((domain == null) ? "" : ("; domain=" + domain))
					+ ((secure == true) ? "; secure" : "");
	// alert('document.cookie: ' + document.cookie);
}

function DeleteCookie (name) { 
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	// This cookie is history 
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function GetCookie (name) { 
	var arg = name + "="; 
	var alen = arg.length; 
	var clen = document.cookie.length; 
	var i = 0; 
	while (i < clen) { 
		var j = i + alen; 
		if (document.cookie.substring(i, j) == arg) { return getCookieVal (j); }
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) { break; }
	} return null;
}

function getCookieVal (offset) { 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) {
		endstr = document.cookie.length; 
	}
	return unescape(document.cookie.substring(offset, endstr));
}


