<!-- 
var require = ['fname','lname',
               'address1', 'city','state','zip','telH'];
var field_name = ['First Name','Last Name',
                  'Address','City','State','Zip Code','Home Phone'];
var hclr = 'yellow',dclr='#ffffff',cf,tipto;
var lastFoc=12;

function isblank(s) { 
    var nofc=0;

    for ( var i = 0; i < s.length; i++) {
	var c = s.charAt(i);
	if ( ( c != ' ') && (c != '\n') && (c != '\t') ) nofc++;
    }
    if ( nofc == 0 ) return true;
    return false;
}

function ValidEmail(s) {
    var at=0;
    var dot=0;
    var invalid=0;
    for (  var i = 0; i < s.length; i++) {
	var c = s.charAt(i);
	if ( ( c == ' ') || (c == '\n') || (c == '\t') ) invalid++;
	if ( c == '@' ) at++;
	if ( c == '.' ) dot++;
    }
    if ( at == 1 && dot > 0 && !invalid ) return true;
    return false;
}

function ischecked(name,f) {

 var checked;

 for( var c=0; c < eval("f."+name+".length");c++) {
      checked = eval("f."+name+"["+c+"].checked");
      if ( checked ) { return true; }
 }
 return false;
}

function highLight(i,tf,c) {
   if ( ! document.getElementById ) return; 
   document.getElementById('lgnd').style.display='';

   var pd=document.catalog[String(i)];

   if ( pd.style ) {
      if ( tf == true ) pd.style.backgroundColor = hclr; 
      else pd.style.backgroundColor = c;
   }

   return;
}

function clearForm(f) {
    var l=0;
    var req_field = require[l];
    for (var i = 0; i < f.length; i++) {
	 var e = f.elements[i];

	 if ( e.name == 'email' ) {
		 highLight(e.name,0,dclr);
	    }
	 if ( e.name == req_field ) {

            if ( (e.type == "text") ) { 
		 highLight(e.name,0,dclr);
	    }
            else if ( e.name == "state" ) {
		    highLight(e.name,0,dclr);
            }   
	    else { 
              if ( e.type == 'select-one' ) highLight(e.name,0,dclr);
              if ( e.type == 'select-multiple' ) highLight(e.name,0,dclr);
              if ( e.type == 'checkbox' ) highLight(e.name,0,dclr);
            }
	    l++;
            req_field = require[l];
	 }
    }
    document.getElementById('lgnd').style.display='none';
    top.seen_tip=1;
    return true;
}

function Check_Comments(f) {
    var msg = "",errors = "",warning = "";
    var dbg1 = "", dbg2 = "";
    var l=0,k=0,warn=0;
    var err = new Array();
    var req_field = require[l];
    var ee='hcqujcrrctFcstidomc%28eik';

    for (var i = 0; i < f.length; i++) {
	 var e = f.elements[i];

	 if ( e.name == 'email' && ! isblank(e.value) && ! ValidEmail(e.value) ) {
		 errors += "\n     Email address appears to be invalid"; 
		 err[k] = i;
		 highLight(e.name,true,'transparent');
		 k++;
	    }
	 if ( e.name == req_field ) {

	    if ( e.type == "checkbox" && ! ischecked(e.name,f) ) { 
		 errors += "\n     "+field_name[l]; 
		 err[k] = i;
		 highLight(e.name,true,'transparent');
                 k++;
            }
            else if ( (e.type == "text") && isblank(e.value) ) { 
		 errors += "\n     "+field_name[l]; 
		 err[k] = i;
		 highLight(e.name,true,'transparent');
		 k++;
	    }
            else if ( (e.name == "state") && (e.selectedIndex == 0) ) {
  		    errors += "\n     "+field_name[l]; 
		    err[k] = i;
		    highLight(e.name,true,'#ffffff');
		    k++;
            }   
	    else { highLight(e.name,false); }

           
	    l++;
            req_field = require[l];
	 }
    }

    msg  = "---------------------------------------------------------------\n";
    msg += "The following required fields were blank or invalid:\n";

    if ( isblank(f.email.value) && ! isblank(f.comments.value) ) {
       warning = "\nPlease note: We will not be";
       warning += " able to reply to your comments if you";
       warning += " do not fill-in your email address.\n";
       warn++;
    }


//    alert( 'Errors: ' + errors.length + ' Warn: ' + warn );

    if ( errors.length > 1 || warn ) {
       if ( errors.length > 1 ) {
          alert( warning + msg + errors ); }
       else { 
         warning += '\n\n Hit [OK] to submit information without your email address';
         warning += '\n Hit [Cancel] to enter your email address\n';
         if(confirm(warning)) return True;
	 else { f.email.focus(); return false;}
	 }
       if ( errors.length > 1 ) {
          self.scrollTo(0,0);}
       else {
          f.email.focus();}
       return false;
       }

    document.getElementById('lgnd').style.display='none';
    return true;

}

var seen_tip=1;
var df=0;
var winw=0;
var winh=0;

function getdim(ob,p) {
  var pv = 0;
  while (ob) {
    pv += ob[p];
    ob = ob.offsetParent;
  }
  return pv;
}


function HideTip(tid) {
   var tip=document.getElementById(tid);
   var submit_button=document.getElementById("submit-button");
   var clear_button=document.getElementById("clear-button");
   var t=Number(lastFoc)-1;
   clearTimeout(tipto);
   tip.style.visibility="hidden";
   tip.style.display="none";
   submit_button.disabled = false;
   clear_button.disabled = false;
   top.seen_tip += 1;
   cf = window.setTimeout("focusNext('"+t+"');",300);
}

function focusNext(n) {
   window.clearTimeout(cf);
   document.catalog[n].focus();
}

function SetName(e) {
   lastFoc = e.tabIndex;
}

function ShowTip(iid) {

   var name=document.getElementById(iid).name;
   var tip=document.getElementById(name+"_tip");
   var submit_button=document.getElementById("submit-button");
   var clear_button=document.getElementById("clear-button");

//   if ( tip.style.visibility == "hidden" ) { 
//      return;
//   }
   if ( document.getElementById && ! document.all ) {
      documentWidth=self.innerWidth/2+window.pageXOffset-(winw/2);
      documentHeight=self.innerHeight/2+window.pageYOffset-(winh/2);
   } else if ( document.all && document.compatMode && document.compatMode != "BackCompat" ) {
            d = document.documentElement;
            documentWidth=d.offsetWidth/2+d.scrollLeft-(winw/2);
            documentHeight=d.offsetTop/2+d.scrollTop+(winh/2)+150;
   } else if ( document.all )  {
            d = document.body;
            documentWidth=d.offsetWidth/2+d.scrollLeft-(winw/2);
            documentHeight=d.offsetTop/2+d.scrollTop+(winh/2)+150;
	    }
   tip.style.position = "absolute";
   tip.style.display = "block";
   tip.style.top = documentHeight + "px";
   tip.style.left = documentWidth + "px"; 
   tip.style.visibility = "visible";
   submit_button.disabled = true;
   clear_button.disabled = true;
   tipto=setTimeout("ShowTip('"+iid+"')", 100);
}


function Reset_Seen (obj) {
   top.seen_tip=1;
}

function Ser(ee) {
   var eem=unescape(ee);
   var dem='';
   for(i=0;i<eem.length;i++){dem += String.fromCharCode(6^eem.charCodeAt(i));}
   return dem;
}

function Se(iid) {
   if ( top.df > 0 ) return;
   var ob=document.getElementById(iid);
   ob.innerHTML=Ser(unescape(ob.innerHTML));
   top.df=1;
   return;
}

function DisplayTip(iid) {
   if ( top.seen_tip > 1 ) return;
   var ob=document.catalog[iid];
   var tip=document.getElementById(ob.name+"_tip");
   if ( ob.value.length == 0 ) return;
   tip.style.display="block";
   winw=tip.offsetWidth;
   winh=tip.offsetHeight;

   tip.style.visibility="visible";
   if (iid == 'email' ) { Se('ea'); }
   tip.style.display="none";
   ShowTip(iid);
}

//-->
