//RETURNS THE STYLE OBJECT
function getStyle(name){
if (document.getElementById){return document.getElementById(name).style;}
else if (document.all){return document.all[name].style;}
else if (document.layers){return document.layers[name];}
}

//HANDLES THE CHANGE IN SELECT BOX
function checkInput(value){
if (value=='Other'){show('HowNowText')}else{hide('HowNowText')}
return;
}

//CHANGES THE DISPLAY PROPERTY OF ELEMENT 'ID' TO BLOCK
function show(id){
var styleObj=getStyle(id);
styleObj.display='block';
}

//CHANGES THE DISPLAY PROPERTY OF ELEMENT 'ID' TO NONE
function hide(id){
var styleObj=getStyle(id);
styleObj.display='none';
}

<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}
// End -->  
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}
// End -->  
function emailCheck (emailStr) {

var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);

if (matchArray==null) {
	alert("Email address seems incorrect (check @ and .'s)");
	return false;
}

var user=matchArray[1];
var domain=matchArray[2];

for (i=0; i<user.length; i++) {
	if (user.charCodeAt(i)>127) {
		alert("This username contains invalid characters.");
		return false;
	   }
}
for (i=0; i<domain.length; i++) {
	if (domain.charCodeAt(i)>127) {
		alert("This domain name contains invalid characters.");
		return false;
	   }
}


if (user.match(userPat)==null) {
	alert("The username doesn't seem to be valid.");
	return false;
}

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
	for (var i=1;i<=4;i++) {
		if (IPArray[i]>255) {
			alert("Destination IP address is invalid!");
			return false;
		   }
	}
	return true;
}

 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;

for (i=0;i<len;i++) {
	if (domArr[i].search(atomPat)==-1) {
		alert("The domain name does not seem to be valid.");
		return false;
	   }
}

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
	alert("The address must end in a well-known domain or two letter " + "country.");
	return false;
}

if (len<2) {
	alert("This address is missing a hostname!");
	return false;
}

}


function junpone(){
var val = "";
val = document.FrontPage_Form1.hp.value;
//alert(val);
if((val.length)== 3)
document.FrontPage_Form1.hp1.focus();
}

function junptwo(){
var val = "";
val = document.FrontPage_Form1.hp1.value;
if((val.length)== 3)
document.FrontPage_Form1.hp2.focus();
}

function junpthree(){
	var val = "";
	val = document.FrontPage_Form1.hp2.value;
	if((val.length)== 4)
	document.FrontPage_Form1.wphone.focus();
}

function junpfour(){
	var val = "";
	val = document.FrontPage_Form1.wphone.value;
	if((val.length)== 3)
	document.FrontPage_Form1.wphone1.focus();
}
function junpfive(){
	var val = "";
	val = document.FrontPage_Form1.wphone1.value;
	if((val.length)== 3)
	document.FrontPage_Form1.wphone2.focus();
}
function junpsix(){
	var val = "";
	val = document.FrontPage_Form1.wphone2.value;
	if((val.length)== 4)
	document.FrontPage_Form1.fax.focus();
}


function junpseven(){
	var val = "";
	val = document.FrontPage_Form1.fax.value;
	if((val.length)== 3)
	document.FrontPage_Form1.fax1.focus();
}
function junpeight(){
	var val = "";
	val = document.FrontPage_Form1.fax1.value;
	if((val.length)== 3)
	document.FrontPage_Form1.fax2.focus();
	
}
function junpnine(){
var val = "";
	val = document.FrontPage_Form1.fax2.value;
	if((val.length)== 4)
	document.FrontPage_Form1.email.focus();}


function FrontPage_Form1_Validator(theForm)
{
  if (theForm.fname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.fname.focus();
    return (false);
  }

  if (theForm.fname.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"First Name\" field.");
    theForm.fname.focus();
    return (false);
  }

  if (theForm.fname.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"First Name\" field.");
    theForm.fname.focus();
    return (false);
  }


 if (theForm.lname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.lname.focus();
    return (false);
  }

  if (theForm.lname.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Last Name\" field.");
    theForm.lname.focus();
    return (false);
  }

  if (theForm.lname.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Last Name\" field.");
    theForm.lname.focus();
    return (false);
  }
  
  ///////////////////////////////////////////////////////////////////////////
  if (theForm.add1.value == "")
  {
    alert("Please enter a value for the \"Address \" field.");
    theForm.add1.focus();
    return (false);
  }

  if (theForm.add1.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Address\" field.");
    theForm.add1.focus();
    return (false);
  }

  if (theForm.add1.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Address \" field.");
    theForm.add1.focus();
    return (false);
  }


 
   if (theForm.city.value == "")
  {
    alert("Please enter a value for the \"City \" field.");
    theForm.city.focus();
    return (false);
  }

  if (theForm.city.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"City\" field.");
    theForm.city.focus();
    return (false);
  }

  if (theForm.city.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"City\" field.");
    theForm.city.focus();
    return (false);
  }


 if (theForm.Province.value == "")
  {
    alert("Please enter a value for the \"State \" field.");
    theForm.Province.focus();
    return (false);
  }

  if (theForm.Province.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"State\" field.");
    theForm.Province.focus();
    return (false);
  }

  if (theForm.Province.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"State\" field.");
    theForm.Province.focus();
    return (false);
  }
  
 
  if (theForm.zip.value == "")
  {
    alert("Please enter a value for the \"zip\" field.");
    theForm.zip.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.zip.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"zip\" field.");
    theForm.zip.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \"zip\" field.");
    theForm.zip.focus();
    return (false);
  }
 
 
   if (theForm.hp.value==""){

alert ("Please enter  the value for the \" Home Phone \" Field");
theForm.hp.focus();
return false;
}


 var checkOK = "0123456789";
  var checkStr = theForm.hp.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Home Phone\" field.");
    theForm.hp.focus();
    return (false);
  }


  if (theForm.hp.value.length < 3)
  {
    alert("Please enter at most 3 characters in the \"Home Phone\" field.");
    theForm.hp.focus();
    return (false);
  }
  /////////////////

   if (theForm.hp1.value==""){

alert ("Please enter  the value for the \" Home Phone \" Field");
theForm.hp1.focus();
return false;
}


 var checkOK = "0123456789";
  var checkStr = theForm.hp1.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Home Phone\" field.");
    theForm.hp1.focus();
    return (false);
  }


  if (theForm.hp1.value.length < 3)
  {
    alert("Please enter at most 3 characters in the \"Home Phone\" field.");
    theForm.hp1.focus();
    return (false);
  }


//////////////////////////////////////
 if (theForm.hp2.value==""){

alert ("Please enter  the value for the \" Home Phone \" Field");
theForm.hp2.focus();
return false;
}


 var checkOK = "0123456789";
  var checkStr = theForm.hp2.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Home Phone\" field.");
    theForm.hp2.focus();
    return (false);
  }
  
  if (theForm.hp2.value.length < 4)
  {
    alert("Please enter at most 3 characters in the \"Home Phone\" field.");
    theForm.hp2.focus();
    return (false);
  }

   ////////////////////////////////////////
 var checkOK = "0123456789";
  var checkStr = theForm.wphone.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Work Phone\" field.");
    theForm.wphone.focus();
    return (false);
  }

 

   var checkOK = "0123456789";
  var checkStr = theForm.wphone1.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Work Phone\" field.");
    theForm.wphone1.focus();
    return (false);
  }



 var checkOK = "0123456789";
  var checkStr = theForm.wphone2.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Work Phone\" field.");
    theForm.wphone2.focus();
    return (false);
  }
 
 var checkOK = "0123456789";
  var checkStr = theForm.fax.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Fax\" field.");
    theForm.fax.focus();
    return (false);
  }


 
 var checkOK = "0123456789";
  var checkStr = theForm.fax1.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Fax\" field.");
    theForm.fax1.focus();
    return (false);
  }




var checkOK = "0123456789";
  var checkStr = theForm.fax2.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only Digit characters in the \"Fax\" field.");
    theForm.fax2.focus();
    return (false);
  }
 
 
 /////////////////////////////////

  
    if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }  	

    if (theForm.comments.value == "")
  {
    alert("Please enter a value for the \"comments\" field.");
    theForm.comments.focus();
    return (false);
  }  	

if (theForm.comments.value.length > 400)
  {
    alert("Please enter at most 400 characters in the \"comments\" field.");
    theForm.comments.focus();
    return (false);
  }
  
  }


  
//-->