<!--
var newMailWindow = null;
var newLetterHeadWindow = null;
var newControlPanelWindow = null;
var previewWindow = null;
var newCalculatorWindow = null;

function openCalculatorWindow() {
	newCalculatorWindow = window.open('', 'calculator', 'toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,width=430, height=420');
	newCalculatorWindow.focus();
	return;
}

function openMailWindow() {
	newMailWindow = window.open('', 'mail', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,width=1024,height=768');
	newMailWindow.focus();
	return;
}

function openLetterHeadWindow() {
	newLetterHeadWindow = window.open('', 'letterhead', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,width=592,height=500');
	newLetterHeadWindow.focus();
	return;
}

function openPreview(filePath) {
    previewWindow = window.open('', 'ad', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,width=1024,height=768,resizable=yes');    
    previewWindow.document.write('<html><head><title>AD Preview</title>');   
    previewWindow.document.write('</head><body><center>');
    previewWindow.document.write('<img src="' + filePath + '" border="0"><br><br>');
    previewWindow.document.write('<input type="button" value="Close" onClick="javascript:self.close()"></a><br>');
    previewWindow.document.write('</body></html>');
    previewWindow.document.close();
	previewWindow.focus();

	previewWindow.moveTo(0,0);
	previewWindow.resizeTo(screen.width,screen.height);
    return;
}

function openControlPanelWindow() {
	newControlPanelWindow = window.open('', 'controlpanel', 'resizable=no, scrollbars=yes, status=no, location=no, width=650, height=800');	
	newControlPanelWindow.focus();
	return;
}

function entersubmit(){
	if (event.keyCode == 13)
		document.quicksearch.submit();
}

function init_agent(userid) {
    document.editAgent.submit();
}

function city(type) {
    document.searchCity["type"].value = type;
    document.searchCity.submit();
	return;
}

function search(value) {
    if (value == -2) {
       document.searchSpecial["hot"].value = 'Y';
       document.searchSpecial["lo"].value = '';
       document.searchSpecial["agent"].value = '';
    }
    else if (value == -1) {
       document.searchSpecial["hot"].value = '';
       document.searchSpecial["lo"].value = 'Y';
       document.searchSpecial["agent"].value = '';
    }
    else if (value == -3) {
       document.searchSpecial["hot"].value = '';
       document.searchSpecial["lo"].value = '';
       document.searchSpecial["agent"].value = 'Y';
    }
    else if (value == -4) {
       document.searchSpecial["hot"].value = '';
       document.searchSpecial["lo"].value = '';
       document.searchSpecial["agent"].value = 'N';
    }
    document.searchSpecial.submit();
}

function search_map(city,county)
{
	document.searchMap.searchcity_map.value = city;
	document.searchMap.county.value = county;
	document.searchMap.submit();
}

function search_main() 
{
	if(document.search.searchcity.value == "Enter a City"){		
		document.search.searchcity.value = "";
	}
	if(document.search.zip.value.length != 5 && document.search.searchcity.value == ""){
		alert("Please enter city name or zipcode.");
	}
	else {
		document.search.submit();
	}
}

function search_main2() 
{
	if(document.search.searchstr.value == "Enter a City or Zip code" || document.search.searchstr.value.length < 4){		
		alert("Please enter a City or Zip code.")
	} 
	else {
		document.search.submit();
	}
}

//General Purpose Search Used Anywhere
function search_custom(type,city,county,state,zip)	
{
	document.searchCustom.type.value = type;
	document.searchCustom.city.value = county + "|" + city;
	document.searchCustom.state.value = state;
	document.searchCustom.zip.value = zip;
	document.searchCustom.submit();
}

function quick_search()
{
	if (document.quicksearch.searchstr.value.length > 2){
		document.quicksearch.submit();	
	}
	else {
		alert("Please enter city or zipcode.")
	}
}

function estate(mlsnum) {
    document.showEstate["mlsnum"].value = mlsnum;
    document.showEstate.submit();
}

function estate_custom(customno) {
    document.showEstateCustom["customno"].value = customno;
    document.showEstateCustom.submit();
}

function estate_sold(propertyno) {
    document.showEstateSold["propertyno"].value = propertyno;
    document.showEstateSold.submit();
}

function estate_combus(idno) {
    document.showEstateComBus["idno"].value = idno;
    document.showEstateComBus.submit();
}

function delete_mls(mlsnum) {
    if (confirm("Are you sure?")) {
        document.deleteMLS["mlsnum"].value = mlsnum;
        document.deleteMLS.submit();
    }
}

function delete_business(businessno) {
    if (confirm("Are you sure?")) {
        document.deleteBusiness["businessno"].value = businessno;
        document.deleteBusiness.submit();
    }
}
//--> 
