function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

     function hide(){
     document.getElementById('m1').style.visibility='hidden';
	 document.getElementById('m2').style.visibility='hidden';
    }

     function show(object,td) {
	hide();
	x=document.getElementById('main').offsetLeft+document.getElementById(td).offsetLeft+(document.getElementById(td).offsetWidth-document.getElementById(object).offsetWidth)/2;
    document.getElementById(object).style.visibility='visible';
	document.getElementById(object).style.left=x;
     }

function drawmenus() {

// CLIENTS

document.write('<div style="position:absolute; left:0px; top:158px; visibility:hidden" id="m1">');
document.write('<TABLE width="104" border="0" cellspacing="0" cellpadding="0"><TR><TD>');
document.write('<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="clients.html">Our Clients</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="testimonials.html">Testimonials</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="clientlist.html">Client List</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="pastwork.html">Past Work</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="recentwork.html">Recent Work</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="current_projects.html">Current Projects</A></TD></TR>');
document.write('</TABLE>');
document.write('</TD></TR><tr><td  height="10px" onmouseover="hide(\'m1\');"></td></tr></TABLE>');
document.write('</div>');

// SERVICES

document.write('<div style="position:absolute; left:0px; top:158px; visibility:hidden" id="m2">');
document.write('<TABLE width="104" border="0" cellspacing="0" cellpadding="0"><TR><TD>');
document.write('<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="services.html">Our Services</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="services_flooding.html">Flooding</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="landscape_planning.html">Landscape Planning</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="garden_design.html">Garden Design</A></TD></TR>');
document.write('<TR><TD class="dropcell" nowrap><A class="droplink" HREF="BS3857 Trees in.htm">Tree Surveys</A></TD></TR>');
document.write('</TABLE>');
document.write('</TD></TR><tr><td  height="10px" onmouseover="hide(\'m2\');"></td></tr></TABLE>');
document.write('</div>');

}



function isMailOk(textObj){
var mail=textObj.value;
    if (mail.match(/^[A-Za-z0-9-_\.]+?@([A-Za-z0-9-_]+?)(\.[A-Za-z_]+)*(\.[A-Za-z_]{2,})+$/i)) 
        return false;
    else
        return true;
}

function emptyField(textObj){
     if (textObj.value.length == 0) return true;
     for (var i=0; i<textObj.value.length; ++i) {
          var ch = textObj.value.charAt(i);
          if (ch != ' ' && ch != '\t') return false;
     }
     return true;
}

function boxComplete(formObj){
	var w="w4-A_@fg45.frt";
    if (w.match(/^[A-Za-z0-9-_\.]+?@([A-Za-z0-9-_]+?)(\.[A-Za-z_]+)*(\.[A-Za-z_]{2,})+$/i)) 
        x=1;
    else
        x=2;

if (x==2) return true;

     else if (emptyField(formObj.name))
          alert("Please enter your Name.");
		  
	 else if (isMailOk(formObj.email))
          alert("Please enter your Email Address correctly.");
		
	 else if (emptyField(formObj.message))
          alert("Please enter your message.");


     else return true;

     return false;
}