

<!-- PreLoad Wait - Script -->
<!-- This script and more from http://www.rainbow.arch.scriptmania.com 


function waitPreloadPage() { //DOM
if (document.getElementById){
document.getElementById('prepage').style.visibility='hidden';
}else{
if (document.layers){ //NS4
document.prepage.visibility = 'hidden';
}
else { //IE4
document.all.prepage.style.visibility = 'hidden';
}
}
}

function fnValidateForm(frm){		
	<!--- require search price when MLNUM or Address are not provided ----->
	if ((frm.LISTING_PRICE_MIN.value != '') && (frm.LISTING_PRICE_MAX.value != ''))
	{
		if (fnCompareRangeValues(frm.LISTING_PRICE_MIN, frm.LISTING_PRICE_MAX, 'Minimum Price', 'Maximum Price') == false)
		{
			return false;
		}
	}
	
	if ((frm.SQURE_FEET_MIN.value != '') && (frm.SQURE_FEET_MAX.value != ''))
	{
		if (fnCompareRangeValues(frm.SQURE_FEET_MIN, frm.SQURE_FEET_MAX, 'Minimum Square Feet', 'Maximum Square Feet') == false)
		{
			return false;
		}
	}

	<!-- prevent special char for input text field -->
	for (i=0; i<frm.elements.length; i++){
		if (frm.elements[i].type=="text"){
			if(!validChar(frm.elements[i].value)){
				alert("please don't put special character in " + frm.elements[i].name +  " field");
				return false;
			}
		}
	}
	
	return true;	
}

function showdiv(divid) {
	obj = document.getElementById(divid);
	if(obj.style.display == 'none') {
		obj.style.display = '';
	}
	else {
		obj.style.display = 'none';
	}
}
function showBuyDiv(obj){
	if(obj.checked){
		document.all.divBuy.style.display = '';
		document.all.divLease.style.display = 'none';
		document.frmSearch.LEASE_PRICE_MIN.selectedIndex = 0;
		document.frmSearch.LEASE_PRICE_MAX.selectedIndex = 0;
	}
}
function showLeaseDiv(obj){
	if(obj.checked){
		document.all.divLease.style.display = '';
		document.all.divBuy.style.display = 'none';
		document.frmSearch.LISTING_PRICE_MIN.selectedIndex = 0;
		document.frmSearch.LISTING_PRICE_MAX.selectedIndex = 0;
	}
}
function flipdiv(divid){
	if (divid == 'searchList'){
		obj = document.getElementById('searchList');
		otherobj = document.getElementById('map');

	}
	if (divid == 'map'){
		obj = document.getElementById('map');
		otherobj = document.getElementById('searchList');
		
	}
	
	if(obj.style.display == 'none') {
		obj.style.display = '';
		otherobj.style.display = 'none';
	}
	else {
		obj.style.display = 'none';
		otherobj.style.display = '';
	}

}


function cForm(form, buttonName){
var checkcnt = 0;

for(i=0; i<document.compareForm.listMLNUM.length; i++){
	if(document.compareForm.listMLNUM[i].checked == true){
		checkcnt = checkcnt +1;
	
	}
}
if(checkcnt >5){
	alert('The Maximum number of comparison is 5, '+'you checked '+checkcnt+',\n so some of your selections will be unchecked');
	//alert(checkcnt);
	var mm = checkcnt;
	for(j=0; j<=document.compareForm.listMLNUM.length; j++){
			//alert('i am here');
			if(document.compareForm.listMLNUM[j].checked ==true){
			document.compareForm.listMLNUM[j].checked = false;
			checkcnt = checkcnt -1;
			}
			//alert (j);
			
			if(checkcnt == 5){
				break;
			}
		}
}

	if(buttonName =='Compare'){
	
		 win=window.open('','myWin','toolbars=1,width=820, scrollbars=1'); 
		 form.target='myWin';
		 form.action='http://search.har.com/engine/dispSetMycartTransit.cfm';

	 }else if (buttonName == 'Map'){
		form.target = '';
		form.action='doSearch.cfm';
	 }


}


