

function SearchTop(){

	document.frmIndex.submit();

}



function checkformCallbackDetails()
{
    if(document.frmContact.enquiry_name.value.search(/\S/)==-1){

        alert("Please enter your name.");

        document.frmContact.enquiry_name.focus();

        return false;

    }
        
   if(document.frmContact.enquiry_phone.value.search(/\S/)==-1){   

        alert("Please enter your phone number.");

        document.frmContact.enquiry_phone.focus();

        return false;

    }
        
    if(document.frmContact.enquiry_day.value == 0){

        alert("Please enter the day you that wish us to contact you.");

        document.frmContact.enquiry_day.focus();

        return false;
    }
        
    if(document.frmContact.enquiry_time.value == 0){

        alert("Please enter the time of day that you wish us to contact you.");

        document.frmContact.enquiry_time.focus();

        return false;
    }
}


function checkformContactDetails()
{
    if(document.frmContact.enquiry_name.value.search(/\S/)==-1){

		alert("Please enter your name.");

		document.frmContact.enquiry_name.focus();

		return false;

	}
        
    if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmContact.enquiry_emailaddress.value)==null){

		alert("Please enter a correctly formatted email address.");

		document.frmContact.enquiry_emailaddress.focus();

		return false;

	}
        
        if(document.frmContact.enquiry_type.value == 0){

		alert("Please enter the type of enquiry from the checkbox.");

		document.frmContact.enquiry_type.focus();

		return false;

	}
        
        if(document.frmContact.enquiry_text.value.search(/\S/)==-1){

		alert("Please enter your enquiry.");

		document.frmContact.enquiry_text.focus();

		return false;

	}
}





function checkformDetailsNew(){
    
      if(document.frmSignup.membershiptype.value==0){

		alert("Please select the type of membership (owner/agent).");

		document.frmSignup.membershiptype.focus();

		return false;

	}


	if(document.frmSignup.userid.value.search(/\S/)==-1){

		alert("Please enter a username.");

		document.frmSignup.userid.focus();

		return false;

	}

        if(document.frmSignup.password.value.search(/\S/)==-1){

		alert("Please enter a password.");

		document.frmSignup.password.focus();

		return false;

	}

	if(document.frmSignup.password_confirm.value.search(/\S/)==-1){

		alert("Please confirm password.");

		document.frmSignup.password_confirm.focus();

		return false;

	}	

	if(document.frmSignup.password.value != document.frmSignup.password_confirm.value ){

		alert("Password confirmation doesn't match password specified above.");

		document.frmSignup.password_confirm.focus();

		return false;

	}

        if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmSignup.email_add.value)==null){

		alert("Please enter a correctly formatted email address.");

		document.frmSignup.email_add.focus();

		return false;

	}

        

        if(document.frmSignup.fname.value.search(/\S/)==-1){

		alert("Please enter your first name.");

		document.frmSignup.fname.focus();

		return false;

	}

	if(document.frmSignup.lname.value.search(/\S/)==-1){

		alert("Please enter your last name.");

		document.frmSignup.lname.focus();

		return false;

	}

	if(document.frmSignup.address_1.value.search(/\S/)==-1){

		alert("Please enter your address.");

		document.frmSignup.address_1.focus();

		return false;

	}

         if(document.frmSignup.city.value.search(/\S/)==-1){

		alert("Please enter your city.");

		document.frmSignup.city.focus();

		return false;

	}
        
        if(document.frmSignup.zip.value.search(/\S/)==-1){

		alert("Please enter your postcode.");

		document.frmSignup.zip.focus();

		return false;

	}

	if(document.frmSignup.country_id.value==0){

		alert("Please select country.");

		document.frmSignup.country_id.focus();

		return false;

	}

}

function checkformSendEnquiry1()
{
    if(document.formSendEnquiry.name.value.search(/\S/)==-1){

		alert("Please enter your name.");

		document.formSendEnquiry.name.focus();

		return false;

    }
    
    if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.formSendEnquiry.email.value)==null){

		alert("Please enter a correctly formatted email address");

		document.formSendEnquiry.email.focus();

		return false;

	}
    
}

function checkformSendEnquiry2()
{
    if(document.formSendEnquiry2.name.value.search(/\S/)==-1){

        alert("Please enter your name.");

        document.formSendEnquiry2.name.focus();

        return false;

    }
    
    if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.formSendEnquiry2.email.value)==null){

        alert("Please enter a correctly formatted email address");

        document.formSendEnquiry2.email.focus();

        return false;

    }
    
}

function checkformDetailsEdit()

{

        if(document.frmSignup.fname.value.search(/\S/)==-1){

		alert("Please enter your first name.");

		document.frmSignup.fname.focus();

		return false;

	}

	if(document.frmSignup.lname.value.search(/\S/)==-1){

		alert("Please enter your last name.");

		document.frmSignup.lname.focus();

		return false;

	}

	if(document.frmSignup.address_1.value.search(/\S/)==-1){

		alert("Please enter your address.");

		document.frmSignup.address_1.focus();

		return false;

	}

	if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmSignup.email_add.value)==null){

		alert("Please enter a correctly formatted email address");

		document.frmSignup.email_add.focus();

		return false;

	}

	if(document.frmSignup.country_id.value==""){

		alert("Please select country.");

		document.frmSignup.country_id.focus();

		return false;

	}


}



function checkform(){

	if(document.frmSignup.userid.value.search(/\S/)==-1){

		alert("Please enter your user id.");

		document.frmSignup.userid.focus();

		return false;

	}

    if(document.frmSignup.fname.value.search(/\S/)==-1){

		alert("Please enter your first name.");

		document.frmSignup.fname.focus();

		return false;

	}

	if(document.frmSignup.lname.value.search(/\S/)==-1){

		alert("Please enter your last name.");

		document.frmSignup.lname.focus();

		return false;

	}

	if(document.frmSignup.address_1.value.search(/\S/)==-1){

		alert("Please enter your address in the first address field.");

		document.frmSignup.address_1.focus();

		return false;

	}

	if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmSignup.email_add.value)==null){

		alert("Please enter a proper email");

		document.frmSignup.email_add.focus();

		return false;

	}

	if(document.frmSignup.password.value.search(/\S/)==-1){

		alert("Please enter a password.");

		document.frmSignup.password.focus();

		return false;

	}

	if(document.frmSignup.password_confirm.value.search(/\S/)==-1){

		alert("Please confirm password.");

		document.frmSignup.password_confirm.focus();

		return false;

	}	

	if(document.frmSignup.password.value != document.frmSignup.password_confirm.value ){

		alert("Please enter same password.");

		document.frmSignup.password_confirm.focus();

		return false;

	}

	

	if(document.frmSignup.country_id.value==""){

		alert("Please select country.");

		document.frmSignup.country_id.focus();

		return false;

	}

	if(document.frmSignup.country_id.value=="226" && document.frmSignup.state_id.value==""){

		alert("Please select state.");

		document.frmSignup.state_id.focus();

		return false;

	}



}



function checkformEdit(){

	if(document.frmSignup.userid.value.search(/\S/)==-1){

		alert("Please enter your user id.");

		document.frmSignup.userid.focus();

		return false;

	}

    if(document.frmSignup.fname.value.search(/\S/)==-1){

		alert("Please enter your first name.");

		document.frmSignup.fname.focus();

		return false;

	}

	if(document.frmSignup.lname.value.search(/\S/)==-1){

		alert("Please enter your last name.");

		document.frmSignup.lname.focus();

		return false;

	}

	if(document.frmSignup.address_1.value.search(/\S/)==-1){

		alert("Please enter your address in the first address field.");

		document.frmSignup.address_1.focus();

		return false;

	}

	if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmSignup.email_add.value)==null){

		alert("Please enter a proper email");

		document.frmSignup.email_add.focus();

		return false;

	}

	if(document.frmSignup.country_id.value==""){

		alert("Please select country.");

		document.frmSignup.country_id.focus();

		return false;

	}

	if(document.frmSignup.country_id.value=="226" && document.frmSignup.state_id.value==""){

		alert("Please select state.");

		document.frmSignup.state_id.focus();

		return false;

	}



}



function Login(){

	if(document.frmSignup.userid.value==''){

		alert("Please enter a proper userid to login");

		document.frmSignup.userid.focus();

		return false;

	}

	if(	document.frmSignup.password.value.search(/\S/)==-1) {

		alert('Please enter password');

		document.frmSignup.password.focus();

		return false;

	}

	document.frmSignup.hidaction.value="login";

	document.frmSignup.submit();

}



function Search(){

	document.frmEditSearch.hidaction.value="editSearch";

	document.frmEditSearch.submit();

}

function selectcountryS(){

	document.frmEditSearch.action="edit_search.php";

	document.frmEditSearch.submit();

}





function SearchInclude(){

	document.frmSearch.submit();

}



function SearchTop(){

	document.frmTop.submit();

}



function rowsshown(){

	document.frmPage.submit();

}



function chFrmS(){

	if(	document.frmSearchList.savesearch_name.value.search(/\S/)==-1) {

		alert('Please provide Save Search Name');

		document.frmSearchList.savesearch_name.focus();

		return false;

	}

    opener.document.frmPage.savesearch_name.value = document.frmSearchList.savesearch_name.value;

	opener.document.frmPage.hidaction.value = "SaveSearchListing";

	opener.document.frmPage.submit();

    window.close();

}  



function chFrm(){

	if(	document.frmListing.list_name.value.search(/\S/)==-1) {

		alert('Please provide List name');

		document.frmListing.list_name.focus();

		return false;

	}

    opener.document.frmdetail.list_name.value = document.frmListing.list_name.value;

 opener.document.frmdetail.hidaction.value = "SaveListing";

	opener.document.frmdetail.submit();

    window.close();

}  



function checkformP(Frm){



    if(document.frmAddEdit.country_id.value==""){

		alert("Please select country.");

		document.frmAddEdit.country_id.focus();

		return false;

	}		

	if(document.frmAddEdit.country_id.value=="226" && document.form.state_id.value==""){

		alert("Please select state.");

		document.frmAddEdit.state_id.focus();

		return false;

	}

    if(document.frmAddEdit.city.value==""){

		alert("Please enter a city.");

		document.frmAddEdit.city.focus();

		return false;

	}

	if(document.frmAddEdit.zip.value==""){

		alert("Please enter a zip.");

		document.frmAddEdit.zip.focus();

		return false;

	}

	return true;

}

function selectcountry(){

	document.frmAddEdit.action="property_add.php";

	document.frmAddEdit.submit();

}



function change_image(num,pic,id,path){

	document.frmdetail.slide.src=path+pic;

}

function callBrochure(id){

	window.open('brochure.php?property_id='+id,'Brochure','toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,height=630,width=565,top=10,left=10');

}

function callTermsandConditions(location){

	window.open(location,'toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,height=630,width=565,top=10,left=10');

}

function openSaveListing(id){

	window.open('openSaveListing.php?property_id='+id,'SaveListing','toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,height=300,width=565,top=10,left=10');

}

function openSearchListing(id){

	window.open('openSearchListing.php?property_id='+id,'SaveSearchListing','toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,height=300,width=565,top=10,left=10');

}

function sendMail(id){

	window.open('sendMail.php?property_id='+id,'Sendmail','toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,height=420,width=565,top=10,left=10');

}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




function openWindow(obj,wd,ht){



	features = "width="+wd+",height="+ht;      

	features += ",left=10,top=10,screenX=0,screenY=0,location=no,toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no";

	webwindow=window.open(obj, 'webwindow1', features);

	if (parseInt(navigator.appVersion) >= 4) { 

		webwindow.window.focus(); 

	}

}


function uncheckSingle(formName,field) {

	var ChckBxs = formName.elements[field];

	if(ChckBxs.length!=-1) {

		for (i = 0; i < ChckBxs.length; i++){

			if(ChckBxs[i].value=="99")

				ChckBxs[i].checked = false ;

		}

		formName.elements[field].checked = false;

	}

}



//counts number of words in a block of text

function cnt(w,x,limit)

{

        var y=w.value;

        var r = 0;

        a=y.replace('\n',' ');

        a=a.split(' ');

        for (z=0; z<a.length; z++)

        {

                if (a[z].length > 0)

                {

                        r++;

                }

        }

        x.value=limit - r;

        

        if(x.value < 1)

        {

                w.value = w.value.substring(0,w.value.length-1);

                return false;

        }

        return true;



}

var aDetail = new Array();



function categSelected(theSel,region_id,search){

  theForm = theSel.form;

  opt = theForm.region_id.options;

  opt.length = 0;

  

  

  if (search == 1)

  {

    var defaultstring = "--Any Region--";

  }

  else

  {

    var defaultstring = "--Select Region--";

  }

        

        

  if(theSel.value=="") {

     

     opt[0] = new Option(defaultstring, "");

     return;

  }

  opt[0] = new Option(defaultstring, "");
                     
  for(i=0;i<aDetail.length;i++){

    if(aDetail[i][2]==theSel.value){

      subCategoryValue = aDetail[i][1];

      for(j=0;j<opt.length;j++)

      {

        if(opt[j].value==subCategoryValue)

        {

          subCategoryValue="";

        }

      }

      if(subCategoryValue>"")

      {

        if (region_id == aDetail[i][0])

        {

                    opt[opt.length] = new Option(subCategoryValue, aDetail[i][0],true); 

        }

        else

        {

        opt[opt.length] = new Option(subCategoryValue, aDetail[i][0]);

        }
      }
    }
  }
}

 var tDetail = new Array();   
               
function RegionSelected(theSel,town_id,search){

  theForm = theSel.form;

  opt = theForm.town_id.options;

  opt.length = 0;

  
  
  

  if (search == 1)

  {

    var defaultstring = "--Any Town/City--";

  }

  else

  {

    var defaultstring = "--Select Town/City--";

  }



  if(theSel.value=="") {

     opt[0] = new Option(defaultstring, "");

     return;

  }

  opt[0] = new Option(defaultstring, "");

  for(i=0;i<tDetail.length;i++){

    if(tDetail[i][2]==theForm.region_id.value){

      subCategoryValue = tDetail[i][1];

      for(j=0;j<opt.length;j++)

      {

        if(opt[j].value==subCategoryValue)

        {

          subCategoryValue="";

        }

      }

      if(subCategoryValue>"")

      {

        if (town_id == tDetail[i][0])

        {

                    opt[opt.length] = new Option(subCategoryValue, tDetail[i][0],true); 

        }

        else

        {

        opt[opt.length] = new Option(subCategoryValue, tDetail[i][0]);

        }
      }
    }
  }
}


function  changeColor(admin,id,c) {

        var colour = 'ffffff';

        if (c== '1')

        {
               colour = '00cc66'; 

        }

        else

         if (c== '2')

        {

                colour = 'dd0000'; 

        }

        else

        if (c== '3')

        {

               colour = 'ffff33';  

        }
        
         else

        if (c== '4')

        {

               colour = 'ff9933';  

        }
        else
        {
              if (admin == 1)
              colour = '00cc66';
              else
              colour = 'dd0000'; 
              
        }
	document.getElementById(id).style.backgroundColor = "#" + colour;
}

function submitForm(formId)
{
        var formObj = document.getElementById(formId);
        formObj.submit();
}

function checkpasswordform()
{
        if(document.frmChangePassword.oldpassword.value.search(/\S/)==-1){

		alert("Please enter your old password.");

		document.frmChangePassword.oldpassword.focus();

		return false;

	}
        
        if(document.frmChangePassword.newpassword.value.search(/\S/)==-1){

		alert("Please enter your new password.");

		document.frmChangePassword.newpassword.focus();

		return false;

	}
        
        if(document.frmChangePassword.newpassword_confirm.value.search(/\S/)==-1){

		alert("Please confirm your new password.");

		document.frmChangePassword.newpassword_confirm.focus();

		return false;

	}

	
	if(document.frmChangePassword.newpassword.value != document.frmChangePassword.newpassword_confirm.value ){

		alert("Password confirmation doesn't match password specified above.");

		document.frmChangePassword.newpassword_confirm.focus();

		return false;

	}
}


function CountWords (this_field)
{
    var char_count = this_field.value.length;
    var fullStr = this_field.value + " ";
    var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
    var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
    var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
    var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
    var splitString = cleanedStr.split(" ");
    var word_count = splitString.length -1;
    if (fullStr.length <2)
    {
        word_count = 0;
    }
    
    return word_count;
}


function OnSubmitPropertyDetailForm()
{
  var count  = CountWords(document.frmPropertyDetails.short_description);
  if (count > 50)
  {
   alert("The short description text exceeds 50 words long.");
   document.frmPropertyDetails.short_description.focus();
   document.frmPropertyDetails.sd.value = 50-count;
   return false;
  }
  
  var dcount  = CountWords(document.frmPropertyDetails.description);
  if (dcount > 500)
  {
   alert("The main description text exceeds 500 words long.");
   document.frmPropertyDetails.description.focus();
   document.frmPropertyDetails.d.value = 500-dcount;
   return false;
  }
  
  if(document.pressed == 'cancel')
  {
   document.frmPropertyDetails.action ="property_centre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyDetails.action ="property_details.php";
  }
  return true;
}

function OnSubmitPropertyLocationForm()
{
  var count  = CountWords(document.frmPropertyLocation.directions);
  if (count > 200)
  {
   alert("The directions text exceeds 200 words long.");
   document.frmPropertyLocation.about_directions.focus();
   document.frmPropertyLocation.di.value = 200-count;
   return false;
  }
  
  var dcount  = CountWords(document.frmPropertyLocation.about_area);
  if (dcount > 500)
  {
   alert("The about area text/location exceeds 500 words long.");
   document.frmPropertyLocation.about_area.focus();
   document.frmPropertyLocation.aa.value = 500-dcount;
   return false;
  }
  
  if(document.pressed == 'cancel')
  {
   document.frmPropertyLocation.action ="property_centre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyLocation.action ="property_location.php";
  }
  return true;
}

function OnSubmitPropertyMapForm()
{
  if(document.pressed == 'cancel')
  {
   document.frmPropertyMap.action ="property_centre.php";
  }
  else
  if(document.pressed == 'save')
  {
    document.frmPropertyMap.action ="property_map.php?task=save";
  }
  else
  if(document.pressed == 'search')
  {
    document.frmPropertyMap.action ="property_map.php?task=search";
  }
  return true;
}

function OnSubmitAdminPropertyMapForm()
{
  if(document.pressed == 'cancel')
  {
   document.frmPropertyMap.action ="adminpropertycentre.php";
  }
  else
  if(document.pressed == 'save')
  {
    document.frmPropertyMap.action ="adminproperty_map.php?task=save";
  }
  else
  if(document.pressed == 'search')
  {
    document.frmPropertyMap.action ="adminproperty_map.php?task=search";
  }
  return true;
}


function OnSubmitPropertyTariffForm()
{
  if(document.pressed == 'cancel')
  {
   document.frmPropertyTariff.action ="property_centre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyTariff.action ="property_tariff.php";
  }
  return true;
}

function OnSubmitPropertyPhotosForm()
{
  if(document.pressed == 'cancel')
  {
   document.frmPropertyPhotos.action ="property_centre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyPhotos.action ="property_tariff.php";
  }
  return true;
}

function OnSubmitPropertyAvailabilityForm()
{
  if(document.pressed == 'cancel')
  {
   document.frmPropertyAvailability.action ="property_centre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyAvailability.action ="property_tariff.php";
  }
  return true;
}



function OnSubmitAdminPropertyDetailForm()
{
  
  var count  = CountWords(document.frmPropertyDetails.short_description);
  if (count > 50)
  {
   alert("The short description text exceeds 50 words long.");
   document.frmPropertyDetails.short_description.focus();
   document.frmPropertyDetails.sd.value = 50-count;
   return false;
  }
  
  var dcount  = CountWords(document.frmPropertyDetails.description);
  if (dcount > 500)
  {
   alert("The main description text exceeds 500 words long.");
   document.frmPropertyDetails.description.focus();
   document.frmPropertyDetails.d.value = 500-dcount;
   return false;
  }
  
  if(document.pressed == 'cancel')
  {
   document.frmPropertyDetails.action ="adminpropertycentre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyDetails.action ="adminproperty_details.php";
  }
  return true;
}

function OnSubmitAdminPropertyLocationForm()
{
  var count  = CountWords(document.frmPropertyLocation.directions);
  if (count > 200)
  {
   alert("The directions text exceeds 200 words long.");
   document.frmPropertyLocation.about_directions.focus();
   document.frmPropertyLocation.di.value = 200-count;
   return false;
  }
  
  var dcount  = CountWords(document.frmPropertyLocation.about_area);
  if (dcount > 500)
  {
   alert("The about area text/location exceeds 500 words long.");
   document.frmPropertyLocation.about_area.focus();
   document.frmPropertyLocation.aa.value = 500-dcount;
   return false;
  }
  
  if(document.pressed == 'cancel')
  {
   document.frmPropertyLocation.action ="adminpropertycentre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyLocation.action ="adminproperty_location.php";
  }
  return true;
}

function OnSubmitAdminPropertyTariffForm()
{
  if(document.pressed == 'cancel')
  {
   document.frmPropertyTariff.action ="adminpropertycentre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyTariff.action ="adminproperty_tariff.php";
  }
  return true;
}

function OnSubmitAdminPropertyPhotosForm()
{
  if(document.pressed == 'cancel')
  {
   document.frmPropertyPhotos.action ="adminpropertycentre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyPhotos.action ="adminproperty_tariff.php";
  }
  return true;
}

function OnSubmitAdminPropertyAvailabilityForm()
{
  if(document.pressed == 'cancel')
  {
   document.frmPropertyAvailability.action ="adminpropertycentre.php";
  }
  else
  if(document.pressed == 'Update')
  {
    document.frmPropertyAvailability.action ="adminproperty_tariff.php";
  }
  return true;
}


