﻿//Error handling Constants 
reg_error_hds_customer 			= "Please choose Yes or No";
reg_error_first_name      		= "Please enter first name";
reg_error_first_name_error 		= "Please enter correct first name";
reg_error_mi      		= "Please enter your preferred name";
reg_error_mi_error 	= "Please enter your valid preferred name";
reg_error_last_name      		= "Please enter last name";
reg_error_last_name_error 		= "Please enter correct last name";
reg_error_company				= "Please enter company name";
reg_error_company_error			= "Please enter correct company name";
reg_error_address1				= "Please enter mailing address";
reg_error_address1_error		= "Please enter correct mailing address";
reg_error_textfield3			= "Please enter a mobile number";
reg_error_textfield3_error		= "Please enter a valid mobile number";
reg_error_address			= "Please enter your address";
reg_error_address_error		= "Please enter your valid address";
reg_error_city			= "Please enter your business city";
reg_error_city_error		= "Please enter your valid business city";
reg_error_state			= "Please enter your business state";
reg_error_state_error		= "Please enter your valid business state";
reg_error_textfield6      		= "Please enter full name";
reg_error_textfield6_error 		= "Please enter correct full name";
reg_error_textfield7			= "Please enter your departure port";
reg_error_textfield7_error		= "Please enter your valid departure port";
//reg_error_textfield4			= "Please enter your frequent flyer number";
reg_error_textfield4_error		= "Please enter your valid frequent flyer number";
reg_error_textfield5			= "Please select one";
reg_error_textfield2			= "Please select one";
reg_error_textfield10      		= "Please enter special request";
reg_error_textfield10_error 	= "Please enter correct special request";
reg_error_textfield8     		= "Please enter special dietary requirements";
reg_error_textfield8_error 		= "Please enter correct special dietary requirements";
reg_error_textfield9      		= "Please select one";
reg_error_textfield9_error 		= "Please select one";
reg_error_country				= "Please select country/region";
reg_error_city					= "Please enter city";
reg_error_city_error			= "Please enter correct city";
reg_error_state					= "Please select state/province";
reg_error_state1				= "Please enter state/province";
reg_error_state1_error			= "Please enter correct state/province";
reg_error_zip					= "Please enter postal code";
reg_error_zip_error				= "Please enter correct zip/postal code";
reg_error_phone					= "Please enter a telephone number";
reg_error_phone_error			= "Please enter a valid telephone number";
reg_error_email_empty    		= "Please enter your email address";
reg_error_email_not_valid 		= "Please enter a valid email address";
reg_error_DescribesOther    	= "Please enter best describes option";
reg_error_DescribesOther_error 	= "Please enter correct best describes option";
reg_error_OtherIndustry     	= "Please enter other industry";
reg_error_OtherIndustry_error  	= "Please enter correct other industry";
reg_error_OtherDepartment  		= "Please enter your department name";
reg_error_OtherDepartment_error = "Please enter your correct department name";
reg_error_BusinessOther     	= "Please enter your role";
reg_error_BusinessOther_error  	= "Please enter your correct role";
reg_error_OtherInterest     	= "Please enter your interest";
reg_error_OtherInterest_error  	= "Please enter your correct interest";
reg_error_department			= "Please enter job title";
reg_error_department_error		= "Please enter correct job title";
reg_error_textfield1			= "Please select One";
reg_error_bitsCity1				= "Please select";
reg_error_bitsCity2				= "Please select city";
function getLabelForId(id) {
    var label, labels = document.getElementsByTagName('label');
    for (var i = 0; (label = labels[i]); i++) {
        if (label.htmlFor == id) {
            return label;
        }
    }
    return false;
}
function checkRequired(id) {
    var formfield = document.getElementById(id);
    var label = getLabelForId(id);
    if (formfield.value.length == 0) {
        label.className = 'problem';
    } else {
        label.className = 'completed';
    }
}
function checkRequired1(id,name) {
	//alert(id);
    var formfield = document.getElementById(id);
    var label = getLabelForId(id);
	//alert(formfield.value);
    if (formfield.value.length == 0) {
    	//alert(name);
        label.className = '';/*problem*/
        formfield.style.border='1px solid #7F9DB9';/*#c00*/
    } else {
       label.className = 'completed';
        formfield.style.border='1px solid #0c0';
   }
}
function addEventOnFocus(obj){
	if(obj!=null){
//alert("obj:" + obj);
		addEvent(obj, 'focus', oninputfocus);
	}
}
function addEvent(obj, evType, fn){
    if (obj.addEventListener){
        obj.addEventListener(evType, fn, true);
        return true;
    } else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
        return r;
    } else {
        return false;
    }
}
function oninputfocus(e) {
    /* Cookie-cutter code to find the source of the event */
    if (typeof e == 'undefined') {
        var e = window.event;
}
    var source;
    if (typeof e.target != 'undefined') {
        source = e.target;
	} else if (typeof e.srcElement != 'undefined') {
        source = e.srcElement;
    } else {
        return;
    }
    /* End cookie-cutter code */
    source.style.border='1px solid #c00';
}
window.onload=function(){
init_box_msg_fields();
document.getElementById("first_name").focus();
}
function isNumberInput(event) 
{
	var key, keyChar;
  if (window.event)
    key = window.event.keyCode;
	else if (event)
    key = event.which;
  else
    return true;
  // Check for special characters like backspace
  if (key == null || key == 0 || key == 8 || key == 13 || key == 27)
    return true;
  // Check to see if it's a number
  keyChar =  String.fromCharCode(key);
  if (/\d/.test(keyChar)) 
    {
	window.status = "";
     return true;
    } 
  else 
	{
    window.status = "Field accepts numbers only.";
    return false;
   }
}
var specialChars 	  = /[\(\)\<\>\,\'\.\~\`\|\?\}\{\/\!\@\#\$\%\^\&\*\_\+\-\=\;\:\\\"\[\]]/ ; // Used to check special characters for all
var specialCharsLastName 	  = /[\(\)\<\>\,\'\.\~\`\|\?\}\{\/\!\@\#\$\%\^\&\*\_\+\-\=\;\:\\\"\[\]]/ ;
var specialCharsMiddleName 	  = /[\(\)\<\>\,\'\.\~\`\|\?\}\{\/\!\@\#\$\%\^\&\*\_\+\-\=\;\:\\\"\[\]]/ ;
//var specialCharsLastName 	  = /[\(\)\<\>\,\'\~\`\|\?\}\{\/\!\@\#\$\%\^\&\*\_\+\=\;\:\\\"\[\]]/ ; // Used to check special characters for last name
//var specialCharsMiddleName 	  = /[\(\)\<\>\,\'\~\`\|\?\}\{\/\!\@\#\$\%\^\&\*\_\+\=\;\:\\\"\[\]]/ ; // Used to check special characters for Middle name
var specialCharsAll = /[\<\>\,\'\`\}\{\|\~\?\!\@\#\$\%\^\*\_\=\;\:\\\"\[\]]/ ;
var specialCharsZip = /[\<\>\,\'\`\}\{\|\~\?\/\!\@\#\$\%\^\&\*\_\=\;\:\\\"\[\]]/ ;
var specialCharsCommon = /[\<\>\`\}\{\|\~\?\!\@\$\%\^\*\_\=\;\:\\\"\[\]]/ ;
var specialCharsAlpha = /[a-zA-Z]/ ;
var specialCharsAlphaNum = /[0-9a-zA-Z]/ ;
var specialCharsAllAnd = /[\<\>\,\'\`\}\{\|\~\?\/\!\@\#\$\%\^\*\_\=\;\:\\\"\[\]]/ ;
var specialCharsPhone = /[\<\>\'\`\}\{\|\~\?\/\!\@\#\$\%\^\&\*\_\=\;\:\\\"\[\]]/ ; // Used to check special characters for phone
var specialCharsPlus = /[+]{2,3}/;
var specialCharsBrack = /[(]{2,3}/;
var specialCharsBrackB = /[)]{2,3}/;
var specialCharsDash = /[-]{2,3}/;
var specialCharsDot = /[.]{2,3}/;
var specialCharsColon = /[:]{2,3}/;
var specialCharsAnd = /[&]{2,3}/;
var specialCharsCama = /[,]{2,3}/;
var specialCharsPostS = /[']{2,3}/;
var specialCharsHash = /[#]{2,3}/;
var specialCharsFslash = /[\/]{2,3}/;
//hds_customer
var hds_customer;
var hds_customer_label;
var box_hds_customer;
var msg_hds_customer;
//textfield10
var textfield1;
var textfield1_label;
var box_textfield1;
var msg_textfield1;

var bitsCity1;
var bitsCity1_label;
var box_bitsCity1;
var msg_bitsCity1;

var bitsCity2;
var bitsCity2_label;
var box_bitsCity2;
var msg_bitsCity2;
//first_name
var first_name;
var first_name_label;
var box_first_name;
var msg_first_name;
//full name
var textfield6;
var textfield6_label;
var box_textfield6;
var msg_textfield6;
//Departure Port
var textfield7;
var textfield7_label;
var box_textfield7;
var msg_textfield7;
//Frequent Flyer Number
var textfield4;
var textfield4_label;
var box_textfield4;
var msg_textfield4;
//mi
var mi;
var mi_label;
var box_mi;
var msg_mi;
//last_name
var last_name;
var last_name_label;
var box_last_name;
var msg_last_name;
//Department1
var department1;
var department1_label;
var box_department1;
var msg_department1;
//Deapartment
var department;
var department_label;
var box_department;
var msg_department;
//Company
var company;
var company_label;
var box_company;
var msg_company;
//Business Address
var address;
var address_label;
var box_address;
var msg_address;
//Business City
var city;
var city_label;
var box_city;
var msg_city;
//address1
var address1;
var address1_label;
var box_address1;
var msg_address1;
//Country
var country;
var country_label;
var box_country;
var msg_country;
//City
var city;
var city_label;
var box_city;
var msg_city;
//State
var state;
var state1;
var state_label;
var box_state;
var msg_state;
//Zip
var zip;
var zip_label;
var box_zip;
var msg_zip;
//mobile phone
var textfield3;
var textfield3_label;
var box_textfield3;
var msg_textfield3;

//radio button
var textfield5;
var box_textfield5;
var msg_textfield5;
//textarea
var textfield10;
var textfield10_label;
var box_textfield10;
var msg_textfield10;
//textarea2
var textfield9;
var textfield9_label;
var box_textfield9;
var msg_textfield9;
//textarea3
var textfield8;
var textfield8_label;
var box_textfield8;
var msg_textfield8;
//Telephone
var phone;
var phone_label;
var box_phone;
var msg_phone;
//Email
var email;
var email_label;
var box_email;
var msg_email;
//BusinessOther
var BusinessOther;
var BusinessOther_label;
var box_BusinessOther;
var msg_BusinessOther;
//DescribesOther
var DescribesOther;
var DescribesOther_label;
var box_DescribesOther;
var msg_DescribesOther;
//OtherIndustry
var OtherIndustry;
var OtherIndustry_label;
var box_OtherIndustry;
var msg_OtherIndustry;
//OtherDepartment
var OtherDepartment;
var OtherDepartment_label;
var box_OtherDepartment;
var msg_OtherDepartment;
//redio
var textfield2;
var textfield2_label;
var box_textfield2;
var msg_textfield2;
//OtherInterest
var OtherInterest;
var OtherInterest_label;
var box_OtherInterest;
var msg_OtherInterest;
function init_box_msg_fields()
{
//hds_customer
//hds_customer = document.getElementById('hds_customer');
	hds_customer = document.getElementsByName("hds_customer");
	hds_customer_label = getLabelForId('hds_customer');
	box_hds_customer= document.getElementById('box_hds_customer');
	msg_hds_customer = document.getElementById('msg_hds_customer');
//fist_name
	first_name = document.getElementById('first_name');
	first_name_label = getLabelForId('first_name');
	box_first_name = document.getElementById('box_first_name');
	msg_first_name = document.getElementById('msg_first_name');
	
	//Full name
	textfield6 = document.getElementById('textfield6');
	textfield6_label = getLabelForId('textfield6');
	box_textfield6 = document.getElementById('box_textfield6');
	msg_textfield6 = document.getElementById('msg_textfield6');
	//textarea3
	textfield8 = document.getElementById('textfield8');
textfield8_label = getLabelForId('textfield8');
box_textfield8= document.getElementById('box_textfield8');
msg_textfield8 = document.getElementById('msg_textfield8');
	
	//Departure Port
	textfield7 = document.getElementById('textfield7');
	textfield7_label = getLabelForId('textfield7');
	box_textfield7 = document.getElementById('box_textfield7');
	msg_textfield7 = document.getElementById('msg_textfield7');
	
	//Frequent Flyer Number
	textfield4 = document.getElementById('textfield4');
	textfield4_label = getLabelForId('textfield4');
	box_textfield4 = document.getElementById('box_textfield4');
	msg_textfield4 = document.getElementById('msg_textfield4');
textfield1 = document.getElementById("textfield1");
	textfield1_label = getLabelForId('textfield1');
	box_textfield1 =  document.getElementById('box_textfield1');
	msg_textfield1 = document.getElementById('msg_textfield1');
	
	bitsCity1 = document.getElementsByName("bitsCity1");
	bitsCity1_label = getLabelForId('bitsCity1');
	box_bitsCity1 =  document.getElementById('box_bitsCity1');
	msg_bitsCity1 = document.getElementById('msg_bitsCity1');
	
	
	bitsCity2 = document.getElementsByName("bitsCity2");
	bitsCity2_label = getLabelForId('bitsCity2');
	box_bitsCity2 =  document.getElementById('box_bitsCity2');
	msg_bitsCity2 = document.getElementById('msg_bitsCity2');
	//last_name
	last_name = document.getElementById('last_name');
	last_name_label = getLabelForId('last_name');
	box_last_name= document.getElementById('box_last_name');
	msg_last_name = document.getElementById('msg_last_name');
//mi
	mi = document.getElementById('mi');
	mi_label = getLabelForId('mi');
	box_mi= document.getElementById('box_mi');
	msg_mi = document.getElementById('msg_mi');
//Department
	department = document.getElementById('department');
	department_label = getLabelForId('department');
	box_department = document.getElementById('box_department');
	msg_department = document.getElementById('msg_department');	
//Department
	department1 = document.getElementById('department1');
	department1_label = getLabelForId('department1');
	box_department1 = document.getElementById('box_department1');
	msg_department1 = document.getElementById('msg_department1');	
	//company
	company = document.getElementById('company');
	company_label = getLabelForId('company');
	box_company= document.getElementById('box_company');
	msg_company = document.getElementById('msg_company');
	//Address
	address = document.getElementById('address');
	address_label = getLabelForId('address');
	box_address= document.getElementById('box_address');
	msg_address = document.getElementById('msg_address');
	
	//radio button
	textfield5 = document.getElementsByName("textfield5");
	box_textfield5= document.getElementById('box_textfield5');
	msg_textfield5 = document.getElementById('msg_textfield5');
	
	//textarea
	textfield10 = document.getElementById('textfield10');
	textfield10_label = getLabelForId('textfield10');
	box_textfield10 = document.getElementById('box_textfield10');
	msg_textfield10 = document.getElementById('msg_textfield10');
	
	//radio
	textfield2 = document.getElementsByName("textfield2");
	textfield2_label = getLabelForId('textfield2');
	box_textfield2 = document.getElementById('box_textfield2');
	msg_textfield2 = document.getElementById('msg_textfield2');
	
	//textarea2
	textfield9 = document.getElementsByName("textfield9");
	textfield9_label = getLabelForId('textfield9');
	box_textfield9 =  document.getElementById('box_textfield9');
	msg_textfield9 = document.getElementById('msg_textfield9');
	
	//Business City
	city = document.getElementById('city');
	city_label = getLabelForId('city');
	box_city= document.getElementById('box_city');
	msg_city = document.getElementById('msg_city');
	
	//address1
	address1 = document.getElementById('address1');
	address1_label = getLabelForId('address1');
	box_address1 = document.getElementById('box_address1');
	msg_address1 = document.getElementById('msg_address1');	
	//country
	country = document.getElementById('country');
	country_label = getLabelForId('country');
	box_country= document.getElementById('box_country');
	msg_country = document.getElementById('msg_country');
	//city
	city = document.getElementById('city');
	city_label = getLabelForId('city');
	box_city = document.getElementById('box_city');
	msg_city = document.getElementById('msg_city');
	//State
	state = document.getElementById('state');
	state1 = document.getElementById('state1');
	state2 = document.getElementById('state2');
	state_label = getLabelForId('state');
	box_state = document.getElementById('box_state');
	msg_state = document.getElementById('msg_state');
	//Zip
	zip = document.getElementById('zip');
	zip_label = getLabelForId('zip');
	box_zip = document.getElementById('box_zip');
	msg_zip = document.getElementById('msg_zip');	
	//telephone
	phone = document.getElementById('phone');
	phone_label = getLabelForId('phone');
	box_phone= document.getElementById('box_phone');
	msg_phone = document.getElementById('msg_phone');
//mobile
	textfield3 = document.getElementById('textfield3');
	textfield3_label = getLabelForId('textfield3');
	box_textfield3= document.getElementById('box_textfield3');
	msg_textfield3 = document.getElementById('msg_textfield3');

	//email
	email = document.getElementById('email');
	email_label = getLabelForId('email');
	box_email= document.getElementById('box_email');
	msg_email = document.getElementById('msg_email');	
	//BusinessOther
	textfield2Drop = document.getElementById('textfield2Drop');
	BusinessOther = document.getElementById('BusinessOther');
	BusinessOther_label = getLabelForId('BusinessOther');
	box_BusinessOther= document.getElementById('box_BusinessOther');
	msg_BusinessOther = document.getElementById('msg_BusinessOther');
	//DescribesOther
	textfield1Drop = document.getElementById('textfield1Drop');
	DescribesOther = document.getElementById('DescribesOther');
	DescribesOther_label = getLabelForId('DescribesOther');
	box_DescribesOther= document.getElementById('box_DescribesOther');
	msg_DescribesOther = document.getElementById('msg_DescribesOther');
	//OtherIndustry
	textfield5Drop = document.getElementById('textfield5Drop');
	OtherIndustry = document.getElementById('OtherIndustry');
	OtherIndustry_label = getLabelForId('OtherIndustry');
	box_OtherIndustry= document.getElementById('box_OtherIndustry');
	msg_OtherIndustry = document.getElementById('msg_OtherIndustry');
	//OtherDepartment
	departmentDrop = document.getElementById('departmentDrop');
	OtherDepartment = document.getElementById('OtherDepartment');
	OtherDepartment_label = getLabelForId('OtherDepartment');
	box_OtherDepartment= document.getElementById('box_OtherDepartment');
	msg_OtherDepartment = document.getElementById('msg_OtherDepartment');
	//OtherInterest
	textfield10Drop = document.getElementById('textfield10Drop');
	textfield10 = document.getElementById('textfield10');
	OtherInterest = document.getElementById('OtherInterest');
	OtherInterest_label = getLabelForId('OtherInterest');
	box_OtherInterest= document.getElementById('box_OtherInterest');
	msg_OtherInterest = document.getElementById('msg_OtherInterest');
}
function trim(s)
{
  return s.replace(/^\s+|\s+$/, '');
}
function checkRadio() {
		var i = 0;
		var position=0;
		var selected=false;
		for (i = 0; i < hds_customer.length; i++)
		{
			if (hds_customer[i].checked)
			{	
				position = i;
				i = hds_customer.length + 1;
				//hds_customer[position].style.border='1px solid #0C0';
				selected=true;
			}
		}
		if (!selected)
		{
			//hds_customer[position].focus(); 
			//hds_customer[position].style.border='1px solid #c00';
			hds_customer_label.className = 'problem';
			box_hds_customer.style.display     = 'block';
			msg_hds_customer.innerHTML         = reg_error_hds_customer;
			return false;			
		}
		else{
			hds_customer_label.className = 'completed';
			hds_customer[position].style.border='1px solid #0C0';
			box_hds_customer.style.display     = 'none';
			return true;
		}
}
/*
function checkDepartment() {
	if (!department.disabled) {
		if (department.value.length == 0)
		{ 
			department.style.border='1px solid #c00';
			department_label.className = 'problem';
			box_department.style.display     = 'block';
			msg_department.innerHTML         = reg_error_department;
			return false;
		}
		else{
			department_label.className = 'completed';
			department.style.border='1px solid #0C0';
			box_department.style.display     = 'none';
			return true;
		}
	}
}*/
function checkDepartment() {
	if (!department.disabled) {
		var digits = department.value.replace(/[^0-9]/ig, '');
	    if (trim(department.value).length == 0 || trim(department.value).length <= 1)
	    {
		department.style.border='1px solid #c00';
		department_label.className = 'problem';
		box_department.style.display     = 'block';
		msg_department.innerHTML         = reg_error_department
		return false;
	    }
	    else if (digits || department.value.match(specialChars))
	    { 
		department.style.border='1px solid #c00';
		department_label.className = 'wrongFormat';
		box_department.style.display     = 'block';
		msg_department.innerHTML         = reg_error_department_error;
		return false;
	    }
	    else {
		department_label.className = 'completed';
		department.style.border='1px solid #0C0';
		box_department.style.display     = 'none';
		return true;
	    }
    	}
}
function checkDepartment1() {
	if (!department1.disabled) {
		if (department1.value.length == 0)
		{ 
			department1.style.border='1px solid #c00';
			department1_label.className = 'problem';
			box_department1.style.display     = 'block';
			msg_department1.innerHTML         = reg_error_department1;
			return false;
		}
		else{
			department1_label.className = 'completed';
			department1.style.border='1px solid #0C0';
			box_department1.style.display     = 'none';
			return true;
		}
		
	}
}
function checkFirstName() {
	if (!first_name.disabled) {
		var digits = first_name.value.replace(/[^0-9]/ig, '');
       if (trim(first_name.value).length == 0 || trim(first_name.value).length < 1){
		first_name.style.border='1px solid #c00';
		first_name_label.className = 'problem';
		box_first_name.style.display     = 'block';
		msg_first_name.innerHTML         = reg_error_first_name
		return false;}
		/*else if (digits || first_name.value.match(specialChars)){
		first_name.style.border='1px solid #c00';
		first_name_label.className = 'wrongFormat';
		box_first_name.style.display     = 'block';
		msg_first_name.innerHTML         = reg_error_first_name_error;
		return false;
	    }*/
	    else {
		first_name_label.className = 'completed';
		first_name.style.border='1px solid #0C0';
		box_first_name.style.display     = 'none';
		return true;
	    }
    	}
}
function checktextfield6() {
	
if(document.getElementById('branded1').checked == true)
{
	
		if (!textfield6.disabled) {
			
			
		var digits = textfield6.value.replace(/[^0-9]/ig, '');
		
		
	    if (trim(textfield6.value).length == 0 || trim(textfield6.value).length <= 1){
			
			
			
		textfield6.style.border='1px solid #c00';
		
		
		
		textfield6_label.className = 'problem';
		
		
		box_textfield6.style.display     = 'block';
		
		
		msg_textfield6.innerHTML         = reg_error_textfield6
		return false;}
		
		
		else if (digits || textfield6.value.match(specialChars)){
		textfield6.style.border='1px solid #c00';
		textfield6_label.className = 'wrongFormat';
		box_textfield6.style.display     = 'block';
		msg_textfield6.innerHTML         = reg_error_textfield6_error;
		return false;
	    }
	    else {
		textfield6_label.className = 'completed';
		textfield6.style.border='1px solid #0C0';
		box_textfield6.style.display     = 'none';
		return true;
	    }
    	}
      }
       else
     {
	  return true;
     }
	
}
function checktextfield1() {
	if (!textfield1.disabled) {
		var digits = textfield1.value.replace(/[^0-9]/ig, '');
	    if (trim(textfield1.value).length == 0 || trim(textfield1.value).length <= 1){
		textfield1.style.border='1px solid #c00';
		textfield1_label.className = 'problem';
		box_textfield1.style.display     = 'block';
		msg_textfield1.innerHTML         = reg_error_textfield1
		return false;}
		else if (digits || textfield1.value.match(specialChars)){
		textfield1.style.border='1px solid #c00';
		textfield1_label.className = 'wrongFormat';
		box_textfield1.style.display     = 'block';
		msg_textfield1.innerHTML         = reg_error_textfield1_error;
		return false;
	    }
	    else {
		textfield1_label.className = 'completed';
		textfield1.style.border='1px solid #0C0';
		box_textfield1.style.display     = 'none';
		return true;
	    }
    	}
}
function checkLastName() {
if (!last_name.disabled) {
var digits = last_name.value.replace(/[^0-9]/ig, '');
if (trim(last_name.value).length == 0 || trim(last_name.value).length < 1){
last_name.style.border='1px solid #c00';
last_name_label.className = 'problem';
box_last_name.style.display     = 'block';
msg_last_name.innerHTML         = reg_error_last_name
return false;
}
/*else if (digits || last_name.value.match(specialCharsLastName)){
last_name.style.border='1px solid #c00';
last_name_label.className = 'wrongFormat';
box_last_name.style.display     = 'block';
msg_last_name.innerHTML         = reg_error_last_name_error;
return false;
}
*/
else {
last_name_label.className = 'completed';
last_name.style.border='1px solid #0C0';
box_last_name.style.display     = 'none';
return true;
}
}
}
function checkMiddleName() {
if (!mi.disabled) {
var digits = mi.value.replace(/[^0-9]/ig, '');
if (trim(mi.value).length == 0 || trim(mi.value).length <= 1){
mi.style.border='1px solid #c00';
mi_label.className = 'problem';
box_mi.style.display     = 'block';
msg_mi.innerHTML         = reg_error_mi
return false;
}
else if (digits || mi.value.match(specialCharsMiddleName)){
mi.style.border='1px solid #c00';
mi_label.className = 'wrongFormat';
box_mi.style.display     = 'block';
msg_mi.innerHTML         = reg_error_mi_error;
return false;
}
else {
mi_label.className = 'completed';
mi.style.border='1px solid #0C0';
box_mi.style.display     = 'none';
return true;
}
}
}
function checkCompany() {
	if (!company.disabled) {
	    if (trim(company.value).length == 0 || trim(company.value).length < 1){
		company.style.border='1px solid #c00';
		company_label.className = 'problem';
		box_company.style.display     = 'block';
		msg_company.innerHTML         = reg_error_company
		return false;}
		else{
		company_label.className = 'completed';
		company.style.border='1px solid #0C0';
		box_company.style.display     = 'none';
		return true;}
   		}
}
function checkaddress() {
	if (!address.disabled) {
	    if (trim(address.value).length == 0 || trim(address.value).length <= 1){
		address.style.border='1px solid #c00';
		address_label.className = 'problem';
		box_address.style.display     = 'block';
		msg_address.innerHTML         = reg_error_address
		return false;}
		else{
		address_label.className = 'completed';
		address.style.border='1px solid #0C0';
		box_address.style.display     = 'none';
		return true;}
   		}
}
function checkCount11() {
	if (!textfield8.disabled) {
		if (trim(textfield8.value).length == 0 || trim(textfield8.value).length <= 1)
		//if (textfield36.value.length == 0)
		{ 
			textfield8.style.border='1px solid #c00';
			textfield8_label.className = 'problem';
			box_textfield8.style.display     = 'block';
			msg_textfield8.innerHTML         = reg_error_textfield8
			return false;
		}
		else{
			textfield8_label.className = 'completed';
			textfield8.style.border='1px solid #0C0';
			box_textfield8.style.display     = 'none';
			return true;
		}
	}
}
function checktextfield7() {
if(document.getElementById('branded1').checked == true)
{
	if (!textfield7.disabled) {
	    if (trim(textfield7.value).length == 0 || trim(textfield7.value).length <= 1){
		textfield7.style.border='1px solid #c00';
		textfield7_label.className = 'problem';
		box_textfield7.style.display     = 'block';
		msg_textfield7.innerHTML         = reg_error_textfield7
		return false;}
		else{
		textfield7_label.className = 'completed';
		textfield7.style.border='1px solid #0C0';
		box_textfield7.style.display     = 'none';
		return true;}
   		}
}
else
	
	
{
	
	return true;
}
	
}
function checktextfield8() {
	if (!textfield4.disabled) {
	    if (trim(textfield4.value).length == 0 || trim(textfield4.value).length <= 1){
		textfield4.style.border='1px solid #c00';
		textfield4_label.className = 'problem';
		box_textfield4.style.display     = 'block';
		msg_textfield4.innerHTML         = reg_error_textfield4
		return false;}
		else{
		textfield4_label.className = 'completed';
		textfield4.style.border='1px solid #0C0';
		box_textfield4.style.display     = 'none';
		return true;}
   		}
}
function checkcity() {
	if (!city.disabled) {
	    if (trim(city.value).length == 0 || trim(city.value).length <= 1){
		city.style.border='1px solid #c00';
		city_label.className = 'problem';
		box_city.style.display     = 'block';
		msg_city.innerHTML         = reg_error_city
		return false;}
		else{
		city_label.className = 'completed';
		city.style.border='1px solid #0C0';
		box_city.style.display     = 'none';
		return true;}
   		}
}
function checkq3() {
		var i = 0;
		var position=0;
		var selected=false;
		for (i = 0; i < textfield5.length; i++)
		{
			if (textfield5[i].checked)
			{	
				position = i;
				i = textfield5.length + 1;
				selected=true;
			}
		}
		if (!selected)
		{
		box_textfield5.style.display     = 'block';
		document.getElementById('textfield5_label').className = 'problem';
		msg_textfield5.innerHTML         = reg_error_textfield5;
		return false;			
		}
		else{
		//textfield2[position].style.border='1px solid #0C0';
		document.getElementById('textfield5_label').className = 'completed';
		box_textfield5.style.display     = 'none';
		return true;
		}
}
function checkRepresentative1() {
	if (!textfield10.disabled) {
		if (trim(textfield10.value).length == 0 || trim(textfield10.value).length <= 1)
		//if (textfield36.value.length == 0)
		{ 
			textfield10.style.border='1px solid #c00';
			textfield10_label.className = 'problem';
			box_textfield10.style.display     = 'block';
			msg_textfield10.innerHTML         = reg_error_textfield10;
			return false;
		}
		else{
			textfield10_label.className = 'completed';
			textfield10.style.border='1px solid #0C0';
			box_textfield10.style.display     = 'none';
			return true;
		}
	}
}
function checkCount() {
	if (!textfield9.disabled) {
		if (trim(textfield9.value).length == 0 || trim(textfield9.value).length <= 1)
		//if (textfield36.value.length == 0)
		{ 
			textfield9.style.border='1px solid #c00';
			textfield9_label.className = 'problem';
			box_textfield9.style.display     = 'block';
			msg_textfield9.innerHTML         = reg_error_textfield9;
			return false;
		}
		else{
			textfield9_label.className = 'completed';
			textfield9.style.border='1px solid #0C0';
			box_textfield9.style.display     = 'none';
			return true;
		}
	}
}
function checkStreetAddress1() {
	if (!address1.disabled) {
	    if (trim(address1.value).length == 0 || trim(address1.value).length <= 1)
	    {
		address1.style.border='1px solid #c00';
		address1_label.className = 'problem';
		box_address1.style.display     = 'block';
		msg_address1.innerHTML         = reg_error_address1
		return false;
	    }
	    /*else if (address1.value.match(specialCharsCommon)  || address1.value.match(specialCharsAnd) || address1.value.match(specialCharsDot) || address1.value.match(specialCharsPostS) || address1.value.match(specialCharsHash) || address1.value.match(specialCharsCama) || address1.value.match(specialCharsFslash))
	    { 
		address1.style.border='1px solid #c00';
		address1_label.className = 'wrongFormat';
		box_address1.style.display     = 'block';
		msg_address1.innerHTML         = reg_error_address1_error;
		return false;
	    }*/
		else
		{
		address1_label.className = 'completed';
		address1.style.border='1px solid #0C0';
		box_address1.style.display     = 'none';
		return true;
	    }
   		}
}
function checkContry1() {
	var statelen=document.getElementById('state').length;
	if (country.value =="")
		{	
			document.getElementById('state1').disabled=true;
			document.getElementById('state1').value ="Please select a country first";
			return true;
		}
else
			{
				document.getElementById('state1').disabled=true;
				document.getElementById('state1').value ="Please select a country first";
			}
		/*else
		{	
			if (statelen==0 )
			{
				document.getElementById('state1').disabled=false;
				document.getElementById('state1').value ="";
			}
			else
			{
				document.getElementById('state1').disabled=true;
				document.getElementById('state1').value ="Please select a country first";
			}
	}*/
}
function checkCountry() {
	if (!country.disabled) {
		if (country.value.length == 0)
		{ 
			country.style.border='1px solid #c00';
			country_label.className = 'problem';
			box_country.style.display     = 'block';
			box_state.style.display     = 'none';
			msg_country.innerHTML         = reg_error_country;	
			return false;
		} 
		else{
			country_label.className = 'completed';
			country.style.border='1px solid #0C0';
			box_country.style.display     = 'none';
			return true;
		}
	}
}
function checkCity() {
	if (!city.disabled) {
		var digitscity = city.value.replace(/[^0-9]/ig, '');
	    if (trim(city.value).length == 0 || trim(city.value).length <= 1)
	    {
		city.style.border='1px solid #c00';
		city_label.className = 'problem';
		box_city.style.display     = 'block';
		msg_city.innerHTML         = reg_error_city
		return false;
	    }
	    else if (digitscity || city.value.match(specialCharsAll) || city.value.match(specialCharsPlus) || city.value.match(specialCharsBrack) || city.value.match(specialCharsBrackB) || city.value.match(specialCharsDash) || city.value.match(specialCharsDot) || city.value.match(specialCharsAnd) || city.value.match(specialCharsFslash))
	    { 
		city.style.border='1px solid #c00';
		city_label.className = 'wrongFormat';
		box_city.style.display     = 'block';
		msg_city.innerHTML         = reg_error_city_error;
		return false;
	    }
	    else {
		city_label.className = 'completed';
		city.style.border='1px solid #0C0';
		box_city.style.display     = 'none';
		return true;
	    }
   		}
}
function checkstate() {
	if (!state.disabled) {
		if (state.value.length == 0 || state.value == "Please Select One")
		{ 
			state.style.border='1px solid #c00';
			state_label.className = 'problem';
			box_state.style.display     = 'block';
			msg_state.innerHTML         = reg_error_state;
			return false;
		}
		else{
			state_label.className = 'completed';
			state.style.border='1px solid #0C0';
			box_state.style.display     = 'none';
			return true;
		}
	}
	else
	{
		return true;
	}
}
function checkstate1() {
	if (!state1.disabled) {
		var digitsstate1 = state1.value.replace(/[^0-9]/ig, '');
	    if (trim(state1.value).length == 0 || state1.value == 'Please select a country first' &&  trim(state1.value).length <= 1)
	    {
		state1.style.border='1px solid #c00';
		state_label.className = 'problem';
		box_state.style.display     = 'block';
		msg_state.innerHTML         = reg_error_state1
		return false;
	    }
	    else if (digitsstate1 || state1.value.match(specialCharsAll) || state1.value.match(specialCharsPlus) || state1.value.match(specialCharsBrack) || state1.value.match(specialCharsBrackB) || state1.value.match(specialCharsDash) || state1.value.match(specialCharsDot) || state1.value.match(specialCharsAnd) || state1.value.match(specialCharsFslash))
	    { 
		state1.style.border='1px solid #c00';
		state_label.className = 'wrongFormat';
		box_state.style.display     = 'block';
		msg_state.innerHTML         = reg_error_state1_error;
		return false;
	    }
	    else {
		state_label.className = 'completed';
		state1.style.border='1px solid #0C0';
		box_state.style.display     = 'none';
		return true;
	    }
   		}
	else
	{
		return true;
	}
}
function checkZip() {
	if (!zip.disabled) {
	    if (trim(zip.value).length == 0 || trim(zip.value).length <= 3)
	    {
		zip.style.border='1px solid #c00';
		zip_label.className = 'problem';
		box_zip.style.display     = 'block';
		msg_zip.innerHTML         = reg_error_zip
		return false;
	    }
	    else if (zip.value.match(specialCharsZip) || zip.value.match(specialCharsPlus) || zip.value.match(specialCharsBrack) || zip.value.match(specialCharsBrackB) || zip.value.match(specialCharsDash) || zip.value.match(specialCharsDot))
	    { 
		zip.style.border='1px solid #c00';
		zip_label.className = 'wrongFormat';
		box_zip.style.display     = 'block';
		msg_zip.innerHTML         = reg_error_zip_error;
		return false;
	    }
	    else {
		zip_label.className = 'completed';
		zip.style.border='1px solid #0C0';
		box_zip.style.display     = 'none';
		return true;
	    }
   		}
}
function checkpublicsector() {
if(!document.getElementById('textfield1').checked)
		{
			box_textfield1.style.display     = 'block';
			document.getElementById('textfield1_label').className = 'problem';
			msg_textfield1.innerHTML         = reg_error_textfield1;
			return false;			
		}
		else{
			//textfield1[position].style.border='1px solid #0C0';
			document.getElementById('textfield1_label').className = 'completed';
			box_textfield1.style.display     = 'none';
			return true;
		}
}
function checkbits() {
if(!document.getElementById('bitsCity1').checked)
		{
				document.getElementById("bitsCity2").disabled = 'disabled'; 
        		document.getElementById("bitsCity3").disabled = 'disabled';
				document.getElementById('bitsCity2_label').className = 'disabled';
				document.getElementById('box_bitsCity2').style.display = 'none';
			box_bitsCity1.style.display     = 'block';
			document.getElementById('bitsCity1_label').className = 'problem';
			msg_bitsCity1.innerHTML         = reg_error_bitsCity1;
			return false;			
		}
		else{
				document.getElementById("bitsCity2").disabled = ''; 
        		document.getElementById("bitsCity3").disabled = '';
			//textfield1[position].style.border='1px solid #0C0';
			document.getElementById('bitsCity1_label').className = 'completed';
			box_bitsCity1.style.display     = 'none';
			return true;
			
		}
}
function checkbitsCity() {
if(!document.getElementById('bitsCity2').checked && !document.getElementById('bitsCity3').checked)
		{
			//alert("not selected");	
			box_bitsCity2.style.display     = 'block';
			document.getElementById('bitsCity2_label').className = 'problem';
			msg_bitsCity2.innerHTML         = reg_error_bitsCity2;
			return false;
					
		}
		else{
			//alert("selected");
			document.getElementById('bitsCity2_label').className = 'completed';
			box_bitsCity2.style.display     = 'none';
			return true;
		}
}
function sendbitsCity(){
	var bitsCityvalue = new Array();
	if (document.getElementById('bitsCity1').checked == true){
		bitsCityvalue.push(document.getElementById('bitsCity1').value);
	}if (document.getElementById('bitsCity2').checked == true){	
		bitsCityvalue.push(document.getElementById('bitsCity2').value);
	}if (document.getElementById('bitsCity3').checked == true){
		bitsCityvalue.push(document.getElementById('bitsCity3').value);
	}
	document.getElementById('address3').value = bitsCityvalue;	
}
function checkPhone() {
	if (!phone.disabled) {
		var digitsPhone = phone.value.replace(/[^a-zA-Z]/ig, '');
	    if (trim(phone.value).length == 0 || trim(phone.value).length < 5)
	    {
		phone.style.border='1px solid #c00';
		phone_label.className = 'problem';
		box_phone.style.display     = 'block';
		msg_phone.innerHTML         = reg_error_phone
		return false;
	    }
	    else if (digitsPhone || phone.value.match(specialCharsPhone) || phone.value.match(specialCharsPlus) || phone.value.match(specialCharsBrack) || phone.value.match(specialCharsBrackB) || phone.value.match(specialCharsDash) || phone.value.match(specialCharsCama) || phone.value.match(specialCharsDot))
	    { 
		phone.style.border='1px solid #c00';
		phone_label.className = 'wrongFormat';
		box_phone.style.display     = 'block';
		msg_phone.innerHTML         = reg_error_phone_error;
		return false;
	    }
	    else {
		phone_label.className = 'completed';
		phone.style.border='1px solid #0C0';
		box_phone.style.display     = 'none';
		return true;
	    }
   		}
}
function checkMobile() {
	if (!textfield3.disabled) {
	var digitsmobile = textfield3.value.replace(/[^a-zA-Z]/ig, '');
	    if (trim(textfield3.value).length == 0 || trim(textfield3.value).length <= 5)
	    {
		textfield3.style.border='1px solid #c00';
		textfield3_label.className = 'problem';
		box_textfield3.style.display     = 'block';
		msg_textfield3.innerHTML         = reg_error_textfield3
		return false;
	    }
	    else if (digitsmobile || textfield3.value.match(specialCharsPhone) || textfield3.value.match(specialCharsPlus) || textfield3.value.match(specialCharsBrack) || textfield3.value.match(specialCharsBrackB) || textfield3.value.match(specialCharsDash) || textfield3.value.match(specialCharsCama) || textfield3.value.match(specialCharsDot))
	    { 
		textfield3.style.border='1px solid #c00';
		textfield3_label.className = 'wrongFormat';
		box_textfield3.style.display     = 'block';
		msg_textfield3.innerHTML         = reg_error_textfield3_error;
		return false;
	    }
	    else {
		textfield3_label.className = 'completed';
		textfield3.style.border='1px solid #0C0';
		box_textfield3.style.display     = 'none';
		return true;
	    }
   		}
}
function checkEmail() {
	if (!email.disabled) {
	    if (email.value == "")
	    {
		email.style.border='1px solid #c00';
		email_label.className = 'problem';
		box_email.style.display     = 'block';
		msg_email.innerHTML         = reg_error_email_empty;
		return false;
	    }
	    else if (email.value != "" && !email.value.match(/^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-.]?[0-9a-zA-Z])*[.][a-zA-Z]{2,3}$/))
	    { 
		email.style.border='1px solid #c00';
		email_label.className = 'wrongFormat';
		box_email.style.display     = 'block';
		msg_email.innerHTML         = reg_error_email_not_valid;
		return false;
	    }
	    else {
		email_label.className = 'completed';
		email.style.border='1px solid #0C0';
		box_email.style.display     = 'none';
		return true;
	    }
    	}
}
function checkDescribesOther1() {
	
	var digitsDescribesOther = DescribesOther.value.replace(/[^0-9]/ig, '');
	if (!DescribesOther.disabled) {
		if (textfield1Drop.value == "Technology Partner" && trim(DescribesOther.value).length == 0 || textfield1Drop.value == "Value Added Reseller" && trim(DescribesOther.value).length == 0)
		{ 
		DescribesOther.style.border='1px solid #c00';
		//DescribesOther_label.className = 'problem';
		box_DescribesOther.style.display     = 'block';
		msg_DescribesOther.innerHTML         = reg_error_DescribesOther;		
		return false;
		}
		else if (digitsDescribesOther || DescribesOther.value.match(specialCharsAll) || DescribesOther.value.match(specialCharsBrack) || DescribesOther.value.match(specialCharsBrackB) || DescribesOther.value.match(specialCharsDash) || DescribesOther.value.match(specialCharsDot) || DescribesOther.value.match(specialCharsAnd) || DescribesOther.value.match(specialCharsFslash))
	    { 
		DescribesOther.style.border='1px solid #c00';
		//DescribesOther_label.className = 'wrongFormat';
		box_DescribesOther.style.display     = 'block';
		msg_DescribesOther.innerHTML         = reg_error_DescribesOther_error;
		return false;
	    }
		else
		{
		//DescribesOther_label.className = 'completed';
		DescribesOther.style.border='1px solid #0C0';
		box_DescribesOther.style.display     = 'none';
		return true;
		}
	}else
	{
		return true;
		}
}
function checkDescribesOther(describeValue) {
    if(describeValue == "Technology Partner" && DescribesOther.value.length == 0 || describeValue == "Value Added Reseller" && DescribesOther.value.length == 0)
    {
        document.getElementById("DescribesOther").style.display = "block";		
		document.getElementById('DescribesOther').disabled=false;
		document.getElementById("DescribesOther").focus();
    }
    else
    {
		document.getElementById("DescribesOther").style.display = "none";
		box_DescribesOther.style.display='none';
		document.getElementById("DescribesOther").value = "";
    }
}function checkOtherIndustry1() {
	
	var digitsOtherIndustry = OtherIndustry.value.replace(/[^0-9]/ig, '');
	if (!OtherIndustry.disabled) {
		
		if (textfield5Drop.value == "Other" && trim(OtherIndustry.value).length == 0)
		{ 
		OtherIndustry.style.border='1px solid #c00';
		//OtherIndustry_label.className = 'problem';
		box_OtherIndustry.style.display     = 'block';
		msg_OtherIndustry.innerHTML         = reg_error_OtherIndustry;
		return false;
		}
		else if (digitsOtherIndustry || OtherIndustry.value.match(specialCharsAll) || OtherIndustry.value.match(specialCharsBrack) || OtherIndustry.value.match(specialCharsBrackB) || OtherIndustry.value.match(specialCharsDash) || OtherIndustry.value.match(specialCharsDot) || OtherIndustry.value.match(specialCharsFslash) || OtherIndustry.value.match(specialCharsAnd))
	    { 
		OtherIndustry.style.border='1px solid #c00';
		//OtherIndustry_label.className = 'wrongFormat';
		box_OtherIndustry.style.display     = 'block';
		msg_OtherIndustry.innerHTML         = reg_error_OtherIndustry_error;
		return false;
	    }
		else{
		//OtherIndustry_label.className = 'completed';
		OtherIndustry.style.border='1px solid #0C0';
		box_OtherIndustry.style.display     = 'none';
		return true;
		}
	}else
	{
		return true;
		}
}
function checkOtherIndustry(industryValue) {
    if(industryValue == "Other" && OtherIndustry.value.length == 0)
    {
		document.getElementById("OtherIndustry").style.display = "block";
		document.getElementById('OtherIndustry').disabled=false;
		document.getElementById("OtherIndustry").focus();
    }
    else
    {
		document.getElementById("OtherIndustry").style.display = "none";
		document.getElementById("OtherIndustry").value = "";
		box_OtherIndustry.style.display     = 'none';
		OtherIndustry_label.className = '';
    }
}
function checkOtherDepartment1() {
	
	var digitsOtherDepartment = OtherDepartment.value.replace(/[^0-9]/ig, '');
	if (!OtherDepartment.disabled) {
		
		if (departmentDrop.value == "Other" && trim(OtherDepartment.value).length == 0)
		{ 
		OtherDepartment.style.border='1px solid #c00';
		//OtherDepartment_label.className = 'problem';
		box_OtherDepartment.style.display     = 'block';
		msg_OtherDepartment.innerHTML         = reg_error_OtherDepartment;
		return false;
		}
		else if (digitsOtherDepartment || OtherDepartment.value.match(specialCharsAll) || OtherDepartment.value.match(specialCharsBrack) || OtherDepartment.value.match(specialCharsBrackB) || OtherDepartment.value.match(specialCharsDash) || OtherDepartment.value.match(specialCharsDot) || OtherDepartment.value.match(specialCharsFslash) || OtherDepartment.value.match(specialCharsAnd))
	    { 
		OtherDepartment.style.border='1px solid #c00';
		//OtherDepartment_label.className = 'wrongFormat';
		box_OtherDepartment.style.display     = 'block';
		msg_OtherDepartment.innerHTML         = reg_error_OtherDepartment_error;
		return false;
	    }
		else{
		//OtherDepartment_label.className = 'completed';
		OtherDepartment.style.border='1px solid #0C0';
		box_OtherDepartment.style.display     = 'none';
		return true;
		}
	}else
	{
		return true;
		}
}
function checkOtherDepartment(departmentValue) {
    if(departmentValue == "Other" && OtherDepartment.value.length == 0)
    {
		document.getElementById("OtherDepartment").style.display = "block";
		document.getElementById('BusinessOther').disabled=false;
		document.getElementById("OtherDepartment").focus();
    }
    else
    {
		document.getElementById("OtherDepartment").style.display = "none";
		box_OtherDepartment.style.display     = 'none';
		document.getElementById("OtherDepartment").value = "";
    }
}
function checkBusinessOther1() {
	var digitsBusinessOther = BusinessOther.value.replace(/[^0-9]/ig, '');
	if (!BusinessOther.disabled) {
		if (textfield2Drop.value == "Other" && trim(BusinessOther.value).length == 0)
		{ 
		BusinessOther.style.border='1px solid #c00';
		//BusinessOther_label.className = 'problem';
		box_BusinessOther.style.display     = 'block';
		msg_BusinessOther.innerHTML         = reg_error_BusinessOther;
		return false;
		}
		else if (digitsBusinessOther || BusinessOther.value.match(specialCharsAll) || BusinessOther.value.match(specialCharsBrack) || BusinessOther.value.match(specialCharsBrackB) || BusinessOther.value.match(specialCharsDash) || BusinessOther.value.match(specialCharsDot) || BusinessOther.value.match(specialCharsFslash) || BusinessOther.value.match(specialCharsAnd))
	    { 
		BusinessOther.style.border='1px solid #c00';
		//BusinessOther_label.className = 'wrongFormat';
		box_BusinessOther.style.display     = 'block';
		msg_BusinessOther.innerHTML         = reg_error_BusinessOther_error;
		return false;
	    }
		else{
		//BusinessOther_label.className = 'completed';
		BusinessOther.style.border='1px solid #0C0';
		box_BusinessOther.style.display     = 'none';
		return true;
		}
	}else
	{
		return true;
		}
}
function counting(e, textarea, max, input) {
if (!e.which) keyCode = event.keyCode; // ie5+ op5+
else keyCode = e.which; // nn6+
if (textarea.value.length<max+1)
input.value =
max - textarea.value.length;
if (textarea.value.length>max-1)
{
document.getElementById("counting").style.display = "none";
document.getElementById("countingf").style.display = "none";
}
if (textarea.value.length<max+0)
{
document.getElementById("countingf").style.display = "block";
document.getElementById("counting").style.display = "none";
}
else {
textarea.value =
textarea.value.substring(0,max);
input.value = 0;
document.getElementById("counting").style.display = "block";
return false;
}
}
function counting1(e, textarea, max, input) {
if (!e.which) keyCode = event.keyCode; // ie5+ op5+
else keyCode = e.which; // nn6+
if (textarea.value.length<max+1)
input.value =
max - textarea.value.length;
if (textarea.value.length>max-1)
{
document.getElementById("counting1").style.display = "none";
document.getElementById("countingf1").style.display = "none";
}
if (textarea.value.length<max+0)
{
document.getElementById("countingf1").style.display = "block";
document.getElementById("counting1").style.display = "none";
}
else {
textarea.value =
textarea.value.substring(0,max);
input.value = 0;
document.getElementById("counting1").style.display = "block";
return false;
}
}
function checkq7() {
		var i = 0;
		var position=0;
		var selected=false;
		for (i = 0; i < textfield2.length; i++)
		{
			if (textfield2[i].checked)
			{	
				position = i;
				i = textfield2.length + 1;
				selected=true;
			}
		}
		if (!selected)
		{
			box_textfield2.style.display     = 'block';
			document.getElementById('textfield2_label').className = 'problem';
			msg_textfield2.innerHTML         = reg_error_textfield2;
			return false;			
		}
		else{
			//textfield10[position].style.border='1px solid #0C0';
			document.getElementById('textfield2_label').className = 'completed';
			box_textfield2.style.display     = 'none';
			return true;
		}
}
function pack()
{
	if(document.getElementById('branded1').value = 'I require flights and accommodation')
	{
		document.getElementById('textfield6').disabled = '';
		document.getElementById('textfield7').disabled = '';
		document.getElementById('textfield4').disabled = '';
		//document.getElementById('textfield4').disabled = '';
	}
	}
function pack2()
{
	if(document.getElementById('branded2').value = 'I do not require flights and accommodation')
	{
		document.getElementById('textfield6').disabled = 'disabled';
		document.getElementById('textfield7').disabled = 'disabled';
		document.getElementById('textfield4').disabled = 'disabled';
		document.getElementById('textfield6').value = '';
		document.getElementById('textfield7').value = '';
		document.getElementById('textfield4').value = '';
		textfield6_label.className = "required";
		textfield7_label.className = "required";
		box_textfield6.style.display  = 'none';
		box_textfield7.style.display  = 'none';
		//box_textfield4.style.display  = 'none';
		textfield6.style.border='1px solid #000000';
		textfield7.style.border='1px solid #000000';
		textfield4.style.border='1px solid #000000';
		//textfield4.style.border='1px solid #000000';
		/*document.getElementById('utilize3').disabled = '';
		document.getElementById('utilize4').disabled = '';
     	document.getElementById('utilize5').disabled = '';
    	document.getElementById('utilize1').checked = '';
		document.getElementById('utilize2').checked = '';
		document.getElementById('utilize3').checked = '';
		document.getElementById('utilize4').checked = '';
		document.getElementById('utilize5').checked = '';
		document.getElementById('otherutilize').value = '';
		document.getElementById('other4').style.display = 'none';
		document.getElementById('box_otherutilize').style.display = 'none';*/	
	}
	}
function checkBusinessOther(businessValue) {
    if(businessValue == "Other")
    {
        document.getElementById("BusinessOther").style.display = "block";		
		document.getElementById('BusinessOther').disabled=false;
		document.getElementById("BusinessOther").focus();		
    }
    else
    {
		document.getElementById("BusinessOther").style.display = "none";
		box_BusinessOther.style.display     = 'none';
		document.getElementById("BusinessOther").value = "";	
    }
}
function checkOtherInterest1() {
	var digitsOtherInterest = OtherInterest.value.replace(/[^0-9]/ig, '');
	if (!OtherInterest.disabled) {
			var items=new Array();
			var i,j,flag;
			i=0;j=0;flag=0;
			var prod_Sol=document.getElementById("textfield10Drop");
			while (i<prod_Sol.length)
				{
					if(prod_Sol.options[i].selected)
					{
						items[j] = new Array(prod_Sol.options[i].value);
						if (items[j]=="Other"){flag=1;}
						j=j+1;
					}
					i=i+1;
				}
	if((flag==1) && (items.length==1) && trim(OtherInterest.value).length == 0)
    {
			OtherInterest.style.border='1px solid #c00';
			//OtherInterest_label.className = 'problem';
			box_OtherInterest.style.display     = 'block';
			msg_OtherInterest.innerHTML         = reg_error_OtherInterest;		
			return false;
    }
	else 	if((flag==1) && (items.length>=1) && trim(OtherInterest.value).length == 0)
	{
			OtherInterest.style.border='1px solid #c00';
			//OtherInterest_label.className = 'problem';
			box_OtherInterest.style.display     = 'block';
			msg_OtherInterest.innerHTML         = reg_error_OtherInterest;		
			return false;
    }
	else 	if (digitsOtherInterest || OtherInterest.value.match(specialCharsAll) || OtherInterest.value.match(specialCharsBrack) || OtherInterest.value.match(specialCharsBrackB) || OtherInterest.value.match(specialCharsDash) || OtherInterest.value.match(specialCharsDot) || OtherInterest.value.match(specialCharsFslash) || OtherInterest.value.match(specialCharsAnd))
	{ 
		OtherInterest.style.border='1px solid #c00';
		//OtherInterest_label.className = 'wrongFormat';
		box_OtherInterest.style.display     = 'block';
		msg_OtherInterest.innerHTML         = reg_error_OtherInterest_error;
		return false;
	}
	else
		{
			//OtherInterest_label.className = 'completed';
			OtherInterest.style.border='1px solid #0C0';
			box_OtherInterest.style.display     = 'none';
			return true;
		}
	}
	else
		{
		return true;
		}
}
function checkOtherInterest(interestValue) {
	var items=new Array();
	var i,j,flag;
	i=0;j=0;flag=0;
	var prod_Sol=document.getElementById("textfield10Drop");
		while (i<prod_Sol.length)
			{
				if(prod_Sol.options[i].selected)
				{
					items[j] = new Array(prod_Sol.options[i].value);
					if (items[j]=="Other"){flag=1;}
					j=j+1;
				}
				i=i+1;
			}
j=0;
	//-------------------------------------------------------------------------------------------
	if((flag==1) && (items.length==1))
    {
		document.getElementById("OtherInterest").style.display = "block";
		document.getElementById('OtherInterest').disabled=false;
    }
	else 	if((flag==1) && (items.length>=1))
	{
		document.getElementById("OtherInterest").style.display = "block";
		document.getElementById('OtherInterest').disabled=false;
    }
	else if((flag==0)&& (items.length>=1)) 
	{
		document.getElementById("OtherInterest").style.display = "none";
		box_OtherInterest.style.display     = 'none';
		document.getElementById("OtherInterest").value = "";
		}
}
function checkq6() {
		var i = 0;
		var position=0;
		var selected=false;
		for (i = 0; i < textfield9.length; i++)
		{
			if (textfield9[i].checked)
			{	
				position = i;
				i = textfield9.length + 1;
				selected=true;
			}
		}
		if (!selected)
		{
			box_textfield9.style.display     = 'block';
			
			msg_textfield9.innerHTML         = reg_error_textfield9;
			return false;			
		}
		else{
			//textfield9[position].style.border='1px solid #0C0';
			
			box_textfield9.style.display     = 'none';
			return true;
		}
}
function checkMethod() {
		var i = 0;
		var position=0;
		var selected=false;
		for (i = 0; i < textfield1.length; i++)
		{
			if (textfield1[i].checked)
			{	
				position = i;
				i = textfield1.length + 1;
				selected=true;
			}
		}
		if (!selected)
		{
		box_textfield1.style.display     = 'block';
		document.getElementById('textfield1_label').className = 'problem';
		msg_textfield1.innerHTML         = reg_error_textfield1;
		return false;			
		}
		else{
		//textfield2[position].style.border='1px solid #0C0';
		document.getElementById('textfield1_label').className = 'completed';
		box_textfield1.style.display     = 'none';
		return true;
		}
}
var check_form_error_obj = null;
function check_form () {
var obj, e;
try {
if (!checkFirstName()) {
	first_name.focus();
	return false;
}else if (!checkLastName()) {
	last_name.focus();
	return false;
}else if (!checkCompany()) {
	company.focus();
	return false;
}else if (!checkPhone()) {
	phone.focus();
	return false;
}else if (!checkEmail()) {
	email.focus();
	return false;
}
else if (!checkCountry()) {
		country.focus();
		return false;
	}
else if (!checkstate()) {
	state.focus();
	return false;
}/*else if (!checkMethod()) {
	textfield1.focus();
	return false;
}*/
else{
return true;
}
} catch (e) { check_form_error_obj = obj; return false;}
return false;
}
function changezip(){
		if (country.value == "Canada" || country.value == "United Kingdom" || country.value == "United States"){				
				zip_label.className = "required";			
		} else {				
				zip_label.className = "";	
				zip.style.border='1px solid #7f9db9';	
				box_zip.style.display     = 'none';
			}
}
function DescribesOtherData()
{	if (!DescribesOther.disabled){
		if (textfield1Drop.value == "Technology Partner")
		{
			document.getElementById("textfield1").value = document.getElementById("textfield1Drop").value + ": " + document.getElementById("DescribesOther").value;
		}
		else if(textfield1Drop.value == "Value Added Reseller" )
		{
			document.getElementById("textfield1").value = document.getElementById("textfield1Drop").value + ": " + document.getElementById("DescribesOther").value;
		}
		else
		{
			document.getElementById("textfield1").value = document.getElementById("textfield1Drop").value;
		}
	}
}
function OtherDepartmentData()
{	if (!OtherDepartment.disabled){
		if (departmentDrop.value == "Other")
		{
			document.getElementById("department").value = document.getElementById("departmentDrop").value + ": " + document.getElementById("OtherDepartment").value;
		}
		else
		{
			document.getElementById("department").value = document.getElementById("departmentDrop").value;
		}
	}
}
function stateupdate(){
	if ( country.value != 'Canada' && country.value != 'United States' ){
		con = country.value;
		state.value = con;
		state1.value = con;
		document.getElementById('dummy-state').style.display = 'block';
		state.style.display = 'none';
		state1.style.display = 'none';
				box_state.style.display     = 'none';
				state.disabled = true;
		state1.disabled = true;
	}else {
		document.getElementById('dummy-state').style.display = 'none';
				state.disabled = "";
		state1.disabled = "";
		}
}
//* ======= Character counter for text area =======*/
function count(e, textarea, max, input) {
if (!e.which) keyCode = event.keyCode; // ie5+ op5+
else keyCode = e.which; // nn6+
if (textarea.value.length<max+1)
input.value =
max - textarea.value.length;
if (textarea.value.length>max-1)
{
document.getElementById("count").style.display = "none";
document.getElementById("countf").style.display = "none";
}
if (textarea.value.length<max+0)
{
document.getElementById("countf").style.display = "block";
document.getElementById("count").style.display = "none";
}
else {
textarea.value =
textarea.value.substring(0,max);
input.value = 0;
document.getElementById("count").style.display = "block";
return false;
}
}
function count1(e, textarea, max, input) {
if (!e.which) keyCode = event.keyCode; // ie5+ op5+
else keyCode = e.which; // nn6+
if (textarea.value.length<max+1)
input.value =
max - textarea.value.length;
if (textarea.value.length>max-1)
{
document.getElementById("count1").style.display = "none";
document.getElementById("countf1").style.display = "none";
}
if (textarea.value.length<max+0)
{
document.getElementById("countf1").style.display = "block";
document.getElementById("count1").style.display = "none";
}
else {
textarea.value =
textarea.value.substring(0,max);
input.value = 0;
document.getElementById("count1").style.display = "block";
return false;
}
}
function count11(e, textarea, max, input) {
if (!e.which) keyCode = event.keyCode; // ie5+ op5+
else keyCode = e.which; // nn6+
if (textarea.value.length<max+1)
input.value =
max - textarea.value.length;
if (textarea.value.length>max-1)
{
document.getElementById("count11").style.display = "none";
document.getElementById("countf11").style.display = "none";
}
if (textarea.value.length<max+0)
{
document.getElementById("countf11").style.display = "block";
document.getElementById("count11").style.display = "none";
}
else {
textarea.value =
textarea.value.substring(0,max);
input.value = 0;
document.getElementById("count11").style.display = "block";
return false;
}
}
//end-->
