// JavaScript Document
ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
firefox = ((navigator.appName == "Mozilla"));
safari=((navigator.appName == "Netscape"));
function toggle( targetId ){
  if (ie4){
  		target = document.all( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	} else {
		target = document.getElementById(targetId);
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
	}		
}
function toggleOn(targetId) {
  if (ie4){
  		target = document.all( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			}
  	} else {
		target = document.getElementById(targetId);
  			if (target.style.display == "none"){
  				target.style.display = "";
  			}
	}		
}
function toggleOff(targetId) {
  if (ie4){
  		target = document.all( targetId );
  			if (target.style.display == ""){
  				target.style.display = "none";
  			}
  	} else {
		target = document.getElementById(targetId);
  			if (target.style.display == ""){
  				target.style.display = "none";
  			}
	}		
}


function checkEmail(email) {
	if ((email.length==0) || (email==null)) {
	  toggleOn('errEmail');
	  return false;
	} 
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(email)) {
		return true;
	} else{
		toggleOn('errEmail2');
		return false;
	}
}


function checkBlank(theField) {
	if ((theField.length==0) || (theField==null)) {
	  return false;
	} 
}

function checkQuickSend(theForm) {
	var isWrong=false;
	if ((theForm.name.value=='Your Name...') || (theForm.name.value=='Please supply your name...')) {
		theForm.name.style.color='red';
		theForm.name.value='Please supply your name...';
		isWrong=true;
	}
	if (checkBlank(theForm.name.value)==false) {
		theForm.name.style.color='red';
		theForm.name.value='Please supply your name...';
		isWrong=true;
	}	
	if  ((theForm.messageTxt.value=='Enter your message...') || (theForm.messageTxt.value=='Enter a message please...') || (theForm.messageTxt.value=='No website addresses please...')) {
		theForm.messageTxt.style.color='red';
		theForm.messageTxt.value='Enter a message please...';
		isWrong=true;
	}
	if (checkBlank(theForm.messageTxt.value)==false) {
		theForm.messageTxt.style.color='red';
		theForm.messageTxt.value='Enter a message please...';
		isWrong=true;
	}
	var re = new RegExp("^.*(http|ftp|https).*$");
	if (document.contactQuickSend.messageTxt.value.match(re)) {
		theForm.messageTxt.style.color='red';
		theForm.messageTxt.value='No website addresses please...';
		isWrong=true;
	}
	
	if (isWrong==true) {
		return false;
	} else {
		return true;
	}
}

function checkFooterQuickSend(theForm) {
	var isWrong=false;
	if ((theForm.name.value=='Your Name...') || (theForm.name.value=='Please supply your name...')) {
		theForm.name.style.color='red';
		theForm.name.value='Please supply your name...';
		isWrong=true;
	}
	if (checkBlank(theForm.name.value)==false) {
		theForm.name.style.color='red';
		theForm.name.value='Please supply your name...';
		isWrong=true;
	}	
	if  ((theForm.messageTxt.value=='Enter your message...') || (theForm.messageTxt.value=='Enter a message please...') || (theForm.messageTxt.value=='No website addresses please...')) {
		theForm.messageTxt.style.color='red';
		theForm.messageTxt.value='Enter a message please...';
		isWrong=true;
	}
	if (checkBlank(theForm.messageTxt.value)==false) {
		theForm.messageTxt.style.color='red';
		theForm.messageTxt.value='Enter a message please...';
		isWrong=true;
	}
	var re = new RegExp("^.*(http|ftp|https).*$");
	if (document.footerQuickSend.messageTxt.value.match(re)) {
		theForm.messageTxt.style.color='red';
		theForm.messageTxt.value='No website addresses please...';
		isWrong=true;
	}
	
	if (isWrong==true) {
		return false;
	} else {
		return true;
	}
}