// JavaScript Document
function trim( instr ) {
    	var reFirst = /\S/;		// regular expression for first non-white char
    	var reLast = /\s+$/;	// regular expression for first white char after last non-white char
    	var firstChar = instr.search(reFirst);
    	var lastChar = instr.search(reLast);
    	
    	if( lastChar == -1 ) 
			lastChar = instr.length;    	
    	outstr = instr.substring( firstChar, lastChar );
		return outstr;
}

function loadResidential(cmb){
try
{
var flag  = cmb
var Rstr = ""

Rstr = Rstr + "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
Rstr = Rstr + "  <tr>"
Rstr = Rstr + "    <td><select name='subtype' class=style2>"
Rstr = Rstr + "        <option value='R' selected>All Residential</option>"
Rstr = Rstr + "        <option value='Residential Apartment'>Residential Apartment</option>"
Rstr = Rstr + "        <option value='Independent House'>Independent House</option>"
Rstr = Rstr + "        <option value='Residential Land'>Residential Land</option>"
Rstr = Rstr + "        <option value='Builder Floor'>Builder Floor</option>"
Rstr = Rstr + "        <option value='Farm House'>Farm House</option>"
Rstr = Rstr + "        <option value='Serviced Apartments'>Serviced Apartments</option>"
Rstr = Rstr + "      </select> </td>"
Rstr = Rstr + "  </tr>"
Rstr = Rstr + "</table>"

var Cstr = ""

Cstr = Cstr + "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
Cstr = Cstr + "  <tr>"
Cstr = Cstr + "    <td><select name='subtype' id='CommercialProp' class=style2>"
Cstr = Cstr + "        <option value='C'>All Commercial</option>"
Cstr = Cstr + "        <option value='Commercial Shops'>Commercial Shops</option>"
Cstr = Cstr + "        <option value='Commercial Showrooms'>Commercial Showrooms</option>"
Cstr = Cstr + "        <option value='Commercial Office'>Commercial Office</option>"
Cstr = Cstr + "        <option value='Commercial Land'>Commercial Land</option>"
Cstr = Cstr + "        <option value='Hotel/Guest House'>Hotel/Guest House</option>"
Cstr = Cstr + "        <option value='Time Share'>Time Share</option>"
Cstr = Cstr + "        <option value='Space in Retail Mall'>Space in Retail Mall</option>"
Cstr = Cstr + "        <option value='Office in Business Park'>Office in Business Park</option>"
Cstr = Cstr + "        <option value='Office in IT Park'>Office in IT Park</option>"
Cstr = Cstr + "        <option value='Ware House'>Ware House</option>"
Cstr = Cstr + "        <option value='Industrial Lands/Plots'>Industrial Lands/Plots</option>"
Cstr = Cstr + "        <option value='Cold Storage'>Cold Storage</option>"
Cstr = Cstr + "        <option value='Factory'>Factory</option>"
Cstr = Cstr + "        <option value='Manufacturing'>Manufacturing</option>"
Cstr = Cstr + "        <option value='Agricultural / Farm Land'>Agricultural / Farm Land</option>"
Cstr = Cstr + "        <option value='Business Center'>Business Center</option>"
Cstr = Cstr + "        <option value='Other'>Other</option>"
Cstr = Cstr + "      </select></td>"
Cstr = Cstr + "  </tr>"
Cstr = Cstr + "</table>"

var Bedroomtxt ="<strong class='style3'>Bedroom </strong> " 
var Bedroom = ""

Bedroom = Bedroom + "	<select class='style2' name='bedroom'>"
Bedroom = Bedroom + "        <option value=0 selected>Select</option>"
Bedroom = Bedroom + "        <option value=1>1</option>"
Bedroom = Bedroom + "        <option value=2>2</option>"
Bedroom = Bedroom + "        <option value=3>3</option>"
Bedroom = Bedroom + "        <option value=4>4</option>"
Bedroom = Bedroom + "        <option value=5>5</option>"
Bedroom = Bedroom + "        <option value=6>6</option>"
Bedroom = Bedroom + "        <option value=7>7</option>"
Bedroom = Bedroom + "        <option value=8>8</option>"
Bedroom = Bedroom + "        <option value=9>9</option>"
Bedroom = Bedroom + "        <option value=10>9+</option>"
Bedroom = Bedroom + "   </select>"



	if(flag == 1){
		document.getElementById('Propertycmb').innerHTML = Rstr;
		//document.getElementById('BedRoomCmb').innerHTML = Bedroom;
		//document.getElementById('BedRoomTxt').innerHTML = Bedroomtxt;
//		alert("loadedRes");
	}else{
		document.getElementById('Propertycmb').innerHTML = Cstr;
		document.getElementById('BedRoomCmb').innerHTML = "";
		document.getElementById('BedRoomTxt').innerHTML = "";
	//	alert("loadedCom");
	}
}
catch(e)
{
	//alert(e.message);
}

}

function loadSearchCombo(cmb){
try
{
var flag  = cmb
var Rstr = ""

Rstr = Rstr + "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>"
Rstr = Rstr + "  <tr>"
Rstr = Rstr + "    <td align='center'><select name='subtype' class=style2>"
Rstr = Rstr + "        <option value='R' selected>All Residential</option>"
Rstr = Rstr + "        <option value='Residential Apartment'>Residential Apartment</option>"
Rstr = Rstr + "        <option value='Independent House'>Independent House</option>"
Rstr = Rstr + "        <option value='Residential Land'>Residential Land</option>"
Rstr = Rstr + "        <option value='Builder Floor'>Builder Floor</option>"
Rstr = Rstr + "        <option value='Farm House'>Farm House</option>"
Rstr = Rstr + "        <option value='Serviced Apartments'>Serviced Apartments</option>"
Rstr = Rstr + "      </select> </td>"
Rstr = Rstr + "  </tr>"
Rstr = Rstr + "</table>"

var Cstr = ""

Cstr = Cstr + "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>"
Cstr = Cstr + "  <tr>"
Cstr = Cstr + "    <td align='center'><select name='subtype' id='CommercialProp' class=style2>"
Cstr = Cstr + "        <option value='C'>All Commercial</option>"
Cstr = Cstr + "        <option value='Commercial Shops'>Commercial Shops</option>"
Cstr = Cstr + "        <option value='Commercial Showrooms'>Commercial Showrooms</option>"
Cstr = Cstr + "        <option value='Commercial Office'>Commercial Office</option>"
Cstr = Cstr + "        <option value='Commercial Land'>Commercial Land</option>"
Cstr = Cstr + "        <option value='Hotel/Guest House'>Hotel/Guest House</option>"
Cstr = Cstr + "        <option value='Time Share'>Time Share</option>"
Cstr = Cstr + "        <option value='Space in Retail Mall'>Space in Retail Mall</option>"
Cstr = Cstr + "        <option value='Office in Business Park'>Office in Business Park</option>"
Cstr = Cstr + "        <option value='Office in IT Park'>Office in IT Park</option>"
Cstr = Cstr + "        <option value='Ware House'>Ware House</option>"
Cstr = Cstr + "        <option value='Industrial Lands/Plots'>Industrial Lands/Plots</option>"
Cstr = Cstr + "        <option value='Cold Storage'>Cold Storage</option>"
Cstr = Cstr + "        <option value='Factory'>Factory</option>"
Cstr = Cstr + "        <option value='Manufacturing'>Manufacturing</option>"
Cstr = Cstr + "        <option value='Agricultural / Farm Land'>Agricultural / Farm Land</option>"
Cstr = Cstr + "        <option value='Business Center'>Business Center</option>"
Cstr = Cstr + "        <option value='Other'>Other</option>"
Cstr = Cstr + "      </select></td>"
Cstr = Cstr + "  </tr>"
Cstr = Cstr + "</table>"


	if(flag == 1){
		document.getElementById('Propertycmbo').innerHTML = Rstr;
	}else{
		document.getElementById('Propertycmbo').innerHTML = Cstr;
	}
}
catch(e)
{
	//alert(e.message);
}

}


function selectCombo(value,cmb)
{
	//Select Item
	
	
		for(j=0;j<cmb.options.length;j++)
		{
			if(cmb.options[j].value == value)
			{
				//alert(value);
				cmb.options[j].selected=true;
			}
			
		}
	
}



function loadResiCombo(cmb){
try
{
var flag  = cmb
var Rstr = ""

Rstr = Rstr + "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
Rstr = Rstr + "  <tr>"
Rstr = Rstr + "    <td><select name='subtype' class=style2>"
//Rstr = Rstr + "        <option value='All Residential' selected>All Residential</option>"
Rstr = Rstr + "        <option value='Residential Apartment'>Residential Apartment</option>"
Rstr = Rstr + "        <option value='Independent House'>Independent House</option>"
Rstr = Rstr + "        <option value='Residential Land'>Residential Land</option>"
Rstr = Rstr + "        <option value='Builder Floor'>Builder Floor</option>"
Rstr = Rstr + "        <option value='Farm House'>Farm House</option>"
Rstr = Rstr + "        <option value='Serviced Apartments'>Serviced Apartments</option>"
Rstr = Rstr + "      </select> </td>"
Rstr = Rstr + "  </tr>"
Rstr = Rstr + "</table>"

var Cstr = ""

Cstr = Cstr + "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
Cstr = Cstr + "  <tr>"
Cstr = Cstr + "    <td><select name='subtype' id='CommercialProp' class=style2>"
Cstr = Cstr + "        "
Cstr = Cstr + "        <option value='Commercial Shops'>Commercial Shops</option>"
Cstr = Cstr + "        <option value='Commercial Showrooms'>Commercial Showrooms</option>"
Cstr = Cstr + "        <option value='Commercial Office'>Commercial Office</option>"
Cstr = Cstr + "        <option value='Commercial Land'>Commercial Land</option>"
Cstr = Cstr + "        <option value='Hotel/Guest House'>Hotel/Guest House</option>"
Cstr = Cstr + "        <option value='Time Share'>Time Share</option>"
Cstr = Cstr + "        <option value='Space in Retail Mall'>Space in Retail Mall</option>"
Cstr = Cstr + "        <option value='Office in Business Park'>Office in Business Park</option>"
Cstr = Cstr + "        <option value='Office in IT Park'>Office in IT Park</option>"
Cstr = Cstr + "        <option value='Ware House'>Ware House</option>"
Cstr = Cstr + "        <option value='Industrial Lands/Plots'>Industrial Lands/Plots</option>"
Cstr = Cstr + "        <option value='Cold Storage'>Cold Storage</option>"
Cstr = Cstr + "        <option value='Factory'>Factory</option>"
Cstr = Cstr + "        <option value='Manufacturing'>Manufacturing</option>"
Cstr = Cstr + "        <option value='Agricultural / Farm Land'>Agricultural / Farm Land</option>"
Cstr = Cstr + "        <option value='Business Center'>Business Center</option>"
Cstr = Cstr + "        <option value='Other'>Other</option>"
Cstr = Cstr + "      </select></td>"
Cstr = Cstr + "  </tr>"
Cstr = Cstr + "</table>"

var Bedroomtxt ="<font size='2' face='Verdana, Arial, Helvetica, sans-serif' >Bedroom </font> " 
var Bedroom = ""

Bedroom = Bedroom + "	<select class='style2' name='bedroom'>"
Bedroom = Bedroom + "        <option value=0 selected>Select</option>"
Bedroom = Bedroom + "        <option value=1>1</option>"
Bedroom = Bedroom + "        <option value=2>2</option>"
Bedroom = Bedroom + "        <option value=3>3</option>"
Bedroom = Bedroom + "        <option value=4>4</option>"
Bedroom = Bedroom + "        <option value=5>5</option>"
Bedroom = Bedroom + "        <option value=6>6</option>"
Bedroom = Bedroom + "        <option value=7>7</option>"
Bedroom = Bedroom + "        <option value=8>8</option>"
Bedroom = Bedroom + "        <option value=9>9</option>"
Bedroom = Bedroom + "        <option value=10>9+</option>"
Bedroom = Bedroom + "   </select>"

var propRes = "<input type='hidden' name='proptype' value='R'>";
var propCom = "<input type='hidden' name='proptype' value='C'>";

	if(flag == 1){
		document.getElementById('Propertycombo').innerHTML = Rstr;
		document.getElementById('BedRoomCmb').innerHTML = Bedroom;
		document.getElementById('BedRoomTxt').innerHTML = Bedroomtxt;
		document.getElementById('proptype').innerHTML = propRes;
	}else{
		document.getElementById('Propertycombo').innerHTML = Cstr;
		document.getElementById('BedRoomCmb').innerHTML = "";
		document.getElementById('BedRoomTxt').innerHTML = "";
		document.getElementById('proptype').innerHTML = propCom;
	}
}
catch(e)
{
	//alert(e.message);
}

}


function loadbudget(rd){

var flag  = rd
var Tstr = ""
	
Tstr = Tstr + "  <select class=style2 name='Budget'>"
Tstr = Tstr + "  <option value=' > 0 ' selected>INR</option>"
Tstr = Tstr + "  <option value=' < 1000' >Below Rs.1000 </option>"
Tstr = Tstr + "  <option value=' between 1001 and 2000 ' >Rs.1001 to Rs.2000</option>"
Tstr = Tstr + "  <option value=' between 2001 and 3000 ' >Rs.2001 to Rs.3000</option>"
Tstr = Tstr + "  <option value=' between 3001 and 4000 '>Rs.3001 to Rs.4000 </option>"
Tstr = Tstr + "  <option value=' between 4001 and 5000 '>Rs.4001 to Rs.5000</option>"
Tstr = Tstr + "  <option value=' between 5001 and 7500 '>Rs.5001 to Rs.7500</option>"
Tstr = Tstr + "  <option value=' between 7501 and 10000 ' >Rs.7501 to Rs.10000</option>"
Tstr = Tstr + "  <option value=' between 10001 and 15000 '>Rs.10001 to Rs.15000</option>"
Tstr = Tstr + "  <option value=' between 15001 and 25000 '>Rs.15001 to Rs.25000</option>"
Tstr = Tstr + "  <option value=' between 25001 and 50000 '>Rs.25001 to Rs.50000</option>"
Tstr = Tstr + "  <option value=' between 50001 and 100000 '>Rs.50001 to Rs.100000</option>"
Tstr = Tstr + "  <option value=' >100000 '>Rs.100001 and above</option>"
Tstr = Tstr + "  </select>"

var RmStr = ""
RmStr = RmStr +   "<select class=style2 name='RoomateBudget0'>"
RmStr = RmStr +   "<option value=0 selected>INR</option>"
RmStr = RmStr +   "<option value=1>Below Rs.100 </option>"
RmStr = RmStr +   "<option value=2>Rs.100 to Rs.200</option>"
RmStr = RmStr +   "<option value=3>Rs.201 to Rs.300</option>"
RmStr = RmStr +   "<option value=4>Rs.301 to Rs.400 </option>"
RmStr = RmStr +   "<option value=5>Rs.401 to Rs.500</option>"
RmStr = RmStr +   "<option value=6>Rs.501 to Rs.750</option>"
RmStr = RmStr +   "<option value=7>Rs.751 to Rs.1000</option>"
RmStr = RmStr +   "<option value=8>Rs.1001 to Rs.1500</option>"
RmStr = RmStr +   "<option value=9>Rs.1501 to Rs.2500</option>"
RmStr = RmStr +   "<option value=10>Rs.2501 to Rs.5000</option>"
RmStr = RmStr +   "<option value=11>Rs.5001 and above</option>"
RmStr = RmStr +   "</select>"

var Lstr = "" 

Lstr = Lstr + "  <select class=style2 name='Budget'>"
Lstr = Lstr + "  <option value=' > 0' selected>INR</option>"
Lstr = Lstr + "  <option value=' < 700000'>Below 7 lacs</option>"
Lstr = Lstr + "  <option value=' between 700000 and 1500000 '>7 to 15 lacs</option>"
Lstr = Lstr + "  <option value=' between 1500000 and 2500000 '>15 to 25 lacs</option>"
Lstr = Lstr + "  <option value=' between 2500000 and 4000000 '>25 to 40 lacs</option>"
Lstr = Lstr + "  <option value=' between 4000000 and 6000000 '>40 to 60 lacs</option>"
Lstr = Lstr + "  <option value=' between 6000000 and 10000000 '>60 to 100 lacs</option>"
Lstr = Lstr + "  <option value=' between 10000000 and 15000000 '>1 to 1.5 crores</option>"
Lstr = Lstr + "  <option value=' between 15000000 and 20000000 '>1.5 to 2 crores</option>"
Lstr = Lstr + "  <option value=' between 20000000 and 25000000 '>2 to 2.5 crores</option>"
Lstr = Lstr + "  <option value=' > 25000000 '>Above 2.5 crores</option>"
Lstr = Lstr + "  <option value='> 0'>Negotiable</option>"
Lstr = Lstr + "  </select>"


	if(flag == 1){
		document.getElementById('PropertyRent').innerHTML = Lstr;
		//alert("lacs");
	}else if(flag == 2){
		document.getElementById('PropertyRent').innerHTML = Tstr;
		//alert("Thousands");
	}else{	
		document.getElementById('PropertyRent').innerHTML = RmStr;
		//alert("hundreds");
	}

}

function loadCounter()
 {		
		var sURL    = "counter.asp";
		var CounterText = ""
		var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp.Open("GET", sURL, false);
		xmlhttp.Send();
		if(xmlhttp.statusText == 'OK'){	
			CounterText  =xmlhttp.responseText;
		}else{	
			CounterText  =1000;
		}
		document.getElementById('HitCnt').innerText = CounterText;
}



