
function ViewMyOfficeListing()
{
	 if($("#chkOfficeProp").val() == 0) $("#chkOfficeProp").val(1); else $("#chkOfficeProp").val(0);
	 DoValidateSearch(1);
}

function RemoveAgent()
{
	 $("#divAgentBox").hide();
	 $("#AgentId").val(0);
	 $("#AgentUserId").val(0);
	 $("#chkOfficeProp").val('');
	 DoValidateSearch(1);
}

//Quick serach field validations
function DoValidateSearch(pageno)
{
	 if(pageno != null) $("#PageNo").val(pageno);
	 $("#OrderBy").val($("#cmbOrder").val());
	 var myfrmval=$("#frmQuickSearch").serialize();

	 $("#propertyListing").html('<img src="'+LoadingImage+'" />');

	 $.ajaxSetup(
	 {
		  timeout:100000,
		  dataType:"text",
		  error:function(xhr)
		  {
			   if(xhr.status==404)
					$("#propertyListing").html(xhr.status);
		  }
	 }
	 )
	 //ajax call
	 //if category is residential
	 $.post("php/services/Search_Residential.php",myfrmval,
		  function(data)
		  {
			   $("#propertyListing").html(data);
			   return false;

		  }
		  )
	 return false;
}// End of function checkQuickSearchValues()

function GoTo(type)
{
	 switch(type)
	 {
		  case '1': location.href = 'searchResult_residential.php'; break;
		  case '2': location.href = 'searchResult_commercial.php'; break;
		  case '3': location.href = 'searchResult_rural.php'; break;
		  case '4': location.href = 'searchResult_section.php'; break;
	 }
}

