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 brokSrch()
{
if (document.broker.city.value == "" & document.broker.zip.value == "" )
    {
        alert ("Please enter City or Zip")
        document.broker.city.focus();
        return false;
    } 
    if (document.broker.dealtyp.value == "none")
    {
        alert ("Please Select Your Looking Property Type")
        document.broker.dealtyp.focus();
        return false;
    } 
return true;

}

function checknbSrch()
{
    if (document.nbsearch.city.value == "")
    {
        alert ("Please Enter City Name, Where you want to Search Buildings")
        document.nbsearch.city.focus();
        return false;
    } 
    if (document.nbsearch.plantyp.value == "none")
    {
        alert ("Please Select Plan Type")
        document.nbsearch.plantyp.focus();
        return false;
    } 
return true;

}

function checkall()
{
    if (document.forms[1].fname.value == "")
    {
        alert ("Please enter your First Name")
        document.forms[1].fname.focus();
        return false;
    } 

    if (document.forms[1].lname.value == "")
    {
        alert ("Please enter your Last Name")
        document.forms[1].lname.focus();
        return false;
    } 
    if (document.forms[1].email.value == "")
	{
	    alert ("Please enter your E-Mail Address")
	    document.forms[1].email.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 == "")
	{
	    alert ("Please select City")
	    document.forms[1].city.focus();
	    return false;
}
if (document.forms[1].city.value == "Select City")
	{
	    alert ("Please select City")
	    document.forms[1].city.focus();
	    return false;
}

	if (document.forms[1].occupation.value == "none")
	{
	    alert ("Please select your Occupation")
	    document.forms[1].occupation.focus();
	    return false;
}
if (document.forms[1].two.value == "none")
	{
	    alert ("Please select One")
	    document.forms[1].two.focus();
	    return false;
}
if (document.forms[1].four.value == "none")
	{
	    alert ("Please select One")
	    document.forms[1].four.focus();
	    return false;
}
if (document.forms[1].sale.value == "none")
	{
	    alert ("Please select One")
	    document.forms[1].sale.focus();
	    return false;
}
if (document.forms[1].sale.value == "none")
	{
	    alert ("Please select One")
	    document.forms[1].sale.focus();
	    return false;
}
if (document.forms[1].buy.value == "none")
	{
	    alert ("Please select One")
	    document.forms[1].buy.focus();
	    return false;
}
if (document.forms[1].howknow.value == "none")
	{
	    alert ("Please select One")
	    document.forms[1].howknow.focus();
	    return false;
}
	
	
return true;
}

    
   

function checkAllrent()
{
    if (document.forms[1].catagory.value == "none")
    {
        alert ("Please Select Category")
        document.forms[1].catagory.focus();
        return false;
    } 

    if (document.forms[1].proptyp.value == "none")
    {
        alert ("Please Select Property Type")
        document.forms[1].proptyp.focus();
        return false;
    } 
    if (document.forms[1].acmd.value == "")
    {
        alert ("Please select Accommodation")
        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].propAdrs2.value == "")
    {
        alert ("Please enter your Property Address")
        document.forms[1].propAdrs2.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 == "none")
    {
        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].mRent.value == "")
	{
	    alert ("Please enter Monthly Rent Amount")
	    document.forms[1].mRent.focus();
	    return false;	
	}
var iStr=document.forms[1].details.value;
	if(iStr.length < 50)
	{
		alert("Information About Your Company should contain a minimum of 50 characters");
		document.forms[1].details.focus();
		return false;
	}	

var iStr=document.forms[1].details.value;
	if(iStr.length > 250)
	{
		alert("Information aAbout Your Company should not contain a Maximum of 250 characters");
		document.forms[1].details.focus();
		return false;
	}	
	
	if (document.forms[1].avilfor.value == "none")
	{
	    alert ("Please Selact Your Requirement in Available For")
	    document.forms[1].avilfor.focus();
	    return false;	
	}

	if (document.forms[1].period.value == "none")
	{
	    alert ("Please Select Period of Rantel Property ")
	    document.forms[1].period.focus();
	    return false;	
	}
if (document.forms[1].code.value != document.forms[1].securitycode.value)
    {
        alert ("Entered Code is not Correct, Code is Case Sensitive")
        document.forms[1].code.focus();
        return false;
    }

return true;
}

function checkrentreq()
{
    if (document.forms[1].proptyp.value == "none")
    {
        alert ("Please Select Property Type")
        document.forms[1].proptyp.focus();
        return false;
    } 
    if (document.forms[1].acmd.value == "none")
    {
        alert ("Please select Accommodation")
        document.forms[1].acmd.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 == "")
    {
        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].code.value == "")
    {
        alert ("Please Enter Code")
        document.forms[1].code.focus();
        return false;
    }
if (document.forms[1].code.value != document.forms[1].securitycode.value)
    {
        alert ("Entered Code is not Correct, Code is Case Sensitive")
        document.forms[1].code.focus();
        return false;
    }

return true;
}



function checkAllsale()
{
    if (document.forms[1].catagory.value == "none")
    {
        alert ("Please Select Category")
        document.forms[1].catagory.focus();
        return false;
    } 

    if (document.forms[1].proptyp.value == "none")
    {
        alert ("Please Select Property Type")
        document.forms[1].proptyp.focus();
        return false;
    } 
    if (document.forms[1].acmd.value == "")
    {
        alert ("Please select Accommodation")
        document.forms[1].acmd.focus();
        return false;
    }
    if (document.forms[1].balcony.value == "none")
    {
        alert ("Please select Numbaer of balcony in Accommodation")
        document.forms[1].balcony.focus();
        return false;
    }
	if (document.forms[1].bath.value == "none")
    {
        alert ("Please select Numbaer of Bath Room in Accommodation")
        document.forms[1].bath.focus();
        return false;
    }


	if (document.forms[1].floor.value == "none")
    {
        alert ("Please select Floor")
        document.forms[1].floor.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].propAdrs2.value == "")
    {
        alert ("Please enter your Property Address")
        document.forms[1].propAdrs2.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 == "none")
    {
        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].salePrice.value == "")
	{
	    alert ("Please enter Sale Price")
	    document.forms[1].salePrice.focus();
	    return false;	
	}

	
var iStr=document.forms[1].details.value;
	if(iStr.length < 50)
	{
		alert("Information About Your Company should contain a minimum of 50 characters");
		document.forms[1].details.focus();
		return false;
	}	

var iStr=document.forms[1].details.value;
	if(iStr.length > 250)
	{
		alert("Information aAbout Your Company should not contain a Maximum of 250 characters");
		document.forms[1].details.focus();
		return false;
	}	
	
	if (document.forms[1].code.value != document.forms[1].securitycode.value)
    {
        alert ("Entered Code is not Correct, Code is Case Sensitive")
        document.forms[1].code.focus();
        return false;
    }

	return true;
}


function changerentCount()
{
	var docF=document.forms[1];
	var str=new String();
	
	str=docF.details.value;
	docF.wordcount.value=str.length;
}

function changesaleCount()
{
	var docF=document.saleproperty;
	var str=new String();
	
	str=docF.details.value;
	docF.wordcount.value=str.length;
}

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','none',true,true)",
"('Any','Any')",
"('1 R + L + D + K + G','1 Room + Livinig + Dining + Kitchen + Garden')",
"('2 R + L + D + K + G','2 Room + Livinig + Dining + Kitchen + Garden')",
"('3 R + L + D + K + G','3 Room + Livinig + Dining + Kitchen + Garden')",
"('4 R + L + D + K + G','4 Room + Livinig + Dining + Kitchen + Garden')",
"('5 R + L + D + K + G','5 Room + Livinig + Dining + Kitchen + Garden')",
"('1 R + L + D + K','1 Room + Livinig + Dining + Kitchen')",
"('2 R + L + D + K','2 Room + Livinig + Dining + Kitchen')",
"('3 R + L + D + K','3 Room + Livinig + Dining + Kitchen')",
"('4 R + L + D + K','4 Room + Livinig + Dining + Kitchen')",
"('5 R + L + D + K','5 Room + Livinig + Dining + Kitchen')",
"('2 R + L + K + G','2 Room + Livinig + Kitchen + Garden')",
"('3 R + L + K + G','3 Room + Livinig + Kitchen + Garden')",
"('4 R + L + K + G','4 Room + Livinig + Kitchen + Garden')",
"('5 R + L + K + G','5 Room + Livinig + Kitchen + Garden')",
"('1 R + L + K','1 Room + Livinig + Kitchen')",
"('2 R + L + K','2 Room + Livinig + Kitchen')",
"('3 R + L + K','3 Room + Livinig + Kitchen')",
"('4 R + L + K','4 Room + Livinig + Kitchen')",
"('5 R + L + K','5 Room + Livinig + Kitchen')");

var RowHouseArray =  new Array("('Select Accomodations','none',true,true)",
"('Any','Any')",
"('1 R + L + D + K','1 Room + Livinig + Dining + Kitchen')",
"('2 R + L + D + K','2 Room + Livinig + Dining + Kitchen')",
"('3 R + L + D + K','3 Room + Livinig + Dining + Kitchen')",
"('4 R + L + D + K','4 Room + Livinig + Dining + Kitchen')",
"('5 R + L + D + K','5 Room + Livinig + Dining + Kitchen')",
"('1 R + L + K','1 Room + Livinig + Kitchen')",
"('2 R + L + K','2 Room + Livinig + Kitchen')",
"('3 R + L + K','3 Room + Livinig + Kitchen')",
"('4 R + L + K','4 Room + Livinig + Kitchen')",
"('5 R + L + K','5 Room + Livinig + Kitchen')");

var FlatArray =  new Array("('Select Accomodations','none',true,true)",
"('Any','Any')",
"('1 R + L + D + K','1 Room + Livinig + Dining + Kitchen')",
"('2 R + L + D + K','2 Room + Livinig + Dining + Kitchen')",
"('3 R + L + D + K','3 Room + Livinig + Dining + Kitchen')",
"('4 R + L + D + K','4 Room + Livinig + Dining + Kitchen')",
"('5 R + L + D + K','5 Room + Livinig + Dining + Kitchen')",
"('1 R + L + K','1 Room + Livinig + Kitchen')",
"('2 R + L + K','2 Room + Livinig + Kitchen')",
"('3 R + L + K','3 Room + Livinig + Kitchen')",
"('4 R + L + K','4 Room + Livinig + Kitchen')",
"('5 R + L + K','5 Room + Livinig + Kitchen')");

var TenamentArray =  new Array("('Select Accomodations','none',true,true)",
"('Any','Any')",
"('1 R + L + D + K','1 Room + Livinig + Dining + Kitchen')",
"('2 R + L + D + K','2 Room + Livinig + Dining + Kitchen')",
"('3 R + L + D + K','3 Room + Livinig + Dining + Kitchen')",
"('4 R + L + D + K','4 Room + Livinig + Dining + Kitchen')",
"('5 R + L + D + K','5 Room + Livinig + Dining + Kitchen')",
"('1 R + L + K','1 Room + Livinig + Kitchen')",
"('2 R + L + K','2 Room + Livinig + Kitchen')",
"('3 R + L + K','3 Room + Livinig + Kitchen')",
"('4 R + L + K','4 Room + Livinig + Kitchen')",
"('5 R + L + K','5 Room + Livinig + Kitchen')");

var OfficeArray =  new Array("('Select Accomodations','none',true,true)",
"('Any','Any')",
"('1 Hall','1 Hall')",
"('2 Hall','2 Hall')",
"('1 Room','1 Room')",
"('2 Room','2 Room')",
"('3 Room','3 Room')",
"('1 Room + Kitchen','1 Room + Kitchen')",
"('2 Room + Kitchen','2 Room + Kitchen')",
"('3 Room + Kitchen','3 Room + Kitchen')",
"('4 Room + Kitchen','2 Room + Kitchen')",
"('5 Room + Kitchen','1 Room + Kitchen')");

var ShopArray =  new Array("('Select Accomodations','none',true,true)",
"('Any','Any')",
"('Single Shutter Shop','Single Shutter Shop')",
"('Two Side Shutter Shop','Two Side Shutter Shop')",
"('Three Side Shutter Shop','Three Side Shutter Shop')",
"('Single Shutter Showroom','Single Shutter Showroom')",
"('Two Side Shutter Showroom','Two Side Shutter Showroom')",
"('Three Side Shutter Showroom','Three Side Shutter Showroom')");

var GodownArray =  new Array("('Select Accomodations','none',true,true)",
"('Any','Any')",
"('1 Room','1 Room')",
"('2 Room','1 Room')",
"('3 Room','1 Room')",
"('1 Hall','1 Hall')",
"('2 Hall','2 Hall')",
"('3 Hall','3 Hall')",
"('4 Hall','4 Hall')",
"('5 Hall','5 Hall')",
"('More then 4 Hall','More then 4 Hall')");

var RoomArray =  new Array("('Select Accomodations','none',true,true)",
"('Any','Any')",
"('1 Room','1 Room')",
"('2 Rooms','2 Rooms')");


var pgArray =  new Array("('Select Accomodations','none',true,true)",
"('Any','Any')",
"('Student(s) Male','Student(s) Male')",
"('Studnet(s) Female','Studnet(s) Female')",
"('Single Male','Single Male')",
"('Single Female','Single Female')",
"('Executive Male','Executive Male')",
"('Executive Female','Executive Female')");

var PlotArray =  new Array("('Select Plot','none',true,true)",
"('Any','Any')",
"('Agricultural Plot','Agricultural Plot')",
"('Industrial Plot','Industrial Plot')",
"('Residential Plot','Residential Plot')");

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;
}