	var budgetval = new Object()
	budgetval['1'] = [{value:"999999", text:"Below 10 Lacs"},{value:"1499999", text:"10 to 15 Lacs"},{value:"1999999", text:"15 to 20 Lacs"},{value:"2999999", text:"20 to 30 Lacs"},{value:"3999999", text:"30 to 40 Lacs"},{value:"4999999", text:"40 to 50 Lacs"},{value:"5999999", text:"50 to 60 Lacs"},{value:"7499999", text:"60 to 75 Lacs"},{value:"9999999", text:"75 Lacs to 1 Cr."},{value:"14999999", text:"1 to 1.5 Cr."},{value:"19999999", text:"1.5 to 2 Cr."},{value:"29999999", text:"2 to 3 Cr."},{value:"49999999", text:"3 to 5 Cr."},{value:"99999999", text:"5 to 10 Cr."},{value:"199999999", text:"10 to 20 Cr."},{value:"200000000", text:"More than 20 Cr."}];
	budgetval['2'] = [{value:"4999", text:"Below 5000"},{value:"9999", text:"5001 to 10000"},{value:"14999", text:"10001 to 15000"},{value:"19999", text:"15001 to 20000"},{value:"24999", text:"20001 to 25000"},{value:"39999", text:"25001 to 40000"},{value:"69999", text:"40001 to 70000"},{value:"99999", text:"70001 to 1 Lac"},{value:"149999", text:"1 to 1.5 Lacs"},{value:"199999", text:"1.5 to 2 Lacs"},{value:"499999", text:"2 to 5 Lacs"},{value:"999999", text:"5 to 10 Lacs"},{value:"1000000", text:">10 Lacs"}];
	function validate_search(frm)
	{
		var city = eval('document.'+frm+'.city.value');
		if(city == '')
		{
			alert('Please select the city');
			eval('document.'+frm+'.city.focus();');
			return false;
		}
		return true;
	}
	function setBudget(chooser,def_sale,def_rent)
	{
		var newElem;
		var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
		var cityChooser = chooser.form.elements["budget"];
		while (cityChooser.options.length)
		{
			cityChooser.remove(0);
		}
		var choice = chooser.options[chooser.selectedIndex].value;
		var db = budgetval[choice];
		if (choice != "") 
		{
			for (var i = 0; i < db.length; i++) 
			{
				newElem = document.createElement("option");
				newElem.text = db[i].text;
				newElem.value = db[i].value;
				cityChooser.add(newElem, where);
				if(choice == 1 && db[i].value == def_sale)
				{
					newElem.selected = true;
				}else if(db[i].value == def_rent){
					newElem.selected = true;
				}
			}
		}
	}

function setBudget2(chooser,def_sale,def_rent, find, frm_name, price_from, price_to)
{
	//alert(chooser+"="+def_sale+"="+def_rent+"="+find+"="+frm_name+"="+price_from+"="+price_to);	

	if(!price_from) price_from=0;
	if(!price_to) price_to=0;
	//alert(price_from);
	//alert(price_to);

	if(find == 0) {
		chooser = chooser;
	} else {
		if(eval("document." + frm_name + ".property_for.value")=='1')
			chooser='1';
		else if(eval("document." + frm_name + ".property_for.value")=='2')
			chooser='2';
		else
			chooser='1';
	}
	var newElem;
	var where = (navigator.appName == 'Microsoft Internet Explorer') ? -1 : null;
	var cityChooser = eval("document." + frm_name + ".elements['budget_from']");
	if(find != 1) {
		while (cityChooser.options.length) {
			cityChooser.remove(0);
		}
		var choice = chooser;
		var db = budgetval[choice];
		newElem = document.createElement('option');
		if(chooser == '2') {
			newElem.text = "<5000";
			newElem.value = "4999";
		} else {
			newElem.text = "<10 Lacs";
			newElem.value = "999999";
		}
		cityChooser.add(newElem, where);
		if (choice != '') {
			var selfound = 0;
			for (var i = 0; i < db.length; i++) {
				if(selfound == 0 && chooser == '2' &&  price_from == '4999') {
					newElem.selected = true;
					selfound = 1;
				} else if(selfound == 0 && chooser == '1' &&  price_from == '999999') {
					newElem.selected = true;
					selfound = 1;
				}
				newElem = document.createElement('option');
				newElem.text = db[i].text;
				newElem.value = db[i].value;
				if(i == (db.length-1)) {
					newElem.text = ">" + newElem.text;
				}
				cityChooser.add(newElem, where);
				if(selfound == 0 && db[i].value == price_from) {
					newElem.selected = true;
					selfound = 1;
				} else if(selfound == 0 && chooser == 1 && db[i].value == '3000000') {
					newElem.selected = true;
				}else if(selfound == 0 && chooser == 2 && db[i].value == '15000'){
					newElem.selected = true;
				}
			}
		}
	}

	var cityChooser2 = eval("document." + frm_name + ".elements['budget_to']");
	while (cityChooser2.options.length) {
		cityChooser2.remove(0);
	}
	var choice = chooser;
	var db = budgetval[choice];
	var start = 0;
	if(find == 0) {
		if(chooser == 1) {
			start = 4;
		} else {
			start = 3;
		}
	} else {
		start = cityChooser.selectedIndex;
	}
	var maxoptions=cityChooser.options.length-1;
	//alert(chooser);

	if(start == 0 || start == maxoptions) {
		newElem = document.createElement('option');
		newElem.text = "Max Price";
		newElem.value = "";
		cityChooser2.add(newElem, where);
		cityChooser2.disabled = true;
	}else if (choice != '') {
		var selfound = 0;
		for (var i = start; i < db.length; i++) {
			newElem = document.createElement('option');
			newElem.text = db[i].text;
			newElem.value = db[i].value;
			cityChooser2.add(newElem, where);
			if(db[i].value == price_to) {
					newElem.selected = true;
					selfound = 1;
			} else if(selfound == 0 && choice == 1 && db[i].value == def_sale) {
				newElem.selected = true;
			}else if(selfound == 0 && db[i].value == def_rent){
				newElem.selected = true;
			}
		}
		cityChooser2.disabled = false;
	}

}


	function disable_combo(ctrl,frm_name)
	{
		if(ctrl==2 || ctrl==4 || ctrl==10 || ctrl==11 || ctrl==12 ||  ctrl==13 || ctrl==14 || ctrl==15 || ctrl==16)
		{
			val = (eval('document.' + frm_name + '.bedroom'));
			val.disabled =true;
		}
		else
		{
			val = (eval('document.' + frm_name + '.bedroom'));
			val.disabled=false;
		}
	}
	
function changetab(val, showhide) {
	if(showhide == true) {
	
		if(val == 'reg') {
			document.getElementById('menu-reg-mid').style.color = '#FFFFFF';
			document.getElementById('menu-reg-mid').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-reg-left').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-reg-right').style.backgroundPosition = '0px -29px';

		} else if(val == 'search') {
			document.getElementById('menu-search-mid').style.color = '#FFFFFF';
			document.getElementById('menu-search-mid').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-search-left').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-search-right').style.backgroundPosition = '0px -29px';

		} else if(val == 'list') {
			document.getElementById('menu-list-mid').style.color = '#FFFFFF';
			document.getElementById('menu-list-mid').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-list-left').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-list-right').style.backgroundPosition = '0px -29px';

		} else if(val == 'req') {
			document.getElementById('menu-req-mid').style.color = '#FFFFFF';
			document.getElementById('menu-req-mid').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-req-left').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-req-right').style.backgroundPosition = '0px -29px';

		} else if(val == 'adv') {
			document.getElementById('menu-adv-mid').style.color = '#FFFFFF';
			document.getElementById('menu-adv-mid').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-adv-left').style.backgroundPosition = '0px -29px';
			document.getElementById('menu-adv-right').style.backgroundPosition = '0px -29px';

		}
	} else {

		if(val == 'reg') {
			document.getElementById('menu-reg-mid').style.color = '#000000';
			document.getElementById('menu-reg-mid').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-reg-left').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-reg-right').style.backgroundPosition = '0px 0px';
		} else if(val == 'search') {
			document.getElementById('menu-search-mid').style.color = '#000000';
			document.getElementById('menu-search-mid').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-search-left').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-search-right').style.backgroundPosition = '0px 0px';
		} else if(val == 'list') {
			document.getElementById('menu-list-mid').style.color = '#000000';
			document.getElementById('menu-list-mid').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-list-left').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-list-right').style.backgroundPosition = '0px 0px';
		} else if(val == 'req') {
			document.getElementById('menu-req-mid').style.color = '#000000';
			document.getElementById('menu-req-mid').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-req-left').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-req-right').style.backgroundPosition = '0px 0px';
		} else if(val == 'adv') {
			document.getElementById('menu-adv-mid').style.color = '#000000';
			document.getElementById('menu-adv-mid').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-adv-left').style.backgroundPosition = '0px 0px';
			document.getElementById('menu-adv-right').style.backgroundPosition = '0px 0px';
		}
	}
}


function change_ptype(val, sel_ptype) {
	var IMG_SERVER = 'http://img.makaan.com';
	var msg;
	if(val=='' || val =='1') {
		msg = '<select name="property_type" class="txtComp" onchange="javascript:disable_combo(this.value,\'frm_first\');" style="width:170px;"><option value="1" style="background-color:#FDF6B5;" ';
		if(sel_ptype == '' || sel_ptype == '1') msg += ' selected';
		msg += '>Residential Property</option><option value="3" ';
		if(sel_ptype == '3') msg += ' selected';
		msg += '>Apartment</option><option value="4" ';
		if(sel_ptype == '4') msg += ' selected';
		msg += '>Plot/Land</option><option value="5" ';
		if(sel_ptype == '5') msg += ' selected';
		msg += '>Builder Floor</option><option value="6" ';
		if(sel_ptype == '6') msg += ' selected';
		msg += '>Bungalow/Villa</option><option value="7" ';
		if(sel_ptype == '7') msg += ' selected';
		msg += '>Farm House</option><option value="8" ';
		if(sel_ptype == '8') msg += ' selected';
		msg += '>Service/Studio Apartment</option><option value="9" ';
		if(sel_ptype == '9') msg += ' selected';
		msg += '>Other Residential</option></select>';

		document.frm_first.bedroom.disabled = false;
		if (document.getElementById("span_resitab") != null && document.getElementById("span_resitab") != "undefined") {
			document.getElementById('span_resitab').style.background = 'url('+IMG_SERVER+'/images/src-tb-graditant.gif) top left';
			document.getElementById('span_resitab').style.top = '1px';
		}
		if (document.getElementById("span_commtab") != null && document.getElementById("span_commtab") != "undefined") {
			document.getElementById('span_commtab').style.background = 'url('+IMG_SERVER+'/images/src-tb-normal.gif) top left';
			document.getElementById('span_commtab').style.top = '0px';
		}
		if (document.getElementById("tab_search_main") != null && document.getElementById("tab_search_main") != "undefined")
			document.getElementById('tab_search_main').style.background = 'url('+IMG_SERVER+'/images/citypage/home-search-1.jpg) top left no-repeat';
	} else if(val == '2') {
		msg = '<select name="property_type" class="txtComp" onchange="javascript:disable_combo(this.value,\'frm_first\');" style="width:170px;"><option value="2" style="background-color:#FDF6B5;"';
		if(sel_ptype == '2') msg += ' selected';
		msg += '>Commercial Property</option><option value="10" ';
		if(sel_ptype == '10') msg += ' selected';
		msg += '>Land</option><option value="11" ';
		if(sel_ptype == '11') msg += ' selected';
		msg += '>Office</option><option value="12" ';
		if(sel_ptype == '12') msg += ' selected';
		msg += '>Business Centre</option><option value="13" ';
		if(sel_ptype == '13') msg += ' selected';
		msg += '>Warehouse/Godown</option><option value="14" ';
		if(sel_ptype == '14') msg += ' selected';
		msg += '>Industrial setup</option><option value="15" ';
		if(sel_ptype == '15') msg += ' selected';
		msg += '>Shop</option><option value="16" ';
		if(sel_ptype == '16') msg += ' selected';
		msg += '>Other Commercial</option></select>';

		document.frm_first.bedroom.disabled = true;
		if (document.getElementById("span_resitab") != null && document.getElementById("span_resitab") != "undefined") {
			document.getElementById('span_resitab').style.background = 'url('+IMG_SERVER+'/images/src-tb-normal.gif) top left';
			document.getElementById('span_resitab').style.top = '0px';
		}
		if (document.getElementById("span_commtab") != null && document.getElementById("span_commtab") != "undefined") {
			document.getElementById('span_commtab').style.background = 'url('+IMG_SERVER+'/images/src-tb-graditant.gif) top left';
			document.getElementById('span_commtab').style.top = '1px';
		}
		if (document.getElementById("tab_search_main") != null && document.getElementById("tab_search_main") != "undefined")
			document.getElementById('tab_search_main').style.background = 'url('+IMG_SERVER+'/images/citypage/home-search-commercial.jpg) top left no-repeat';
	}
	document.getElementById('div_ptype').innerHTML = msg;
}