function showhide(divid, thisImg) {
	var obj = this.document.getElementById(divid);
	
	//var obj1 = this.document.getElementById('bodycontainer');
	//obj1.style.height = "auto";
	
	//alert(divid);
	//alert(obj.style.display);
	
	if( obj.style.display == "block" )
	{
		obj.style.display = "none";
		this.document.getElementById(thisImg).src = "upfiles/Image/SetupImages/sliderarrowdown.gif";
	}
	else 
	{
		obj.style.display = "block";
		this.document.getElementById(thisImg).src = "upfiles/Image/SetupImages/sliderarrowup.gif";
	}
	
	//setTall();
	
}

function checkSearch(mainpagelink) 
{ 
    var LocationValue = document.form1.projectlocation.options[document.form1.projectlocation.selectedIndex].value;
	var TypeValue = document.form1.projecttype.options[document.form1.projecttype.selectedIndex].value;
	var BedsValue = document.form1.bedrooms.options[document.form1.bedrooms.selectedIndex].value;
	
	var PoolValue = 0;
	if( document.getElementById("pool") )
		PoolValue = document.getElementById("pool").checked;
	var PriceFromValue = document.form1.pricefrom.options[document.form1.pricefrom.selectedIndex].value;
	var PriceUpToValue = document.form1.priceupto.options[document.form1.priceupto.selectedIndex].value;
	var CoveredFromValue = document.form1.coveredfrom.options[document.form1.coveredfrom.selectedIndex].value;
	var CoveredUpToValue = document.form1.coveredupto.options[document.form1.coveredupto.selectedIndex].value;
	
    if( LocationValue == "" )
    {
      alert("Please select a valid area!!!");
    }
	else if( TypeValue == "" )
    {
      alert("Please select a valid property type!!!");
    }
	else if( BedsValue == "" )
    {
      alert("Please select a valid bedrooms number!!!");
    }
	else if( PriceFromValue == "" )
    {
      alert("Please select a valid from price value!!!");
    }
	else if( PriceUpToValue == "" )
    {
      alert("Please select a valid upto price value!!!");
    }
	else if( CoveredFromValue == "" )
    {
      alert("Please select a valid from covered area value!!!");
    }
	else if( CoveredUpToValue == "" )
    {
      alert("Please select a valid upto covered area value!!!");
    }
	else if( parseInt(PriceFromValue) > parseInt(PriceUpToValue) &&  PriceUpToValue !== "*" )
	{
	  alert("From price cannot be more than upto price!!!");
	}
	else if( parseInt(CoveredFromValue) > parseInt(CoveredUpToValue) && CoveredUpToValue !== "*" )
	{
	  alert("From covered area cannot be more than upto covered area!!!");
	}
    else
    {
	  var location = mainpagelink + "?link=results.php&location=" + LocationValue + "&" +
	  						"type=" + TypeValue + "&" + 
							"bedrooms=" + BedsValue + "&" +
							"pricefrom=" + PriceFromValue + "&" + 
							"priceupto=" + PriceUpToValue + "&" +
							"coveredfrom=" + CoveredFromValue + "&" +
							"coveredupto=" + CoveredUpToValue;
	  if( document.getElementById("pool") )
			location += "&pool=" + PoolValue

	
      parent.location = location;
    }
} 
