function adddetails(specification)
{
	
	room_area= document.getElementById("idroomarea");
	no_of_rooms= document.getElementById("idnoofrooms");
	built= document.getElementById("idbuilt");
	bed_room= document.getElementById("idbedroom");
	bath_room= document.getElementById("idbathroom");
	parking= document.getElementById("idparking");
	income= document.getElementById("idincome");
	farm_type= document.getElementById("idfarmtype");
	cultivation= document.getElementById("idcultivation");
	ad1= document.getElementById("idad1");
	ad2= document.getElementById("idad2");
	ad3= document.getElementById("idad3");
	no_of_floorno= document.getElementById("idnooffloorno");
	locality= document.getElementById("idlocality");
	location_city= document.getElementById("idlocationcity");
	location_state= document.getElementById("idlocationstate");
	expected_price= document.getElementById("idexpectedprice");
	area= document.getElementById("idarea");
	contact= document.getElementById("idcontact");
	contact_city= document.getElementById("idcontactcity");
	submit_value= document.getElementById("idsubmit");
	prop_des= document.getElementById("idpropdes");
	water= document.getElementById("idwater");
	floor_no= document.getElementById("idfloorno");
	room_area2= document.getElementById("idroomarea");
	parking_area= document.getElementById("idparkingarea");
	location_other_city= document.getElementById("idlocationothercity");
	contact_other_city= document.getElementById("idcontactothercity");
	upload_value= document.getElementById("idupload");
	

	if (document.getElementById("select").value == "defaultselect")
	{
		room_area.style.display = "none";
		no_of_rooms.style.display = "none";
		built.style.display = "none";
		bed_room.style.display = "none";
		bath_room.style.display = "none";
		parking.style.display = "none";
		income.style.display = "none";
		farm_type.style.display = "none";
		cultivation.style.display = "none";
		ad1.style.display = "none";
		ad2.style.display = "none";
		ad3.style.display = "none";
		no_of_floorno.style.display = "none";
		locality.style.display = "none";
		location_city.style.display = "none";
		location_state.style.display = "none";
		expected_price.style.display = "none";
		area.style.display = "none";
		prop_des.style.display = "none";
		water.style.display = "none";
		floor_no.style.display = "none";
		room_area2.style.display = "none";
		parking_area.style.display = "none";
		location_other_city.style.display = "none";
		contact_other_city.style.display = "none";
		upload_value.style.display = "none";
		return ;
	}
	if (document.getElementById("select").value=="Home")
	{

		room_area.style.display = "none";
		no_of_rooms.style.display = "none";
		built.style.display = "";
		bed_room.style.display = "";
		bath_room.style.display = "";
		parking.style.display = "";
		income.style.display = "none";
		farm_type.style.display = "none";
		cultivation.style.display = "none";
		ad1.style.display = "none";
		ad2.style.display = "none";
		ad3.style.display = "none";
		no_of_floorno.style.display = "none";
		area.style.display = "";
		floor_no.style.display = "none";
		room_area2.style.display = "none";
		parking_area.style.display = "none";
		contact_other_city.style.display = "none";
	}

	else if (document.getElementById("select").value=="Land")
	{
		room_area.style.display = "none";
		no_of_rooms.style.display = "none";
		built.style.display = "";
		bed_room.style.display = "none";
		bath_room.style.display = "none";
		parking.style.display = "none";
		income.style.display = "";
		farm_type.style.display = "none";
		cultivation.style.display = "";
		ad1.style.display = "none";
		ad2.style.display = "none";
		ad3.style.display = "none";
		no_of_floorno.style.display = "none";
		area.style.display = "";
		floor_no.style.display = "none";
		room_area2.style.display = "none";
		parking_area.style.display = "none";
		contact_other_city.style.display = "none";
		if(document.getElementById("idid").value=="Seller")
		{
			document.getElementById("idincome").style.display= "";
		}
		
	}
	else if (document.getElementById("select").value=="Shop space")
	{
		room_area.style.display = "";
		no_of_rooms.style.display = "none";
		built.style.display = "";
		bed_room.style.display = "none";
		bath_room.style.display = "none";
		parking.style.display = "";
		income.style.display = "none";
		farm_type.style.display = "none";
		cultivation.style.display = "none";
		ad1.style.display = "";
		ad2.style.display = "";
		ad3.style.display = "none";
		no_of_floorno.style.display = "none";
		area.style.display = "none";
		floor_no.style.display = "";
		room_area2.style.display = "";
		parking_area.style.display = "none";
		contact_other_city.style.display = "none";
		
	}

	else if (document.getElementById("select").value=="Commercial building")
	{
		room_area.style.display = "none";
		no_of_rooms.style.display = "";
		built.style.display = "";
		bed_room.style.display = "none";
		bath_room.style.display = "none";
		parking.style.display = "";
		income.style.display = "";
		farm_type.style.display = "none";
		cultivation.style.display = "none";
		ad1.style.display = "";
		ad2.style.display = "";
		ad3.style.display = "none";
		no_of_floorno.style.display = "";
		area.style.display = "";
		floor_no.style.display = "none";
		room_area2.style.display = "none";
		parking_area.style.display = "";
		contact_other_city.style.display = "none";
		if(document.getElementById("idid").value=="Seller")
		{
			document.getElementById("idincome").style.display= "";
		}
		
	}

	else if (document.getElementById("select").value=="Flat")
	{
		room_area.style.display = "none";
		no_of_rooms.style.display = "none";
		built.style.display = "";
		bed_room.style.display = "";
		bath_room.style.display = "";
		parking.style.display = "";
		income.style.display = "none";
		farm_type.style.display = "none";
		cultivation.style.display = "none";
		ad1.style.display = "";
		ad2.style.display = "";
		ad3.style.display = "";
		no_of_floorno.style.display = "none";
		area.style.display = "none";
		floor_no.style.display = "";
		room_area2.style.display = "none";
		contact_other_city.style.display = "none";
	
	}
	else
	{
	alert("Error in property type");
	}

	locality.style.display = "";
	location_state.style.display = "";
	expected_price.style.display = "";
	contact.style.display = "";
	contact_city.style.display = "";
	submit_value.style.display = "";
	prop_des.style.display = "";
	water.style.display = "";
	
	


	if(document.getElementById("idlocationstateoption").value != "Kerala")
	{
		location_city.style.display="none";
		location_other_city.style.display="";
	}
	else
	{
		location_city.style.display="";
		location_other_city.style.display="none";

	}

	if(document.getElementById("idcontactstateoption").value != "Kerala")
	{
		contact_city.style.display="none";
		contact_other_city.style.display="";
	}
	else
	{
		contact_city.style.display="";
		contact_other_city.style.display="none";

	}
	
	if(specification==1)
{
	
	document.sellhomename.locality.value="";
	document.sellhomename.city11.value="";
	document.sellhomename.expectedprice.value="";
	document.sellhomename.area.value="";
	document.sellhomename.roomarea.value="";
	document.sellhomename.built.value="";
	document.sellhomename.bedroom.value="";
	document.sellhomename.bathroom.value="";
	document.sellhomename.floorno.value="";
	document.sellhomename.noofrooms.value="";
	document.sellhomename.nooffloors.value="";
	document.sellhomename.income.value="";
	document.sellhomename.parkingarea.value="";
	document.sellhomename.propdes.value="";
	document.sellhomename.userfile.value="";
	document.sellhomename.fname.value="";
	document.sellhomename.lname.value="";
	document.sellhomename.address.value="";
	document.sellhomename.city21.value="";
	document.sellhomename.phone1.value="";
	document.sellhomename.phone2.value="";
	document.sellhomename.email.value="";
	upload_value.style.display = "";
	document.sellhomename.locality.focus();
}
if(specification==2)
{
	document.buyhomename.locality.value="";
	document.buyhomename.city11.value="";
	document.buyhomename.expectedprice.value="";
	document.buyhomename.area.value="";
	document.buyhomename.built.value="";
	document.buyhomename.bedroom.value="";
	document.buyhomename.expectedpriceto.value="";
	document.buyhomename.areato.value="";
	document.buyhomename.roomareato.value="";
	document.buyhomename.builtto.value="";
	document.buyhomename.bedroomto.value="";
	document.buyhomename.bathroomto.value="";
	document.buyhomename.bathroom.value="";
	document.buyhomename.floorno.value="";
	document.buyhomename.noofrooms.value="";
	document.buyhomename.nooffloors.value="";
	document.buyhomename.income.value="";
	document.buyhomename.parkingarea.value="";
	document.buyhomename.propdes.value="";
	document.buyhomename.fname.value="";
	document.buyhomename.lname.value="";
	document.buyhomename.address.value="";
	document.buyhomename.city21.value="";
	document.buyhomename.phone1.value="";
	document.buyhomename.phone2.value="";
	document.buyhomename.email.value="";
	document.buyhomename.locality.focus();
}
	if(specification==3)
{
	document.renthomename.locality.value="";
	document.renthomename.city11.value="";
	document.renthomename.expectedprice.value="";
	document.renthomename.area.value="";
	document.renthomename.built.value="";
	document.renthomename.bedroom.value="";
	document.renthomename.expectedpriceto.value="";
	document.renthomename.areato.value="";
	document.renthomename.roomareato.value="";
	document.renthomename.builtto.value="";
	document.renthomename.bedroomto.value="";
	document.renthomename.bathroomto.value="";
	document.renthomename.bathroom.value="";
	document.renthomename.floorno.value="";
	document.renthomename.noofrooms.value="";
	document.renthomename.nooffloors.value="";
	document.renthomename.income.value="";
	document.renthomename.parkingarea.value="";
	document.renthomename.propdes.value="";
	document.renthomename.fname.value="";
	document.renthomename.lname.value="";
	document.renthomename.address.value="";
	document.renthomename.city21.value="";
	document.renthomename.phone1.value="";
	document.renthomename.phone2.value="";
	document.renthomename.email.value="";
	document.renthomename.locality.focus();
}
	if(specification==4)
{
	document.rentouthomename.locality.value="";
	document.rentouthomename.city11.value="";
	document.rentouthomename.expectedprice.value="";
	document.rentouthomename.area.value="";
	document.rentouthomename.built.value="";
	document.rentouthomename.bedroom.value="";
	document.rentouthomename.bathroom.value="";
	document.rentouthomename.floorno.value="";
	document.rentouthomename.noofrooms.value="";
	document.rentouthomename.nooffloors.value="";
	document.rentouthomename.income.value="";
	document.rentouthomename.parkingarea.value="";
	document.rentouthomename.propdes.value="";
	document.rentouthomename.userfile.value="";
	document.rentouthomename.fname.value="";
	document.rentouthomename.lname.value="";
	document.rentouthomename.address.value="";
	document.rentouthomename.city21.value="";
	document.rentouthomename.phone1.value="";
	document.rentouthomename.phone2.value="";
	document.rentouthomename.email.value="";
	document.rentouthomename.cultivation.value="";
	upload_value.style.display = "";
	document.rentouthomename.locality.focus();
}

	
	
	
}


function funcheckbox(checkboxvalue)
{

	if(document.getElementById(checkboxvalue).value == "0")
	{
		document.getElementById(checkboxvalue).value="1";
	}
	else
	{
		document.getElementById(checkboxvalue).value="0";
	}
}
function isanumber(num)
{	
	if(isNaN(num))
	{
		alert("This not a number");
	}
}

function emailvalidation(src)
{
	if(src!="")
	{
	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	var regex = new RegExp(emailReg);
	if(regex.test(src)==false)
	{
		alert("This is not a valid e-mail address");
	}
	}
}

function ispark(str)
{
	if (document.getElementById("select").value=="Commercial building")
	{	
		if(str=="No")
		{
			document.getElementById("idparkingarea").style.display="none";
		}
		else
		{
			document.getElementById("idparkingarea").style.display="";
		}
	}
}
function locationstatefunction(statestring)
{
	var f=0;
	if(statestring == "Kerala")
	{
		document.getElementById("idlocationcity").style.display="";
		document.getElementById("idlocationothercity").style.display="none";
		f=1;
	}
	else
	{
		document.getElementById("idlocationcity").style.display="none";
		document.getElementById("idlocationothercity").style.display="";

	}
	return f;
}

function contactstatefunction(statestring)
{
	var f=0;
	if(statestring == "Kerala")
	{
		document.getElementById("idcontactcity").style.display="";
		document.getElementById("idcontactothercity").style.display="none";
		f=1;
	}
	else
	{
		document.getElementById("idcontactcity").style.display="none";
		document.getElementById("idcontactothercity").style.display="";

	}
	return f;
	
	
	
}

function uplo()
{
	window.open("upload.php","200px","200px");
}

