<!-- Begin

//Hides all status bar messages
	function hidestatus(){
	window.status=''
	return true
	}
	if (document.layers)
	document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
	document.onmouseover=hidestatus
	document.onmouseout=hidestatus
//

//Ignore Spaces
function ignoreSpaces(string) {
var temp = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
temp += splitstring[i];
return temp;
}

//No apostrophe ( ' )
function no_apostrophe(o,w){
  o.value = o.value.replace("'",'');
}	
	
//Physical to Mailing Address 
	<!-- Begin
	var mailAdd1 = "";
	//var mailAdd2 = "";
	var mailCity = "";
	var mailState = "";
	var mailZip = "";
		
	function InitSaveVariables(form) {
	mailAdd1 = form.mailAdd1.value;
	//mailAdd2 = form.mailAdd2.value;
	mailCity = form.mailCity.value;
	mailState = form.mailState.value;
	mailZip = form.mailZip.value;
	}
	
	function PhysicalToMailing(form) {
	if (form.mailAddChk.checked) {
	InitSaveVariables(form);
	form.mailAdd1.value = form.PhysicalAddress1.value;
	//form.mailAdd2.value = form.PhysicalAddress2.value;
	form.mailCity.value = form.PhysicalCity.value;
	form.mailState.value = form.PhysicalState.value;
	form.mailZip.value = form.PhysicalZip.value;
	}
	else {
	form.mailAdd1.value = mailAdd1;
	//form.mailAdd2.value = mailAdd2;
	form.mailCity.value = mailCity;
	form.mailState.value = mailState;
	form.mailZip.value = mailZip;
	   }
	}
	//  End -->

//validate integer numbers are added in a box
	var r={
	  'special':/[\W]/g,
	  'quotes':/['\''&'\"']/g,
	  'notnumbers':/[^\d]/g
	}	
	function valid(o,w){
	  o.value = o.value.replace(r[w],'');
	}	

//Limit characters in text box
	function getObject(obj) {
	  var theObj;
	  if(document.all) {
		if(typeof obj=="string") {
		  return document.all(obj);
		} else {
		  return obj.style;
		}
	  }
	  if(document.getElementById) {
		if(typeof obj=="string") {
		  return document.getElementById(obj);
		} else {
		  return obj.style;
		}
	  }
	  return null;
	}
	//Contador de caracteres.
	function Contar(entrada,salida,texto,caracteres) {
	  var entradaObj=getObject(entrada);
	  var salidaObj=getObject(salida);
	  var longitud=caracteres - entradaObj.value.length;
	  if(longitud <= 0) {
		longitud=0;
		texto='<span class="disable"> '+texto+' </span>';
		entradaObj.value=entradaObj.value.substr(0,caracteres);
	  }
	  salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
	}
	function Contar1(entrada,salida,texto,caracteres) {
	  var entradaObj=getObject(entrada);
	  var salidaObj=getObject(salida);
	  var longitud=caracteres - entradaObj.value.length;
	  if(longitud <= 0) {
		longitud=0;
		texto='<span class="disable"> '+texto+' </span>';
		entradaObj.value=entradaObj.value.substr(0,caracteres);
	  }
	  salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
	}
//


function admin_add() {
	var themessage = "You are required to complete the following fields: ";	
	if (document.form.email.value=="") {
	themessage = themessage + " \n E-mail";
	}
	if (document.form.password.value=="") {
	themessage = themessage + " \n Password";
	}	
	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following fields: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}


function admin_edit() {
	var themessage = "You are required to complete the following fields: ";	
	if (document.form.email.value=="") {
	themessage = themessage + " \n E-mail";
	}
	if (document.form.password.value=="") {
	themessage = themessage + " \n Password";
	}
	if (document.form.verpassword.value=="") {
	themessage = themessage + " \n VerifyPassword";
	}	
	
	pw1 = form.password.value;
	pw2 = form.verpassword.value;	
	if (pw1 != pw2) {
	themessage = themessage +" \n Passwords must match in both fields.";
	}
	
	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following fields: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   	
	
}

function admin_pricing() {
	var themessage = "You are required to complete the following fields: ";	
	if (document.form.application.value=="") {
	themessage = themessage + " \n Application";
	}
	if (document.form.list_purchase.value=="") {
	themessage = themessage + " \n List Purchase";
	}	
	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following fields: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}

function admin_email() {
	var themessage = "You are required to complete the following fields: ";	
	if (document.form.subject.value=="") {
	themessage = themessage + " \n Subject";
	}
	if (document.form.sender_name.value=="") {
	themessage = themessage + " \n Senders Name";
	}	
	if (document.form.sender_email.value=="") {
	themessage = themessage + " \n Senders Email";
	}
	if (document.form.message.value=="") {
	themessage = themessage + " \n Message";
	}	
	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following fields: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}

function admin_forgot_password() {
	var themessage = "You are required to complete the following fields: ";	
	if (document.form.email.value=="") {
	themessage = themessage + " \n Email Address";
	}
	if (document.form.fein.value=="") {
	themessage = themessage + " \n FEIN #";
	}
	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following fields: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}

function admin_add_member() {
	var themessage = "You are required to complete the following fields: ";	
	if (document.form.email.value=="") {
	themessage = themessage + " \n Email";
	}
	if (document.form.fname.value=="") {
	themessage = themessage + " \n First Name";
	}	
	if (document.form.lname.value=="") {
	themessage = themessage + " \n Last Name";
	}
	if (document.form.company.value=="") {
	themessage = themessage + " \n Company";
	}		
	if (document.form.address1.value=="") {
	themessage = themessage + " \n Address 1";
	}	
	/*if (document.form.address2.value=="") {
	themessage = themessage + " \n Address 2";
	}*/
	if (document.form.city.value=="") {
	themessage = themessage + " \n City";
	}	
	if (document.form.state.value=="") {
	themessage = themessage + " \n State";
	}
	if (document.form.zip.value=="") {
	themessage = themessage + " \n Zip Code";
	}	
	if (document.form.phone.value=="") {
	themessage = themessage + " \n Phone";
	}
	if (document.form.county.value=="") {
	themessage = themessage + " \n County";
	}	

	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following fields: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}

function user_register() {
	var themessage = "You are required to complete the following fields: ";	
	if (document.form.email.value=="") {
	themessage = themessage + " \n Email";
	}
	if (document.form.fname.value=="") {
	themessage = themessage + " \n First Name";
	}	
	if (document.form.lname.value=="") {
	themessage = themessage + " \n Last Name";
	}
	if (document.form.company.value=="") {
	themessage = themessage + " \n Company";
	}	
	
	if (document.form.fein.value=="") {
	themessage = themessage + " \n FEIN";
	}
	else if(document.form.fein.value.length != 9) {
	themessage = themessage + " \n Invalid FEIN";
	}
	if (document.form.userid.value=="") {
	themessage = themessage + " \n User ID";
	}	
	if (document.form.password.value=="") {
	themessage = themessage + " \n Password";
	}
	if (document.form.address1.value=="") {
	themessage = themessage + " \n Address 1";
	}	
	//if (document.form.address2.value=="") {
	//themessage = themessage + " \n Address 2";
	//}
	if (document.form.city.value=="") {
	themessage = themessage + " \n City";
	}	
	if (document.form.state.value=="") {
	themessage = themessage + " \n State";
	}
	if (document.form.zip.value=="") {
	themessage = themessage + " \n Zip Code";
	}	
	if (document.form.phone.value=="") {
	themessage = themessage + " \n Phone";
	}
	if (document.form.county.value=="") {
	themessage = themessage + " \n County";
	}	

	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following fields: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}

function admin_login() {
	var themessage = "You are required to complete the following field: ";	
	if (document.form.userid.value=="") {
	themessage = themessage + " \n User ID";
	}	
	if (document.form.password.value=="") {
	themessage = themessage + " \n Password";
	}	
	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following field: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}


function user_application() {
	var themessage = "You are required to complete the following field: ";	
	
	//if (document.form.mailAddChk.checked==true) {}else{
		if (document.form.mailAdd1.value=="") {
		themessage = themessage + " \n Address";
		}	
		if (document.form.mailCity.value=="") {
		themessage = themessage + " \n City";
		}	
		if (document.form.mailState.value=="") {
		themessage = themessage + " \n State";
		}	
		if (document.form.mailZip.value=="") {
		themessage = themessage + " \n Zip";
		}	
	//}	

	if (document.form.mailEmpNum.value=="") {
	themessage = themessage + " \n No. of Employees";
	}	
	if (document.form.mailBusiness.value=="") {
	themessage = themessage + " \n Type of Business";
	}	

	var radio_choice = false;
	if ( (document.form.C[0].checked) || (document.form.C[1].checked) || (document.form.C[2].checked) ){
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	themessage = themessage + " \n How is your company insured for workers' compensation?";
	}

	var radio_choice = false;
	if ( (document.form.labCert[0].checked) || (document.form.labCert[1].checked) || (document.form.labCert[2].checked) ){
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	themessage = themessage + " \n Certification of Laboratory";
	}

	/*var radio_choice = false;
	if ( (document.form.four_a[0].checked) || (document.form.four_a[1].checked) || (document.form.four_a[2].checked) ){	
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	themessage = themessage + " \n Employee Education Required for Certification";
	}*/
	
	//document.form.four_a.checked!=true ||
	if (document.form.one_a.checked!=true || document.form.one_b.checked!=true || document.form.one_c.checked!=true ||
		document.form.one_d.checked!=true || document.form.one_e.checked!=true || document.form.one_f.checked!=true ||
		document.form.one_g.checked!=true || document.form.one_i.checked!=true ||
		document.form.one_j.checked!=true || document.form.one_k.checked!=true || document.form.one_l.checked!=true ||
		document.form.two_a1.checked!=true || document.form.two_a2.checked!=true || document.form.two_a3.checked!=true ||
		document.form.two_b1.checked!=true || document.form.two_b2.checked!=true ||
		document.form.two_b3.checked!=true || document.form.three_a.checked!=true ||
		document.form.four_a.checked!=true ||
		document.form.five_a.checked!=true || document.form.five_b.checked!=true || document.form.six_a.checked!=true 
		) {
		themessage = themessage + " \n All check boxes / radio buttons having * are mandatory";	
	}

	if (document.form.labName.value=="") {
	themessage = themessage + " \n Laboratory Name";
	}	
	if (document.form.labAddress1.value=="") {
	themessage = themessage + " \n Laboratory Address";
	}	
	if (document.form.labCity.value=="") {
	themessage = themessage + " \n Laboratory City";
	}	
	if (document.form.labState.value=="") {
	themessage = themessage + " \n Laboratory State";
	}	
	if (document.form.labZip.value=="") {
	themessage = themessage + " \n Laboratory Zip";
	}	
	if (document.form.emp_name.value=="") {
	themessage = themessage + " \n Employer Name";
	}	
	if (document.form.title.value=="") {
	themessage = themessage + " \n Name & Title";
	}	
	//if (document.form.date.value=="") {
	//themessage = themessage + " \n Date";
	//}	
	if (document.form.sign.value=="") {
	themessage = themessage + " \n Officer/Owner Signature";
	}	

	var radio_choice = false;
	if ( (document.form.acceptDecline[0].checked) || (document.form.acceptDecline[1].checked) ){
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	themessage = themessage + " \n Accept / Decline ";
	}

	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following field: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}

function disclaimer(){
	var themessage = "You are required to complete the following field: ";	
	
	var radio_choice = false;
	if ( (document.form.acceptDecline[0].checked) || (document.form.acceptDecline[1].checked) ){
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	themessage = themessage + " \n Select an option";
	}
	
	/*
	//only works in IE and not in FireFox
	var radio_choice = false;
	for (counter = 0; counter < form.acceptDecline.length; counter++)
	{
	if (form.acceptDecline[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	themessage = themessage + " \n Please select Accept or Decline.";
	}*/
	
	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following field: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   	
}

function payment() {
	var themessage = "You are required to complete the following fields: ";	
	if (document.form.fname.value=="") {
	themessage = themessage + " \n First Name";
	}	
	if (document.form.lname.value=="") {
	themessage = themessage + " \n Last Name";
	}
	if (document.form.company.value=="") {
	themessage = themessage + " \n Company";
	}			
	if (document.form.addr1.value=="") {
	themessage = themessage + " \n Address 1";
	}	
	//if (document.form.addr2.value=="") {
	//themessage = themessage + " \n Address 2";
	//}
	if (document.form.city.value=="") {
	themessage = themessage + " \n City";
	}	
	if (document.form.state.value=="") {
	themessage = themessage + " \n State";
	}
	if (document.form.zip.value=="") {
	themessage = themessage + " \n Zip Code";
	}	
	if (document.form.phone.value=="") {
	themessage = themessage + " \n Phone";
	}
	if (document.form.email.value=="") {
	themessage = themessage + " \n Email";
	}	

	if (document.form.card_type.value=="") {
	themessage = themessage + " \n Card Type";
	}
	if (document.form.card_number.value=="") {
	themessage = themessage + " \n Card Number";
	}	
	if (document.form.card_ver_code.value=="") {
	themessage = themessage + " \n Card Verification Code";
	}
	if (document.form.card_exp_date.value=="") {
	themessage = themessage + " \n Card Expiry Date";
	}	
	//alert if fields are empty and cancel form submit
	if (themessage == "You are required to complete the following fields: ") {
	document.form.submit();
	}
	else {
	alert(themessage);
	return false;
	}   
}


<!---Character Limit control starts-->
	function getObject(obj) {
	  var theObj;
	  if(document.all) {
		if(typeof obj=="string") {
		  return document.all(obj);
		} else {
		  return obj.style;
		}
	  }
	  if(document.getElementById) {
		if(typeof obj=="string") {
		  return document.getElementById(obj);
		} else {
		  return obj.style;
		}
	  }
	  return null;
	}
	//Contador de caracteres.
	function Contar(entrada,salida,texto,caracteres) {
	  var entradaObj=getObject(entrada);
	  var salidaObj=getObject(salida);
	  var longitud=caracteres - entradaObj.value.length;
	  if(longitud <= 0) {
		longitud=0;
		texto='<span class="disable"> '+texto+' </span>';
		entradaObj.value=entradaObj.value.substr(0,caracteres);
	  }
	  salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
	}
<!---Character Limit control ends-->


<!-- Begin emailCheck
function emailCheck (emailStr) {
//onChange="emailCheck(this.email.value)"

/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=1;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/

var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Finally, let's start trying to figure out if the supplied address is valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

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;
   }
}

// See if "user" is valid 

if (user.match(userPat)==null) {

// user is not valid

alert("The username doesn't seem to be valid.");
return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

// this is an IP address

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
   }
}
return true;
}

// Domain is symbolic name.  Check if it's valid.
 
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;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

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;
}

// Make sure there's a host name preceding the domain.

if (len<2) {
alert("This address is missing a hostname!");
return false;
}

// If we've gotten this far, everything's valid!
return true;
}
<!-- ends emailCheck




//  End -->
