<!-- 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("Ths username contains invalid characters.");
		return false;
	   }
}
for (i=0; i<domain.length; i++) {
	if (domain.charCodeAt(i)>127) {
		alert("Ths 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;
}

return true;
}

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.country.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.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }
  
  
  
if (theForm.hp.value==""){

alert ("Please enter  the value for the \" Home Phone \" Field");
theForm.hp.focus();
return false;
}

     if (theForm.company.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    theForm.company.focus();
    return (false);
  }
  
  
  
     if (theForm.Industry.selectedIndex == 0)
  {
    alert("Please Select the \"Industry\" .");
    theForm.Industry.focus();
	return (false);
	
  }
  
  
      if (theForm.Level.selectedIndex == 0)
  {
		alert("Please Select the \"LeveL\" .");
		theForm.Level.focus();
		return (false);
	
  }


      if (theForm.jobtitle.value == "")
  {
		alert("Please Select the \"Job Title\" .");
		theForm.jobtitle.focus();
		return (false);
  }
  
  
  
       if (theForm.relate.selectedIndex == 0)
  {
    
	alert ("Please enter  the value for the \" Relationship \" Field");
    theForm.relate.focus();
	return (false);
	
  }
  
  
       if (theForm.RoleInDecisionMake.selectedIndex == 0)
  {

	alert ("Please enter  the value for the \" Role \" Field");
    theForm.RoleInDecisionMake.focus();
	return (false);
	
  }
  
         if (theForm.businessneedDesc.value == "")
  {
       alert("Please Select the \"Business need Description\" . Field");
    theForm.businessneedDesc.focus();
	return (false);
	
  }
  

  
         if (theForm.businessneedDesc.selectedIndex == 0)
  {

	alert("Please Select the \"Business need Description\" . Field");
	
    theForm.businessneedDesc.focus();
    return (false);
  }

       if (theForm.BudgetInfo.selectedIndex == 0)
  {

	alert("Please Select the \"Budget Information\" . Field");
    theForm.BudgetInfo.focus();
    return (false);
  }
  
         if (theForm.EstimatedBudget.selectedIndex == 0)
  {
		alert("Please Select the \"Estimated Budget\" . Field");
    theForm.EstimatedBudget.focus();
    return (false);
  }
 
       
     if (theForm. PlanProject.selectedIndex == 0)
  {
   
	alert("Please Select the \"Plan to Begin the Project\" . Field");
    theForm.PlanProject.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);
  }

    

  
  return (true);
}
//-->