//<![CDATA[
var needValidate = false;
 
var defaultVal2 = "Type your question here and click below...";
function  openchatwindow(cbForm,windowName) {
	var res = true;
 
	var msg = document.getElementById("lp_msgfield");
 
	if(needValidate){
		var validateMessage = "Before you start your chat, type in the following fields:\r\n ";
 
		if(msg.value.length==0 || msg.value==defaultVal2 ){
			validateMessage += "Your Question\r\n";
			res=false;
		}
		if(res==false){
			alert(validateMessage);
		}
 
	}
 
    var formurl = cbForm.action;
    if(formurl.indexOf('?')==-1)
        formurl += '?';
    var elemCol = cbForm.elements;
    for(var ie=0; ie<elemCol.length; ie++){
        var et = elemCol[ie].type;
        if(et=="text" || et=="hidden" || et=="radio" || et=="textarea"){
            formurl += elemCol[ie].name + "=" + escape(elemCol[ie].value) + "&" ;
        }
    }
 
	if(res==true)
		window.open(formurl, windowName,'width=475,height=400,resizable=yes');
	return res;
}

function checkSelectVal(elm) {
	
	if (jQuery(elm).val() != '') {
		jQuery(elm).removeClass('empty');
	 }	else {
		jQuery(elm).addClass('empty') 
	 }
}

function removeVal(elm, initVal) {
	if (jQuery(elm).val() == initVal) {
		jQuery(elm).removeClass('empty')
		jQuery(elm).val('');
	}	 	
}
 
function restoreVal(elm, initVal) {
	if (jQuery(elm).val() == '') {
		jQuery(elm).addClass('empty')
		jQuery(elm).val(initVal);
	}	 	
}

function cleanValue(numVal) {
	
	var emptyVal = '';
	var alphaNumExp = /^[0-9]+$/;
	
	var fieldToClean = numVal;
	
	if ((fieldToClean != "")) {
		var tempName = '';
		
		for(var i = 0; i < fieldToClean.length; i++) {
			var c = fieldToClean.charAt(i);
			if (c.match(alphaNumExp)) {
				tempName += c;
			}				
		}
		
		return tempName;
	}
	
	return emptyVal;
}

function qsvalidateLPrice(whichForm) {
	
	var minPrice = parseInt(document.forms[whichForm].lprice[document.forms[whichForm].lprice.selectedIndex].value);
	var maxPrice = parseInt(document.forms[whichForm].uprice[document.forms[whichForm].uprice.selectedIndex].value);
	
	if(isNaN(maxPrice)) { maxPrice = 0; }
	var newSelected = false;

	var newMax = document.forms[whichForm].lprice.options[document.forms[whichForm].lprice.selectedIndex + 1].value;
	if(maxPrice > newMax) { newMax = maxPrice; }
	
	for (var i=1;i<document.forms[whichForm].lprice.options.length; i++) {
	
		if(parseInt(document.forms[whichForm].lprice.options[i].value) < minPrice) {
			//alert("Set it grey");			
			//lPrice.options[i].style.color='#999999';
		} else if(parseInt(document.forms[whichForm].lprice.options[i].value) <= newMax) {
			document.forms[whichForm].lprice.options[i].style.color='#000000';
		} else {
			break;
		}
	}

	for (var i=document.forms[whichForm].uprice.options.length - 1;i>=0; i--) {
		if(parseInt(document.forms[whichForm].uprice.options[i].value) < minPrice)
		{
			document.forms[whichForm].uprice.options[i].style.color = '#CCCCCC';
			if(!newSelected && maxPrice < minPrice)
			{
				if( (i + 2) < document.forms[whichForm].uprice.options.length)
				{					
					if(document.forms[whichForm].uprice.selectedIndex != 0)
					{
						document.forms[whichForm].uprice.options[i + 2].selected = true;
					}
					newSelected = true;
				}
			}
		} else { 
			document.forms[whichForm].uprice.options[i].style.color='#000000';
		}
	}

}

function qsvalidateUPrice(whichForm) {
	
	var minPrice = parseInt(document.forms[whichForm].lprice[document.forms[whichForm].lprice.selectedIndex].value);
	var maxPrice = parseInt(document.forms[whichForm].uprice[document.forms[whichForm].uprice.selectedIndex].value);
	
	if(isNaN(minPrice)) { minPrice = 0; }
	document.forms[whichForm].uprice.options[document.forms[whichForm].uprice.selectedIndex].style.color = '#000000';
	//var newSelected = false;
	for (var i=document.forms[whichForm].lprice.options.length - 1;i>=0; i--) {
		if (parseInt(document.forms[whichForm].lprice.options[i].value) >= maxPrice) {
			document.forms[whichForm].lprice.options[i].style.color='#CCCCCC';
			if (minPrice > maxPrice) {
				document.forms[whichForm].lprice.options[i - 1].selected = true;	
				document.forms[whichForm].lprice.options[i - 1].style.color = '#000000';
			}
		} else if(parseInt(document.forms[whichForm].lprice.options[i].value) >= minPrice) {
			document.forms[whichForm].lprice.options[i].style.color='#000000';
		}
	}
}

function updateQuickSearchCount(searchType) {
	var formData;
	var submitButton;
	var frmAction;
	var counter;
	var quicksearchid = '';
	var listtype = '';
	var subarea = '';
	var zip = '';
	var city = '';
	var county = '';				
	var lbeds = '';
	var lbaths = '';
	var lprice = '';
	var uprice = '';
	var reo = '';
	var basement = '';
	var lsqft = '';
	var daysonmarket = '';		
	var streetnumber1 = '';
	var streetname1 = '';
	var streetdir1 = '';
	var streetnumber2 = '';
	var streetname2 = '';
	var streetdir2 = '';
	var streetnumber3 = '';
	var streetname3 = '';
	var streetdir3 = '';	
	var streetnumber4 = '';
	var streetname4 = '';
	var streetdir4 = '';					
	var mls = '';	
	var pool = '';
	var golfcoursefront = '';
	var lot = '';
	var communityfeatures = '';
	
	var sep = '';	
	
	switch (searchType) {
		case '1':
			for (i = 0; i < document.frmQSCounty.listtype.length; i++ ) { if( document.frmQSCounty.listtype[i].checked == true ) { listtype = document.frmQSCounty.listtype[i].value; } }
			county = document.frmQSCounty.county[document.frmQSCounty.county.selectedIndex].value;
			lprice = document.frmQSCounty.lprice[document.frmQSCounty.lprice.selectedIndex].value;
			uprice = document.frmQSCounty.uprice[document.frmQSCounty.uprice.selectedIndex].value;
			lbeds = document.frmQSCounty.lbeds[document.frmQSCounty.lbeds.selectedIndex].value;
			lbaths = document.frmQSCounty.lbaths[document.frmQSCounty.lbaths.selectedIndex].value;
			daysonmarket = document.frmQSCounty.daysonmarket[document.frmQSCounty.daysonmarket.selectedIndex].value;
			lsqft = document.frmQSCounty.lsqft[document.frmQSCounty.lsqft.selectedIndex].value;
			basement = document.frmQSCounty.basement[document.frmQSCounty.basement.selectedIndex].value;			
			communityfeatures = document.frmQSCounty.communityfeatures[document.frmQSCounty.communityfeatures.selectedIndex].value;
			if (document.frmQSCounty.reo.checked) { reo = 'true' }
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			submitButton = jQuery('#btnSubmit1');
			break;
		case '2': 
			for (i = 0; i < document.frmQSCity.listtype.length; i++ ) { if( document.frmQSCity.listtype[i].checked == true ) { listtype = document.frmQSCity.listtype[i].value; } }
			city = document.frmQSCity.city[document.frmQSCity.city.selectedIndex].value;
			lprice = document.frmQSCity.lprice[document.frmQSCity.lprice.selectedIndex].value;
			uprice = document.frmQSCity.uprice[document.frmQSCity.uprice.selectedIndex].value;
			lbeds = document.frmQSCity.lbeds[document.frmQSCity.lbeds.selectedIndex].value;
			lbaths = document.frmQSCity.lbaths[document.frmQSCity.lbaths.selectedIndex].value;
			daysonmarket = document.frmQSCity.daysonmarket[document.frmQSCity.daysonmarket.selectedIndex].value;
			lsqft = document.frmQSCity.lsqft[document.frmQSCity.lsqft.selectedIndex].value;
			basement = document.frmQSCity.basement[document.frmQSCity.basement.selectedIndex].value;			
			communityfeatures = document.frmQSCity.communityfeatures[document.frmQSCity.communityfeatures.selectedIndex].value;
			if (document.frmQSCity.reo.checked) { reo = 'true' }
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			submitButton = jQuery('#btnSubmit2');
			break;
	    case '3':
			for (counter = 0; counter < document.frmQSMLS.mls.length; counter++) {
				if ((document.frmQSMLS.mls[counter].value != 'MLS #') && (document.frmQSMLS.mls[counter].value != '')) {
					mls += sep + document.frmQSMLS.mls[counter].value;
					sep = ',';
				}
			}
			quicksearchid = document.frmQSMLS.quicksearchid.value;
			submitButton = jQuery('#btnSubmit3');
			break;			
		case '4':
			for (i = 0; i < document.frmQSZipCode.listtype.length; i++ ) { if( document.frmQSZipCode.listtype[i].checked == true ) { listtype = document.frmQSZipCode.listtype[i].value; } }	
			if (document.frmQSZipCode.zip.value != 'Enter Zip Codes') { zip = document.frmQSZipCode.zip.value }
			lprice = document.frmQSZipCode.lprice[document.frmQSZipCode.lprice.selectedIndex].value;
			uprice = document.frmQSZipCode.uprice[document.frmQSZipCode.uprice.selectedIndex].value;
			lbeds = document.frmQSZipCode.lbeds[document.frmQSZipCode.lbeds.selectedIndex].value;
			lbaths = document.frmQSZipCode.lbaths[document.frmQSZipCode.lbaths.selectedIndex].value;
			daysonmarket = document.frmQSZipCode.daysonmarket[document.frmQSZipCode.daysonmarket.selectedIndex].value;
			lsqft = document.frmQSZipCode.lsqft[document.frmQSZipCode.lsqft.selectedIndex].value;
			basement = document.frmQSZipCode.basement[document.frmQSZipCode.basement.selectedIndex].value;			
			communityfeatures = document.frmQSZipCode.communityfeatures[document.frmQSZipCode.communityfeatures.selectedIndex].value;
			if (document.frmQSZipCode.reo.checked) { reo = 'true' }
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			submitButton = jQuery('#btnSubmit4');
			break;
		case '5':
			if (document.frmQSStreetName.streetname1.value != 'Enter Street Name') { streetname1 = document.frmQSStreetName.streetname1.value }
			if (document.frmQSStreetName.streetname2.value != 'Enter Street Name') { streetname2 = document.frmQSStreetName.streetname2.value }
			if (document.frmQSStreetName.streetname3.value != 'Enter Street Name') { streetname3 = document.frmQSStreetName.streetname3.value }
			if (document.frmQSStreetName.streetname4.value != 'Enter Street Name') { streetname4 = document.frmQSStreetName.streetname4.value }
			

			if (document.frmQSStreetName.streetnumber1.value != 'Enter Street #') { streetnumber1 = document.frmQSStreetName.streetnumber1.value }
			if (document.frmQSStreetName.streetnumber2.value != 'Enter Street #') { streetnumber2 = document.frmQSStreetName.streetnumber2.value }
			if (document.frmQSStreetName.streetnumber3.value != 'Enter Street #') { streetnumber3 = document.frmQSStreetName.streetnumber3.value }
			if (document.frmQSStreetName.streetnumber4.value != 'Enter Street #') { streetnumber4 = document.frmQSStreetName.streetnumber4.value }
			
			streetdir1 = document.frmQSStreetName.streetdir1[document.frmQSStreetName.streetdir1.selectedIndex].value;
			streetdir2 = document.frmQSStreetName.streetdir2[document.frmQSStreetName.streetdir2.selectedIndex].value;
			streetdir3 = document.frmQSStreetName.streetdir3[document.frmQSStreetName.streetdir3.selectedIndex].value;
			streetdir4 = document.frmQSStreetName.streetdir4[document.frmQSStreetName.streetdir4.selectedIndex].value;
			
			quicksearchid = document.frmQSStreetName.quicksearchid.value;
			submitButton = jQuery('#btnSubmit5');
			break;
		case '6':
			for (i = 0; i < document.frmQSNeighborhood.listtype.length; i++ ) { if( document.frmQSNeighborhood.listtype[i].checked == true ) { listtype = document.frmQSNeighborhood.listtype[i].value; } }	
			city = document.frmQSNeighborhood.city.value;
			subarea = document.frmQSNeighborhood.subarea[document.frmQSNeighborhood.subarea.selectedIndex].value;
			lprice = document.frmQSNeighborhood.lprice[document.frmQSNeighborhood.lprice.selectedIndex].value;
			uprice = document.frmQSNeighborhood.uprice[document.frmQSNeighborhood.uprice.selectedIndex].value;
			lbeds = document.frmQSNeighborhood.lbeds[document.frmQSNeighborhood.lbeds.selectedIndex].value;
			lbaths = document.frmQSNeighborhood.lbaths[document.frmQSNeighborhood.lbaths.selectedIndex].value;
			daysonmarket = document.frmQSNeighborhood.daysonmarket[document.frmQSNeighborhood.daysonmarket.selectedIndex].value;
			lsqft = document.frmQSNeighborhood.lsqft[document.frmQSNeighborhood.lsqft.selectedIndex].value;
			basement = document.frmQSNeighborhood.basement[document.frmQSNeighborhood.basement.selectedIndex].value;			
			communityfeatures = document.frmQSNeighborhood.communityfeatures[document.frmQSNeighborhood.communityfeatures.selectedIndex].value;
			if (document.frmQSNeighborhood.reo.checked) { reo = 'true' }
			if (subarea == '') { city = '' }
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			submitButton = jQuery('#btnSubmit6');
			break;			
		default:
			for (i = 0; i < document.frmQSNeighborhood.listtype.length; i++ ) { if( document.frmQSNeighborhood.listtype[i].checked == true ) { listtype = document.frmQSNeighborhood.listtype[i].value; } }	
			city = document.frmQSNeighborhood.city.value;
			subarea = document.frmQSNeighborhood.subarea[document.frmQSNeighborhood.subarea.selectedIndex].value;
			lprice = document.frmQSNeighborhood.lprice[document.frmQSNeighborhood.lprice.selectedIndex].value;
			uprice = document.frmQSNeighborhood.uprice[document.frmQSNeighborhood.uprice.selectedIndex].value;
			lbeds = document.frmQSNeighborhood.lbeds[document.frmQSNeighborhood.lbeds.selectedIndex].value;
			lbaths = document.frmQSNeighborhood.lbaths[document.frmQSNeighborhood.lbaths.selectedIndex].value;
			daysonmarket = document.frmQSNeighborhood.daysonmarket[document.frmQSNeighborhood.daysonmarket.selectedIndex].value;
			lsqft = document.frmQSNeighborhood.lsqft[document.frmQSNeighborhood.lsqft.selectedIndex].value;
			basement = document.frmQSNeighborhood.basement[document.frmQSNeighborhood.basement.selectedIndex].value;			
			communityfeatures = document.frmQSNeighborhood.communityfeatures[document.frmQSNeighborhood.communityfeatures.selectedIndex].value;
			if (document.frmQSNeighborhood.reo.checked) { reo = 'true' }
			if (subarea == '') { city = '' }
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			submitButton = jQuery('#btnSubmit6');
			break;	
	}
	
	//alert('streetnumber1: ' + streetnumber1);
	//alert('streetname1: ' + streetname1);
	//alert('streetdir1: ' + streetdir1);
	//alert('streetnumber2: ' + streetnumber2);
	//alert('streetname2: ' + streetname2);
	//alert('streetdir2: ' + streetdir2);
	//alert('streetnumber3: ' + streetnumber3);
	//alert('streetname3: ' + streetname3);
	//alert('streetdir3: ' + streetdir3);
	//alert('streetnumber4: ' + streetnumber4);
	//alert('streetname4: ' + streetname4);
	//alert('streetdir4: ' + streetdir4);
	
	document.frmQSSubmitter.quicksearchid.value = quicksearchid;
	document.frmQSSubmitter.listtype.value = listtype;
	document.frmQSSubmitter.subarea.value = subarea;
	document.frmQSSubmitter.zip.value = zip;
	document.frmQSSubmitter.city.value = city;
	document.frmQSSubmitter.county.value = county;
	document.frmQSSubmitter.lbeds.value = lbeds;
	document.frmQSSubmitter.lbaths.value = lbaths;
	document.frmQSSubmitter.lprice.value = lprice;
	document.frmQSSubmitter.uprice.value = uprice;
	document.frmQSSubmitter.reo.value = reo;
	document.frmQSSubmitter.basement.value = basement;
	document.frmQSSubmitter.lsqft.value = lsqft;
	document.frmQSSubmitter.daysonmarket.value = daysonmarket;
	document.frmQSSubmitter.streetnumber1.value = streetnumber1;
	document.frmQSSubmitter.streetname1.value = streetname1;
	document.frmQSSubmitter.streetdir1.value = streetdir1;
	document.frmQSSubmitter.streetnumber2.value = streetnumber2;
	document.frmQSSubmitter.streetname2.value = streetname2;
	document.frmQSSubmitter.streetdir2.value = streetdir2;
	document.frmQSSubmitter.streetnumber3.value = streetnumber3;
	document.frmQSSubmitter.streetname3.value = streetname3;	
	document.frmQSSubmitter.streetdir3.value = streetdir3;
	document.frmQSSubmitter.streetnumber4.value = streetnumber4;
	document.frmQSSubmitter.streetname4.value = streetname4;
	document.frmQSSubmitter.streetdir4.value = streetdir4;
	document.frmQSSubmitter.mls.value = mls;
	document.frmQSSubmitter.pool.value = pool;
	document.frmQSSubmitter.golfcoursefront.value = golfcoursefront;
	document.frmQSSubmitter.lot.value = lot;
	
	var formData = jQuery('#frmQSSubmitter').serialize();	
	var pointCount;

	jQuery.ajax({
		type:'POST',
		data:formData,
		async:false,
		url:'/property-search/sist_ajax/mls_mapmarkerscount.asp',
		dataType:'xml',
		error:function(xml){
		  //alert('error: ' + t.responseText);
        },
		success:function(xml){
			
			jQuery(xml).find('results').each(function(){
 				pointCount = jQuery(this).find('count').attr('value');
				if ((pointCount + '') != '') {
					pointCount = parseFloat(pointCount)
				} else {
					pointCount = 0
				}
			});
			
			if (pointCount >= 1) { 
				submitButton.val('View ' + pointCount + ' Matches >>');
			} else {
				submitButton.val('No Matching Listings');
			}
			
		}	
	})
}

function runQuickSearch(searchType, searchAction) {
	var frmAction;
	var counter;
	var communityfeatures = '';
	var pool = '';
	var golfcoursefront = '';
	var lot = '';
	var subarea = '';
	var city = '';
	
	if (searchAction == 'map') {
		frmAction = '/property-search/map/'
	}	else {
		frmAction = '/property-search/list/'
	}

	switch (searchType){
		case '1':
			communityfeatures = document.frmQSCounty.communityfeatures[document.frmQSCounty.communityfeatures.selectedIndex].value;
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			document.frmQSCounty.pool.value = pool;
			document.frmQSCounty.golfcoursefront.value = golfcoursefront;
			document.frmQSCounty.lot.value = lot;
			document.frmQSCounty.action = frmAction;
			document.frmQSCounty.submit();
			break;
		case '2': 
			communityfeatures = document.frmQSCity.communityfeatures[document.frmQSCity.communityfeatures.selectedIndex].value;
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			document.frmQSCity.pool.value = pool;
			document.frmQSCity.golfcoursefront.value = golfcoursefront;
			document.frmQSCity.lot.value = lot;		
			document.frmQSCity.action = frmAction;
			document.frmQSCity.submit();
			break;
	    case '3':
			for (counter = 0; counter < document.frmQSMLS.mls.length; counter++) {
				if (document.frmQSMLS.mls[counter].value == 'MLS #') {
					document.frmQSMLS.mls[counter].value = '';
				}
			}
			
			document.frmQSMLS.action = frmAction;	
			document.frmQSMLS.submit();
			break;			
		case '4':
			if (document.frmQSZipCode.zip.value == 'Enter Zip Codes') { document.frmQSZipCode.zip.value = '' }
			communityfeatures = document.frmQSZipCode.communityfeatures[document.frmQSZipCode.communityfeatures.selectedIndex].value;
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			document.frmQSZipCode.pool.value = pool;
			document.frmQSZipCode.golfcoursefront.value = golfcoursefront;
			document.frmQSZipCode.lot.value = lot;				
			document.frmQSZipCode.action = frmAction;
			document.frmQSZipCode.submit();
			break;
		case '5':
			if (document.frmQSStreetName.streetnumber1.value == 'Enter Street #') { document.frmQSStreetName.streetnumber1.value = '' }
			if (document.frmQSStreetName.streetnumber2.value == 'Enter Street #') { document.frmQSStreetName.streetnumber2.value = '' }
			if (document.frmQSStreetName.streetnumber3.value == 'Enter Street #') { document.frmQSStreetName.streetnumber3.value = '' }
			if (document.frmQSStreetName.streetnumber4.value == 'Enter Street #') { document.frmQSStreetName.streetnumber4.value = '' }
			if (document.frmQSStreetName.streetname1.value == 'Enter Street Name') { document.frmQSStreetName.streetname1.value = '' }
			if (document.frmQSStreetName.streetname2.value == 'Enter Street Name') { document.frmQSStreetName.streetname2.value = '' }
			if (document.frmQSStreetName.streetname3.value == 'Enter Street Name') { document.frmQSStreetName.streetname3.value = '' }
			if (document.frmQSStreetName.streetname4.value == 'Enter Street Name') { document.frmQSStreetName.streetname4.value = '' }			

			document.frmQSStreetName.action = frmAction;
			document.frmQSStreetName.submit();
			break;
		case '6':
			communityfeatures = document.frmQSNeighborhood.communityfeatures[document.frmQSNeighborhood.communityfeatures.selectedIndex].value;
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			subarea = document.frmQSNeighborhood.subarea[document.frmQSNeighborhood.subarea.selectedIndex].value;
			if (subarea == '') { document.frmQSNeighborhood.city.value = '' }
			
			document.frmQSNeighborhood.pool.value = pool;
			document.frmQSNeighborhood.golfcoursefront.value = golfcoursefront;
			document.frmQSNeighborhood.lot.value = lot;				
			document.frmQSNeighborhood.action = frmAction;
			document.frmQSNeighborhood.submit();
			break;			
		default:
			communityfeatures = document.frmQSNeighborhood.communityfeatures[document.frmQSNeighborhood.communityfeatures.selectedIndex].value;
			
			if (communityfeatures == 'golfcoursefront') { 
				golfcoursefront = 'true';
			} else if (communityfeatures == 'pool') { 
				pool = 'true';
			} else if (communityfeatures == 'mountain view') { 
				lot = 'mountain view';
			} else if (communityfeatures == 'city view') { 
				lot = 'city view';
			} else if (communityfeatures == 'rv parking') { 
				lot = 'rv parking';
			}
			
			subarea = document.frmQSNeighborhood.subarea[document.frmQSNeighborhood.subarea.selectedIndex].value;
			if (subarea == '') { document.frmQSNeighborhood.city.value = '' }
			
			document.frmQSNeighborhood.pool.value = pool;
			document.frmQSNeighborhood.golfcoursefront.value = golfcoursefront;
			document.frmQSNeighborhood.lot.value = lot;			
			document.frmQSNeighborhood.action = frmAction;	
			document.frmQSNeighborhood.submit();
			break;
	}
}

function popOHWin (theURL) { 
  var newWin = window.open(theURL, 'OHWin', 'location=1,status=1,scrollbars=1,resizable=1,toolbar=1,width=770,height=550');
}
		   
function popWin (theURL) { //v2.0
  var newWin = window.open(theURL, 'realtyInfo', 'location=1,status=1,scrollbars=1,resizable=1,toolbar=1,width=770,height=540');
  newWin.moveTo(10,10); 
}

function vidWin (theURL,theName,theFeatures) {
  var newVid = window.open(theURL, theName, theFeatures);
}
 
function noSpam(user,domain) {
locationstring = "mailto:" + user + "@" + domain;
window.location = locationstring;
}
 
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//]]>
