﻿function simplesearch()
{
 var ct1;
 ct1=document.getElementById('txtSearch')
if(isEmpty(ct1))
{
 alert("Please enter Subrub,postcode or property Id");
 ct1.focus();
 return false;
}
 return true;
}
//.......................................................................................
function simplesearch1()
{
 var ct1;
 ct1=document.getElementById('ctl00_txtSearch')
if(isEmpty(ct1))
{
 alert("Please enter Subrub,postcode or property Id");
 ct1.focus();
 return false;
}
 return true;
}
//.......................................................................................

function simplesearch2()
{
 var ct1;
 ct1=document.getElementById('ctl00_ctl00_txtSearch')
if(isEmpty(ct1))
{
 alert("Please enter Subrub,postcode or property Id");
 ct1.focus();
 return false;
}
 return true;
}
//.......................................................................................

function isRegister()
{
 var ctl;
    
    
    
     ctl = document.getElementById("ctl00_content_txtfname");
    
    if(isEmpty(ctl))
    {
        alert("Please enter name");
        ctl.focus();
        return false;
    }
//    ctl = document.getElementById("ctl00_content_txtlname");
//    
//    if(isEmpty(ctl))
//    {
//        alert("Please enter last name");
//        ctl.focus();
//        return false;
//    }
      ctl = document.getElementById("ctl00_content_txtEmail");
    
    if(isEmpty(ctl))
    {
        alert("Please enter email");
        ctl.focus();
        return false;
    }
    
        
    if(!isEmail(ctl))
    {
        alert("Please enter valid email");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_content_txtuname");
    
    if(isEmpty(ctl))
    {
        alert("Please enter user name");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_content_txtpwd");
    
    if(isEmpty(ctl))
    {
        alert("Please enter password");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_content_txtpwd");
     if(!isMatch(ctl, document.getElementById("ctl00_content_txtcnfm")))
     {
       alert("Passwords do not match");
        ctl.focus();
        return false;
     }
     ctl = document.getElementById("ctl00_content_ddlstates");
    
    if(!isSelected(ctl))
    {
        alert("Please select state");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_content_ddlarea");
    
    if(!isSelected(ctl))
    {
        alert("Please select area");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_content_ddlsubrub");
    
    if(!isSelected(ctl))
    {
        alert("Please select location");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_content_ddllook");
    
    if(!isSelected(ctl))
    {
        alert("Please select category");
        ctl.focus();
        return false;
    }
  ctl = document.getElementById("ctl00_content_ddlutype");
    
    if(!isSelected(ctl))
    {
        alert("Please select register as");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_content_txtcontact");
    
    if(isEmpty(ctl))
    {
        alert("Please enter address");
        ctl.focus();
        return false;
    }
    
      ctl = document.getElementById("ctl00_content_txtpost");
    
    if(isEmpty(ctl))
    {
        alert("Please enter postcode");
        ctl.focus();
        return false;
    }
    
       
   
     ctl = document.getElementById("ctl00_content_txtphone");
    
    if(isEmpty(ctl))
    {
        alert("Please enter phone number");
        ctl.focus();
        return false;
    }
      ctl = document.getElementById("ctl00_content_txtmob");
    
    if(isEmpty(ctl))
    {
        alert("Please enter mobile number");
        ctl.focus();
        return false;
    }
    return true;
}
//.......................................................................................

function changepass()
{
 var ctl;
    
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtold");
    
    if(isEmpty(ctl))
    {
        alert("Please enter old password");
        ctl.focus();
        return false;
    }
    
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtpwd");
    
    if(isEmpty(ctl))
    {
        alert("Please enter new password");
        ctl.focus();
        return false;
    }
    
    if(!isMatch(ctl, document.getElementById("ctl00_ctl00_content_cnt_customer_txtcnfm")))
    {
        alert("Passwords do not match");
        ctl.focus();
        return false;
    }
    
    return true;
}
//.......................................................................................

function isEdit()
{
 var ctl;
    
    
    
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtfname");
    
    if(isEmpty(ctl))
    {
        alert("Please enter first name");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtlname");
    
    if(isEmpty(ctl))
    {
        alert("Please enter last name");
        ctl.focus();
        return false;
    }
    
    
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtcontact");
    
    if(isEmpty(ctl))
    {
        alert("Please enter address");
        ctl.focus();
        return false;
    }
    
       
      ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtEmail");
    
    if(isEmpty(ctl))
    {
        alert("Please enter email");
        ctl.focus();
        return false;
    }
    
        
    if(!isEmail(ctl))
    {
        alert("Please enter valid email");
        ctl.focus();
        return false;
    }
   
     
    
    
      ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtpost");
    
    if(isEmpty(ctl))
    {
        alert("Please enter postcode");
        ctl.focus();
        return false;
    }
    
       
   
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtphone");
    
    if(isEmpty(ctl))
    {
        alert("Please enter phone number");
        ctl.focus();
        return false;
    }
      ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtmob");
    
    if(isEmpty(ctl))
    {
        alert("Please enter mobile number");
        ctl.focus();
        return false;
    }
    return true;
}
//.......................................................................................
function isProperty()
{
  var  ctl;
  ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddlstates");
    
    if(!isSelected(ctl))
    {
        alert("Please select state");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddlarea");
    
    if(!isSelected(ctl))
    {
        alert("Please select area");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddlsubrub");
    
    if(!isSelected(ctl))
    {
        alert("Please select location");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddllook");
    
    if(!isSelected(ctl))
    {
        alert("Please select looking for");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddltype");
    
    if(!isSelected(ctl))
    {
        alert("Please select property type");
        ctl.focus();
        return false;
    }
//     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtbed");
//    
//    if(isEmpty(ctl))
//    {
//        alert("Please enter no of bedrooms");
//        ctl.focus();
//        return false;
//    }
//     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtbath");
//    
//    if(isEmpty(ctl))
//    {
//        alert("Please enter no of bathrooms");
//        ctl.focus();
//        return false;
//    }
//     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtcar");
//    
//    if(isEmpty(ctl))
//    {
//        alert("Please enter no of carspace");
//        ctl.focus();
//        return false;
//    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtland");
    
    if(isEmpty(ctl))
    {
        alert("Please enter landsize");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddlmin");
    if(!isSelected(ctl))
    {
        alert("Please select minimum price");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddlmax");
    if(!isSelected(ctl))
    {
        alert("Please select maximum price");
        ctl.focus();
        return false;
    }

    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtcontact");
    
    if(isEmpty(ctl))
    {
        alert("Please enter address");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtcity");
    
    if(isEmpty(ctl))
    {
        alert("Please enter city");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtpost");
    
    if(isEmpty(ctl))
    {
        alert("Please enter postcode");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtphone");
    
    if(isEmpty(ctl))
    {
        alert("Please enter phoneNo");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtmob");
    
    if(isEmpty(ctl))
    {
        alert("Please enter mobile no");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtdes");
    
    if(isEmpty(ctl))
    {
        alert("Please enter description");
        ctl.focus();
        return false;
    }
   
    return true;
}
//.......................................................................................
function iseditproperty()
{

    var ctl;
//     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtbed");
//    
//    if(isEmpty(ctl))
//    {
//        alert("Please enter no of bedrooms");
//        ctl.focus();
//        return false;
//    }
//     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtbath");
//    
//    if(isEmpty(ctl))
//    {
//        alert("Please enter no of bathrooms");
//        ctl.focus();
//        return false;
//    }
//     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtcar");
//    
//    if(isEmpty(ctl))
//    {
//        alert("Please enter no of carspace");
//        ctl.focus();
//        return false;
//    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtland");
    
    if(isEmpty(ctl))
    {
        alert("Please enter landsize");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddlmin");
    if(!isSelected(ctl))
    {
        alert("Please select minimum price");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_ddlmax");
    if(!isSelected(ctl))
    {
        alert("Please select maximum price");
        ctl.focus();
        return false;
    }

    ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtcontact");
    
    if(isEmpty(ctl))
    {
        alert("Please enter address");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtcity");
    
    if(isEmpty(ctl))
    {
        alert("Please enter city");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtpost");
    
    if(isEmpty(ctl))
    {
        alert("Please enter postcode");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtphone");
    
    if(isEmpty(ctl))
    {
        alert("Please enter phoneNo");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtmob");
    
    if(isEmpty(ctl))
    {
        alert("Please enter mobile no");
        ctl.focus();
        return false;
    }
     ctl = document.getElementById("ctl00_ctl00_content_cnt_customer_txtdes");
    
    if(isEmpty(ctl))
    {
        alert("Please enter description");
        ctl.focus();
        return false;
    }
   
    return true;

}
//.......................................................................................
function agentsearch()
{
    var  ctl, ctl1;
     ctl = document.getElementById("ctl00_content_txtagent");
    ctl1=document.getElementById("ctl00_content_txtname");
    if(isEmpty(ctl) && isEmpty(ctl1))
    {
        alert("Please enter search options");
        ctl.focus();
        return false;
    }
return true;
}
 //.......................................................................................
function agentmail()
{
 var  ctl;
 ctl = document.getElementById("txtnm");
  if(isEmpty(ctl))
    {
        alert("Please enter Name");
        ctl.focus();
        return false;
    }
   ctl = document.getElementById("txtemail");
  if(isEmpty(ctl))
    {
        alert("Please enter Email");
        ctl.focus();
        return false;
    }
     if(!isEmail(ctl))
    {
        alert("Please enter valid email");
        ctl.focus();
        return false;
    }
    ctl = document.getElementById("txtph");
  if(isEmpty(ctl))
    {
        alert("Please enter Phone no:");
        ctl.focus();
        return false;
    }
    return true;
}
//.......................................................................................
function isbuyproperty()
{
 var  ctl;
 ctl = document.getElementById("ctl00_content_txtproperty");
  if(isEmpty(ctl))
    {
        alert("Please enter suburb,area or postcode");
        ctl.focus();
        return false;
    }
    return true;
}
//---------------------------------------------------------------------

