function initPage() {
	setHeight();
	window.onresize = function(){setHeight();}
}

function loadRollover() {
	var preload0 = new Image;
	preload0.src = '/jpls/images/home-service-button-on.gif';
	var preload1 = new Image;
	preload1.src = '/jpls/images/nav-bar-shim-ov.gif';
}

function setHeight() {
	var string1, string2;
	if (document.all) {
		string1 = "document.all['";
		string2 = "']";
	} else if (document.getElementById) {
		string1 = "document.getElementById('";
		string2 = "')";
	}

	myHeight = 0;
	if(document.documentElement && document.documentElement.clientHeight) {
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	} else if(document.body && document.body.clientHeight) {
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	} else if( typeof( window.innerHeight ) == 'number' ) {
		//Non-IE
		myHeight = window.innerHeight;
	}

	var fullpage = eval(string1 + "fullpage" + string2);
	var topsection = eval(string1 + "topsection" + string2);
	var midsection = eval(string1 + "midsection" + string2);
	var lowsection = eval(string1 + "lowsection" + string2);
	var botsection = eval(string1 + "botsection" + string2);

	if (fullpage.offsetHeight < myHeight) {
		midsection.style.height = (myHeight - (topsection.offsetHeight + lowsection.offsetHeight + botsection.offsetHeight)) + 'px';
	}
}

function isblank(s) {
	for (var i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if ((c != ' ') && (c != '\n') && (c != '\t'))
			return(false);
	}
	return(true);
}

function quoteVerify(quote) {
	var string1, string2;
	if (document.all) {
		string1 = "document.all['";
		string2 = "']";
	} else if (document.getElementById) {
		string1 = "document.getElementById('";
		string2 = "')";
	}

	var q;
	var errors;
	for (var i = 0; i < quote.length; i++) {
		q = quote.elements[i];
		if (q.name == 'contactname') {
			if ((q.value == null) || (q.value == '') || isblank(q.value)) {
				var elem = eval(string1 + "rqdname" + string2);
				elem.style.color = 'red';
				errors = true;
			}
		} else if (q.name == 'request') {
			if ((q.value == null) || (q.value == '') || isblank(q.value) || (q.value == 'Enter a summary of your project.')) {
				var elem = eval(string1 + "rqdrequest" + string2);
				elem.style.color = 'red';
				errors = true;
			}
		} else if (q.name == 'email') {
			if ((q.value == null) || (q.value == '') || isblank(q.value)) {
				var elem = eval(string1 + "rqdemail" + string2);
				elem.style.color = 'red';
				errors = true;
			}
		} else if (q.name == 'mv_captcha_guess') {
			if ((q.value == null) || (q.value == '') || isblank(q.value)) {
				var elem = eval(string1 + "rqdcode" + string2);
				elem.style.color = 'red';
				errors = true;
			}
		}
	}

	if (errors) {
		var elem = eval(string1 + "quoteerror" + string2);
		elem.style.display = "inline";
		elem.style.visibility = "visible";
		return(false);
	}
}


