/* Browser check */
IS_DOM = (document.getElementById) ? true : false;
IS_IE = (document.all) ? true : false;
IS_IE50 = (navigator.userAgent.indexOf("IE 5.0") != -1);
IS_Mac = (navigator.appVersion.indexOf("Mac") != -1);

// preload level 1 mains
var topLevelNav = new Array();
topLevelNav = ["", "about", "demo", "faq", "sign-up", "log-in", "dashboard"];
for (var i = 0; i < topLevelNav.length; i++) { 
	eval("main" + i + "on = new Image();"); eval("main" + i + "off = new Image();");
	eval("main" + i + "on.src = \"" + sFolderDepth + "img/navigation/" + topLevelNav[i] + "-r.gif\";");
	eval("main" + i + "off.src = \"" + sFolderDepth + "img/navigation/" + topLevelNav[i] + "-0.gif\";");
	if (sSelectedNavigation == topLevelNav[i]) {
		eval("main" + i + "on.src = \"" + sFolderDepth + "img/navigation/" + topLevelNav[i] + "-1.gif\";");
		eval("main" + i + "off.src = \"" + sFolderDepth + "img/navigation/" + topLevelNav[i] + "-1.gif\";");
	}
}

// Image Swapping
function changeImages() 
{
  if (document.getElementById) {
    for (var i = 0; i < changeImages.arguments.length; i += 2) { 
  		document.getElementById(changeImages.arguments[i]).src = eval(changeImages.arguments[i + 1] + ".src"); 
	}
  }
}

// centered popup window script
function centeredPopUpWindow(mypage, myname, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}