<!--
var newLine = null;

if (navigator.appVersion.lastIndexOf("Win") != -1) {
	newLine = "\r\n";
}
else {
	newLine = "\n";
}

var digits = "0123456789";
var lowercaseLetters = "abcdefghijklmnopqrstuvwxyz";
var uppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var whitespace = " \t\n\r";
var phoneNumberDelimiters = "()-. ";
var validUSPhoneChars = digits + phoneNumberDelimiters;
var validWorldPhoneChars = digits + phoneNumberDelimiters + "+";
var digitsInUSPhoneNumber = 10;

var reWhitespace = /^\s+$/;
var reLetter = /^[a-zA-Z]$/;
var reAlphabetic = /^[a-zA-Z]+$/;
var reAlphanumeric = /^[a-zA-Z0-9]+$/;
var reDigit = /^\d/;
var reLetterOrDigit = /^([a-zA-Z]|\d)$/;
var reInteger = /^\d+$/;
var reSignedInteger = /^(\+|-)?\d+$/;

var reFirstName = /^[A-Za-z'\s]{1,50}$/;
var reLastName = /^[A-Za-z\,\'\-\s\.]{1,50}$/;
var reJobTitle = /^[A-Za-z\,\'\-\s\.]{1,100}$/;
var reCompanyName = /^[A-Za-z0-9'\-\.\,\s]{1,160}$/;
var reAddress = /^[A-Za-z0-9'\-\.\,\s]{1,50}$/;
var reCity = /^[A-Za-z'\-\.\s]{1,50}$/;
var reStateOrProvince = /^[A-Za-z\,\'\-\.\s]{1,50}$/;
var reProductInterest = /^[A-Za-z\,\'\-\.\s]{1,50}$/;
var reZipCode = /^[A-Za-z0-9\-\s]{3,11}$/;
var reEmail = /^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/;
//var rePhone = /^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/
var rePhone = /^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})$/;
var	reAPV = /^[1-9]{1}\d{0,9}$/;
var	reNOP = /^[1-9]{1}\d{0,9}$/;
var	reComments = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\,\.\/\?\;\:\'\"\\\-\_\=\+\s]{0,2000}$/;

var sExistingCustomer = "Are you an existing T-System customer?";
var sSalutation = "Salutation";
var sFirstName = "First Name";
var sLastName = "Last Name";
var sJobTitle = "Job Title";
var sCompanyName = "Company/Facility Name";
var sAddress1 = "Address 1";
var sAddress2 = "Address 2";
var sCity = "City";
var sStateOrProvince = "State/Province";
var sCountry = "Country/Region";
var sZipCode = "Zip/Postal Code";
var sPhone = "Phone Number";
var sEmail = "E-mail Address";
var sProdInterest = "Product Interest";
var sAPV = "Annual Patient Volume";
var sNOP = "Number of Providers";
var sComments = "Comments";
var sProductInterest = "Products of Interest";

var hFirstName = '[Field]' + newLine + 'First Name' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, the apostrophe and space.' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hLastName = '[Field]' + newLine + 'Last Name' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, the comma, apostrophe, dash, period, and space.' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hJobTitle = '[Field]' + newLine + 'JobTitle' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, the comma, apostrophe, dash, period, and space.' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hCompanyName = '[Field]' + newLine + 'Company/Facility' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, 0-9, the comma, apostrophe, dash, period, and space.' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hAddress1 = '[Field]' + newLine + 'Address 1' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, 0-9, the comma, apostrophe, dash, period, and space.' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hAddress2 = '[Field]' + newLine + 'Address 2' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, 0-9, the comma, apostrophe, dash, period, and space.' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'No';
var hCity = '[Field]' + newLine + 'City' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, the apostrophe, dash, period, and space.' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hStateOrProvince = '[Field]' + newLine + 'State/Province' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, the comma, apostrophe, dash, period, and ' + 'space.' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hZipCode = '[Field]' + newLine + 'Zip/Postal Code' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, 0-9, the dash, and space.' + newLine + newLine + '[Max Length]' + newLine + '11' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hUSPhone = '[Field]' + newLine + 'US Phone Number' + newLine + newLine + '[Characters Allowed]' + newLine + '0-9, the parenthesis, dash, period, and space.' + newLine + newLine + '[Required]' + newLine + 'Yes' + newLine + newLine + '[Example]' + newLine + '(555) 555-5555';
var hAUPhone = '[Field]' + newLine + 'AU Phone Number' + newLine + newLine + '[Characters Allowed]' + newLine + '0-9, the parenthesis, dash, period, and space.' + newLine + newLine + '[Required]' + newLine + 'Yes' + newLine + newLine + '[Example]' + newLine + '(5) 5555-5555 or (55) 5555-5555';
var hWorldPhone = '[Field]' + newLine + 'World Phone Number' + newLine + newLine + '[Characters Allowed]' + newLine + '0-9 and the plus sign (+).' + newLine + newLine + '[Required]' + newLine + 'Yes' + newLine + newLine + '[Example]' + newLine + '2 acceptable formats (both no spaces):' + newLine + newLine + '+5555555555555 (plus sign followed by country code, area code, and number)' + newLine + newLine + '5555555555555 (country code and/or area code and number)';
var hEmail = '[Field]' + newLine + 'E-mail Address' + newLine + newLine + '[Max Length]' + newLine + '50' + newLine + newLine + '[Required]' + newLine + 'Yes';
var hAPV = '[Field]' + newLine + 'Annual Patient Volume' + newLine + newLine + '[Characters Allowed]' + newLine + '0-9' + newLine + newLine + '[Max Length]' + newLine + '10' + newLine + newLine + '[Required]' + newLine + 'No' + newLine + newLine + '[Example]' + newLine + 'Allowed: 5' + newLine + 'Allowed: 55555' + newLine + 'Not Allowed: 05' + newLine + 'Not Allowed: 55,555' + newLine + 'If you are trying to enter 0, just leave the field blank';
var hNOP = '[Field]' + newLine + 'Number Of Providers' + newLine + newLine + '[Characters Allowed]' + newLine + '0-9' + newLine + newLine + '[Max Length]' + newLine + '10' + newLine + newLine + '[Required]' + newLine + 'No' + newLine + newLine + '[Example]' + newLine + 'Allowed: 5' + newLine + 'Allowed: 55555' + newLine + 'Not Allowed: 05' + newLine + 'Not Allowed: 55,555' + newLine + 'If you are trying to enter 0, just leave the field blank';
var hComments = '[Field]' + newLine + 'Comments' + newLine + newLine + '[Characters Allowed]' + newLine + 'A-Z, 0-9, `~!@#$%^&*(),./?;:\'"\\-_=+' + newLine + newLine + '[Max Length]' + newLine + '2000' + newLine + newLine + '[Required]' + newLine + 'No';

var pEntryPrompt = "Please enter a value for ";
var pEntryPromptDD = "Please select ";

var mSuffix = " field is a required field." + newLine;
var iSuffix = " field is invalid." + newLine;
var vSuffix = " If you need help with an invalid field, click the help icon to view its detailed information."

var defaultEmptyOK = false;

function makeArray(n) {
   for (var i = 1; i <= n; i++) {
      this[i] = 0;
   } 
   return this;
}

function isEmpty(s)
{   return ((s == null) || (s.length == 0));
}

function isWhitespace (s)

{   // Is s empty?
    return (isEmpty(s) || reWhitespace.test(s));
}

function stripCharsInRE (s, bag)

{       return s.replace(bag, "");
}

function stripCharsInBag (s, bag)

{   var i;
    var returnString = "";

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }

    return returnString;
}


function stripCharsNotInBag (s, bag)

{   var i;
    var returnString = "";

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) != -1) returnString += c;
    }

    return returnString;
}

function stripWhitespace (s)

{   return stripCharsInBag (s, whitespace);
}

function charInString (c, s)
{   for (i = 0; i < s.length; i++)
    {   if (s.charAt(i) == c) return true;
    }
    return false;
}

function stripInitialWhitespace (s)

{   var i = 0;

    while ((i < s.length) && charInString (s.charAt(i), whitespace))
       i++;
    
    return s.substring (i, s.length);
}

function isLetter (c)
{   return reLetter.test(c);
}

function isDigit (c)
{   return reDigit.test(c);
}

function isLetterOrDigit (c)
{   return reLetterOrDigit.test(c);
}

function isInteger (s)

{   var i;

    if (isEmpty(s)) {
		if (isInteger.arguments.length == 1) 
			return defaultEmptyOK;
		else 
			return (isInteger.arguments[1] == true);
	} 
	else
		return reInteger.test(s);
}

function isSignedInteger (s)

{   if (isEmpty(s)) {
		if (isSignedInteger.arguments.length == 1)
			return defaultEmptyOK;
		else 
			return (isSignedInteger.arguments[1] == true);
	}
    else 
       return reSignedInteger.test(s);
}

function isPositiveInteger (s)
{   var secondArg = defaultEmptyOK;

    if (isPositiveInteger.arguments.length > 1)
        secondArg = isPositiveInteger.arguments[1];
	
    return (isSignedInteger(s, secondArg)
         && ( (isEmpty(s) && secondArg)  || (parseInt (s) > 0) ) );
}

function isAlphabetic (s)

{   var i;

    if (isEmpty(s)) 
       if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;
       else return (isAlphabetic.arguments[1] == true);

    else {
       return reAlphabetic.test(s);
    }
}

function isAlphanumeric (s)

{   var i;

    if (isEmpty(s)) 
       if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;
       else return (isAlphanumeric.arguments[1] == true);

    else {
       return reAlphanumeric.test(s);
    }
}

function reformat (s)

{   var arg;
    var sPos = 0;
    var resultString = "";

    for (var i = 1; i < reformat.arguments.length; i++) {
       arg = reformat.arguments[i];
       if (i % 2 == 1) resultString += arg;
       else {
           resultString += s.substring(sPos, sPos + arg);
           sPos += arg;
       }
    }
    return resultString;
}

function isUSPhoneNumber (s)
{   if (isEmpty(s)) 
       if (isUSPhoneNumber.arguments.length == 1) return defaultEmptyOK;
       else return (isUSPhoneNumber.arguments[1] == true);
    return (isInteger(s) && s.length == digitsInUSPhoneNumber && s.charAt(0) != "0");
}

function isAUPhoneNumber (s)
{   if (isEmpty(s)) 
       if (isAUPhoneNumber.arguments.length == 1) return defaultEmptyOK;
       else return (isAUPhoneNumber.arguments[1] == true);
    return (isInteger(s) && ((s.length == 9) || ((s.length == 10) && (s.charAt(0) == "0"))));
}

function isInternationalPhoneNumber (s)
{   if (isEmpty(s)) 
       if (isInternationalPhoneNumber.arguments.length == 1) return defaultEmptyOK;
       else return (isInternationalPhoneNumber.arguments[1] == true);
    return (isPositiveInteger(s));
}

function checkString (theField, s, emptyOK)
{   // Next line is needed on NN3 to avoid "undefined is not a number" error
    // in equality comparison below.
    if (checkString.arguments.length == 2) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    if (isWhitespace(theField.value)) 
       return warnEmpty (theField, s);
    else return true;
}

function reformatUSPhone (USPhone)
{   return (reformat (USPhone, "(", 3, ") ", 3, "-", 4));
}

function checkUSPhone (theField, emptyOK)
{   if (checkUSPhone.arguments.length == 1) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    else
    {  var normalizedPhone = stripCharsInBag(theField.value, phoneNumberDelimiters)
       if (!isUSPhoneNumber(normalizedPhone, false)) 
          return false;
       else 
       {  // if you don't want to reformat as (123) 456-7890, comment next line out
          theField.value = reformatUSPhone(normalizedPhone);
          return true;
       }
    }
}

function reformatAUPhone (AUPhone)
{   if ((AUPhone.length == 10) && (AUPhone.charAt(0) == "0"))
		AUPhone = AUPhone.substring(1);
	return (reformat(AUPhone, "(", 1, ") ", 4, "-", 4));
}

function checkAUPhone (theField, emptyOK)
{   if (checkAUPhone.arguments.length == 1) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    else
    {  var normalizedPhone = stripCharsInBag(theField.value, phoneNumberDelimiters)
       if (!isAUPhoneNumber(normalizedPhone, false)) 
          return false;
       else 
       {  // if you don't want to reformat as (1) 2345-6789, comment next line out
          theField.value = reformatAUPhone(normalizedPhone);
          return true;
       }
    }
}

function checkInternationalPhone (theField, emptyOK)
{   if (checkInternationalPhone.arguments.length == 1) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    else
    {  if (!isInternationalPhoneNumber(theField.value, false)) 
          return false;
       else return true;
    }
}

function prompt (s)
{   window.status = s;
}

function statusOff ()
{   window.status = "";
}

function promptEntry (s)
	
{   

window.status = pEntryPrompt + s;
}

function promptEntryDD (s)
{   window.status = pEntryPromptDD + s;
}

function warnInvalid (id)
{   var regAlertMsg = "";

	switch (id) {
		case "txtFirstName":
			regAlertMsg = hFirstName;
			break;
		case "txtLastName":
			regAlertMsg = hLastName;
			break;
		case "txtJobTitle":
			regAlertMsg = hJobTitle;
			break;
		case "txtCompanyName":
			regAlertMsg = hCompanyName;
			break;
 		case "txtAddress1":
 			regAlertMsg = hAddress1;
 			break;
 		case "txtAddress2":
 			regAlertMsg = hAddress2;
 			break;
 		case "txtCity":
 			regAlertMsg = hCity;
 			break;
 		case "txtStateOrProvince":
 			regAlertMsg = hStateOrProvince;
 			break;
 		case "txtZipCode":
 			regAlertMsg = hZipCode;
 			break;
 		case "txtPhone":
 			switch (warnInvalid.arguments[1]) {
 				case "US":
 					regAlertMsg = hUSPhone;
 					break;
 				case "AU":
 					regAlertMsg = hAUPhone;
 					break;
 				default:
 					regAlertMsg = hWorldPhone;
 					break;
 			}
 			break;
 		case "txtEmail":
 			regAlertMsg = hEmail;
 			break;
 		case "txtComments":
 			regAlertMsg = hComments;
 			break;
 		case "txtAPV":
 			regAlertMsg = hAPV;
 			break;
 		case "txtNOP":
 			regAlertMsg = hNOP;
 			break;
		default:
			break;
	}
	
	var theField = document.getElementById(id);
	
	if (theField){
		theField.focus();
		theField.select();
		alert(regAlertMsg);
    }
    
    return false;
}

// additional-info-sf.aspx
function warnInvalidSf (id)
{   var regAlertMsg = "";
	//alert("Entered warnInvalidSf");
	switch (id) {
		case "first_name":
			regAlertMsg = hFirstName;
			break;
		case "last_name":
			regAlertMsg = hLastName;
			break;
		
		case "company":
			regAlertMsg = hCompanyName;
			break;
 		
 		
 		
 		case "phone":
 				var c = document.getElementById("state");
 				switch(c.value){
 					case "AL", "AK", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY":
 						//alert("WarnInvalidSF US");
 						regAlertMsg = hUSPhone;
 						break;
 					case "INT":
 						//alert("warnInvalidSf.arguments[1]:" + warnInvalidSf.arguments[1])
 						//alert("WarnInvalidSF INT");
 						regAlertMsg = hWorldPhone;
 						break;
 					default:
 						//alert("warnInvalidSf.arguments[1]:" + warnInvalidSf.arguments[1])
 						//alert("WarnInvalidSF default: arguments[1] " + warnInvalidSf.arguments[1]);
 						//alert("state: " + c.value);
 						regAlertMsg = hUSPhone;
 						break;
 						}
 			/*switch (warnInvalidSf.arguments[1]) {
 				case "US":
 					alert("WarnInvalidSF US");
 					regAlertMsg = hUSPhone;
 					break;
 				//case "AU":
 					//regAlertMsg = hAUPhone;
 					//break;
 				case "INT":
 					//alert("warnInvalidSf.arguments[1]:" + warnInvalidSf.arguments[1])
 					alert("WarnInvalidSF INT");
 					regAlertMsg = hWorldPhone;
 					break;
 				default:
 					//alert("warnInvalidSf.arguments[1]:" + warnInvalidSf.arguments[1])
 					alert("WarnInvalidSF default: arguments[1] " + warnInvalidSf.arguments[1]);
 					regAlertMsg = hWorldPhone;
 					break;
 			}*/
 			
 			break;
 		case "email":
 			regAlertMsg = hEmail;
 			break;
 		// APV
 		case "state":
 			regAlertMsg = hStateOrProvince;
 			break;
 		// Is a case statement needed for product interest?
 			
 		case "00N60000001RHXF":
 			regAlertMsg = hAPV;
 			break;
 		
		default:
			break;
	}
	
	var theField = document.getElementById(id);
	
	if (theField){
		theField.focus();
		theField.select();
		alert(regAlertMsg);
    }
    
    return false;
}

// EV-ContactUs.aspx
function warnInvalidEVContact (id)
{   var regAlertMsg = "";
	//alert("Entered warnInvalidSf");
	switch (id) {
		case "first_name":
			regAlertMsg = hFirstName;
			break;
		case "last_name":
			regAlertMsg = hLastName;
			break;
		
		case "company":
			regAlertMsg = hCompanyName;
			break;
 		
 		
 		
 //		case "phone":
 //				var c = document.getElementById("state");
 //				switch(c.value){
 //					case "AL", "AK", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY":
 //						//alert("WarnInvalidSF US");
 //						regAlertMsg = hUSPhone;
 //						break;
 //					case "INT":
 //						//alert("warnInvalidSf.arguments[1]:" + warnInvalidSf.arguments[1])
 						//alert("WarnInvalidSF INT");
 //						regAlertMsg = hWorldPhone;
 //						break;
 //					default:
 						//alert("warnInvalidSf.arguments[1]:" + warnInvalidSf.arguments[1])
 						//alert("WarnInvalidSF default: arguments[1] " + warnInvalidSf.arguments[1]);
 						//alert("state: " + c.value);
 //						regAlertMsg = hUSPhone;
 //						break;
 //						}
 			/*switch (warnInvalidSf.arguments[1]) {
 				case "US":
 					alert("WarnInvalidSF US");
 					regAlertMsg = hUSPhone;
 					break;
 				//case "AU":
 					//regAlertMsg = hAUPhone;
 					//break;
 				case "INT":
 					//alert("warnInvalidSf.arguments[1]:" + warnInvalidSf.arguments[1])
 					alert("WarnInvalidSF INT");
 					regAlertMsg = hWorldPhone;
 					break;
 				default:
 					//alert("warnInvalidSf.arguments[1]:" + warnInvalidSf.arguments[1])
 					alert("WarnInvalidSF default: arguments[1] " + warnInvalidSf.arguments[1]);
 					regAlertMsg = hWorldPhone;
 					break;
 			}*/
 			
 //			break;
 		case "email":
 			regAlertMsg = hEmail;
 			break;
 		// APV
 		case "state":
 			regAlertMsg = hStateOrProvince;
 			break;
 		// Is a case statement needed for product interest?
 			
 		case "00N60000001RHXF":
 			regAlertMsg = hAPV;
 			break;
 		
		default:
			break;
	}
	
	var theField = document.getElementById(id);
	
	if (theField){
		theField.focus();
		theField.select();
		alert(regAlertMsg);
    }
    
    return false;
}

function evUserConfValidation() {
	var total = 0;
	var valSummary = "";
	var products = "";
	
	var elemFirstName = document.getElementById("txtFirstName");
	var elemLastName = document.getElementById("txtLastName");
	var elemJobTitle = document.getElementById("txtJobTitle");
	var elemCompanyName = document.getElementById("txtCompanyName");
	var elemAddress1 = document.getElementById("txtAddress1");
	var elemAddress2 = document.getElementById("txtAddress2");
	var elemCity = document.getElementById("txtCity");
	var elemState = document.getElementById("txtStateOrProvince");
	var elemCountry = document.getElementById("ddlCountry");
	var elemZipCode = document.getElementById("txtZipCode");
	var elemPhone = document.getElementById("txtPhone");
	var elemEmail = document.getElementById("txtEmail");
	var elemComments = document.getElementById("txtComments");
	
	valSummary += validateCtrl(elemFirstName);	
	valSummary += validateCtrl(elemLastName);	
	valSummary += validateCtrl(elemJobTitle);	
	valSummary += validateCtrl(elemCompanyName);	
	valSummary += validateCtrl(elemAddress1);	
	valSummary += validateCtrl(elemAddress2);
	valSummary += validateCtrl(elemCity);	
	valSummary += validateCtrl(elemState);
	valSummary += validateCtrl(elemCountry);	
	valSummary += validateCtrl(elemZipCode);
	valSummary += validateCtrl(elemPhone);	
	valSummary += validateCtrl(elemEmail);
	valSummary += validateCtrl(elemComments);	
	
	if (valSummary != "") {
		valSummary += newLine + newLine + "Please correct all errors and resubmit.";
		if (valSummary.indexOf("invalid") > 0){valSummary += newLine + newLine + vSuffix;}
		valSummary += newLine + newLine + "Thank You.";
		alert(valSummary);
		return false;
	}
	
	return true;
}


// Validate the entries and selections on Additional-info.aspx page

function productValidation() {
	var total = 0;
	var valSummary = "";
	var products = "";
	var salesConsultantYesNo = "";
	var salesConsultantTotal = 0;
	
	var elemFirstName = document.getElementById("txtFirstName");
	var elemLastName = document.getElementById("txtLastName");
	var elemJobTitle = document.getElementById("txtJobTitle");
	var elemCompanyName = document.getElementById("txtCompanyName");
	var elemAddress1 = document.getElementById("txtAddress1");
	var elemAddress2 = document.getElementById("txtAddress2");
	var elemCity = document.getElementById("txtCity");
	var elemState = document.getElementById("txtStateOrProvince");
	var elemCountry = document.getElementById("ddlCountry");
	var elemZipCode = document.getElementById("txtZipCode");
	var elemPhone = document.getElementById("txtPhone");
	var elemEmail = document.getElementById("txtEmail");
	var elemAPV = document.getElementById("txtAPV");
	var elemNOP = document.getElementById("txtNOP");
	var elemComments = document.getElementById("txtComments");
	
	valSummary += validateCtrl(elemFirstName);	
	valSummary += validateCtrl(elemLastName);	
	valSummary += validateCtrl(elemJobTitle);	
	valSummary += validateCtrl(elemCompanyName);	
	valSummary += validateCtrl(elemAddress1);	
	valSummary += validateCtrl(elemAddress2);
	valSummary += validateCtrl(elemCity);	
	valSummary += validateCtrl(elemState);
	valSummary += validateCtrl(elemCountry);	
	valSummary += validateCtrl(elemZipCode);
	valSummary += validateCtrl(elemPhone);	
	valSummary += validateCtrl(elemEmail);
	valSummary += validateCtrl(elemAPV);
	valSummary += validateCtrl(elemNOP);
	valSummary += validateCtrl(elemComments);	
	
	if (document.getElementById("evAutoDemo").checked == true) {
		products += " EV AutoDemo"; 
		total++;
	}
	if (document.getElementById("evWhitePaperEDIS").checked == true) {
		products += " White Paper on EDIS Selection and implementation"; 
		total++;
	}
	if (document.getElementById("evWhitePaperCharting").checked == true) {
		products += " White Paper on Electronic Charting"; 
		total++;
	}
	if (document.getElementById("evSalesConsultantYes").checked == true) {
		salesConsultantYesNo += " Yes";
		salesConsultantTotal++;
	}
	if (document.getElementById("evSalesConsultantNo").checked == true) {
		salesConsultantYesNo += " No";
		salesConsultantTotal++;
	}
	
	if ((total > 0) && (valSummary == "")) {
		//var a = document.getElementById("apv");
		//var n = document.getElementById("nop");
		var s = document.getElementById("subject");
		var a = document.getElementById("txtAPV");
		var n = document.getElementById("txtNOP");
		
		s.value = "Web Request -" + products;
		
		if (a.value == "") a.value=0;
		if (n.value == "") n.value=0;
				
		//if (elemAPV && a)
		//	if (elemAPV.value != "") {a.value = elemAPV.value;}
	
		//if (elemNOP && n)
		//	if (elemNOP.value != "") {n.value = elemNOP.value;}
	}
	else {
		if (total <= 0){valSummary += newLine + "You must select at least 1 option to be contacted about.";}
		if (salesConsultantTotal <= 0){valSummary += newLine + "You must select yes or no for the salesperson.";}
		if (valSummary != "") {
			valSummary += newLine + newLine + "Please correct all errors and resubmit.";
			if (valSummary.indexOf("invalid") > 0){valSummary += newLine + newLine + vSuffix;}
			valSummary += newLine + newLine + "Thank You.";
			alert(valSummary);
		}
		
		return false;
	} //else
	
	return true;
}

// Validate the entries and selections on Additional-info-sf.aspx page
function productValidationEVContact() {
	
	
	
}


// Validate the entries and selections on Additional-info-sf.aspx page
function productValidationSf() {
	
	var valSummary = "";
	var products = "";
	var salesConsultantYesNo = "";
	var salesConsultantTotal = 0;
	
	var elemFirstName = document.getElementById("first_name");
	var elemLastName = document.getElementById("last_name");
	var elemState = document.getElementById("state");
	var elemCompanyName = document.getElementById("company");
	var elemPhone = document.getElementById("phone");
	var elemEmail = document.getElementById("email");
	var elemAPV = document.getElementById("00N60000001RHXF"); // APV
	var elemProductInterest = document.getElementById("00N60000001RHXP"); // Product Interest
	//var elemAPV = document.getElementById("current_apv"); //APV
	
	//alert("entered product validation SF");
	valSummary += "[Field(s)]";
	valSummary += newLine;
	valSummary += validateCtrlSf(elemFirstName);	
	valSummary += validateCtrlSf(elemLastName);	
	valSummary += validateCtrlSf(elemState);
	valSummary += validateCtrlSf(elemCompanyName);	
	valSummary += validateCtrlSf(elemPhone);	
	valSummary += validateCtrlSf(elemEmail);
	valSummary += validateCtrlSf(elemProductInterest);
	valSummary += validateCtrlSf(elemAPV);
	//alert(valSummary);
	
	//if (valSummary != "") {
	if (valSummary != "[Field(s)]" + newLine) {
		valSummary += newLine + newLine + "Please correct all errors and resubmit.";
		if (valSummary.indexOf("invalid") > 0){valSummary += newLine + newLine + vSuffix;}
		valSummary += newLine + newLine + "Thank You.";
		alert(valSummary);
		return false;
	}
	return true;
	
}

// Validate the entries and selections on EVAutoDemo-WhitePapers.aspx page
function evAutoDemoValidation() {
	var total = 0;
	var valSummary = "";
	var products = "";
	
	var elemFirstName = document.getElementById("txtFirstName");
	var elemLastName = document.getElementById("txtLastName");
	var elemJobTitle = document.getElementById("txtJobTitle");
	var elemCompanyName = document.getElementById("txtCompanyName");
	var elemAddress1 = document.getElementById("txtAddress1");
	var elemAddress2 = document.getElementById("txtAddress2");
	var elemCity = document.getElementById("txtCity");
	var elemState = document.getElementById("txtStateOrProvince");
	var elemCountry = document.getElementById("ddlCountry");
	var elemZipCode = document.getElementById("txtZipCode");
	var elemPhone = document.getElementById("txtPhone");
	var elemEmail = document.getElementById("txtEmail");
	var elemAPV = document.getElementById("txtAPV");
	var elemNOP = document.getElementById("txtNOP");
	
	
	valSummary += validateCtrl(elemFirstName);	
	valSummary += validateCtrl(elemLastName);	
	valSummary += validateCtrl(elemJobTitle);	
	valSummary += validateCtrl(elemCompanyName);	
	valSummary += validateCtrl(elemAddress1);	
	valSummary += validateCtrl(elemAddress2);
	valSummary += validateCtrl(elemCity);	
	valSummary += validateCtrl(elemState);
	valSummary += validateCtrl(elemCountry);	
	valSummary += validateCtrl(elemZipCode);
	valSummary += validateCtrl(elemPhone);	
	valSummary += validateCtrl(elemEmail);
	valSummary += validateCtrl(elemAPV);
	valSummary += validateCtrl(elemNOP);
	
	
	if (document.getElementById("evWebExDemo").checked == true) {
		products += " EV WebEx Demo"; 
		total++;
	}
	if (document.getElementById("evProduct").checked == true) {
		products += " EV"; 
		total++;
	}
	if (document.getElementById("nxProduct").checked == true) {
		products += " Pathway Solutions"; 
		total++;
	}
	if (document.getElementById("epProduct").checked == true) {
		products += " EP";
		total++;
	}
	if (document.getElementById("nnProduct").checked == true) {
		products += " NN";
		total++;
	}
	if (document.getElementById("pcProduct").checked == true) {
		products += " PC";
		total++;
	}
	if (document.getElementById("ucProduct").checked == true) {
		products += " UC";
		total++;
	}
	
	if ((total > 0) && (valSummary == "")) {
		//var a = document.getElementById("apv");
		//var n = document.getElementById("nop");
		var s = document.getElementById("subject");
		var a = document.getElementById("txtAPV");
		var n = document.getElementById("txtNOP");
		
		s.value = "Web Request -" + products;
		
		if (a.value == "") a.value=0;
		if (n.value == "") n.value=0;
				
		//if (elemAPV && a)
		//	if (elemAPV.value != "") {a.value = elemAPV.value;}
	
		//if (elemNOP && n)
		//	if (elemNOP.value != "") {n.value = elemNOP.value;}
	}
	else {
		if (total <= 0){valSummary += newLine + "You must select at least 1 option to be contacted about.";}
		if (valSummary != "") {
			valSummary += newLine + newLine + "Please correct all errors and resubmit.";
			if (valSummary.indexOf("invalid") > 0){valSummary += newLine + newLine + vSuffix;}
			valSummary += newLine + newLine + "Thank You.";
			alert(valSummary);
		}
		
		return false;
	}
	
	return true;
}

function resetForm() {
	//alert("entered resetForm");
	for (i = 0; i < document.forms[0].elements.length; i++){
		var elem = document.forms[0].elements[i];
		
		if (elem != null) {
			if (elem.type == "checkbox")
				elem.checked = false;
			else if ((elem.type == "text") || (elem.type == "textarea"))
				elem.value = "";
			else if (elem.type == "select-multiple")
				elem.selectedIndex = -1;
			else if (elem.type == "select-one")
				elem.selectedIndex = 0;
			
			var errName = "error-" + elem.name;
			elemOff(errName);
			
		}
	}
	
	//elemOff("pnlApvNop");
	
	//document.getElementById("sideBar").height = "865px";
}



function elemOff(elemId) {
	var elem = document.getElementById(elemId);
	
	if (elem) {
		elem.className = "panelOff";
		elem.innerHTML = "";
	}
}
// added reset code for radio buttons
// Swamy Pabbisetty
// 5/17/2007

//function resetForm() {
//	for (i = 0; i < document.forms[0].elements.length; i++){
//		var elem = document.forms[0].elements[i];
//		
//		if (elem != null) {
//			if (elem.type == "checkbox")
//				elem.checked = false;
//			else if ((elem.type == "text") || (elem.type == "textarea"))
//				elem.value = "";
//			else if (elem.type == "select")
//				{
//				alert(elem.selectedIndex);
//				elem.selectedIndex = 0;
//				}
//			//else if (elem[i].type== "checked")  
//			//	{
//			//	elem[i].checked = false;
//			//	alert(elem[i].value);
//			}
//			var errName = "error-" + elem.name;
//			elemOff(errName);
//		}
//	}
//	
//	//elemOff("pnlApvNop");
//	
//	//document.getElementById("sideBar").height = "865px";
//}
/*
************************************************************************
	08/10/2007
	Swamy pabbisetty
	This function is commented was designed for addition-info.aspx
	See the modified function for additional-info-sf.aspx
************************************************************************
*/
function validateCtrl(ctrl) {
	var retval = "";
	
	if (ctrl) {
		var ctrlId = ctrl.id;
		var ctrlValue = ctrl.value;
		var divTagName = "error-" + ctrlId;
		var divTag = document.getElementById(divTagName);
		var isRequired = false;
		var validFormatRegExp;
		var sField = "";
			
		switch (ctrlId) {
			case "txtFirstName":
				validFormatRegExp = reFirstName;
				sField = sFirstName;
				isRequired = true;
 				break;
			case "txtLastName":
				validFormatRegExp = reLastName;
				sField = sLastName;
				isRequired = true;
 				break;
			case "txtJobTitle":
				validFormatRegExp = reJobTitle;
				sField = sJobTitle;
				isRequired = true;
 				break;
			case "txtCompanyName":
				validFormatRegExp = reCompanyName;
				sField = sCompanyName;
				isRequired = true;
 				break;
 			case "txtAddress1":
 				validFormatRegExp = reAddress;
 				sField = sAddress1;
 				isRequired = true;
 				break;
 			case "txtAddress2":
 				validFormatRegExp = reAddress;
 				sField = sAddress2;
 				isRequired = false;
 				break;
 			case "txtCity":
 				validFormatRegExp = reCity;
 				sField = sCity;
 				isRequired = true;
 				break;
 			case "txtStateOrProvince":
 				validFormatRegExp = reStateOrProvince;
 				sField = sStateOrProvince;
 				isRequired = true;
 				break;
 			case "ddlCountry":
 				sField = sCountry;
 				isRequired = true;
 				break;
 			case "txtZipCode":
 				validFormatRegExp = reZipCode;
 				sField = sZipCode;
 				isRequired = true;
 				break;
 			case "txtPhone":
 				sField = sPhone;
 				isRequired = true;
 				break;
 			case "txtEmail":
 				validFormatRegExp = reEmail;
 				sField = sEmail;
 				isRequired = true;
 				break;
 			case "txtAPV":
 				validFormatRegExp = reAPV;
 				sField = sAPV;
 				if (document.getElementById("evWebExDemo").checked == true || 
 				    document.getElementById("evProduct").checked == true || 
 				    document.getElementById("nxProduct").checked == true || 
 				    document.getElementById("epProduct").checked == true || 
 				    document.getElementById("nnProduct").checked == true) 
 				    isRequired = true;
 				else
 					isRequired = false;
 				break;
 			case "txtNOP":
 				validFormatRegExp = reNOP;
 				sField = sNOP;
 				if (document.getElementById("pcProduct").checked == true || 
 				    document.getElementById("ucProduct").checked == true) 
 				    isRequired = true;
 				else
 					isRequired = false;
 				break;
 			case "txtComments":
 				validFormatRegExp = reComments;
 				sField = sComments;
 				isRequired = false;
 				break;
			default:
				break;
		}
		
		if ((ctrlValue == "") && (isRequired)) {
			divTag.className = "panelOn";
			divTag.innerHTML = "<span class=\"errorText\">&nbsp;Required</span>";
			retval = sField + mSuffix;
		}
		else if ((ctrlValue == "") && (!isRequired)){
			divTag.className = "panelOff";
			divTag.innerHTML = "";
		}
		else {
			var isValid = true;
			
			switch (ctrlId) {
				case "txtPhone":
					var c = document.getElementById("ddlCountry");
				
					if (c) {
						var countryCode = "";
						
						switch (c.value) {
							case "":
								countryCode = "US";
								isValid = checkUSPhone(ctrl);
								if (!isValid) {
									countryCode = "AU";
									isValid = checkAUPhone(ctrl);
									if (!isValid) {
										countryCode = "INT";
										isValid = checkInternationalPhone(ctrl);
									}	
								}
								break;
							case "United States":
								countryCode = "US";
								isValid = checkUSPhone(ctrl);
								break;
							case "Australia":
								countryCode = "AU";
								isValid = checkAUPhone(ctrl);
								break;
							default:
								countryCode = "INT";
								isValid = checkInternationalPhone(ctrl);
								break;
						}
						
						if (isValid) {
							divTag.className = "panelOff";
							divTag.innerHTML = "";
						}
						else {
							divTag.className = "panelOn";
							divTag.innerHTML = "<a TabIndex=\"-1\" href=\"javascript:void 0;\" onClick='warnInvalid(\"" + ctrlId + "\", \"" + countryCode + "\");'><img align=\"absMiddle\" alt=\"Click to view requirements\" src=\"http://www.tsystem.com/library/media/images/icon-help.gif\" border=\"0\"></a><span class=\"errorText\">&nbsp;Invalid</span>";
							retval = sField + iSuffix;
						}
					}
					break;
				case "ddlCountry":
					var p = document.getElementById("txtPhone");
					if (p.value != "") {validateCtrl(p);}
					
					divTag.className = "panelOff";
					divTag.innerHTML = "";
					break;
				default:
					isValid = validFormatRegExp.test(ctrlValue);	
					if (isValid) {
						divTag.className = "panelOff";
						divTag.innerHTML = "";
					}
					else {
						divTag.className = "panelOn";
						divTag.innerHTML = "<a TabIndex=\"-1\" href=\"javascript:void 0;\" onClick='warnInvalid(\""+ctrlId+"\");'><img align=\"absMiddle\" alt=\"Click to view requirements\" src=\"http://www.tsystem.com/library/media/images/icon-help.gif\" border=\"0\"></a><span class=\"errorText\">&nbsp;Invalid</span>";
						retval = sField + iSuffix;
					}
					break;
			}
		}
	}
		
	return retval;
}


// Modified function for additional-info-sf.aspx form

function validateCtrlSf(ctrl) {
	var retval = "";
	//alert("entered validateCtrlSf(): ")
	if (ctrl) {
		var ctrlId = ctrl.id;
		var ctrlValue = ctrl.value;
		var divTagName = "error-" + ctrlId;
		var divTag = document.getElementById(divTagName);
		var isRequired = false;
		var validFormatRegExp;
		var sField = "";
		//alert("entered validateCtrlSf(): " + ctrlId);
		switch (ctrlId) {
			case "first_name":
				validFormatRegExp = reFirstName;
				sField = sFirstName;
				isRequired = true;
				//alert("entered first_name: " + validFormatRegExp + " " + sField);
 				break;
			case "last_name":
				validFormatRegExp = reLastName;
				sField = sLastName;
				isRequired = true;
 				break;
			
			case "company":
				validFormatRegExp = reCompanyName;
				sField = sCompanyName;
				isRequired = true;
 				break;
 			
 			
 			case "state":
 				validFormatRegExp = reStateOrProvince;
 				sField = sStateOrProvince;
 				isRequired = true;
 				break;
 			
 			
 			case "phone":
 				validFormatRegExp = rePhone;
 				sField = sPhone;
 				isRequired = true;
 				break;
 			case "email":
 				validFormatRegExp = reEmail;
 				sField = sEmail;
 				isRequired = true;
 				break;
 			case "00N60000001RHXP":
 				validFormatRegExp = reProductInterest;
 				sField = sProdInterest;
 				isRequired = true;
 				break;
 			case "00N60000001RHXF": 
 				// //APV
 				validFormatRegExp = reAPV;
 				sField = sAPV;
 				/*if (document.getElementById("evWebExDemo").checked == true || 
 				    document.getElementById("evProduct").checked == true || 
 				    document.getElementById("nxProduct").checked == true || 
 				    document.getElementById("epProduct").checked == true || 
 				    document.getElementById("nnProduct").checked == true) */
 				   // isRequired = true;
 				/*else*/
 					isRequired = false;
 				break;
 			
 			
			default:
				break;
		}
		
		if ((ctrlValue == "") && (isRequired)) {
			divTag.className = "panelOn";
			divTag.innerHTML = "<span class=\"errorText\">&nbsp;Required</span>";
			retval = sField + mSuffix;
			//alert("vsf retval: " + retval);
		}
		else if ((ctrlValue == "") && (!isRequired)){
			divTag.className = "panelOff";
			divTag.innerHTML = "";
		}
		else {
			var isValid = true;
			
			switch (ctrlId) {
				case "phone":
					var c = document.getElementById("state");
					//alert("state value = " + c.value);
					if (c) {
							//alert("state value = " + c.value);		
							switch(c.value){
							/*case "INT":
								alert("Inside INT value = " + c.value);		
								//countryCode = "INT";
								isValid = checkInternationalPhone(ctrl);
								break;
							case "AR", "TX", "NY":
								alert("Inside state value = " + c.value);		
								//countryCode = "US";
								isValid = checkUSPhone(ctrl);
								break; */
							default:
								//alert("Inside default value = " + c.value);		
								//countryCode = "US";
								isValid = checkUSPhone(ctrl);
								break; 
								}
						}
				

						//}
			
			}
			//alert("vsf isValid: " + isValid + " 1 ");
			//switch (ctrlId) {
				
				
				//default:
					 isValid = validFormatRegExp.test(ctrlValue);	
					//alert("vsf isValid + default: " + isValid);
					if (isValid) {
						divTag.className = "panelOff";
						divTag.innerHTML = "";
					}
					else {
						divTag.className = "panelOn";
						divTag.innerHTML = "<a TabIndex=\"-1\" href=\"javascript:void 0;\" onClick='warnInvalidSf(\""+ctrlId+"\");'><img align=\"absMiddle\" alt=\"Click to view requirements\" src=\"http://www.tsystem.com/library/media/images/icon-help.gif\" border=\"0\"></a><span class=\"errorText\">&nbsp;Invalid</span>";
						retval = sField + iSuffix;
					}
					//break;
			}
		//}
	}
	//alert("vsf retval: " + retval + "last");	
	return retval;
}

// Modified function for EV-ContactUs.aspx form

function validateCtrlEVContact(ctrl) {
	var retval = "";
	//alert("entered validateCtrlSf(): ")
	if (ctrl) {
		var ctrlId = ctrl.id;
		var ctrlValue = ctrl.value;
		var divTagName = "error-" + ctrlId;
		var divTag = document.getElementById(divTagName);
		var isRequired = false;
		var validFormatRegExp;
		var sField = "";
		//alert("entered validateCtrlSf(): " + ctrlId);
		switch (ctrlId) {
			case "first_name":
				validFormatRegExp = reFirstName;
				sField = sFirstName;
				isRequired = true;
				//alert("entered first_name: " + validFormatRegExp + " " + sField);
 				break;
			case "last_name":
				validFormatRegExp = reLastName;
				sField = sLastName;
				isRequired = true;
 				break;
			
			case "company":
				validFormatRegExp = reCompanyName;
				sField = sCompanyName;
				isRequired = true;
 				break;
 			
 			
 			case "state":
 				validFormatRegExp = reStateOrProvince;
 				sField = sStateOrProvince;
 				isRequired = true;
 				break;
 			
 			
 		
 			case "email":
 				validFormatRegExp = reEmail;
 				sField = sEmail;
 				isRequired = true;
 				break;
 			
 			case "00N60000001RHXF": 
 				// //APV
 				validFormatRegExp = reAPV;
 				sField = sAPV;
 				isRequired = false;
 				break;
 			
 			
			default:
				break;
		}
		
		if ((ctrlValue == "") && (isRequired)) {
			divTag.className = "panelOn";
			divTag.innerHTML = "<span class=\"errorText\">&nbsp;Required</span>";
			retval = sField + mSuffix;
			//alert("vsf retval: " + retval);
		}
		else if ((ctrlValue == "") && (!isRequired)){
			divTag.className = "panelOff";
			divTag.innerHTML = "";
		}
		else {
			var isValid = true;
			
			switch (ctrlId) {
				case "phone":
					var c = document.getElementById("state");
					//alert("state value = " + c.value);
					if (c) {
							//alert("state value = " + c.value);		
							switch(c.value){
							/*case "INT":
								alert("Inside INT value = " + c.value);		
								//countryCode = "INT";
								isValid = checkInternationalPhone(ctrl);
								break;
							case "AR", "TX", "NY":
								alert("Inside state value = " + c.value);		
								//countryCode = "US";
								isValid = checkUSPhone(ctrl);
								break; */
							default:
								//alert("Inside default value = " + c.value);		
								//countryCode = "US";
								isValid = checkUSPhone(ctrl);
								break; 
								}
						}
				

						//}
			
			}
			//alert("vsf isValid: " + isValid + " 1 ");
			//switch (ctrlId) {
				
				
				//default:
					 isValid = validFormatRegExp.test(ctrlValue);	
					//alert("vsf isValid + default: " + isValid);
					if (isValid) {
						divTag.className = "panelOff";
						divTag.innerHTML = "";
					}
					else {
						divTag.className = "panelOn";
						divTag.innerHTML = "<a TabIndex=\"-1\" href=\"javascript:void 0;\" onClick='warnInvalidSf(\""+ctrlId+"\");'><img align=\"absMiddle\" alt=\"Click to view requirements\" src=\"http://www.tsystem.com/library/media/images/icon-help.gif\" border=\"0\"></a><span class=\"errorText\">&nbsp;Invalid</span>";
						retval = sField + iSuffix;
					}
					//break;
			}
		//}
	}
	//alert("vsf retval: " + retval + "last");	
	return retval;
}


function checkHandler() {
	var bAPV = false;
	var bNOP = false;
	var sideBar = document.getElementById("sideBar");
	var divApvNop = document.getElementById("pnlApvNop");
	var htmlStart = '<TABLE cellSpacing="5" border="0">'
	var htmlAPV = '<TR>'
				+ '<TD>Current APV:&nbsp;</TD>' 
				+ '<TD><input class="textbox" type="text" id="txtAPV" maxLength="10" name="txtAPV" onfocus="promptEntry(sAPV);" onfocusout="statusOff();validateCtrl(this);"></td>'
				+ '<td><div id="error-txtAPV" class="errorOff"></div></td>' 
				+ '</TR>';
	var htmlNOP = '<TR>' 
				+ '<TD># of Providers:&nbsp;</TD>' 
				+ '<TD><input class="textbox" type="text" id="txtNOP" maxLength="10" name="txtNOP" onfocus="promptEntry(sNOP);" onfocusout="statusOff();validateCtrl(this);"></td>'
				+ '<td><div id="error-txtNOP" class="errorOff"></div></td>' 
				+ '</TR>' 
	var htmlEnd = "</TABLE><br>";
					
	if (document.getElementById("evProduct").checked) bAPV = true;
	if (document.getElementById("nxProduct").checked) bAPV = true;
	if (document.getElementById("epProduct").checked) bAPV = true;
	if (document.getElementById("nnProduct").checked) bAPV = true;
	if (document.getElementById("pcProduct").checked) bNOP = true;
	if (document.getElementById("ucProduct").checked) bNOP = true;

	if ((bAPV == true) && (bNOP == true))
	{
		divApvNop.className = "panelOn";
		divApvNop.innerHTML = htmlStart + htmlAPV + htmlNOP + htmlEnd;
		sideBar.height = "912px";
	} 
	else if ((bAPV == true) && (bNOP == false)) 
	{
		divApvNop.className = "panelOn";
		divApvNop.innerHTML = htmlStart + htmlAPV + htmlEnd;
		sideBar.height = "886px";
	}
	else if ((bAPV == false) && (bNOP == true))
	{
		divApvNop.className = "panelOn";
		divApvNop.innerHTML = htmlStart + htmlNOP + htmlEnd;
		sideBar.height = "886px";
	}
	else if ((bAPV == false) && (bNOP == false)) 
	{
		divApvNop.className = "panelOff";
		divApvNop.innerHTML = "";
		sideBar.height = "855px";
	}
}
//-->