var pwaitint;
window.onload = bravoLoad;

function bravoLoad() {
	initToolTip();
	addToolTips();
	setheight();
	if (getLoc() == "easy_add.asp" || getLoc() == "easyadd/" || getLoc() == "easyadd/default.asp") { makenewrow(15); prePop(); }
	if (getLoc() == "cart_order.asp") { orderLoad(); }
	if (getLoc() == "cart_view.asp") { updatehead(); }
	if (getLoc() == "order_history.asp") { document.getElementById("admin_pass").focus(); }
	if (getLoc() == "my_account.asp") { document.getElementById("admin_pass").focus(); }
	if (getLoc() == "support/" || getLoc() == "support/default.asp") { loadsupport(); }
	//window.setInterval("updateForceLink();", 5000);
}

function getLoc() {
	var winloc = window.location.href;
	winloc = winloc.split(".com/");
	winloc = winloc[1].split("?")[0];
	//winloc = winloc[winloc.length-1].split(".")[0];
	return winloc.toLowerCase();
}

function phide() {
	var pwaitblur = document.getElementById("pwaitblur");
	var pleasewait = document.getElementById("pleasewait");
	window.clearTimeout(pwaitint);
	pwaitblur.style.visibility = "hidden";
	pleasewait.style.visibility = "hidden";
		
}

function pClear() {
	var pwaitblur = document.getElementById("pwaitblur");
	var pleasewait = document.getElementById("pleasewait");
	pleasewait.style.visibility = "hidden";
	pwaitblur.style.visibility = "hidden";
}

function pwait(ran) {
	var pwaitblur = document.getElementById("pwaitblur");
	var pleasewait = document.getElementById("pleasewait");
	setheight();
	if (typeof(ran)!="number") ran=0;
	pwaitblur.style.visibility = "visible";
	document.getElementById("pwimg").src = "/images/pwait.gif?aqwd=15151";
	var ftable = document.getElementById("pwtable");
	pleasewait.style.visibility = "visible";
	objh = parseFloat(pleasewait.style.height)/2;
	objw = parseFloat(pleasewait.style.width)/2;
	pleasewait.style.top = Math.floor(Math.round((document.documentElement.offsetHeight/2)+document.body.scrollTop)-objh)+'px';
    pleasewait.style.left = Math.floor(Math.round((document.documentElement.offsetWidth/2)+document.body.scrollLeft)-objw)+'px';
    ran++;
    if (ran<=6) {
		window.setTimeout("pwait("+ran+")", 50);
    }
}

function InformationalPopup(val, bln_show) {
	pop = document.getElementById("informational_pop");
	if (bln_show==true) {
		document.getElementById("informational").innerHTML = val;
		objh = parseFloat(pop.style.height)/2;
		objw = parseFloat(pop.style.width)/2;
		pop.style.top = Math.floor(Math.round((document.documentElement.offsetHeight/2)+document.body.scrollTop)-objh)+'px';
		pop.style.left = Math.floor(Math.round((document.documentElement.offsetWidth/2)+document.body.scrollLeft)-objw)+'px';	
		pop.style.display = "block";
		window.setTimeout("setOnClick();", 100);
	} else {
		document.body.onclick = "";
		pop.style.display = "none";
    }
}

function setOnClick() {
		document.body.onclick = function () { InformationalPopup("", false); }
}