var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
var lS = "/";
var url = window.location.pathname;
var idx = url.indexOf(lS,1);
var rootPath = url.substring(0,idx+1);
if (sPage != "hp.aspx") {
	if (parent.header) {
		var TH = parent.header.location.href;
		var tP = TH.substring(TH.lastIndexOf('/') + 1);
		var tPage = rootPath + "TopNav.aspx";
		if (tP != "TopNav.aspx") {
			parent.header.location.replace(tPage);
		}
	}
}
if (sPage != "Wait4Confirm.aspx") {
	if (parent.CurrentCust) {
		var TH = parent.CurrentCust.location.href;
		var tP = TH.substring(TH.lastIndexOf('/') + 1);
		var tPage = rootPath + "CurrentCust.aspx";
		if (tP != "CurrentCust.aspx") {
			parent.CurrentCust.location.replace(tPage);
		}
	}
}

document.write("<script src='Scripts/browser_detect.js' type='text/javascript'></script>");

function ModalDialog(name,height,width,args) {
	var retval="";
	if (browser) {
		var props = ""
		if (browser.isGecko==false) {
			props = "dialogHeight: " + height + "px; dialogWidth: " + width + "px; edge: Raised;"
			props += "center: Yes; help: No; resizable: yes; status: No; scroll: No;"
			retval = window.showModalDialog('dhf.htm?' + name,args,props);
			return retval;
		} else {
			var props = "width=" + width + ",height=" + height + ",resizable=no"
			retval = window.open('dhf.htm?' + name, '', props);
			return retval;
		}
	} else {
		var props = "width=" + width + ",height=" + height + ",resizable=no"
		retval = window.open('dhf.htm?' + name, '', props);
		return retval;
	}
}