function GO_onclick() {
if (document.searchform.SEARCH.value == "")
    {
        alert ("Please enter your Search")
        document.searchform.SEARCH.focus();
        return false;
    } 
}

function GO_onsearch() {
if (document.search.txtsearch.value == "")
    {
        alert ("Please enter your Search")
        document.search.txtsearch.focus();
        return false;
    } 
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		Autos_over = newImage("images/Autos_over.gif");
		RealEstate_over = newImage("images/RealEstate_over.gif");
		Computers_over = newImage("images/Computers_over.gif");
		RealEstate_over011 = newImage("images/RealEstate_over-11.gif");
		Downloads_over = newImage("images/Downloads_over.gif");
		RealEstate_over015 = newImage("images/RealEstate_over-15.gif");
		Entertainment_over = newImage("images/Entertainment_over.gif");
		Jobs_over = newImage("images/Jobs_over.gif");
		Travel_over = newImage("images/Travel_over.gif");
		RealEstate_over025 = newImage("images/RealEstate_over-25.gif");
		MySignature_over = newImage("images/MySignature-_over.gif");
		preloadFlag = true;
	}
}

function passValues()
{
    if (document.forms[1].sameProp.checked  == true)
    {
        document.forms[1].contAdrs1.value = document.forms[1].propAdrs1.value
        document.forms[1].contAdrs2.value = document.forms[1].propAdrs2.value        
        document.forms[1].contAdrs3.value = document.forms[1].propAdrs3.value
        
    }
    else 
    {
        document.forms[1].contAdrs1.value = ""
        document.forms[1].contAdrs2.value = ""
        document.forms[1].contAdrs3.value = ""
        
    }
}
function checkAll()
{
    if (document.forms[1].proptyp.value == "none")
    {
        alert ("Please enter Property Type")
        document.forms[1].proptyp.focus();
        return false;
    } 
    if (document.forms[1].acmd.value == "")
    {
        alert ("Please select Accomodation")
        document.forms[1].acmd.focus();
        return false;
    }

    if (document.forms[1].propAdrs1.value == "")
    {
        alert ("Please enter your Property Address")
        document.forms[1].propAdrs1.focus();
        return false;
    }
    if (document.forms[1].state.value == "none")
    {
        alert ("Please Select State")
        document.forms[1].state.focus();
        return false;
    }
    if (document.forms[1].city.value == "Select City / Area")
    {
        alert ("Please Select City")
        document.forms[1].city.focus();
        return false;
    }
    if (document.forms[1].area.value == "")
    {
        alert ("Please enter Your Area")
        document.forms[1].area.focus();
        return false;
    }
    else if (document.forms[1].area.value != "")
	{
		if (document.forms[1].area.value.charAt(0) == " ")
		{
			alert ("Area Name should not start with Space")
			document.forms[1].area.focus()	
			return false;		
		}
	}
	if (document.forms[1].zipcd.value == "")
	{
		alert ("Please enter zip code")
		document.forms[1].zipcd.focus()	
		return false;
	}
	if (document.forms[1].contactNm.value == "")
	{
	    alert ("Please enter Contact Person Name")
	    document.forms[1].contactNm.focus();
	    return false;	
	}	
	if (document.forms[1].contAdrs1.value == "")
	{
	    alert ("Please enter Contact Address")
	    document.forms[1].contAdrs1.focus();
	    return false;	
	}
	if (document.forms[1].mRent.value == "")
	{
	    alert ("Please enter Monthly Rent Amount")
	    document.forms[1].mRent.focus();
	    return false;	
	}
	
return true;
}

function Today(obj)
{
	var today;
	today = new Date()
	var mon = today.getMonth()
	mon = parseInt(mon) + 1
	var toDayDate = today.getDate() + "/" + mon + "/" + today.getFullYear()
	obj.value = toDayDate
}

// Combo box fill in for Accomodations of Properties

var BunglowArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('1 Room + Dinning + Kitchen','1 Room + Dinning + Kitchen')",
"('2 Rooms + Dinning + Kitchen','2 Rooms + Dinning + Kitchen')",
"('3 Rooms + Dinning + Kitchen','3 Rooms + Dinning + Kitchen')",
"('4 Rooms + Dinning + Kitchen','4 Rooms + Dinning + Kitchen')",
"('Other','Other')");

var RowHouseArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('1 Room + Dinning + Kitchen','1 Room + Dinning + Kitchen')",
"('2 Rooms + Dinning + Kitchen','2 Rooms + Dinning + Kitchen')",
"('3 Rooms + Dinning + Kitchen','3 Rooms + Dinning + Kitchen')",
"('4 Rooms + Dinning + Kitchen','4 Rooms + Dinning + Kitchen')",
"('Other','Other')");

var FlatArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('1 Room + Dinning + Kitchen','1 Room + Dinning + Kitchen')",
"('2 Rooms + Dinning + Kitchen','2 Rooms + Dinning + Kitchen')",
"('3 Rooms + Dinning + Kitchen','3 Rooms + Dinning + Kitchen')",
"('4 Rooms + Dinning + Kitchen','4 Rooms + Dinning + Kitchen')",
"('Other','Other')");

var TenamentArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('1 Room + Dinning + Kitchen','1 Room + Dinning + Kitchen')",
"('2 Rooms + Dinning + Kitchen','2 Rooms + Dinning + Kitchen')",
"('3 Rooms + Dinning + Kitchen','3 Rooms + Dinning + Kitchen')",
"('4 Rooms + Dinning + Kitchen','4 Rooms + Dinning + Kitchen')",
"('Other','Other')");

var OfficeArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('At 1st Floor','At 1st Floor')",
"('At 2nd Floor','At 2nd Floor')",
"('At 3rd Floor','At 3rd Floor')",
"('Above 3rd Floor','Above 3rd Floor')");

var shopArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('At 1st Floor','At 1st Floor')",
"('At 2nd Floor','At 2nd Floor')",
"('At 3rd Floor','At 3rd Floor')",
"('Above 3rd Floor','Above 3rd Floor')");

var LandArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('Agricultural Land',''Agricultural Land')",
"('Industrial Land',''Industrial Land')",
"('Other','Other')");

var GodownArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('Room','Room')",
"('Room + Hall','Room + Hall')",
"('Hall','Hall')",
"('Room With Parking','Room With Parking')",
"('Hall With Parking','Hall With Parking')");

var roomArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('1 Room','1 Room')",
"('2 Rooms','2 Rooms')",
"('3 Rooms','3 Rooms')",
"('4 Rooms','4 Rooms')");

var pgArray =  new Array("('Select Accomodations','',true,true)",
"('Any','Any')",
"('Student(s) Male','Student(s) Male')",
"('Studnet(s) Female','Studnet(s) Female')",
"('Single Male','Single Male')",
"('Single Male','Single Male')",
"('Executive Male','Executive Male')",
"('Executive Male','Executive Male')",
"('Retired Person','Retired Person')",
"('Other','Other')");

var landArray =  new Array("('Any','',true,true)",
"('Any','Any')",
"('for Business','for Business')",
"('for Residence','for Residence')",
"('for Other','for Other')");

var noneArray =  new Array("('Any','',true,true)");
// Function to fill combo box
function populateAcmd(inForm,selected) {
var selectedArray = eval(selected + "Array");
while (selectedArray.length < inForm.acmd.options.length)
{
inForm.acmd.options[(inForm.acmd.options.length - 1)] = null;
}
for (var i=0; i < selectedArray.length; i++) {
eval("inForm.acmd.options[i]=" + "new Option" + selectedArray[i]);
}
if (inForm.proptyp.options[0].value == '') {
inForm.proptyp.options[0]= null;
if ( navigator.appName == 'Netscape') {
if (parseInt(navigator.appVersion) < 4) {
window.history.go(0);
}
else {   	
if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
window.history.go(0);
            }
         }
      }
   }
}
// End Function

function validateBroker()
{
	if (document.forms[0].brkrName.value == "")
	{
		alert ("Please enter Broker Name")
		document.forms[0].brkrName.focus();
		return false;	
	}
	
	if (document.forms[0].brkrName.value != "")
	{
		if (document.forms[0].brkrName.value.charAt(0) == " ")
		{
			alert ("Broker Name cannot start with blank space")
			document.forms[0].brkrName.focus();
			return false;
		}
	}
	
	if (document.forms[0].brokerType.value == "none")
	{
		alert ("Please Select Broker Type")
		document.forms[0].brokerType.focus();	
		return false;
	}

	if (document.forms[0].brkrAdrs1.value == "")
	{
		alert ("Work Place Address")
		document.forms[0].brkrAdrs1.focus();	
		return false;
	}
	
	if (document.forms[0].state.value == "none")
	{
		alert ("Please Select State")
		document.forms[0].state.focus();	
		return false;
	}

/*	if (document.forms[0].city.value == "")
	{
		alert ("Please Select City")
		document.forms[0].city.focus();	
		return false;
	}	*/
	
	if (document.forms[0].brZipCd.value == "")
	{
		alert ("Please enter Zip Code")
		document.forms[0].brZipCd.focus();	
		return false;
	}
return true;
}
function checkBuyPrNrSrch()
{
	if ((document.rentProperty.proptyp.value == "") || (document.rentProperty.proptyp.value == "none"))
	{
		alert ("Please Select Property Type")
		document.rentProperty.proptyp.focus();
		return false;
	}
	
	if ((document.rentProperty.state.value == "") || (document.rentProperty.state.value == "none"))
	{
		alert ("Please Select Your State")
		document.rentProperty.state.focus();
		return false;
	}
	if ((document.rentProperty.city.value == "") || (document.rentProperty.city.value == "Select City"))
	{
		alert ("Please Select Your City")
		document.rentProperty.city.focus();
		return false;
	}
return true;
}

function checkBuyPrAdvSrch()
{
	if ((document.buyPropertyAdv.proptyp.value == "") || (document.buyPropertyAdv.proptyp.value == "none"))
	{
		alert ("Please Select Property Type")
		document.buyPropertyAdv.proptyp.focus();
		return false;
	}
	
	if ((document.buyPropertyAdv.state.value == "") || (document.buyPropertyAdv.state.value == "none"))
	{
		alert ("Please Select Your State")
		document.buyPropertyAdv.state.focus();
		return false;
	}
	if ((document.buyPropertyAdv.city.value == "") || (document.buyPropertyAdv.city.value == "none"))
	{
		alert ("Please Select Your City")
		document.buyPropertyAdv.city.focus();
		return false;
	}
	if ((document.buyPropertyAdv.acmd.value == "") || (document.buyPropertyAdv.acmd.value == "none"))
	{
		alert ("Please Select Accomodation")
		document.buyPropertyAdv.acmd.focus();
		return false;
	}
return true;
}