// check if user login info is right or wrong
function chk_agree_term()
{
	//alert("chk_agree_term");
	//alert(document.frm_chk_term_condition.chk_agree.checked);
	if(document.frm_chk_term_condition.chk_agree.checked==false)
	{
		alert("If You are not agree with terms and condition You are not aligible to view / Add property");
		document.frm_chk_term_condition.chk_agree.focus();
	}else{
		document.frm_chk_term_condition.action="property_mgmt.php";
		document.frm_chk_term_condition.submit();
	}
}
function chkLogin()
{	
	if(document.frmLogin.txtLoginId.value=="")
	{
		alert("Please Enter Login Id");
		document.frmLogin.txtLoginId.focus();
		return false;
	}
	if(document.frmLogin.txtPassword.value=="")
	{
		alert("Please Enter Password");
		document.frmLogin.txtPassword.focus();
		return false;
	}
	document.frmLogin.action="login_validate.php";
	//document.frmLogin.submit();
	return true;
}
function chkAgentLogin()
{
	if(document.frmAgentLogin.txtLoginId.value=="")
	{
		alert("Please Enter Login Id");
		document.frmAgentLogin.txtLoginId.focus();
		return false;
	}
	if(document.frmAgentLogin.txtPassword.value=="")
	{
		alert("Please Enter Password");
		document.frmAgentLogin.txtPassword.focus();
		return false;
	}
	document.frmAgentLogin.action="agent_account.php";
	document.frmAgentLogin.submit();
	return true;
}
function chkmemberlogin()
{
	//alert("goto login");
	if(document.frmAgentLogin.txtLoginId.value=="")
	{
		alert("Please Enter Login Id");
		document.frmAgentLogin.txtLoginId.focus();
		return false;
	}
	if(document.frmAgentLogin.txtPassword.value=="")
	{
		alert("Please Enter Password");
		document.frmAgentLogin.txtPassword.focus();
		return false;
	}
	document.frmAgentLogin.action="member_login_check.php";
	document.frmAgentLogin.submit();
}
function updateInfo()
{
	document.frmAccount.action1.value="Update";
	document.frmAccount.action="register.php";
	document.frmAccount.submit();
}
function chkRegisterInfo()
{
	document.frmRegister.action="register.php?do=menu";
	document.frmRegister.submit();
}
//add user
function addUser()
{
	document.frmUserMgmt.action1.value="Add";
	document.frmUserMgmt.action="user.php";
	document.frmUserMgmt.submit();
}
function addmember()
{
	//alert("add member");
	document.frmProtectedMemMgmt.action1.value="Add";
	document.frmProtectedMemMgmt.action="protected_mem.php";
	document.frmProtectedMemMgmt.submit();
}
function editUser(id)
{
	document.frmUserMgmt.action1.value="Update";
	document.frmUserMgmt.userid.value=id;
	document.frmUserMgmt.action="user.php";
	document.frmUserMgmt.submit();
}
function editMember(id,page,limit)
{
	document.frmProtectedMemMgmt.action1.value="Update";
	document.frmProtectedMemMgmt.member_id.value=id;
	document.frmProtectedMemMgmt.action="protected_mem.php?limit="+limit+"&page="+page;
	document.frmProtectedMemMgmt.submit();
}
function deleteUser(FrmPara)
{
	document.frmUserMgmt.hidFrmVal.value = "Delete";
	document.frmUserMgmt.action = FrmPara;
	document.frmUserMgmt.submit();
	
}
function deleteMember(FrmPara)
{  //alert("delete=="+FrmPara);
	document.frmProtectedMemMgmt.hidFrmVal.value = "Delete";
	document.frmProtectedMemMgmt.action = FrmPara;
	document.frmProtectedMemMgmt.submit();
}
function chkUserInfo()
{
	document.frmUser.action="user.php";
	document.frmUser.submit();
}
function chkMemberInfo(page,limit)
{
	//alert("add member");
	document.frmProtectedMem.action="protected_mem.php?limit="+limit+"&page="+page;
	document.frmProtectedMem.submit();
}
function deleteenquiry(id,linkname)
{
	//alert(id+"="+linkname);
	document.frmEnquiryMgmt.process.value="Delete";
	document.frmEnquiryMgmt.id.value=id;
	document.frmEnquiryMgmt.action=linkname;
	document.frmEnquiryMgmt.submit();
}
function editenquiry(id,linkname)
{
	document.frmEnquiryMgmt.id.value=id;
	document.frmEnquiryMgmt.process.value="Update";
	var test12=document.frmEnquiryMgmt.process.value;
	//alert(test12);
	//alert(document.frmEnquiryMgmt.id.value);
	var link1=linkname+"?id="+id;
	document.frmEnquiryMgmt.action=link1;
	document.frmEnquiryMgmt.submit();
}
function chkenquiry(linkname)
{
		//alert(linkname);
	document.frmEnquiry.action=linkname;
	document.frmEnquiry.submit();
}
function addProperty(linkname,page,limit)
{
	document.frmPropertyMgmt.process.value="Add";
	var link_page=linkname+"?page="+page+"&limit="+limit;
	//alert(link_page);
	document.frmPropertyMgmt.action=link_page;
	document.frmPropertyMgmt.submit();
}
function deleteproperty(id,linkname,page,limit)
{//alert("page=="+page+"==limit=="+limit+"linkname=="+linkname);
	document.frmPropertyMgmt.process.value="Delete";
	document.frmPropertyMgmt.id.value=id;
	var link_page=linkname+"?limit="+limit;
  //alert(link_page);
	document.frmPropertyMgmt.action=link_page;
	document.frmPropertyMgmt.submit();
}
function Inint_AJAX() {
   try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
   try { return new XMLHttpRequest(); } catch(e) {} //Native Javascript
   alert("XMLHttpRequest not supported");
   return null;
};
function get_ref_no(id,property_id)
{  
	//alert("call javascript"+id+"iiouiouoiu"+property_id);
    var req = Inint_AJAX();
     //alert(src);alert(val);
		req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
					//alert(req.responseText);
                    document.getElementById("ref_no").innerHTML=req.responseText; //retuen value
						//document.frmProperty.submit();
               } 
          }
     }; 
		 req.open("GET", "get_ref_no.php?id="+id+"&property_id="+property_id); //make connection
	 
	 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
	
}
function get_ref_no1(id)
{  
	//alert("call javascript"+id);
    var req = Inint_AJAX();
     //alert(src);alert(val);
		req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
					//alert(req.responseText);
                    document.getElementById("ref_no").innerHTML=req.responseText; //retuen value
						//document.frmProperty.submit();
               } 
          }
     }; 
		 req.open("GET", "get_ref_no.php?id="+id); //make connection
	 
	 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
	
}


function get_order_no(id,property_id)
{   alert("hello");
	//alert("call javascript"+id+"iiouiouoiu"+property_id);
    var req = Inint_AJAX();
     //alert(src);alert(val);
		req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
					//alert(req.responseText);
                    document.getElementById("ref_no").innerHTML=req.responseText; //retuen value
						//document.frmProperty.submit();
               } 
          }
     }; 
		 req.open("GET", "get_ref_no.php?id="+id+"&property_id="+property_id); //make connection
	 
	 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
	
}
function get_order_no1(id)
{  alert(id);
	//alert("call javascript"+id);
    var req = Inint_AJAX();
     //alert(src);alert(val);
		req.onreadystatechange = function () { 
		 alert("onreadystatechange");
          if (req.readyState==4) {
			  alert("4");
               if (req.status==200) {
				   alert("yes");
					//alert(req.responseText);
                    document.getElementById("photo_id").innerHTML=req.responseText; //retuen value
						//document.frmProperty.submit();
               } 
          }
     }; 
		
	 	req.open("GET", "image_order.php?link="+id);
	 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
	
}



function delete_pdf_1(id,no)
{
	//alert("delete"+id+"==="+no);
	//alert(val);
	var ans=confirm("Are you sure want to delete?")
	if(ans==true)
	{
     var req = Inint_AJAX();
     //alert(src);alert(val);
		req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
					//alert(req.responseText);
                    document.getElementById("location").innerHTML=req.responseText; //retuen value
						document.frmProperty.submit();
               } 
          }
     };
		 req.open("GET", "delete_pdf.php?id="+id+"&no="+no); //make connection
	 
	 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
	}
}
function delete_pdf_front(id,no)
{
	alert("delete"+id+"==="+no);
	//alert(val);
	var ans=confirm("Are you sure want to delete?")
	if(ans==true)
	{
     var req = Inint_AJAX();
     //alert(src);alert(val);
		req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
					//alert(req.responseText);
                    document.getElementById("location1").innerHTML=req.responseText; //retuen value
						document.frmProperty.submit();
               } 
          }
     };
		 req.open("GET", "delete_pdf.php?id="+id+"&no="+no); //make connection
	 
	 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
	}
}

function editProperty(id,linkname,page,limit)
{
   //alert("page=="+page+"==limit=="+limit+"linkname=="+linkname);
	document.frmPropertyMgmt.process.value="Update";
	document.frmPropertyMgmt.id.value=id;
	var link_page=linkname+"?page="+page+"&limit="+limit;
	//alert(link_page);
	document.frmPropertyMgmt.action=link_page;
	document.frmPropertyMgmt.submit();
}
function valid_price(anum)
{	//alert("m,mn,"); 
	//alert(anum);
	 var valid = "0123456789";
   		 //alert(anum.length);
         for (var i=0; i < anum.length; i++)
         {
           temp = "" + anum.substring(i, i+1);
            if (valid.indexOf(temp) == "-1") 
        	 {
    			//alert("Invalid characters in your phone. Please try again.");
          		return false;
         	}
		}
		
       return true;
}
function chkProperty(page,limit)
{    //alert("chkProperty");
	//alert("page"+page+"limit"+limit);
	if(document.frmProperty.property_price.value=='')
	{
		alert("Please Enter Price");
		document.frmProperty.property_price.focus();
		return false;
	}
    if(valid_price(document.frmProperty.property_price.value)==false)
	{
		alert("Please enter Only digit in price other character such as(. ,) in not allow");
		document.frmProperty.property_price.focus();
		return false;
	}
	document.frmProperty.action="property.php?page="+page+"&limit="+limit;
	document.frmProperty.submit();
}
function Addfeature(linkname)
{	
	document.frmFeatureMgmt.process.value="Add";
	document.frmFeatureMgmt.action=linkname;
	document.frmFeatureMgmt.submit();
}
function deletefeature(id,linkname)
{
	document.frmFeatureMgmt.process.value="Delete";
	document.frmFeatureMgmt.id.value=id;
	document.frmFeatureMgmt.action=linkname;
	document.frmFeatureMgmt.submit();
}
function editfeature(id,linkname)
{
	document.frmFeatureMgmt.process.value="Update";
	document.frmFeatureMgmt.id.value=id;
	document.frmFeatureMgmt.action=linkname;
	document.frmFeatureMgmt.submit();
}
function chkFeature()
{
	document.frmFeature.action="property_feature.php";
	document.frmFeature.submit();
}
function Addtype(linkname)
{	
	document.frmTypeMgmt.process.value="Add";
	document.frmTypeMgmt.action=linkname;
	document.frmTypeMgmt.submit();
}
function deletetype(id,linkname)
{
	document.frmTypeMgmt.process.value="Delete";
	document.frmTypeMgmt.id.value=id;
	document.frmTypeMgmt.action=linkname;
	document.frmTypeMgmt.submit();
}
function edittype(id,linkname)
{
	document.frmTypeMgmt.process.value="Update";
	document.frmTypeMgmt.id.value=id;
	document.frmTypeMgmt.action=linkname;
	document.frmTypeMgmt.submit();
}
function chktype(linkname)
{
	document.frmType.action=linkname;
	document.frmType.submit();
}
function addcategory(linkname)
{	
	document.frmCategoryMgmt.process.value="Add";
	document.frmCategoryMgmt.action=linkname;
	document.frmCategoryMgmt.submit();
}
function deletecategory(id,linkname)
{
	document.frmCategoryMgmt.process.value="Delete";
	document.frmCategoryMgmt.id.value=id;
	document.frmCategoryMgmt.action=linkname;
	document.frmCategoryMgmt.submit();
}
function editcategory(id,linkname)
{
	
	document.frmCategoryMgmt.process.value="Update";
	document.frmCategoryMgmt.id.value=id;
	document.frmCategoryMgmt.action=linkname;
	document.frmCategoryMgmt.submit();
}
function chkcategory(linkname)
{
	document.frmCategory.action=linkname;
	document.frmCategory.submit();
}
function addstatus(linkname)
{	
	document.frmStatusMgmt.process.value="Add";
	document.frmStatusMgmt.action=linkname;
	document.frmStatusMgmt.submit();
}
function deletestatus(id,linkname)
{
	document.frmStatusMgmt.process.value="Delete";
	document.frmStatusMgmt.id.value=id;
	document.frmStatusMgmt.action=linkname;
	document.frmStatusMgmt.submit();
}
function editstatus(id,linkname)
{
	
	document.frmStatusMgmt.process.value="Update";
	document.frmStatusMgmt.id.value=id;
	document.frmStatusMgmt.action=linkname;
	document.frmStatusMgmt.submit();
}
function chkstatus(linkname)
{
	document.frmStatus.action=linkname;
	document.frmStatus.submit();
}
function addphoto(linkname)
{	
	document.frmPhotoMgmt.process.value="Add";
	document.frmPhotoMgmt.action=linkname;
	document.frmPhotoMgmt.submit();
}
function deletephoto(id,linkname)
{
	document.frmPhotoMgmt.process.value="Delete";
	document.frmPhotoMgmt.id.value=id;
	document.frmPhotoMgmt.action=linkname;
	document.frmPhotoMgmt.submit();
}
function editphoto(id,linkname)
{
	
	document.frmPhotoMgmt.process.value="Update";
	document.frmPhotoMgmt.id.value=id;
	document.frmPhotoMgmt.action=linkname;
	document.frmPhotoMgmt.submit();
}
function chkphoto(linkname)
{
	
	document.frmPhoto.action=linkname;	
	document.frmPhoto.submit();
}
function addpage(linkname)
{	
	document.frmPageMgmt.process.value="Add";
	document.frmPageMgmt.action=linkname;
	document.frmPageMgmt.submit();
}
function editpage(id,linkname)
{
	document.frmPageMgmt.process.value="Update";
	document.frmPageMgmt.id.value=id;
	document.frmPageMgmt.action=linkname;
	document.frmPageMgmt.submit();
}
function chkpage(linkname)
{
		document.frmPage.action=linkname;
		document.frmPage.submit();
}
function addvideo(linkname)
{	
	document.frmVideoMgmt.process.value="Add";
	document.frmVideoMgmt.action=linkname;
	document.frmVideoMgmt.submit();
}
function deletevideo(id,linkname)
{
	document.frmVideoMgmt.process.value="Delete";
	document.frmVideoMgmt.id.value=id;
	document.frmVideoMgmt.action=linkname;
	document.frmVideoMgmt.submit();
}
function editvideo(id,linkname)
{
	
	document.frmVideoMgmt.process.value="Update";
	document.frmVideoMgmt.id.value=id;
	document.frmVideoMgmt.action=linkname;
	document.frmVideoMgmt.submit();
}
function chkvideo(linkname)
{
	
	document.frmVideo.action=linkname;	
	document.frmVideo.submit();
}
function getPropertydetail(propertyid)
{
	document.frmPropertyId.property_id.value=propertyid;
	document.frmPropertyId.action="property_detail.php?property_id="+propertyid;
	document.frmPropertyId.submit();
}

function addnews(linkname)
{	
	document.frmNewsMgmt.process.value="Add";
	document.frmNewsMgmt.action=linkname;
	document.frmNewsMgmt.submit();
}
function addmembernews(linkname,member_id)
{   linkname=linkname+"?member_id="+member_id;
	//alert(linkname);
	document.frmNewsMgmt.process.value="Add";
	document.frmNewsMgmt.action=linkname;
	document.frmNewsMgmt.submit();
}
function deletenews(id,linkname)
{
	document.frmNewsMgmt.process.value="Delete";
	document.frmNewsMgmt.id.value=id;
	document.frmNewsMgmt.action=linkname;
	document.frmNewsMgmt.submit();
}
function editnews(id,linkname)
{
	document.frmNewsMgmt.process.value="Update";
	document.frmNewsMgmt.id.value=id;
	document.frmNewsMgmt.action=linkname;
	document.frmNewsMgmt.submit();
}
function editmemberNews(id,linkname,member_id)
{  //alert(id+"===="+linkname+"==="+member_id);
	document.frmNewsMgmt.process.value="Update";
	document.frmNewsMgmt.id.value=id;
	linkname=linkname+"?member_id="+member_id;
	document.frmNewsMgmt.action=linkname;
	document.frmNewsMgmt.submit();
}
function deletemembernews(id,linkname,member_id)
{
	document.frmNewsMgmt.process.value="Delete";
	document.frmNewsMgmt.id.value=id;
	linkname=linkname+"?member_id="+member_id;
	document.frmNewsMgmt.action=linkname;
	document.frmNewsMgmt.submit();
}
function chknews(linkname)
{   
  // alert("chknews=="+linkname);
	document.frmNews.action=linkname;
	document.frmNews.submit();
}
function chkmembernews(linkname,member_id)
{
	//alert("chknews=="+linkname+"member_id=="+member_id);
	linkname=linkname+"?member_id="+member_id;
	document.frmNews.action=linkname;
	document.frmNews.submit();
}
/*-----------*/
function addcountry(linkname)
{	
	document.frmCountryMgmt.process.value="Add";
	document.frmCountryMgmt.action=linkname;
	document.frmCountryMgmt.submit();
}
function deletecountry(id,linkname)
{
	
	document.frmCountryMgmt.process.value="Delete";
	document.frmCountryMgmt.id.value=id;
	document.frmCountryMgmt.action=linkname;
	document.frmCountryMgmt.submit();
}
function editcountry(id,linkname)
{
	document.frmCountryMgmt.process.value="Update";
	document.frmCountryMgmt.id.value=id;
	document.frmCountryMgmt.action=linkname;
	document.frmCountryMgmt.submit();
}
function chkcountry(linkname)
{
	document.frmCountry.action=linkname;
	document.frmCountry.submit();
}
/*-----------*/
//======================for the front page=======================================
function addfrontpage(linkname)
{
	//alert("add front page");
	//alert(linkname);
	document.frmFrontpageMgmt.process.value="Add";
	//alert(document.frmFrontpageMgmt.process.value);
	document.frmFrontpageMgmt.action=linkname;
	document.frmFrontpageMgmt.submit();
}
function editfrontpage(id,linkname)
{
	//alert("edit front");
	document.frmFrontpageMgmt.process.value="Update";
	document.frmFrontpageMgmt.id.value=id;
	document.frmFrontpageMgmt.action=linkname;
	document.frmFrontpageMgmt.submit();
}
function deletefrontpage(id,linkname)
{
	//alert("delete front page");
	document.frmFrontpageMgmt.process.value="Delete";
	document.frmFrontpageMgmt.id.value=id;
	document.frmFrontpageMgmt.action=linkname;
	document.frmFrontpageMgmt.submit();

}
function chkfrontpage(linkname)
{
	//alert("chkfrontpage");
	document.frmFrontpage_add.action=linkname;
	document.frmFrontpage_add.submit();
}
//============================
function addlocation(linkname)
{	
	document.frmLocationMgmt.process.value="Add";
	document.frmLocationMgmt.action=linkname;
	document.frmLocationMgmt.submit();
}
function deletelocation(id,linkname)
{
	document.frmLocationMgmt.process.value="Delete";
	document.frmLocationMgmt.id.value=id;
	document.frmLocationMgmt.action=linkname;
	document.frmLocationMgmt.submit();
}
function editlocation(id,linkname)
{
	document.frmLocationMgmt.process.value="Update";
	document.frmLocationMgmt.id.value=id;
	document.frmLocationMgmt.action=linkname;
	document.frmLocationMgmt.submit();
}
function chklocation(linkname)
{
	document.frmLocation.action=linkname;
	document.frmLocation.submit();
}
/*-----------*/
function openMap(newcontent)
 {
  var wincontent = window.open(newcontent, 'map', 'width=418,height=490,top=50,left=50,titlebar=yes,resizable=yes,toolbar=no,menubar=no,scrollbars=yes')         
  wincontent.focus();
 }

function openLondon(newcontent)
 {
  var wincontent = window.open(newcontent, 'london', 'width=628,height=564,scrollbars=yes,resizable=no,top=50,left=50,titlebar=yes,toolbar=no,menubar=no')         
  wincontent.focus();
 }

function openTube(newcontent)
 {
  var wincontent = window.open(newcontent, 'tube', 'width=645,height=550,scrollbars=no,resizable=no,top=50,left=50,titlebar=yes,toolbar=no,menubar=no')         
  wincontent.focus();
 }
<!--          Function to call ajax              -->
function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	  }
	return xmlHttp;
}
function getdetail(str)
{ 	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="getdetail.php";
	url=url+"?id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getPrintVersion(link1)
{ 	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="getprintversion.php";
	url=url+"?link="+link1;
	url=url+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function getvideoclip(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="get_video_clip.php";
	url=url+"?id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function getcontact(str,id)
{  //alert("id==="+id);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="getcontact.php";
	url=url+"?id="+str;
	url=url+"&property_id="+id;
	url=url+"&sid="+Math.random();
	//url=url+"&property_id="+id;
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								//alert(xmlHttp.responseText);
								document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function downloadpdf(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="downloadpdf.php";
	url=url+"?id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								//alert(xmlHttp.responseText);
								document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function getnewsdetail(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="getnewsdetail.php";
	url=url+"?id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("txtHint"+str).innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
}
function getEnquiryDetail(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="get_enquiry_detail.php";
	url=url+"?id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								//alert(xmlHttp.responseText);
								document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
}
/********************** ************/
// TUBE MAP


	function imgUp(img,com){
	 if (img.checked){return;}// don't do anything if the image is checked
	 
	 if (com){
	 	//if true mouse over

		img.src = eval(img.name+"02.src");

	 } else {
	 	//if false mouse out
		img.src = eval(img.name+"01.src");
	 }
	
	}
	
	function chckbx(obj){
		// clicking on the div will set the checkbox and image to be checked
		var chbx = obj.getElementsByTagName('INPUT')[0];
		var img =  obj.getElementsByTagName('IMG')[0];
		var bool = chbx.checked;
		chbx.checked = (bool)? false : true;
		img.checked = (!bool);
		if (bool) {
			img.src = eval(img.name+"01.src");
		}
	}
	
	function setCheckedImage(id,bool){
		// set the image checked value when page loads
		img = id+"img";
		if (bool) {
			document.getElementById(img).src = oversrc;
		}	
		document.getElementById(id).checked = bool;
		document.getElementById(img).checked = bool;
	}
	
	function CheckSearchValues()
	{		
		//Check whether user has added a value to the drop down boxs or not.		
		
		var iError = 0;
		//For users who have clicked to Buy
		if(document.forms[0].textSearchBox.value == '')
		{
		alert('Please enter a location before actioning your search.');
		++iError;
		}		
		
		
		if(document.forms[0].buysection.checked == true)
		{			
						
			
			if(document.forms[0].buyminprice.value != '-1' && document.forms[0].buymaxprice.value != '-1' && document.forms[0].buyminprice.length > document.forms[0].buymaxprice.length)
			{
				alert('Minimum price exceeds maximum price. Please adjust.');			
				++iError;				
			}
									
		}
		
		if(iError != 0)
		{
			return false;
		}
					
	}
	
	
// END -->

	//submit on enter (RW 27/1/2004)

	function checkEnter(event)
	{ 	
		var code = 0;
		var NS4;
		NS4 = (document.layers) ? true : false;	
		if (NS4)
			{
				code = event.which;
			}
		else
			{
				code = event.keyCode;
			}
		if (code==13)
			{
				document.forms[0].autoSubmit.value='search';
				document.forms[0].submit();
			}
	}
// ******************************************** //
// main site
function chkYourProperty()
{
	document.frmYourPropertyDetail.action="your_property_detail.php";
	document.frmYourPropertyDetail.submit();
}
function getPropertyByAgent()
{
	//alert('hi');
	document.frmGetContact.action="agent_property.php";
	document.frmGetContact.submit();
}
function sendmail()
{	
	document.frmGetContact.action="mail.php";
	document.frmGetContact.submit();
}
function chkForgetPswd()
{
	if(document.FrmForgetPwd.txtLogin.value=="")
	{
		alert('Please Enter Login Email Id');
		document.FrmForgetPwd.txtLogin.focus();
		return false;
	}
	if(document.FrmForgetPwd.txtLogin.value.indexOf("@") == -1 || document.FrmForgetPwd.txtLogin.value.indexOf(".") == -1)
	{
		alert("Please Enter Valid Email Id!!!");
		document.FrmForgetPwd.txtLogin.focus();
		return false;
	}
	document.FrmForgetPwd.done.value="sendmail";
	document.FrmForgetPwd.action="forgetpwd.php";
	document.FrmForgetPwd.submit();
	return true;
}
function addAgentProperty(linkname)
{
	//alert('hi');
	document.frmAgentPropertyMgmt.process.value="Add";
	document.frmAgentPropertyMgmt.action=linkname;
	document.frmAgentPropertyMgmt.submit();
}
function deleteAgentproperty(id,linkname)
{
	document.frmAgentPropertyMgmt.process.value="Delete";
	document.frmAgentPropertyMgmt.id.value=id;
	document.frmAgentPropertyMgmt.action=linkname;
	document.frmAgentPropertyMgmt.submit();
}
function editAgentProperty(id,linkname)
{
	document.frmAgentPropertyMgmt.process.value="Update";
	document.frmAgentPropertyMgmt.id.value=id;
	document.frmAgentPropertyMgmt.action=linkname;
	document.frmAgentPropertyMgmt.submit();
}
function chkAgentProperty()
{
	document.frmAgentProperty.action="property.php";
	document.frmAgentProperty.submit();
}

function checkImageOrder(linkname,photo_id)
{   alert(linkname);
	//document.frmPhotoMgmt.action="image_order.php"+"?link="+linkname;
	document.frmPhotoMgmt.action="image_order.php"+"?link="+linkname+"&id="+photo_id;
	document.frmPhotoMgmt.submit();
	
}

function chkSearch()
{
	if(document.frmSeekerProperty.ref_text.value=="")
	{
		alert("Please Enter Refrence Number");
		document.frmSeekerProperty.ref_text.focus();
		return false;
	}
}
	function checkOrderProduct(id,parentid)
{
	document.frmPhotoMgmt.action = "change_photo_order.php?id="+id+"&parentid="+parentid;
	document.frmPhotoMgmt.submit();
}



function getapplicant(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="applicant_detail.php";
	url=url+"?app_id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("getdetail").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getproperty(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="property_list_display.php";
	url=url+"?app_id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("getdetail").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getlog(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="view_applicant_log.php";
	url=url+"?app_id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("getdetail").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getView(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="view.php";
	url=url+"?app_id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("getdetail").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function getCalender(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="get_calender.php";
	url=url+"?property_id="+str;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}