function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; SafeAddOnresize(MM_reloadPage); }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function sh() { //v6.0
  var i,p,v,obj,args=sh.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// Determine browser.
var isMinNS4 = document.layers;
var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var dom=document.getElementById&&!ie;
// Browser Detection
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;

function getLeft(aDiv) {
	if (aDiv.offsetParent) return (aDiv.offsetLeft + getLeft(aDiv.offsetParent));
	else return (aDiv.offsetLeft);
}

function getTop(aDiv) {
	if ( aDiv.offsetParent  ) return (aDiv.offsetTop + getTop(aDiv.offsetParent));
	else return (aDiv.offsetTop);
}

function moveLayerTo(aDiv, x, y) {
	if (isMinNS4) aDiv.moveTo(x, y);
	if (ie||dom) {
		sS=""; if ((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1) && (!window.opera)) {sS="px";}
		aDiv.style.left = x + sS; aDiv.style.top = y + sS;
	}
}

function openWin( windowURL, windowName, windowFeatures ) { 
	return window.open( windowURL, windowName, windowFeatures ) ; 
}

// Body onresize utility (supports multiple onresize functions)
if (!gSafeOnresize)
	var gSafeOnresize = new Array();
function SafeAddOnresize(f)
{
	if (IEmac && IE4)  // IE 4.5 blows out on testing window.onresize
	{
		window.onresize = SafeOnresize;
		gSafeOnresize[gSafeOnresize.length] = f;
	}
	else if  (window.onresize)
	{
		if (window.onresize != SafeOnresize)
		{
			gSafeOnresize[0] = window.onresize;
			window.onresize = SafeOnresize;
		}		
		gSafeOnresize[gSafeOnresize.length] = f;
	}
	else
		window.onresize = f;
}

function SafeOnresize()
{
	for (var i=0;i<gSafeOnresize.length;i++)
		gSafeOnresize[i]();
}

// Body onload utility (supports multiple onload functions)
if (!gSafeOnload)
	var gSafeOnload = new Array();
function SafeAddOnload(f)
{
try {
	if (IEmac && IE4)  // IE 4.5 blows out on testing window.onload
	{
		window.onload = SafeOnload;
		gSafeOnload[gSafeOnload.length] = f;
	}
	else if (window.onload)
	{
		
		if (window.onload != SafeOnload)
		{
			gSafeOnload[0] = window.onload;
			window.onload = SafeOnload;
		}		
		gSafeOnload[gSafeOnload.length] = f;
	}
	else {
		window.onload = f;
		//alert(window.onload);
	}
}
catch (e) {}
}

function SafeOnload()
{
	for (var i=0;i<gSafeOnload.length;i++) {
		gSafeOnload[i]();
		}
}

function gobaz (aURL) {
	window.location.href = aURL;
}

function getCookieValue(key) {
	if (document.cookie) {
		aPairs=document.cookie.split(';');
		for (var i=0;i < aPairs.length;i++) {
			aKeyValue = aPairs[i].split('=');
			if (aKeyValue[0].indexOf(key) >= 0)
				return aKeyValue[1];
		}
	}
	return;
}
function setCookieValue(key,value) {
	//alert(document.cookie);
	if (document.cookie) {
		tmp = document.cookie;
		bExisted = false;
		aPairs=document.cookie.split(';');
		for (var i=0;i < aPairs.length;i++) {
			aKeyValue = aPairs[i].split('=');
			if (aKeyValue[0].indexOf(key) >= 0) {
				aKeyValue[1] = value;
				bExisted = true;
			}
			if (tmp.length)
				tmp += ';';
			tmp += aKeyValue[0] + '=' + aKeyValue[1];
		}
		if (!bExisted) {
			if (tmp.length)
				tmp += ';';
			tmp += key + '=' + value;
		}
		document.cookie = tmp;
	}	
	//alert(document.cookie);
	return;
}

function baz_getCookie(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 baz_setCookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

function baz_deleteCookie(name,path,domain) {
    if (baz_getCookie(name)) document.cookie = name + "=" +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

//PHPAds
function phpads_deliverActiveX(content)
	{document.write(content);}