var sCurLink;
var bhilight = false;
// window.onerror=null

function getArgs() {
	var args = new Object();
	// Get Query String
	var query = location.search.substring(1); 
	// Split query at the comma
	var pairs = query.split("&"); 
	
	// Begin loop through the querystring
	for(var i = 0; i < pairs.length; i++) {

		// Look for "name=value"
		var pos = pairs[i].indexOf('='); 
		// if not found, skip to next
		if (pos == -1) continue; 
		// Extract the name
		var argname = pairs[i].substring(0,pos); 
		
		// Extract the value
		var value = pairs[i].substring(pos+1); 
		// Store as a property
		args[argname] = unescape(value); 
	}
	return args; // Return the Object
}

function hilightmenu(sImg, sFrame) {
	bhilight = false;
//	setTimeout("hilightmenut('" + sImg + "')",4000);
//	setTimeout("hilightmenut('" + sImg + "')",2000);
	setTimeout("hilightmenut('" + sImg + "','" + sFrame + "',1)",1000);
//	setTimeout("hilightmenut('" + sImg + "')",500);
//	setTimeout("hilightmenut('" + sImg + "')",250);
//	setTimeout("hilightmenut('" + sImg + "')",100);
//	hilightmenut(sImg);
}
function hilightmenut(sImg, sFrame, iParent) {
	var oNav
	if (bhilight == false) {
		try {
			if (iParent==1) { oNav = eval('parent.' + sFrame); }
			if (iParent==2) { oNav = eval('parent.parent.' + sFrame); }
			oNav.hitlink(sImg);
			bhilight = true;
			
		}
		catch(ex) {
			setTimeout("hilightmenut('" + sImg + "','" + sFrame + "',2)",500);
		}
	}
}
function framecheck() {
    var parentframe = 'fs-home.asp';
    if (parent.location.href == self.location.href) {
	var current = window.self.location.pathname;
	if (current.indexOf("mu-mid.htm") != -1) { current='mp-service-4.htm'; }
	if (current.indexOf("pg-bottom.asp") != -1) { current='mp-service-4.htm'; }
        window.location.replace (parentframe + '?' + current);
    }
}

function cmdSubmit(oThis) {
	var oForm = oThis //.form;
	
    var bgcolor = "#FFFF99";
    var IsValid = true;
    var sMsg = "";
    var str;
    if (oForm.tbxName.value == "") { 
       sMsg = sMsg + "\tName\n";
       oForm.tbxName.style.backgroundColor = bgcolor; 
       IsValid = false;
    }
    if (oForm.tbxEmail.value == "" || oForm.tbxEmail.value.indexOf('@') == -1) { 
       sMsg = sMsg + "\tEmail\n";
       oForm.tbxEmail.style.backgroundColor = bgcolor; 
       IsValid = false;
    } else {
	str = oForm.tbxEmail.value;
	if (!(str.indexOf(".") > 2) && (str.indexOf("@") > 0)) {
            sMsg = sMsg + "\tEmail\n";
            oForm.tbxEmail.style.backgroundColor = bgcolor; 
            IsValid = false;
        }
    }
    if (oForm.tbxPhone.value == "") { 
       sMsg = sMsg + "\tPhone\n";
       oForm.tbxPhone.style.backgroundColor = bgcolor; 
       IsValid = false;
    }
    if (IsValid == false) {    
//	var oMsg = document.getElementById("idMsg");
//	oMsg.innerHTML = "The fields in yellow are required."
        alert("The fields in yellow are required:\n\n" + sMsg, "Title");
        return false;
    }
}
 

function hitlink(sImg) {
	if (sCurLink==sImg)  return; 
	if (sCurLink!="Start") DD.btnOff(sCurLink);
	sCurLink = sImg;
//	clearmenu();
//	var oPic = document.images[sImg];
//	var sPic = oPic.src
//	if (sPic.indexOf("-ro") == -1) {
//		sPic = sPic.substr(0,sPic.length-4) + "-ro.gif";	
//		oPic.src = sPic;
//		oPic.blur();
//	}
	try {DD.btnOn(sImg);}
	catch(ex) {}
}

function clearmenu() {
//	document.images['imgServices'].src = "images/menu-slice_05.gif";
//	document.images['imgShowroom'].src = "images/menu-slice_06.gif";
//	document.images['imgPricing'].src = "images/menu-slice_07.gif";
//	document.images["imgHistory"].src = "images/menu-slice_08.gif";
//	document.images["imgContactus"].src = "images/menu-slice_08.gif";
//	document.images['imgSignin'].src = "images/menu-slice_09.gif";
//	document.images["imgEmployment"].src = "images/menu-slice_10.gif";
}
