var isLowNSBrowser = false;
var isLowIEBrowser = false;
var isHighIEBrowser = false;
var isHighNSBrowser = false;
var isHighBrowser = false;

if(navigator.appName == "Netscape")
{
	if(parseInt(navigator.appVersion) > 4)
	{
		isHighNSBrowser = true;
		isHighBrowser = true;
	}
	else
	{
		isLowNSBrowser = true;
	}
}
else if(navigator.appName == "Microsoft Internet Explorer")
{
	var searchString = navigator.appVersion.split("MSIE")
	searchString = searchString[1].split(";");
	if (parseInt(searchString[0]) >= 5)
	{
		isHighIEBrowser = true;
		isHighBrowser = true;
	}
	else
	{
		isLowIEBrowser = true;
	}
}

	var isLoaded = false;
	
	var pronumoff = new Array(7);
	var pronumon = new Array(7);
	var lineoff = new Array(7);
	var lineon = new Array(7);
	var blurboff = new Array(7);
	var blurbon = new Array(7);
	var pageNames = new Array(7);
	
	for (var i=0;i<7;i++) {
		pronumoff[i] = new Image();
		pronumon[i] = new Image();
		lineoff[i] = new Image();
		lineon[i] = new Image();
		blurboff[i] = new Image();
		blurbon[i] = new Image();
	}
	
	pageNames[0] = "welcome";
	pageNames[1] = "playnums";
	pageNames[2] = "decide";
	pageNames[3] = "prequal";
	pageNames[4] = "findhome";
	pageNames[5] = "makeoffr";
	pageNames[6] = "closing";
	
	pronumoff[0].src = "/images/pnav1.gif";
	pronumoff[1].src = "/images/pnav2.gif";
	pronumoff[2].src = "/images/pnav3.gif";
	pronumoff[3].src = "/images/pnav4.gif";
	pronumoff[4].src = "/images/pnav5.gif";
	pronumoff[5].src = "/images/pnav6.gif";
	pronumoff[6].src = "/images/pnav7.gif";
	lineoff[0].src = "/images/trans.gif";
	lineoff[1].src = "/images/trans.gif";
	lineoff[2].src = "/images/trans.gif";
	lineoff[3].src = "/images/trans.gif";
	lineoff[4].src = "/images/trans.gif";
	lineoff[5].src = "/images/trans.gif";
	lineoff[6].src = "/images/trans.gif";
	blurboff[0].src = "/images/pnav1_welcome.gif";
	blurboff[1].src = "/images/pnav2_playnumbers.gif";
	blurboff[2].src = "/images/pnav3_decideloan.gif";
	blurboff[3].src = "/images/pnav4_getprequal.gif";
	blurboff[4].src = "/images/pnav5_findhome.gif";
	blurboff[5].src = "/images/pnav6_makeoffer.gif";
	blurboff[6].src = "/images/pnav7_Closing.gif";
	pronumon[0].src = "/images/pnav1_on.gif";
	pronumon[1].src = "/images/pnav2_on.gif";
	pronumon[2].src = "/images/pnav3_on.gif";
	pronumon[3].src = "/images/pnav4_on.gif";
	pronumon[4].src = "/images/pnav5_on.gif";
	pronumon[5].src = "/images/pnav6_on.gif";
	pronumon[6].src = "/images/pnav7_on.gif";
	lineon[0].src = "/images/pnav_line.gif";
	lineon[1].src = "/images/pnav_line.gif";
	lineon[2].src = "/images/pnav_line.gif";
	lineon[3].src = "/images/pnav_line.gif";
	lineon[4].src = "/images/pnav_line.gif";
	lineon[5].src = "/images/pnav_line.gif";
	lineon[6].src = "/images/pnav_line.gif";
	blurbon[0].src = "/images/pnav1_welcome_on.gif";
	blurbon[1].src = "/images/pnav2_playnumbers_on.gif";
	blurbon[2].src = "/images/pnav3_decideloan_on.gif";
	blurbon[3].src = "/images/pnav4_getprequal_on.gif";
	blurbon[4].src = "/images/pnav5_findhome_on.gif";
	blurbon[5].src = "/images/pnav6_makeoffer_on.gif";
	blurbon[6].src = "/images/pnav7_Closing_on.gif";

isLoaded = true;

function showProcess(divName) {
	if ((isHighBrowser) && (isLoaded)) {
		if (document.getElementById("welcome") != null) {
			document.getElementById("welcome").style.visibility = "hidden";
		}
		if (document.getElementById("playnums") != null) {
			document.getElementById("playnums").style.visibility = "hidden";
		}
		if (document.getElementById("decide") != null) {
			document.getElementById("decide").style.visibility = "hidden";
		}
		if (document.getElementById("prequal") != null) {
			document.getElementById("prequal").style.visibility = "hidden";
		}
		if (document.getElementById("findhome") != null) {
			document.getElementById("findhome").style.visibility = "hidden";
		}
		if (document.getElementById("makeoffr") != null) {
			document.getElementById("makeoffr").style.visibility = "hidden";
		}
		if (document.getElementById("closing") != null) {
			document.getElementById("closing").style.visibility = "hidden";
		}
	} else if ((isLowIEBrowser) && (isLoaded)) { 
		if (document.all["welcome"] != null) {
			document.all["welcome"].style.visibility = "hidden";
		}
		if (document.all["playnums"] != null) {
			document.all["playnums"].style.visibility = "hidden";
		}
		if (document.all["decide"] != null) {
			document.all["decide"].style.visibility = "hidden";
		}
		if (document.all["prequal"] != null) {
			document.all["prequal"].style.visibility = "hidden";
		}
		if (document.all["findhome"] != null) {
			document.all["findhome"].style.visibility = "hidden";
		}
		if (document.all["makeoffr"] != null) {
			document.all["makeoffr"].style.visibility = "hidden";
		}
		if (document.all["closing"] != null) {
			document.all["closing"].style.visibility = "hidden";
		}
	} else if ((isLowNSBrowser) && (isLoaded)) {
		if (document.layers["welcome"] != null) {
			document.layers["welcome"].visibility = "hide";
		}
		if (document.layers["playnums"] != null) {
			document.layers["playnums"].visibility = "hide";
		}
		if (document.layers["decide"] != null) {
			document.layers["decide"].visibility = "hide";
		}
		if (document.layers["prequal"] != null) {
			document.layers["prequal"].visibility = "hide";
		}
		if (document.layers["findhome"] != null) {
			document.layers["findhome"].visibility = "hide";
		}
		if (document.layers["makeoffr"] != null) {
			document.layers["makeoffr"].visibility = "hide";
		}
		if (document.layers["closing"] != null) {
			document.layers["closing"].visibility = "hide";
		}
	}
	
	var left;
	var top;
	
	switch ( divName )
	{
		case "welcome" :
			left = 0;
			break;
		case "playnums" :
			left = 75;
			break;
		case "decide" :
			left = 150;
			break;
		case "prequal" :
			left = 225;
			break;
		case "findhome" :
			left = 300;
			break;
		case "makeoffr" :
			left = 375;
			break;
		case "closing" :
			left = 450;
			break;
	}
	
	left += 11;
	
	if(isHighIEBrowser || isLowIEBrowser){
		top = 138;
	}else if(isHighNSBrowser){
		top = 128;
	}else if(isLowNSBrowser){
		top = 132;
	}
	
	if ((isHighBrowser) && (isLoaded) && (document.getElementById(divName) != null)) {
		document.getElementById(divName).style.visibility = "visible";
		document.getElementById(divName).style.top = getOffsetTop() + top;
		document.getElementById(divName).style.left = getOffsetLeft() + left;
	}
	else if ((isLowIEBrowser) && (isLoaded) && (document.all[divName] != null)) {
		document.all[divName].style.visibility = "visible";
		document.all[divName].style.top = getOffsetTop() + top;
		document.all[divName].style.left = getOffsetLeft() + left;
	}
	else if ((isLowNSBrowser) && (isLoaded) && (document.layers[divName] != null)) {
		document.layers[divName].visibility = "show";
		document.layers[divName].top = getOffsetTop() + top;
		document.layers[divName].left = getOffsetLeft() + left;
	}
}

function hideProcess(divName) {
	if ((isHighBrowser) && (isLoaded) && (document.getElementById(divName) != null)) {
		document.getElementById(divName).style.visibility = "hidden";
	}
	else if ((isLowIEBrowser) && (isLoaded) && (document.all[divName] != null)) {
		document.all[divName].style.visibility = "hidden";
	}
	else if ((isLowNSBrowser) && (isLoaded) && (document.layers[divName] != null)) {
		document.layers[divName].visibility = "hide";
	}
}




function overItProcess_B(imgID) {
	if (isLoaded) {
		var imgName2 = "document.pronum" + imgID;
		eval(imgName2).src = pronumon[imgID].src;
	}
}

function outOfItProcess_A(imgID) {
	if (isLoaded) {
		var imgName3 = "document.line" + imgID;
	}
}

function outOfItProcess_B(imgID) {
	if (isLoaded) {
		if ( !activePage(imgID) )
		{
			var imgName2 = "document.pronum" + imgID;
			eval(imgName2).src = pronumoff[imgID].src;
		}
	}
}

function activePage(imgID)
{
	var sPageName = document.frmMain.pageName.value;
	if ( pageNames[imgID] == sPageName )
	{
		return true;
	}
	else
	{
		return false;
	}
}

function getOffsetTop() {
	var ctrl="pageOffset";
	if(document.layers){
		return document[ctrl].y;
	}

	var obj;
	if(document.getElementById){
		obj = document.getElementById(ctrl);
	}else if(document.all){
		obj = document.all(ctrl);
	}
	var ot=obj.offsetTop;
	while((obj=obj.offsetParent) != null) { ot += obj.offsetTop; }
	return ot;
}

function getOffsetLeft() {
	var ctrl = "pageOffset";
	if(document.layers){
		return document[ctrl].x;
	}
	
	var obj;
	if(document.getElementById){
		obj = document.getElementById(ctrl);
	}else if(document.all){
		obj = document.all(ctrl);
	}
	var ol=obj.offsetLeft;
	while((obj=obj.offsetParent) != null) { ol += obj.offsetLeft; }
	return ol;
}