// Match Column Heights
matchHeight=function(){
         var divs,contDivs,maxHeight,divHeight,d;
         divs=document.getElementsByTagName('div');
         contDivs=[];
         maxHeight=0;
         for(var i=0;i<divs.length;i++){
              if(/\bcontent-column\b/.test(divs[i].className)){
                    d=divs[i];
                    contDivs[contDivs.length]=d;
                    if(d.offsetHeight){
                         divHeight=d.offsetHeight;
                    }
                    else if(d.style.pixelHeight){
                         divHeight=d.style.pixelHeight;
                    }
                    maxHeight=Math.max(maxHeight,divHeight);
              }
         }
         for(var i=0;i<contDivs.length;i++){
              contDivs[i].style.height=maxHeight+'px';
         }
    }
    window.onload=function(){
         if(document.getElementsByTagName){
              matchHeight();
         }
    }

//Select Focus
function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
//email validator
function isemail(s)
{      
    var i = 1;
    var sLength = s.length;
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}
// Form Validation
function checkform ( form )
{
  if (form.name.value == "" || form.name.value == "Name") {
    alert( "Please enter your Name." );
    form.name.focus();
	form.name.style.border = "1px solid red";
    return false ;
  }
  if (form.email.value == "" || form.email.value == "Email") {
    alert( "Please enter your Email address." );
    form.email.focus();
	form.email.style.border = "1px solid red";
    return false ;
  }
  if (!isemail(document.enquire.email.value))
  {
	window.alert("Please enter a valid Email address (eg. user@company.com)");
	document.enquire.email.focus();
	form.email.style.border = "1px solid red";
	return false;
  }
  if (form.enquiry.value == "" || form.enquiry.value == "What have you got to say for yourself?") {
    alert( "Please enter your enquiry." );
    form.enquiry.focus();
	form.enquiry.style.border = "1px solid red";
    return false ;
  }
  // ** END **
  return true ;
}