function formHandler(form) {
	var URL = document.ldc.getdocs.options[document.ldc.getdocs.selectedIndex].value;
	window.location.href = URL;
	}

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();
}
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 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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

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 mmLoadMenus() {
  if (window.mm_menu_0918063549_0) return;
  window.mm_menu_0918063549_0 = new Menu("root",145,16,"Verdana, Helvetica, sans-serif",10,"#0000FF","#0000FF","#E6E6E6","#E4EDF6","left","middle",2,0,1000,-5,7,true,true,true,0,false,true);
mm_menu_0918063549_0.addMenuItem("Document Center","location='http://www.lawsmart.com/documents/index.html'");  mm_menu_0918063549_0.addMenuItem("F.A.Q.'s","location='http://www.lawsmart.com/faqs.html'");
  mm_menu_0918063549_0.addMenuItem("Legal Forms","location='http://www.lawsmart.com/forms.html'");
  mm_menu_0918063549_0.addMenuItem("Audio Guides","location='http://www.lawsmart.com/audioguides.html'");
  mm_menu_0918063549_0.addMenuItem("Canadian FAQ's","location='http://www.lawsmart.com/canada_faqs.html'");
  mm_menu_0918063549_0.addMenuItem("Canadian Legal Forms","location='http://www.lawsmart.com/canada_forms.html'");
  mm_menu_0918063549_0.addMenuItem("Financial Calculators","location='http://www.lawsmart.com/calculators/index.html'");
  mm_menu_0918063549_0.addMenuItem("Corp. Record Keeping","location='http://www.lawsmart.com/corporate_record_keeping.html'");
   mm_menu_0918063549_0.hideOnMouseOut=true;
   mm_menu_0918063549_0.menuBorder=0;
   mm_menu_0918063549_0.menuLiteBgColor='#ffffff';
   mm_menu_0918063549_0.menuBorderBgColor='#8ec8fe';
   mm_menu_0918063549_0.bgColor='#555555';
 
  mm_menu_0918063549_0.writeMenus();
} // mmLoadMenus()


function ValidateForm(form)
{
	if (form1.pracarea.options[form1.pracarea.selectedIndex].value == "") {
    alert("Please select a practice area.");
    form1.pracarea.focus();
    return (false);
  }
  if (form1.state.options[form1.state.selectedIndex].value == "") {
  	if (form1.areacode.value == "") {
    alert("Please either enter an area code or select a state.");
    form1.areacode.focus();
    return (false);
	}

	function IsNumeric(sText)  {
	 var ValidChars = "0123456789";
	 var IsNumber=true;
	 var Char;
 
	for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
	return IsNumber;
	}

   if (!IsNumeric(form1.areacode.value)) 
   { 
      alert('Please enter only numbers in the area code field') 
      form1.areacode.focus(); 
      return false; 
      }

if (form1.areacode.value.length < 3 || form1.areacode.value.length > 3) {
      alert('Please enter three digits') 
      form1.areacode.focus(); 
      return false; 
      }

  }
return true;
} 
