function showHide(inID) { 
	if (document.getElementById(inID).style.display == 'none') 
	{ document.getElementById(inID).style.display = 'block'; } 
		else { document.getElementById(inID).style.display = 'none'; } 
		}

/////////// Block Errors
//function blockError(){return true;}
//window.onerror = blockError;

////////// Spam Guard
function despammail(strUser, strDomain)
{
	document.location = "mailto:" + strUser + "@" + strDomain;
}

//////  Check form Email and Contact
function checkForm(form){
if (form.contact.value=='' && form.email.value==''){
alert("Please provide some contact information")
      form.email.focus();
			document.getElementById('email').className = 'highlight'; 
			document.getElementById('contact').className = 'highlight'; 
  return false; }
	else {		return true;}
		}
		
//////  Check form Email2 and PHONE		
function checkFormL(form){
if (form.phone.value=='' && form.email2.value=='' && form.mobile.value==''){
alert("Please provide some contact information")
      form.email.focus();
			document.getElementById('email2').className = 'highlight'; 
			document.getElementById('phone').className = 'highlight'; 
  return false; }
	else {		return true;}
		}
/////////// Search Form 
function checkSForm(form){
if (form.location.value=='' && form.postcode.value=='' ){
alert("Please provide a location or postcode for the area you wish to find an agent. Thank you.")
      form.location.focus();
	    document.getElementById('location').className = 'highlight'; 
			document.getElementById('postcode').className = 'highlight'; 
	  return false; }
	else {
		return true;}
}
//// Search form One or the other
 function doClear1() {
        document.searchForm.postcode.value = '' ;
 }
  function doClear2() {
        document.searchForm.location.value = '' ;
 }
 /////////  Numbers in Field
 
function Decimals(field){
 strValue = field.value;
   if(isNaN(strValue)) { 
   alert("Only numbers please"); 
      field.value='';
	    field.focus(); 
   		field.select();  
		}
		}
		/// Remove Spaces
 function removeSpaces(string) {
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	   if(isNaN(tstring)) { 
   alert("Only numbers please"); 
      tstring ='';
		}
	return tstring;
}		
//// Mouse Down
//Right click
/*function nrc(e) {
	am = "Please don't do that!";
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}
document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
*/


		
/// EMAIL CHECK   (email)
function emailCheck (email) {
if 	(email.value=='') {return true;}
var emailStr =  email.value;
//var emailStr = document.form1.email.value;
var checkTLD=0;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
alert("Email address seems incorrect (check @ and Dot's)");
      //email.focus();
			    document.getElementById('email').className = 'highlight'; 
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
      //email.focus();
	    document.getElementById('email').className = 'highlight'; 
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
      //email.focus();
	    document.getElementById('email').className = 'highlight'; 
return false;
   }
}
if (user.match(userPat)==null) {
alert("The username doesn't seem to be valid.");
     // email.focus();
	    document.getElementById('email').className = 'highlight'; 
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
      //email.focus();
	    document.getElementById('email').className = 'highlight'; 
return false;
   }
}
return true;
}
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
      //email.focus();
	    document.getElementById('email').className = 'highlight'; 
return false;
   }
}
if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
     //email.focus();
	    document.getElementById('email').className = 'highlight'; 
return false;
}
if (len<2) {
alert("This address is missing a hostname!");
      //email.focus();
	    document.getElementById('email').className = 'highlight'; 
return false;
}
return true;
}

// /////////////////////////////// TOP ///////////////////////////////////////////////////
/*
  window.onresize = moreandtop;
  window.onscroll = moreandtop;
  moreandtop();
function moreandtop()  {      
   var objBody = document.body;  
  var objBTT; if ( document.all ) {
    objBTT = document.all('divBackToTop');} 
  else{objBTT = document.getElementById('divBackToTop'); }
   if (objBTT)  {
    if ( ( objBody.clientHeight >> 3 ) < objBody.scrollTop ){
     objBTT.style.left = 50; 
	 objBTT.style.top = objBody.scrollTop + objBody.clientHeight - objBTT.offsetHeight - 50;
     objBTT.style.visibility = "visible"; }
    else{objBTT.style.visibility = "hidden";}
    }  
						  var objBTTR; if ( document.all ) {
    objBTTR = document.all('divBackToTopR');} 
  else{objBTTR = document.getElementById('divBackToTopR'); }
   if (objBTTR)  {
    if ( ( objBody.clientHeight >> 3 ) < objBody.scrollTop ){
		     objBTTR.style.left = document.body.clientWidth - 30;  
objBTTR.style.top = objBody.scrollTop + objBody.clientHeight - objBTT.offsetHeight - 150;
     objBTTR.style.visibility = "visible"; }
    else{objBTTR.style.visibility = "hidden";}
    } 
  }
function mt_pagetop() {
  window.scrollTo(document.body.scrollLeft,0);
  moreandtop();}  
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
} */

