function change_res_com_requirement()
{
	var selected = document.requiremant_frm.property_type_id.value;
	if(selected==4 || selected==10 || selected==9 || selected==16 || selected==7 || selected==6)
	{
		document.getElementById("unit_combo").style.display='';
		document.getElementById("sqfeet").style.display='none';
	}
	else
	{
		document.getElementById("unit_combo").style.display='none';
		document.getElementById("sqfeet").style.display='';
	}
	if(selected == 4 || selected >= 10)
	{
		document.getElementById('tr_bedrooms').style.display = 'none';
	}
	else
	{
		document.getElementById('tr_bedrooms').style.display = '';
	}
}

// validate post your requirement form
function check_requiremant()
{
	var count_bug=0;
	var focus_field = ""
	var com_id = 10;
	var res_id = 4;
	var selected = document.requiremant_frm.property_type_id.value;
	var option_sr = document.requiremant_frm.property_for.value;
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
	if(document.requiremant_frm.property_for[0].checked == true)
	{
		var option_sr = 'Sell';
	}
	else
	{
		var option_sr = 'Rent';
	}
	if(document.requiremant_frm.property_type_id.value == "")
	{
		document.getElementById('div_propertyidcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select property type";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "") focus_field = "property_type_id";
	}
	
	if(document.requiremant_frm.city.value=="")
	{
		document.getElementById('div_citycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select a city";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "city";
	}
	else if(document.requiremant_frm.city.value=="other" && (document.requiremant_frm.city_other.value=="Please enter other city" || document.requiremant_frm.city_other.value==""))
	{
		document.getElementById('div_cityothercheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a city";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "city_other";
	}
	if(document.requiremant_frm.city.value.indexOf("other") != -1 && (document.requiremant_frm.city_other.value!="" && !check_name(document.requiremant_frm.city_other.value)))
	{
		document.getElementById('div_cityothercheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid city.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "city_other";
	}


	if((selected != '4' && selected <= '10') && (document.requiremant_frm.bedroom.value == ""))
	{
		document.getElementById('div_bedcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please provide no. of bedroom";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "bedroom";
	}
	if(option_sr == 'Sell' && document.requiremant_frm.budget_sale.value == "")
	{
		document.getElementById('div_budget').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your budget";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
				focus_field = "budget_sale";
	}
	if(option_sr == 'Rent' && document.requiremant_frm.budget_rent.value == "")
	{
		document.getElementById('div_budget').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your budget";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
				focus_field = "budget_sale";
	}
	
	if((selected==4 || selected==10 || selected==9 || selected==16 || selected==7 || selected==6) && (document.requiremant_frm.area_unit.value == "Unit" || document.requiremant_frm.area_unit.value == ""))
	{
		document.getElementById('div_area').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select area unit";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "area_unit";
	}
	if(document.requiremant_frm.min_area.value == "" || isNaN(document.requiremant_frm.min_area.value))
	{
		document.getElementById('div_area').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid minimum area";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "min_area";
	}
	else if(document.requiremant_frm.min_area.value.indexOf(".") != "-1")
	{
		document.getElementById('div_area').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter minimum area without decimals";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "min_area";
	}
	
	if( document.requiremant_frm.contact_name.value== "" || validatesymbolwithspace('requiremant_frm','contact_name')==false)
	{
		document.getElementById('div_cnamecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid name";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_name";
	}
	
	if(document.requiremant_frm.mob_country_code.value=="" && document.requiremant_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "mob_country_code";
	}
	if(document.requiremant_frm.mob_country_code.value!="" && document.requiremant_frm.mobile1.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "mob_country_code";
	}
	if(document.requiremant_frm.mobile1.value=="" && document.requiremant_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_mobile2";
	}
	else if(!ValidateNo(document.requiremant_frm.mobile1.value,"1234567890,-/+") && document.requiremant_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "mobile1";
	}
	else if(!ValidateNo(document.requiremant_frm.contact_mobile2.value,"1234567890,-/+") && document.requiremant_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_mobile2";
	}

	else if(!ValidateNo(document.requiremant_frm.mob_country_code.value,"1234567890,-/+") && document.requiremant_frm.mob_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "mob_country_code";
	}
	else if(!ValidateNo(document.requiremant_frm.ph_country_code.value,"1234567890,-/+") && document.requiremant_frm.ph_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional country code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_country_code";
	}
	else if(document.requiremant_frm.ph_country_code.value!="" && document.requiremant_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_country_code";
	}
	else if(document.requiremant_frm.ph_country_code.value=="" && document.requiremant_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional country code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_country_code";
	}
	else if(!ValidateNo(document.requiremant_frm.contact_mobile2.value,"1234567890,-/+") && document.requiremant_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_mobile2";
	}

	if(isNaN(document.requiremant_frm.ph_area_code.value) && document.requiremant_frm.ph_area_code.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid area code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code";
	}
	else if(document.requiremant_frm.ph_area_code.value!="" && document.requiremant_frm.phone1.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code";
	}
	else if(document.requiremant_frm.ph_area_code.value=="" && document.requiremant_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your area code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code";
	}
	else if(!ValidateNo(document.requiremant_frm.phone1.value,"1234567890,-/+") && document.requiremant_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "phone1";
	}
	
	
	if(isNaN(document.requiremant_frm.ph_area_code2.value) && document.requiremant_frm.ph_area_code2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional area code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code2";

	}
	else if(document.requiremant_frm.ph_area_code2.value!="" && document.requiremant_frm.contact_phone2.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_phone2";
	}
	else if(document.requiremant_frm.ph_area_code2.value=="" && document.requiremant_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional area code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_phone2";
	}
	else if(!ValidateNo(document.requiremant_frm.contact_phone2.value,"1234567890,-/+") && document.requiremant_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_phone2";
	}
	if(requiremant_frm.contact_email.value == "")
	{
		document.getElementById('div_cemailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter an e-mail.";
			if(count_bug==0) count_bug+=1;
			if(focus_field == "")
				focus_field = "contact_email";
	}
	else
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(requiremant_frm.contact_email.value))
		{
		}
		else
		{
			document.getElementById('div_cemailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			if(count_bug==0) count_bug+=1;
			if(focus_field == "")
				focus_field = "contact_email";
		}
	}
	if(document.requiremant_frm.folder_name.value == "")
	{
		document.getElementById('div_folder_name').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter folder name";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "folder_name";
	}
	if(count_bug>0)
	{
		eval('document.requiremant_frm.' + focus_field + '.focus();');	
		return false;
	}
	else
	{
		return true;
	}
}
// validate post your requirement form
function check_requiremant_form()
{
	var count_bug=0;
	var focus_field = ""
	var com_id = 10;
	var res_id = 4;
	var selected = parseInt(document.requiremant_frm.property_type_id.value);
	var option_sr = document.requiremant_frm.property_for.value;
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
	if(document.requiremant_frm.property_for[0].checked == true)
	{
		var option_sr = 'Sale';
	}
	else
	{
		var option_sr = 'Rent';
	}
	if(document.requiremant_frm.property_type_id.value == "")
	{
		document.getElementById('div_propertyidcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select property type";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "") focus_field = "property_type_id";
	}
	
	if(document.requiremant_frm.city.value=="")
	{
		document.getElementById('div_citycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select a city";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "city";
	}
	else if(document.requiremant_frm.city.value=="other" && (document.requiremant_frm.city_other.value=="Please enter other city" || document.requiremant_frm.city_other.value==""))
	{
		document.getElementById('div_cityothercheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a city";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "city_other";
	}
	if(document.requiremant_frm.city.value.indexOf("other") != -1 && (document.requiremant_frm.city_other.value!="" && !check_name(document.requiremant_frm.city_other.value)))
	{
		document.getElementById('div_cityothercheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid city.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "city_other";
	}


	if(document.requiremant_frm.bedroom.value == "")
	{
		document.getElementById('div_bedcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please provide no. of bedroom";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "bedroom";
	}
	if(option_sr == 'Sale' && document.requiremant_frm.budget_sale.value == "INR")
	{
		document.getElementById('div_budget').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your budget";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "budget_sale";
	}
	if(option_sr == 'Rent' && document.requiremant_frm.budget_rent.value == "INR")
	{
		
		document.getElementById('div_budget').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select your budget";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "budget_rent";
	}
	
	if((selected==4 || selected==10 || selected==9 || selected==16 || selected==7 || selected==6) && (document.requiremant_frm.area_unit.value == "Unit" || document.requiremant_frm.area_unit.value == ""))
	{
		document.getElementById('div_area').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select area unit";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "min_area";
	}
	if(document.requiremant_frm.min_area.value == "" || isNaN(document.requiremant_frm.min_area.value))
	{
		document.getElementById('div_area').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid minimum area";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "min_area";
	}
	else if( document.requiremant_frm.min_area.value.indexOf(".") != "-1")
	{
		document.getElementById('div_area').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter minimum area without decimals";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "min_area";
	}
	
	
	if( document.requiremant_frm.contact_name.value== "" || validatesymbolwithspace('requiremant_frm','contact_name')==false)
	{
		document.getElementById('div_cnamecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid name";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_name";
	}
	
	if(document.requiremant_frm.mob_country_code.value=="" && document.requiremant_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "mob_country_code";
	}
	if(document.requiremant_frm.mob_country_code.value!="" && document.requiremant_frm.mobile1.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "mob_country_code";
	}
	if(document.requiremant_frm.mobile1.value=="" && document.requiremant_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_mobile2";
	}
	else if(!ValidateNo(document.requiremant_frm.mobile1.value,"1234567890,-/+") && document.requiremant_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "mobile1";
	}
	else if(!ValidateNo(document.requiremant_frm.contact_mobile2.value,"1234567890,-/+") && document.requiremant_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_mobile2";
	}

	else if(!ValidateNo(document.requiremant_frm.mob_country_code.value,"1234567890,-/+") && document.requiremant_frm.mob_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "mob_country_code";
	}
	else if(!ValidateNo(document.requiremant_frm.ph_country_code.value,"1234567890,-/+") && document.requiremant_frm.ph_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional country code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_country_code";
	}
	else if(document.requiremant_frm.ph_country_code.value!="" && document.requiremant_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_country_code";
	}
	else if(document.requiremant_frm.ph_country_code.value=="" && document.requiremant_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional country code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_country_code";
	}
	else if(!ValidateNo(document.requiremant_frm.contact_mobile2.value,"1234567890,-/+") && document.requiremant_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_mobile2";
	}

	if(isNaN(document.requiremant_frm.ph_area_code.value) && document.requiremant_frm.ph_area_code.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid area code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code";
	}
	else if(document.requiremant_frm.ph_area_code.value!="" && document.requiremant_frm.phone1.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code";
	}
	else if(document.requiremant_frm.ph_area_code.value=="" && document.requiremant_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your area code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code";
	}
	else if(!ValidateNo(document.requiremant_frm.phone1.value,"1234567890,-/+") && document.requiremant_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "phone1";
	}
	
	
	if(isNaN(document.requiremant_frm.ph_area_code2.value) && document.requiremant_frm.ph_area_code2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional area code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code2";

	}
	else if(document.requiremant_frm.ph_area_code2.value!="" && document.requiremant_frm.contact_phone2.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_phone2";
	}
	else if(document.requiremant_frm.ph_area_code2.value=="" && document.requiremant_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional area code.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_phone2";
	}
	else if(!ValidateNo(document.requiremant_frm.contact_phone2.value,"1234567890,-/+") && document.requiremant_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		if(count_bug==0) count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_phone2";
	}
	if(requiremant_frm.contact_email.value == "")
	{
		document.getElementById('div_cemailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter an e-mail.";
			if(count_bug==0) count_bug+=1;
			if(focus_field == "")
				focus_field = "contact_email";
	}
	else
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(requiremant_frm.contact_email.value))
		{
		}
		else
		{
			document.getElementById('div_cemailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			if(count_bug==0) count_bug+=1;
			if(focus_field == "")
				focus_field = "contact_email";
		}
	}
	
	//if(document.requiremant_frm.folder_name.value == "")
	//{
	//	document.getElementById('div_folder_name').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter folder name";
	//	if(count_bug==0) count_bug+=1;
	//	if(focus_field == "")
		//	focus_field = "folder_name";
	//}

	return focus_field;
}

//validate list your property form
function check_list_property_form(frm,com_id,res_id,farm_id,warehouse_id)
{

	var res_plot=4; // copy all values from database
	var com_land=10;
	var farm_house=7;
	var ware_house=13;
	var independent_bunglow=6;
	var com_office=11;
	var business_center=12;
	var inductrial_setup=14;
	var com_shop=15;
	var com_other=16;
	var count_bug=0;
	var focus_field = ""
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}

	var selected = document.listproperty_frm.property_type_id.value;
	if(document.listproperty_frm.property_type_id.value == "")
	{
		document.getElementById('div_propertyidcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select property type";
		if(eval(count_bug)==0) document.listproperty_frm.property_type_id.focus();
			count_bug+=1;
		if(focus_field == "")
			focus_field = "property_type_id";
	}

	if(document.listproperty_frm.city.value=="")
	{
		document.getElementById('div_citycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select a city";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "city";
	}

	var separator = '_';
	cityvalue=document.listproperty_frm.city.value.split(separator);
	if((cityvalue[0]=="other" || cityvalue[0]=="Other")  && (document.listproperty_frm.city_other.value=="" || document.listproperty_frm.city_other.value == "Please enter other city"))
	{
		document.getElementById('div_othercitycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter other city";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "city_other";
	}

	if(document.listproperty_frm.locality_id.value=="")
	{
		document.getElementById('div_locationcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select the locality";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "locality_id";
	}

	if((document.listproperty_frm.locality_id.value=="other" || document.listproperty_frm.locality_id.value=="Other")  && (document.listproperty_frm.locality_other.value=="Please enter other locality" || document.listproperty_frm.locality_other.value==""))
	{
			document.getElementById('div_otherlocationcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a locality";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "locality_other";
	}

	if((selected==res_plot || selected==com_land) && (document.listproperty_frm.area_unit.value=="" || document.listproperty_frm.area_unit.value=="Unit"))
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please check the area unit";
		count_bug+=1;
	}

	if(document.listproperty_frm.area_value.value=="" || isNaN(document.listproperty_frm.area_value.value))
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please check the area/unit";		
			count_bug+=1;
		if(focus_field == "")
			focus_field = "area_value";
	}

	if(document.listproperty_frm.area_value.value=="0")
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please provide a valid area/unit";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "area_value";
	}
	else if( document.listproperty_frm.area_value.value.indexOf(".") != "-1")
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please provide area/unit without decimals";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "area_value";
	}


	if(document.listproperty_frm.price.value=="" || document.listproperty_frm.price.value=="0" || document.listproperty_frm.price.value=="0.00" || isNaN(document.listproperty_frm.price.value))
	{
		document.getElementById('div_pricecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid price";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "price";
	}
	else if(document.listproperty_frm.price.value.indexOf(".") != "-1")
	{
		document.getElementById('div_pricecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter the price without decimals";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "price";
	}

	if(document.listproperty_frm.is_negotiable[0].checked==false && document.listproperty_frm.is_negotiable[1].checked==false)
	{
		document.getElementById('div_negotiablecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please choose whether the price is negotiable.";
		count_bug+=1;
	}


if(selected!=res_plot && selected!=com_land && selected!=com_office && selected!=business_center && selected!=com_shop && selected!=com_other && selected!=ware_house && selected!=inductrial_setup)
{
	if(document.listproperty_frm.bedroom.value=="" )
	{
		document.getElementById('div_bedcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please provide no. of bedroom";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "bedroom";
	}
}
if(selected != res_plot && selected != com_land && selected!=independent_bunglow && selected!=farm_house && selected!=ware_house && selected!=inductrial_setup)
{
	if( document.listproperty_frm.number_of_floor.value=="" || isNaN(document.listproperty_frm.number_of_floor.value))
	{
		document.getElementById('div_numfloorcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select the floor number";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "number_of_floor";
	}
}


if(selected != res_plot && selected != com_land && selected!=independent_bunglow && selected!=farm_house && selected!=ware_house && selected!=inductrial_setup)
{
	if(parseInt(document.listproperty_frm.number_of_floor.value) > parseInt(document.listproperty_frm.total_floor.value))
	{
		document.getElementById('div_numfloorcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Floor number should be less than or equal to total floor";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "number_of_floor";
	}
}



	if( document.listproperty_frm.contact_name.value== "" || validatesymbolwithspace('listproperty_frm','contact_name')==false)
	{
		document.getElementById('div_cnamecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid name";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_name";
	}
	
	if(document.listproperty_frm.mob_country_code.value=="" && document.listproperty_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mobile1";
	}
	if(document.listproperty_frm.mob_country_code.value!="" && document.listproperty_frm.mobile1.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mobile1";
	}
	if(document.listproperty_frm.mobile1.value=="" && document.listproperty_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mobile1";
	}
	else if(!ValidateNo(document.listproperty_frm.mobile1.value,"1234567890,-/+") && document.listproperty_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mobile1";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_mobile2.value,"1234567890,-/+") && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_mobile2";
	}

	else if(!ValidateNo(document.listproperty_frm.mob_country_code.value,"1234567890,-/+") && document.listproperty_frm.mob_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mob_country_code";
	}
	else if(!ValidateNo(document.listproperty_frm.ph_country_code.value,"1234567890,-/+") && document.listproperty_frm.ph_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional country code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_country_code";
	}
	else if(document.listproperty_frm.ph_country_code.value!="" && document.listproperty_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_mobile2";
	}
	else if(document.listproperty_frm.ph_country_code.value=="" && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional country code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_mobile2";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_mobile2.value,"1234567890,-/+") && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_mobile2";
	}


	if(isNaN(document.listproperty_frm.ph_area_code.value) && document.listproperty_frm.ph_area_code.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid area code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_area_code";
	}
	else if(document.listproperty_frm.ph_area_code.value!="" && document.listproperty_frm.phone1.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "phone1";
	}
	else if(document.listproperty_frm.ph_area_code.value=="" && document.listproperty_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your area code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "phone1";
	}
	else if(!ValidateNo(document.listproperty_frm.phone1.value,"1234567890,-/+") && document.listproperty_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "phone1";
	}
	
	/*-*/
	
	if(isNaN(document.listproperty_frm.ph_area_code2.value) && document.listproperty_frm.ph_area_code2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional area code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_area_code2";
	}
	else if(document.listproperty_frm.ph_area_code2.value!="" && document.listproperty_frm.contact_phone2.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_area_code2";
	}
	else if(document.listproperty_frm.ph_area_code2.value=="" && document.listproperty_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional area code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_area_code2";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_phone2.value,"1234567890,-/+") && document.listproperty_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_phone2";
	}



	if(listproperty_frm.contact_email.value != "")
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(listproperty_frm.contact_email.value))
		{
		}
		else
		{
			document.getElementById('div_cemailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "contact_email";
		}
	}
	if(count_bug>0)
	{
		eval("document.listproperty_frm."+focus_field+".focus();")
		return false;
	}
	else
	{
		//return false;		//test
		return true;
	}
}

function check_create_listing_form()
{  
	
	var res_plot=4; // copy all values from database
	var com_land=10;
	var farm_house=7;
	var ware_house=13;
	var independent_bunglow=6;
	var com_office=11;
	var business_center=12;
	var inductrial_setup=14;
	var com_shop=15;
	var com_other=16;
	var res_other=9;
	var count_bug=0;
	var focus_field = ""
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}

	var selected = document.listproperty_frm.property_type_id.value;
	if(document.listproperty_frm.property_type_id.value == "")
	{
		document.getElementById('div_propertyidcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select property type";
		if(eval(count_bug)==0) document.listproperty_frm.property_type_id.focus();
			count_bug+=1;
		if(focus_field == "")
			focus_field = "property_type_id";
	}

	if(document.listproperty_frm.city.value=="")
	{
		document.getElementById('div_citycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select a city";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "city";
	}

	var separator = '_';
	cityvalue=document.listproperty_frm.city.value.split(separator);
	if((cityvalue[0]=="other" || cityvalue[0]=="Other")  && (document.listproperty_frm.city_other.value=="" || document.listproperty_frm.city_other.value == "Please enter other city"))
	{
		document.getElementById('div_othercitycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter other city";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "city_other";
	}

	if(document.listproperty_frm.locality_id.value=="")
	{
		document.getElementById('div_locationcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter the locality";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "locality_id";
	}
if(document.listproperty_frm.area_value.value=="")
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter amount of area";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "area_value";
	}
	if((document.listproperty_frm.locality_id.value=="other" || document.listproperty_frm.locality_id.value=="Other")  && (document.listproperty_frm.locality_other.value=="Please enter other locality" || document.listproperty_frm.locality_other.value==""))
	{
			document.getElementById('div_otherlocationcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a locality";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "locality_other";
	}
	
	

	if(document.listproperty_frm.is_negotiable[0].checked==false && document.listproperty_frm.is_negotiable[1].checked==false)
	{
		document.getElementById('div_negotiablecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please choose whether the price is negotiable.";
		count_bug+=1;
	}

if( document.listproperty_frm.contact_name.value== "" || validatesymbolwithspace('listproperty_frm','contact_name')==false)
	{
		document.getElementById('div_cnamecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid name";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_name";
	}
	
	if(document.listproperty_frm.mob_country_code.value=="" && document.listproperty_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mobile1";
	}
	if(document.listproperty_frm.mob_country_code.value!="" && document.listproperty_frm.mobile1.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mobile1";
	}
	if(document.listproperty_frm.mobile1.value=="" && document.listproperty_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mobile1";
	}
	else if(!ValidateNo(document.listproperty_frm.mobile1.value,"1234567890,-/+") && document.listproperty_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mobile1";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_mobile2.value,"1234567890,-/+") && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_mobile2";
	}

	else if(!ValidateNo(document.listproperty_frm.mob_country_code.value,"1234567890,-/+") && document.listproperty_frm.mob_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "mob_country_code";
	}
	else if(!ValidateNo(document.listproperty_frm.ph_country_code.value,"1234567890,-/+") && document.listproperty_frm.ph_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional country code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_country_code";
	}
	else if(document.listproperty_frm.ph_country_code.value!="" && document.listproperty_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_mobile2";
	}
	else if(document.listproperty_frm.ph_country_code.value=="" && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional country code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_mobile2";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_mobile2.value,"1234567890,-/+") && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_mobile2";
	}


	if(isNaN(document.listproperty_frm.ph_area_code.value) && document.listproperty_frm.ph_area_code.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid area code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_area_code";
	}
	else if(document.listproperty_frm.ph_area_code.value!="" && document.listproperty_frm.phone1.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "phone1";
	}
	else if(document.listproperty_frm.ph_area_code.value=="" && document.listproperty_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your area code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "phone1";
	}
	else if(!ValidateNo(document.listproperty_frm.phone1.value,"1234567890,-/+") && document.listproperty_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "phone1";
	}
	
	/*-*/
	
	if(isNaN(document.listproperty_frm.ph_area_code2.value) && document.listproperty_frm.ph_area_code2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional area code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_area_code2";
	}
	else if(document.listproperty_frm.ph_area_code2.value!="" && document.listproperty_frm.contact_phone2.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_area_code2";
	}
	else if(document.listproperty_frm.ph_area_code2.value=="" && document.listproperty_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional area code.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "ph_area_code2";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_phone2.value,"1234567890,-/+") && document.listproperty_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		count_bug+=1;
		if(focus_field == "")
				focus_field = "contact_phone2";
	}

	if(document.listproperty_frm.contact_email.value == "")
	{
		document.getElementById('div_cemailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "contact_email";
	}
	else
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(listproperty_frm.contact_email.value))
		{
		}
		else
		{
			document.getElementById('div_cemailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "contact_email";
		}
	}


if(selected!=4 && selected!=10 && selected!=11 && selected!=12 && selected!=15 && selected!=16 && selected!=13 && selected!=14)
{
	if(document.listproperty_frm.bedroom.value=="" )
	{
		document.getElementById('div_bedcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please provide no. of bedroom";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "bedroom";
	}
}
if((selected ==3 || selected ==5 || selected==8 || selected==9 || 
	selected==11 || selected==12  || selected==15) && document.listproperty_frm.number_of_floor.value=="")
{
		document.getElementById('div_numfloorcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select floor number";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "number_of_floor";
}
return focus_field;
}



function change_res_com_land()
{
	var res_plot;
	res_plot=4;
	
	var independent_bunglow;
	independent_bunglow=6;

	var farm_house;
	farm_house=7;

	var res_other;
	res_other=9;
	
	var com_land;
	com_land=10;
	
	var com_office;
	com_office=11;

	var business_center;
	business_center=12;

	var ware_house;
	ware_house=13;

	var inductrial_setup;
	inductrial_setup=14;

	var com_shop;
	com_shop=15;

	var com_other;
	com_other=16;	

	//alert(document.listproperty_frm.property_type_id.value);
	var selected;
	selected=document.listproperty_frm.property_type_id.value;
	
	if(selected == 16)
	{
		document.getElementById("floor_star").innerHTML='';
		//document.getElementById("div_numfloorcheck").innerHTML='';
	}else{
		document.getElementById("floor_star").innerHTML='&nbsp;*&nbsp;';
	}
	if(selected==res_plot || selected==com_land || selected==res_other || selected==com_other 
		|| selected==independent_bunglow || selected==farm_house)
	{
		document.getElementById("unit_combo").style.display='';
		document.getElementById("sqfeet").style.display='none';
	}
	else
	{
		document.getElementById("unit_combo").style.display='none';
		document.getElementById("sqfeet").style.display='';
	}

	if(selected == res_plot || selected == com_land)
	{
		document.getElementById('tr_bedrooms').style.display = 'none';
		document.getElementById('tr_furnished').style.display = 'none';
		document.getElementById('tr_age_of_construction').style.display = 'none';
		document.getElementById('tr_number_of_floor').style.display = 'none';
		document.getElementById('tr_total_floor').style.display = 'none';
		document.getElementById('tr_features').style.display = 'none';
		document.getElementById('tr_features_all').style.display = 'none';
	}
	else if(selected==independent_bunglow || selected==farm_house)
	{
		document.getElementById('tr_bedrooms').style.display = '';
		document.getElementById('tr_furnished').style.display = '';
		document.getElementById('tr_age_of_construction').style.display = '';
		document.getElementById('tr_number_of_floor').style.display = 'none';
		document.getElementById('tr_total_floor').style.display = 'none';
		document.getElementById('tr_features').style.display = '';
		document.getElementById('tr_features_all').style.display = '';
	}
	else if(selected==com_office || selected==business_center || selected==com_shop || selected==com_other)
	{
		document.getElementById('tr_bedrooms').style.display = 'none';
		document.getElementById('tr_furnished').style.display = '';
		document.getElementById('tr_age_of_construction').style.display = '';
		document.getElementById('tr_number_of_floor').style.display = '';
		document.getElementById('tr_total_floor').style.display = '';
		document.getElementById('tr_features').style.display = '';
		document.getElementById('tr_features_all').style.display = '';
	}
	else if(selected==ware_house || selected==inductrial_setup)
	{
		document.getElementById('tr_bedrooms').style.display = 'none';
		document.getElementById('tr_furnished').style.display = '';
		document.getElementById('tr_age_of_construction').style.display = '';
		document.getElementById('tr_number_of_floor').style.display = 'none';
		document.getElementById('tr_total_floor').style.display = 'none';
		document.getElementById('tr_features').style.display = '';
		document.getElementById('tr_features_all').style.display = '';
	}
	else
	{
		document.getElementById('tr_bedrooms').style.display = '';
		document.getElementById('tr_furnished').style.display = '';
		document.getElementById('tr_age_of_construction').style.display = '';
		document.getElementById('tr_number_of_floor').style.display = '';
		document.getElementById('tr_total_floor').style.display = '';
		document.getElementById('tr_features').style.display = '';
		document.getElementById('tr_features_all').style.display = '';
	}
}

function change_asking_price(res_id,com_id,farm_id,warehouse_id)
{
	var res_plot;
	res_plot=4;
	
	var independent_bunglow;
	independent_bunglow=6;

	var farm_house;
	farm_house=7;

	var res_other;
	res_other=9;
	
	var com_land;
	com_land=10;
	
	var com_office;
	com_office=11;

	var business_center;
	business_center=12;

	var ware_house;
	ware_house=13;

	var inductrial_setup;
	inductrial_setup=14;

	var com_shop;
	com_shop=15;

	var com_other;
	com_other=16;
	
	var area_value;
	area_value=0;

	if(document.listproperty_frm.area_value.value!="" && document.listproperty_frm.area_value.value!="undefined")
		area_value=document.listproperty_frm.area_value.value;

	var price_value;
	price_value=0;

	if(document.listproperty_frm.price.value!="")
		price_value=document.listproperty_frm.price.value;

	var selected = document.listproperty_frm.property_type_id.value;

	// change by mohammad saleem : please see this before upload
	if(selected!=res_plot && selected!=com_land && selected!=independent_bunglow && selected!=farm_house 
	&& selected!=res_other && selected!=com_other)
	{
		//document.listproperty_frm.area_unit.value='Unit';
		document.getElementById("unit_combo").style.display='none';
	}
	else
	{
		document.getElementById("unit_combo").style.display='';
	}
	
	if(area_value!="" && eval(area_value)>0 && !isNaN(area_value) && price_value!="" && eval(price_value)>0 && !isNaN(price_value))
	{
	  var asking = (parseInt(price_value)/parseInt(area_value));
	  msg = "<b>Rate (Price / Area)</b> for your property is <strong class='orange'>Rs. "+ asking.toFixed(0) ;

	  if(document.listproperty_frm.area_unit.value!="" && document.listproperty_frm.area_unit.value!="Unit")
		  msg+=" / " + document.listproperty_frm.area_unit.value;
	  if( (selected==res_id || selected==com_id) && document.listproperty_frm.area_unit.value=="Unit")
		  msg+=" / Unit Area";
	  if((document.listproperty_frm.area_unit.value=="Unit" || document.listproperty_frm.area_unit.value=="") && selected!=res_id && selected!=com_id)
		  msg+=" / Sq.Ft";

	  document.getElementById('div_show_price').innerHTML=msg+"</strong>";
	}
	else
	{
		document.getElementById('div_show_price').innerHTML = "<b>Rate (Price / Area)</b> for your property is <strong class='orange'>Rs. 0 / Unit Area</strong>";
	}
		

}








function check_edit_property_form(frm,com_id,res_id,farm_id,warehouse_id)
{

	var res_plot=4; // copy all values from database
	var com_land=10;
	var farm_house=7;
	var ware_house=13;
	var independent_bunglow=6;
	var com_office=11;
	var business_center=12;
	var inductrial_setup=14;
	var com_shop=15;
	var com_other=16;

	var count_bug=0;
	var focus_field = ""
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
	var selected = document.listproperty_frm.property_type_id.value;
	
	if(document.listproperty_frm.city.value=="")
	{
		document.getElementById('div_citycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select a city";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "city";
	}

	if(document.listproperty_frm.city.value!="" && document.listproperty_frm.city.value!="undefined")
	{
		var separator = '_';
		cityvalue = document.listproperty_frm.city.value.split(separator);	
		if((cityvalue[0]=="other" || cityvalue[0]=="Other")  && (document.listproperty_frm.city_other.value=="" || document.listproperty_frm.city_other.value == "Please enter other city"))
		{
			document.getElementById('div_othercitycheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter other city";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "city_other";
		}
	}
	

	if(document.listproperty_frm.locality_id.value=="")
	{
		document.getElementById('div_locationcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select the locality";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "locality_id";
	}
	

	if((document.listproperty_frm.locality_id.value=="other" || document.listproperty_frm.locality_id.value=="Other")  && (document.listproperty_frm.locality_other.value=="Please enter other locality" || document.listproperty_frm.locality_other.value==""))
	{
			document.getElementById('div_otherlocationcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a locality";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "locality_other";
	}

	if((selected==res_plot || selected==com_land) && (document.listproperty_frm.area_unit.value=="" || document.listproperty_frm.area_unit.value=="Unit"))
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please check the area unit";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "area_unit";
	}

	if(document.listproperty_frm.area_value.value=="" || isNaN(document.listproperty_frm.area_value.value))
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please check the area/unit";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "area_value";
	}
	else if(document.listproperty_frm.area_value.value.indexOf(".") != "-1")
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter the area/unit without decimals";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "area_value";
	}

	if(document.listproperty_frm.area_value.value=="0" || document.listproperty_frm.area_value.value=="0.00")
	{
		document.getElementById('div_areacheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please provide a valid area/unit";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "area_value";
	}


	/*if(document.listproperty_frm.price.value=="" || document.listproperty_frm.price.value=="0" || document.listproperty_frm.price.value=="0.00" || isNaN(document.listproperty_frm.price.value))
	{
		document.getElementById('div_pricecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid price";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "price";
	}
	else if(document.listproperty_frm.price.value.indexOf(".") != "-1")
	{
		document.getElementById('div_pricecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter the price without decimals";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "price";
	}*/

	if(document.listproperty_frm.is_negotiable[0].checked==false && document.listproperty_frm.is_negotiable[1].checked==false)
	{
		document.getElementById('div_negotiablecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please choose whether the price is negotiable.";
		count_bug+=1;
	}


if(selected!=res_plot && selected!=com_land && selected!=com_office && selected!=business_center && selected!=com_shop && selected!=com_other && selected!=ware_house && selected!=inductrial_setup)
{
	if(document.listproperty_frm.bedroom.value=="" )
	{
		document.getElementById('div_bedcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please provide no. of bedroom";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "bedroom";
	}
}
/*
if(selected != res_plot && selected != com_land)
{
	if(document.listproperty_frm.age_of_construction.value=="" )
	{
		document.getElementById('div_agecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select age of construction";
		if(eval(count_bug)==0) document.listproperty_frm.age_of_construction.focus();
			count_bug+=1;
		if(focus_field == "")
			focus_field = "age_of_construction";
	}
}
*/
if(selected != com_other && selected != res_plot && selected != com_land && selected!=independent_bunglow && selected!=farm_house && selected!=ware_house && selected!=inductrial_setup)
{
	if( document.listproperty_frm.number_of_floor.value=="" || isNaN(document.listproperty_frm.number_of_floor.value))
	{
		document.getElementById('div_numfloorcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select the floor number";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "number_of_floor";
	}
}


if(selected != res_plot && selected != com_land && selected!=independent_bunglow && selected!=farm_house && selected!=ware_house && selected!=inductrial_setup)
{
	if(parseInt(document.listproperty_frm.number_of_floor.value) > parseInt(document.listproperty_frm.total_floor.value))
	{
		document.getElementById('div_numfloorcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Floor number should be less than or equal to total floor";
			count_bug+=1;
		if(focus_field == "")
			focus_field = "number_of_floor";
	}
}


	if( document.listproperty_frm.contact_name.value== "" || validatesymbolwithspace('listproperty_frm','contact_name')==false)
	{
		document.getElementById('div_cnamecheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid name";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_name";
	}
	
	if(document.listproperty_frm.mob_country_code.value=="" && document.listproperty_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "mobile1";
	}
	if(document.listproperty_frm.mob_country_code.value!="" && document.listproperty_frm.mobile1.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "mobile1";
	}
	if(document.listproperty_frm.mobile1.value=="" && document.listproperty_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "mobile1";
	}
	else if(!ValidateNo(document.listproperty_frm.mobile1.value,"1234567890,-/+") && document.listproperty_frm.mobile1.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid mobile.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "mobile1";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_mobile2.value,"1234567890,-/+") && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "&nbsp;&nbsp;<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "mobile2";
	}

	else if(!ValidateNo(document.listproperty_frm.mob_country_code.value,"1234567890,-/+") && document.listproperty_frm.mob_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid country code.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "mob_country_code";
	}
	else if(!ValidateNo(document.listproperty_frm.ph_country_code.value,"1234567890,-/+") && document.listproperty_frm.ph_country_code.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional country code.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_country_code";
	}
	else if(document.listproperty_frm.ph_country_code.value!="" && document.listproperty_frm.contact_mobile2.value=="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_mobile2";
	}
	else if(document.listproperty_frm.ph_country_code.value=="" && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional country code.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_country_code";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_mobile2.value,"1234567890,-/+") && document.listproperty_frm.contact_mobile2.value!="")
	{
		document.getElementById('msg_phone').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional mobile.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_mobile2";
	}


	if(isNaN(document.listproperty_frm.ph_area_code.value) && document.listproperty_frm.ph_area_code.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid area code.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code";
	}
	else if(document.listproperty_frm.ph_area_code.value!="" && document.listproperty_frm.phone1.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code";
	}
	else if(document.listproperty_frm.ph_area_code.value=="" && document.listproperty_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your area code.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "phone1";
	}
	else if(!ValidateNo(document.listproperty_frm.phone1.value,"1234567890,-/+") && document.listproperty_frm.phone1.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid landline.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "phone1";
	}
	
	/*-*/
	
	if(isNaN(document.listproperty_frm.ph_area_code2.value) && document.listproperty_frm.ph_area_code2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional area code.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code2";
	}
	else if(document.listproperty_frm.ph_area_code2.value!="" && document.listproperty_frm.contact_phone2.value=="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code2";
	}
	else if(document.listproperty_frm.ph_area_code2.value=="" && document.listproperty_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your additional area code.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "ph_area_code2";
	}
	else if(!ValidateNo(document.listproperty_frm.contact_phone2.value,"1234567890,-/+") && document.listproperty_frm.contact_phone2.value!="")
	{
		document.getElementById('msg_mobile_add').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your valid additional landline.";
		count_bug+=1;
		if(focus_field == "")
			focus_field = "contact_phone2";
	}



	if(listproperty_frm.contact_email.value != "")
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(listproperty_frm.contact_email.value))
		{
		}
		else
		{
			document.getElementById('div_cemailcheck').innerHTML = "<img src='"+ALERT_IMG+"' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter a valid e-mail.";
			count_bug+=1;
			if(focus_field == "")
				focus_field = "contact_email";
		}
	}

//alert(count_bug);
	if(count_bug>0)
	{
		eval("document.listproperty_frm."+focus_field+".focus();")
		return false;
	}
	else
	{
		//return false;
		return true;
	}
}

function new_listing()
{
	var count_bug=0;
	var focus_field = ""
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
if(document.listproperty_frm.property_address.value == "")
{
document.getElementById('div_property_address').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter property address.";
count_bug+=1;
focus_field="property_address";
}
if(document.listproperty_frm.city.value == "")
{
document.getElementById('div_citycheck').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select city.";
count_bug+=1;
focus_field="city";
}
if(document.listproperty_frm.locality_id.value == "")
{
document.getElementById('div_locationcheck').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter property locality.";
count_bug+=1;
focus_field="locality_id";
}
if(document.getElementById('property_for').checked == true)
	{
	if(document.listproperty_frm.buy_budget.value == "INR")
		{
		document.getElementById('div_budcheck').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select proper property price.";
        count_bug+=1;
        focus_field="buy_budget";
		}
	}
if(document.getElementById('property_for1').checked == true)
	{
	if(document.listproperty_frm.rent_budget.value == "INR")
		{
		document.getElementById('div_budcheck').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please select proper rent per month.";
        count_bug+=1;
        focus_field="rent_budget";
		}
	}
if(document.listproperty_frm.contact_name.value == "")
		{
		document.getElementById('div_cnamecheck').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter contact person name.";
        count_bug+=1;
        focus_field="contact_name";
		}
if(document.listproperty_frm.mobile1.value == "")
		{
		document.getElementById('msg_phone').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid mobile no.";
        count_bug+=1;
        focus_field="mobile1";
		}
if(document.listproperty_frm.contact_email.value == "")
	{
		document.getElementById('div_cemailcheck').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter e-mail.";
        count_bug+=1;
        focus_field="contact_email";
	}
	else
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.listproperty_frm.contact_email.value))
		{
		}
		else
		{
			document.getElementById('div_cemailcheck').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter valid e-mail.";
        count_bug+=1;
        focus_field="contact_email";
		}
	}
if(count_bug>0)
	{
		eval("document.listproperty_frm."+focus_field+".focus();")
		return false;
	}
	else
	{
		//return false;
		return true;
	}
}




function disable()
{
document.getElementById('usertype').disabled = true;
document.getElementById('usertype1').disabled = true;
}
function change_user_type(val)
{
	
if(val == "existing")
{
disableFormElement();
document.getElementById('div_login').style.display = '';
document.getElementById('userid').disabled = false;
document.frm_login.userid.focus();
document.getElementById('password').disabled = false;
document.getElementById('loginbutton').disabled = false;

document.listproperty_frm.usertype.value = 'exiting';
}
else
{
enableFormElement();
document.getElementById('div_login').style.display = 'none';

document.getElementById('userid').disabled = true;
document.getElementById('password').disabled = true;
document.getElementById('loginbutton').disabled = true;
//document.listproperty_frm.usertype.value = 'new';
}
}

function change_user_type1(val)
{
if(val == "existing")
{
disableFormElement();
document.getElementById('div_login').style.display = '';
document.getElementById('userid').disabled = false;
document.frm_login.userid.focus();
document.getElementById('password').disabled = false;
document.getElementById('loginbutton').disabled = false;

//document.listproperty_frm.usertype.value = 'exiting';
}
else
{
enableFormElement();
document.getElementById('div_login_table').style.display = 'none';

document.getElementById('userid').disabled = true;
document.getElementById('password').disabled = true;
document.getElementById('loginbutton').disabled = true;
//document.listproperty_frm.usertype.value = 'new';
}
}
function check_login()
{
if(document.frm_login.userid.value == "" && document.frm_login.password.value == "")
{
document.getElementById('div_loginmsg').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your username and password.";
document.frm_login.userid.focus();
}else if(document.frm_login.userid.value == "") {
document.getElementById('div_loginmsg').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your username.";
document.frm_login.userid.focus();
}else if(document.frm_login.password.value == "") {
document.getElementById('div_loginmsg').innerHTML = "<img src='images/alert.gif' width='10' height='10' align='absmiddle' vspace='3' border=0>&nbsp;Please enter your password.";
document.frm_login.password.focus();
}else
{
new_makerequest('check-login.php?value='+escape(document.frm_login.userid.value)+'&pass='+escape(document.frm_login.password.value),'div_loginmsg','div_welcome','list_your_property.php');
}
return false;
}
function check_price_type()
{
if(document.listproperty_frm.property_for[1].checked == true){
document.getElementById('price_type').innerHTML = 'per month';
document.getElementById('price_total').innerHTML = 'Rent (Rs.) <font color="red">&nbsp;*&nbsp;';
document.getElementById('mypricetype').innerHTML = '&nbsp;Rent (In Words)';
}else{
document.getElementById('price_type').innerHTML = '';
document.getElementById('price_total').innerHTML = 'Total Price (Rs.) <font color="red">&nbsp;*&nbsp;</font><sub>(Approx.)';
document.getElementById('mypricetype').innerHTML = '&nbsp;Total Price (In Words)';
}
}

function show_addiotinal_detail()
{
if(document.getElementById('addtional_detail').style.display == '')
{
document.getElementById('addtional_detail').style.display = 'none';
}
else
{
document.getElementById('addtional_detail').style.display = '';
document.getElementById('div_add_info').style.display = 'none';

}
}

