
var ns = (navigator.appName=="Netscape" && parseInt(navigator.appVersion)>=4)?true:false
var ie = (navigator.appName=="Microsoft Internet Explorer" && parseInt(navigator.appVersion)>=4)?true:false
var ns6 = (document.getElementById&&!document.all)

var safari = new String(navigator.appVersion);
var expr=/safari/gi;
Saf = safari.search(expr);

var navigsaf = (Saf!=-1)?true:false;

	
//alert(ie);

function getLayerName(name) {
	
  if (ie) {  
  
    return document.getElementsByName(name);
	
  }
	if (ns6) {	
	 return eval('document.all.' + name);		
	}
  return null;
  
}

function getLayer(name) {
	
  if (ie) {  
   // return document.getElementById(name);
	return eval('document.all.' + name);
  }
	if (ns6) {
		  return document.getElementById(name);
		//return eval('document.all.' + name);
		
	}
  return null;
  
}

function showMissing(el,etat){
	//alert(el);
	//alert(sm);   
	// alert(etat);
	 if(etat=='error') {
		 document.getElementById(el).style.color='#ff0000';
	 }
	 if(etat=='') {
		 document.getElementById(el).style.color='#006600';
	 }	 
}


function checkAllRecruiting() {
	document.personnal.recruiting_all.checked=true;
	document.personnal.recruiting_requisition.checked=true;
	document.personnal.recruiting_screening.checked=true;
	document.personnal.recruiting_hire.checked=true;
	document.personnal.recruiting_reporting.checked=true;
}
function uncheckRecruiting(actualCheckbox) {
	if(eval("document.personnal." + actualCheckbox.name).checked==false) {
		document.personnal.recruiting_all.checked=false;
	}
	
}
function checkAllTalent() {
	document.personnal.talent_all.checked=true;
	document.personnal.talent_performance.checked=true;
	document.personnal.talent_employee.checked=true;
	document.personnal.talent_compensation.checked=true;
	document.personnal.talent_succession.checked=true;
}
function uncheckTalent(actualCheckbox) {
	if(eval("document.personnal." + actualCheckbox.name).checked==false) {
		document.personnal.talent_all.checked=false;
	}
}

function checkAll() {
	checkAllRecruiting();
	checkAllTalent() ;
}

function uncheckAll(actualCheckbox) {
	//alert(actualCheckbox);
	
	var qty = eval("document.questions." + actualCheckbox.name).length;
	//alert(eval("document.questions." + actualCheckbox.name)[qty-1].checked);
	//var qty = 0;
	if(eval("document.questions." + actualCheckbox.name)[qty-1].checked) {
		for (var i=0; i <= eval("document.questions." + actualCheckbox.name).length-2; i++) {	
			eval("document.questions." + actualCheckbox.name)[i].checked=false;
			if (eval("document.questions." + actualCheckbox.name)[i].checked) {										
				qty=1;				
			}
		}
	}		
}

function uncheckNone(actualCheckbox) {
	var qty = eval("document.questions." + actualCheckbox.name).length;
	//alert(eval("document.questions." + actualCheckbox.name)[qty-1].checked);
	//var qty = 0;
	if(eval("document.questions." + actualCheckbox.name)[qty-1].checked) {
		eval("document.questions." + actualCheckbox.name)[qty-1].checked = false
	}		
}

/**
 * Validation logic for initial (short) registration screen.
 * @author timo (tim@aimedarrow.com)
 */
function validateRegShort(form)
{
	if (form.FirstName) {
		form.FirstName.value = allTrim(form.FirstName.value);
		if (form.FirstName.value == "")
		{
			alert('Please enter your first name.');
			location="#FirstNameLink";
			form.FirstName.focus();
			return false;
		}
	}

	if (form.LastName) {
		form.LastName.value = allTrim(form.LastName.value);
		if (form.LastName.value == "")
		{
			alert('Please enter your last name.');
			location="#LastNameLink";
			form.LastName.focus();
			return false;
		}
	}
	
	if (form.Email) {
		form.Email.value = allTrim(form.Email.value);
		if (form.Email.value == "")
		{
			alert('Please enter your email address.');
			location="#EmailLink";
			form.Email.focus();
			return false;
		}
		
		if (!(validEmailSyntax(form.Email.value)))
		{
			alert('Please enter a valid Business Email Address.');
			location="#EmailLink";
			form.Email.focus();
			return false;
		}
		
		if (form.Email.value!="") {
				//Check for non-business email
				/*if(form.Email.value.match(/@yahoo.com|@hotmail.com|@msn.com|@comcast.com|@sbcglobal.net|@aol.com|@earthlink.net|@gmail.com/i)) {*/
				if(form.Email.value.match(/@hotmail.com|@msn.com|@comcast.com|@sbcglobal.net|@aol.com|@earthlink.net/i)) {

					alert("Please enter a valid Business Email Address.");
					return false;
			}
		}
	}
	
	if(form.ProductInterest_Recruiting) {  // refactor
	
		var ProductInterestChecked = 0;
		if (document.getElementsByName("ProductInterest_Recruiting")[0].checked == true) { ProductInterestChecked++ ; }
		if (document.getElementsByName("ProductInterest_Performance-Management")[0].checked == true) { ProductInterestChecked++ ; }
		if (document.getElementsByName("ProductInterest_Onboarding")[0].checked == true) { ProductInterestChecked++ ; }
		if (document.getElementsByName("ProductInterest_Analytics")[0].checked == true) { ProductInterestChecked++ ; }
		if (document.getElementsByName("ProductInterest_Succession-Planning")[0].checked == true) { ProductInterestChecked++ ; }
		if (document.getElementsByName("ProductInterest_Career-and-Goal-Management")[0].checked == true) { ProductInterestChecked++ ; }
		if (document.getElementsByName("ProductInterest_Compensation")[0].checked == true) { ProductInterestChecked++ ; }
		if (document.getElementsByName("ProductInterest_Other")[0].checked == true) { ProductInterestChecked++ ; }
		
		if (!ProductInterestChecked >= 1 )
			{
				alert('Please select one or more products.');
				location="#ProductInterest";
				return false;
			}
	}
	
	if(document.personnal.recruiting_requisition.checked==false && document.personnal.recruiting_screening.checked==false && document.personnal.recruiting_hire.checked==false && document.personnal.recruiting_reporting.checked==false && document.personnal.talent_performance.checked==false && document.personnal.talent_employee.checked==false && document.personnal.talent_compensation.checked==false && document.personnal.talent_succession.checked==false){
		alert("You must check at least one module on the left.\n");
		return false;
	}
	
	document.personnal.submit();
}

/**
 * Validation logic for final (long) registration form.
 * Updated 2/19/2010: product interests moved to short reg form.
 * @author timo (tim@aimedarrow.com)
 */
function validateEloqua(form)
{
	//alert('allo');
	
	if (form.elements["selectDateGroup"]) {
		var radiobtns = form.elements["selectDateGroup"];
		var radiobtnslength = form.elements["selectDateGroup"].length;
	
		var radiobtncount = -1;
		for(var i=radiobtnslength-1; i > -1; i--) {
			if(radiobtns[i].checked) { 
				radiobtncount = i;
				i = -1;
			} 
		}
		if (radiobtncount == -1) {
			alert('Please select a date.');
			location="#selectDateLink";
			return false;
		}
	
	}
	
	//temp
	if (form.elements["RadioGroup1"]) {
		var radiobtns = form.elements["RadioGroup1"];
		var radiobtnslength = form.elements["RadioGroup1"].length;
	
		var radiobtncount = -1;
		for(var i=radiobtnslength-1; i > -1; i--) {
			if(radiobtns[i].checked) { 
				radiobtncount = i;
				i = -1;
			} 
		}
		if (radiobtncount == -1) {
			alert('Please select webcast(s).');
			location="#selectRadioGroup1Link";
			return false;
		}
	
	}	

	if (form.FirstName) {
		form.FirstName.value = allTrim(form.FirstName.value);
		if (form.FirstName.value == "")
		{
			alert('Please enter your first name.');
			location="#FirstNameLink";
			form.FirstName.focus();
			return false;
		}
	}

	if (form.LastName) {
		form.LastName.value = allTrim(form.LastName.value);
		if (form.LastName.value == "")
		{
			alert('Please enter your last name.');
			location="#LastNameLink";
			form.LastName.focus();
			return false;
		}
	}
	
	if (form.CompanyName) {
		form.CompanyName.value = allTrim(form.CompanyName.value);
		if (form.CompanyName.value == "")
		{
			alert('Please enter your company name.');
			location="#CompanyNameLink";
			form.CompanyName.focus();
			return false;
		}
	}

	if (form.JobTitle) {
		form.JobTitle.value = allTrim(form.JobTitle.value);
		if (form.JobTitle.value == "")
		{
			alert('Please enter your job title.');
			location="#JobTitleLink";
			form.JobTitle.focus();
			return false;
		}
	}

	if (form.Email) {
		form.Email.value = allTrim(form.Email.value);
		if (form.Email.value == "")
		{
			alert('Please enter your email address.');
			location="#EmailLink";
			form.Email.focus();
			return false;
		}
		
		if (!(validEmailSyntax(form.Email.value)))
		{
			alert('Please enter a valid Business Email Address.');
			location="#EmailLink";
			form.Email.focus();
			return false;
		}
		
		if (form.Email.value!="") {
				//Check for non-business email
				/*if(form.Email.value.match(/@yahoo.com|@hotmail.com|@msn.com|@comcast.com|@sbcglobal.net|@aol.com|@earthlink.net|@gmail.com/i)) {*/
				if(form.Email.value.match(/@hotmail.com|@msn.com|@comcast.com|@sbcglobal.net|@aol.com|@earthlink.net/i)) {

					alert("Please enter a valid Business Email Address.");
					return false;
			}
		}
	}
	
	if (form.Phone) {
		form.Phone.value = allTrim(form.Phone.value);
		if (form.Phone.value.length <= 9)
		{
			alert('Please enter your phone number.');
			location="#PhoneLink";
			form.Phone.focus();
			return false;
		}
	}
	
	
	if (form.StreetAddress) {
		form.StreetAddress.value = allTrim(form.StreetAddress.value);
		if (form.StreetAddress.value == "")
		{
			alert('Please enter your Street Address.');
			location="#StreetAddressLink";
			form.StreetAddress.focus();
			return false;
		}
	}	
	

	if (form.City) {
		form.City.value = allTrim(form.City.value);
		if (form.City.value == "")
		{
			alert('Please enter your City.');
			location="#CityLink";
			form.City.focus();
			return false;
		}
	}
	
	
	if (form.Country) {
		form.Country.value = allTrim(form.Country.value);
		if (form.Country.value == "")
		{
			alert('Please select a country.');
			location="#CountryLink";
			form.Country.focus();
			return false;
		}
	}


	if (form.StrategicInitiative_Faster) {
		//alert(form.StrategicInitiative_Faster.value);
		if (form.StrategicInitiative_Faster.value == "")
		{
			alert('Please select a faster time-to-hire.');
			location="#StrategicInitiatives";
			form.StrategicInitiative_Faster.focus();
			return false;
		}
	}

	if (form.StrategicInitiative_Improve) {
		if (form.StrategicInitiative_Improve.value == "")
		{
			alert('Please select a improve quality-of-hire.');
			location="#StrategicInitiatives";
			form.StrategicInitiative_Improve.focus();
			return false;
		}
	}

	if (form.StrategicInitiative_Reduce) {
		if (form.StrategicInitiative_Reduce.value == "")
		{
			alert('Please select a reduce cost-per-hire.');
			location="#StrategicInitiatives";
			form.StrategicInitiative_Reduce.focus();
			return false;
		}
	}

	if (form.Country) {
		if (form.Country.value=="USA" || form.Country.value=="Canada")
		{
			if (form.StateProvince.value == "")
			{
				alert('Please select a state/province.');
				location="#ltStateProvinceLink";
				form.StateProvince.focus();
				return false;
			}
		//Clear 	
		} else { form.StateProvince.value = ""; }
	}

	if (form.ZipCode) {
		form.ZipCode.value = allTrim(form.ZipCode.value);
		if (form.ZipCode.value == "") {
			alert('Please enter your Zip or Postal Code.');
			location="#ZipCodeLink";
			form.ZipCode.focus();
			return false;
		}
	
		if (form.Country) {
			if (form.Country.value=="USA" || form.Country.value=="Canada") {
				if (form.Country.value=="USA") {
					// Check for correct zip code
					reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
					if (!reZip.test(form.ZipCode.value)) {
						alert("Please enter your 5 digit or 5 digit + 4 digit Zip Code.  Example: 12345 or 12345-1234.");
						return false;
					}
				}
				if (form.Country.value=="Canada") {
					//Check for correct postal code
					rePostal = new RegExp(/(^s*([a-z](\s)?\d(\s)?){3}$)s*/i);
					if(!rePostal.test(form.ZipCode.value)) {
						alert("Please enter a valid Postal Code.");
						return false;
					}
				}
			}
		}
	}


	if (form.Industry) { 
		form.Industry.value = allTrim(form.Industry.value);
		if (form.Industry.value == "")
		{
			alert('Please add your Industry.');
			location="#Industry";
			form.Industry.focus();
			return false;
		}
	}

	if (form.numberEmployees) {
		form.numberEmployees.value = allTrim(form.numberEmployees.value);
		if (form.numberEmployees.value == "")
		{
			alert('Please answer the "Number of Employees?" question.');
			location="#numberofEmployeesLink";
			form.numberEmployees.focus();
			return false;
		}
	}
	
	
	if (form.PurchaseTimeframe) {
		form.PurchaseTimeframe.value = allTrim(form.PurchaseTimeframe.value);
		if (form.PurchaseTimeframe.value == "")
		{
			alert('Please select a purchase timeframe.');
			location="#PurchaseTimeframe";
			form.PurchaseTimeframe.focus();
			return false;
		}
	}


	if (form.CompanyWebsite) { 
		form.CompanyWebsite.value = allTrim(form.CompanyWebsite.value);
		if (form.CompanyWebsite.value == "")
		{
			alert('Please add your Company Website.');
			location="#CompanyWebsite";
			form.CompanyWebsite.focus();
			return false;
		}
	}


	
	if (form.CurrentSolution) { 
		form.CurrentSolution.value = allTrim(form.CurrentSolution.value);
		if (form.CurrentSolution.value == "")
		{
			alert('Please add your Current Solution.');
			location="#CurrentSolution";
			form.CurrentSolution.focus();
			return false;
		}
	}

	document.personnal.submit();
}

//---------------



function dropDownEmpty(objDropDown, objTextFieldOther)
{
	return ((dropDownSelectedValue(objDropDown)=="" || objDropDown.selectedIndex==objDropDown.length-1) && objTextFieldOther.value=="");
}


function dropDownSelectedValue(objDropDown)
{
	return objDropDown.options[objDropDown.selectedIndex].value;
}


function dropDownChangeOther(objDropDown, objTextFieldOther)
{
	if (objDropDown.selectedIndex == objDropDown.length-1)
	{
		objTextFieldOther.focus();
	}
	else
	{
		objTextFieldOther.value = "";
		objTextFieldOther.blur();
	}
}


function dropDownConflict(objDropDown, objTextFieldOther)
{
	return (objTextFieldOther.value!="" && objDropDown.selectedIndex!=objDropDown.length-1);
}


function radioEmpty(objRadioGroup)
{
	for (b=0; b<objRadioGroup.length; b++)
	{
		if (objRadioGroup[b].checked) {return false;}
	}
	return true;
}


function radioSelectedValue(objRadioGroup)
{
	for (b=0; b<objRadioGroup.length; b++)
	{
		if (objRadioGroup[b].checked) {return objRadioGroup[b].value;}
	}
	return "";
}


function checkboxEmpty(objForm,checkboxGroupName,nbrCheckbox)
{
	lettres = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	for (c=0; c<nbrCheckbox; c++)
	{
		if (eval("objForm." + checkboxGroupName + "_" + lettres.substring(c,c+1) + ".checked")) {return false;}
	}
	return true;
}


function checkboxChecked(objForm,checkboxGroupName,nbrCheckbox)
{
	lettres = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	nbrChecked = 0;
	for (c=0; c<nbrCheckbox; c++)
	{
		if (eval("objForm." + checkboxGroupName + "_" + lettres.substring(c,c+1) + ".checked")) {nbrChecked++;}
	}
	return nbrChecked;
}


function checkboxSelectedValue(objCheckbox)
{
	if (objCheckbox.checked)
	{
		return objCheckbox.value;
	}
	return "";
}


function checkboxChangeOther(objCheckbox, objTextFieldOther)
{
	if (objCheckbox.checked)
	{
		objTextFieldOther.focus();
	}
	else
	{
		objTextFieldOther.value = "";
		objTextFieldOther.blur();
	}
}


function checkboxConflict(objCheckbox, objTextFieldOther)
{
	return (objTextFieldOther.value!="" && !(objCheckbox.checked));
}


function IsNumeric(sText)
{
   var ValidChars = "0123456789.-+ ";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}


function validEmailSyntax(str)
{
	emailAdr = allTrim(str);
	atIndex = emailAdr.indexOf("@",0);
	return (atIndex!=-1 && atIndex==emailAdr.lastIndexOf("@",emailAdr.length) && emailAdr.indexOf(".",atIndex)!=-1 && emailAdr.indexOf(" ",0)==-1);
}


function validWebsiteSyntax(str)
{
	websiteAdr = allTrim(str);
	return (websiteAdr!="http://" && websiteAdr.indexOf(".",0)!=-1 && websiteAdr.indexOf(" ",0)==-1);
}


function leftTrim(str)
{
	texte = str;
	while (texte.substring(0,1) == " ")
	{
		texte = texte.substring(1,texte.length);
	}
	return texte;
}


function rightTrim(str)
{
	texte = str;
	while (texte.substring(texte.length-1,texte.length) == " ")
	{
		texte = texte.substring(0,texte.length-1);
	}
	return texte;
}


function allTrim(str)
{
	return rightTrim(leftTrim(str));
}


function delayLink(adr, delay)
{
	setTimeout('location="'+adr+'"', delay);
}



//---------------
function validateEmail(ea) {
	if ( form.email.value.length == 0 ){
		alert("Please Enter Your Email Address"); 
		form.email.focus();
		return false;
	}
	if (checkEmail(form.email.value) == false) {
	    form.email.value=""
	    form.email.focus();
	    return false;
	}
}

function checkEmail(ea)
{
    var reEmail = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    if (!reEmail.test(ea)) {
        alert("Please enter a valid Email Address!")
        return false
    }
    return true
}

function changeCase(frmObj) {
var index;
var tmpStr;
var tmpChar;
var preString;
var postString;
var strlen;
tmpStr = frmObj.value.toLowerCase();
strLen = tmpStr.length;
if (strLen > 0)  {
for (index = 0; index < strLen; index++)  {
if (index == 0)  {
tmpChar = tmpStr.substring(0,1).toUpperCase();
postString = tmpStr.substring(1,strLen);
tmpStr = tmpChar + postString;
}
else {
tmpChar = tmpStr.substring(index, index+1);
if (tmpChar == " " && index < (strLen-1))  {
tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
preString = tmpStr.substring(0, index+1);
postString = tmpStr.substring(index+2,strLen);
tmpStr = preString + tmpChar + postString;
         }
      }
   }
}
frmObj.value = tmpStr;
}



// calculate the ASCII code of the given character
function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}

function checkNumber(val) {
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);

  /* Check if the keyed in character is a number
     do you want alphabetic UPPERCASE only ?
     or lower case only just check their respective
     codes and replace the 48 and 57 */

  if (cCode < 48 || cCode > 57 ) {
    var myNumber = val.value.substring(0, (strLength) - 1);
    val.value = myNumber;
  }
  return false;
}

function checkLetter(val) {
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);

  /* Check if the keyed in character is a number
     do you want alphabetic UPPERCASE only ?
     or lower case only just check their respective
     codes and replace the 48 and 57 */

  if (cCode < 65 || cCode > 122) {
	  //allow dash - hyphen
	  if (cCode != 32 || cCode != 45) {
		var myNumber = val.value.substring(0, (strLength) - 1);
		val.value = myNumber;
	  }
  }
  return false;
}

function fixPhone(x) {

	//strip invalid characters
	for (i = 0; i < x.value.length; i++) {
		
		x.value = x.value.replace('-','');
		x.value = x.value.replace(' ','');
		x.value = x.value.replace('.','');
		x.value = x.value.replace('(','');
		x.value = x.value.replace(')','');
		x.value = x.value.replace('_','');
		x.value = x.value.replace('!','');
		x.value = x.value.replace('@','');
		x.value = x.value.replace('#','');
		x.value = x.value.replace('$','');
		x.value = x.value.replace('%','');
		x.value = x.value.replace('^','');
		x.value = x.value.replace('&','');
		x.value = x.value.replace('*','');
		x.value = x.value.replace('=','');
		
		//these must be in this order because they contain each other
		x.value = x.value.replace('ext','');
		x.value = x.value.replace('ex','');
		x.value = x.value.replace('x','');
	}

	//strip leading one
	if (x.value.substring(0,1) == "1") {
		x.value = x.value.substring(1,x.value.length);
	}

	//format number == 10
	if (x.value.length == 10) { 
		x.value = "(" + x.value.substring(0,3) + ") " + x.value.substring(3,6) + "-" + x.value.substring(6,x.value.length);
	}

	//format number > 10 (extension)
	else if (x.value.length > 10) { 
		x.value = "(" + x.value.substring(0,3) + ") " + x.value.substring(3,6) + "-" + x.value.substring(6,10) + " x" + x.value.substring(10,x.value.length);
	}

}//end function fixPhone




function changeToLowerCase(Obj) {
	Obj.value=Obj.value.toLowerCase();
}

function doLink(url) {
//	alert(url);
	window.location.href = url;
}



function validate(formName,part) {
	////alert("formName=" + formName.name);
	
	strAlert = "";
	
	if(formName.name=='personnal')  {
	
		if(document.personnal.recruiting_requisition.checked==false && document.personnal.recruiting_screening.checked==false && document.personnal.recruiting_hire.checked==false && document.personnal.recruiting_reporting.checked==false && document.personnal.talent_performance.checked==false && document.personnal.talent_employee.checked==false && document.personnal.talent_compensation.checked==false && document.personnal.talent_succession.checked==false){
			strAlert = strAlert + "You must check at least one module on the left.\n";
			//return false;
		}
		if(eval("document." + formName.name).firstname.value=="") {
			strAlert = strAlert + "First name is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).lastname.value=="") {
			strAlert = strAlert + "Last name is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).company.value=="") {
			strAlert = strAlert + "Company name is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).jobtitle.value=="") {
			strAlert = strAlert + "Job title is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).email.value=="") {
			strAlert = strAlert + "Email is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).phone.value=="") {
			strAlert = strAlert + "Phone number is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).city.value=="") {
			strAlert = strAlert + "City is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).state.value=="") {
			strAlert = strAlert + "State is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).country.value=="") {
			strAlert = strAlert + "Country is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).zipcode.value=="") {
			strAlert = strAlert + "Zip Code is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).employees.value=="") {
			strAlert = strAlert + "Total Employees is mandatory.\n";
			//return false;
		}
		if(eval("document." + formName.name).purchase.value=="") {
			strAlert = strAlert + "Purchase Timeframe is mandatory.\n";
			//return false;
		}
		
		////alert(strAlert);
		if(strAlert=='') {
			document.personnal.submit();
		} else {
			alert(strAlert);
		}
		
	} else if(formName.name=='questions') {
		
		
			
		
		
		
		if(part=='part1') {
			//alert("allo");
			//////////////////////////////////////////////////
			//Hiring request 
			var cnt = -1;
			for (var i=document.questions.recHiring.length-1; i > -1; i--) {
				if (document.questions.recHiring[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {				
				showMissing('recHiring','');
			} else {
				strAlert = strAlert + "You must answer : Hiring request.\n";
				showMissing('recHiring','error');
				
			}
			
			//////////////////////////////////////////////////
			//Requisition creation
			var cnt = -1;
			for (var i=document.questions.recRequisition.length-1; i > -1; i--) {
				if (document.questions.recRequisition[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recRequisition','');
			} else {
				strAlert = strAlert + "You must answer : Requisition creation.\n";
				showMissing('recRequisition','error');
			}	
			
			
			//////////////////////////////////////////////////
			//Requisition approval 
			var cnt = -1;
			for (var i=document.questions.recRequisitionApproval.length-1; i > -1; i--) {
				if (document.questions.recRequisitionApproval[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recRequisitionApproval','');
			} else {
				showMissing('recRequisitionApproval','error');
strAlert = strAlert + "You must answer : Requisition approval.\n";
				
			}	
			
			//////////////////////////////////////////////////
			//Sourcing strategy
			var cnt = -1;
			for (var i=document.questions.recSourcingStrategy.length-1; i > -1; i--) {
				if (document.questions.recSourcingStrategy[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recSourcingStrategy','');
			} else {
				showMissing('recSourcingStrategy','error');
strAlert = strAlert + "You must answer : Sourcing strategy.\n";
			}	
			
			//////////////////////////////////////////////////
			//Corporate Careers Site
			var cnt = -1;
			for (var i=document.questions.recCorporateCareers.length-1; i > -1; i--) {
				if (document.questions.recCorporateCareers[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recCorporateCareers','');
			} else {
				showMissing('recCorporateCareers','error');
strAlert = strAlert + "You must answer : Corporate Careers Site.\n";
			}	
			
			//////////////////////////////////////////////////
			//Job Board Management
			var cnt = -1;
			for (var i=document.questions.recJobBoardManagement.length-1; i > -1; i--) {
				if (document.questions.recJobBoardManagement[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recJobBoardManagement','');
			} else {
				showMissing('recJobBoardManagement','error');
strAlert = strAlert + "You must answer : Job Board Management.\n";
			}	
			
			//////////////////////////////////////////////////
			//Sourcing
			var cnt = -1;
			for (var i=document.questions.recSourcing.length-1; i > -1; i--) {
				if (document.questions.recSourcing[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recSourcing','');
			} else {
				showMissing('recSourcing','error');
strAlert = strAlert + "You must answer : Sourcing.\n";
			}
			
			//////////////////////////////////////////////////
			//3rd Party Recruiting Agency
			var cnt = -1;
			for (var i=document.questions.rec3rdParty.length-1; i > -1; i--) {
				if (document.questions.rec3rdParty[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('rec3rdParty','');
			} else {
				showMissing('rec3rdParty','error');
strAlert = strAlert + "You must answer : 3rd Party Recruiting Agency.\n";
			}
			
			//////////////////////////////////////////////////
			//Posting to Employees
			var cnt = -1;
			for (var i=document.questions.recPostingEmployee.length-1; i > -1; i--) {
				if (document.questions.recPostingEmployee[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recPostingEmployee','');
			} else {
				showMissing('recPostingEmployee','error');
strAlert = strAlert + "You must answer : Posting to Employees.\n";
			}
			
			//////////////////////////////////////////////////
			//Employee Referrals
			var cnt = -1;
			for (var i=document.questions.recEmployeeReferrals.length-1; i > -1; i--) {
				if (document.questions.recEmployeeReferrals[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recEmployeeReferrals','');
			} else {
				showMissing('recEmployeeReferrals','error');
strAlert = strAlert + "You must answer : Employee Referrals.\n";
			}
			
			//////////////////////////////////////////////////
			//Channeling & Acknowledgement Candidates
			var cnt = -1;
			for (var i=document.questions.recChanneling.length-1; i > -1; i--) {
				if (document.questions.recChanneling[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recChanneling','');
			} else {
				showMissing('recChanneling','error');
strAlert = strAlert + "You must answer : Channeling & Acknowledgement Candidates.\n";
			}
			
			
			
		} else if(part=='part2') {
			
			//////////////////////////////////////////////////
			//Profiling Question
			var cnt = -1;
			for (var i=document.questions.recProfilingQuestion.length-1; i > -1; i--) {
				if (document.questions.recProfilingQuestion[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recProfilingQuestion','');
			} else {
				showMissing('recProfilingQuestion','error');
strAlert = strAlert + "You must answer : Profiling Question.\n";
			}
			
			//////////////////////////////////////////////////
			//Pre-screening
			var cnt = -1;
			for (var i=document.questions.recPreScreening.length-1; i > -1; i--) {
				if (document.questions.recPreScreening[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recPreScreening','');
			} else {
				showMissing('recPreScreening','error');
strAlert = strAlert + "You must answer : Pre-screening.\n";
			}
			
			//////////////////////////////////////////////////
			//Assessment Testing
			var cnt = -1;
			for (var i=document.questions.recAssessmentTesting.length-1; i > -1; i--) {
				if (document.questions.recAssessmentTesting[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recAssessmentTesting','');
			} else {
				showMissing('recAssessmentTesting','error');
strAlert = strAlert + "You must answer : Assessment Testing.\n";
			}
			
			//////////////////////////////////////////////////
			//Interview
			var cnt = -1;
			for (var i=document.questions.recInterview.length-1; i > -1; i--) {
				if (document.questions.recInterview[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recInterview','');
			} else {
				showMissing('recInterview','error');
strAlert = strAlert + "You must answer : Interview.\n";
			}
			
		} else if(part=='part3') {
			
			//////////////////////////////////////////////////
			//Background Checking Suppliers
			var cnt = -1;
			for (var i=document.questions.recBackgroundChecking.length-1; i > -1; i--) {
				if (document.questions.recBackgroundChecking[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recBackgroundChecking','');
			} else {
				showMissing('recBackgroundChecking','error');
strAlert = strAlert + "You must answer : Background Checking Suppliers.\n";
			}
			
			//////////////////////////////////////////////////
			//Offer Letter
			var cnt = -1;
			for (var i=document.questions.recOfferLetter.length-1; i > -1; i--) {
				if (document.questions.recOfferLetter[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recOfferLetter','');
			} else {
				showMissing('recOfferLetter','error');
strAlert = strAlert + "You must answer : Offer Letter.\n";
			}
			
			//////////////////////////////////////////////////
			//Onboarding Process
			var cnt = -1;
			for (var i=document.questions.recOnboardingProcess.length-1; i > -1; i--) {
				if (document.questions.recOnboardingProcess[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recOnboardingProcess','');
			} else {
				showMissing('recOnboardingProcess','error');
strAlert = strAlert + "You must answer : Onboarding Process.\n";
			}
			
			//////////////////////////////////////////////////
			//Forms and payroll enrollment
			var cnt = -1;
			for (var i=document.questions.recFormsPayroll.length-1; i > -1; i--) {
				if (document.questions.recFormsPayroll[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recFormsPayroll','');
			} else {
				showMissing('recFormsPayroll','error');
strAlert = strAlert + "You must answer : Forms and payroll enrollment.\n";
			}
			
		} else if(part=='part4') {
			
			//////////////////////////////////////////////////
			//Reporting and Metrics
			var cnt = -1;
			for (var i=document.questions.recReportingMetrics.length-1; i > -1; i--) {
				if (document.questions.recReportingMetrics[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recReportingMetrics','');
			} else {
				showMissing('recReportingMetrics','error');
strAlert = strAlert + "You must answer : Reporting and Metrics.\n";
			}
			
			//////////////////////////////////////////////////
			//Sourcing and Analytics
			var cnt = -1;
			for (var i=document.questions.recSourcingAnalytics.length-1; i > -1; i--) {
				if (document.questions.recSourcingAnalytics[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recSourcingAnalytics','');
			} else {
				showMissing('recSourcingAnalytics','error');
strAlert = strAlert + "You must answer : Sourcing and Analytics.\n";
			}
			
			//////////////////////////////////////////////////
			//Process Improvement
			var cnt = -1;
			for (var i=document.questions.recProcessImprovement.length-1; i > -1; i--) {
				if (document.questions.recProcessImprovement[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recProcessImprovement','');
			} else {
				showMissing('recProcessImprovement','error');
strAlert = strAlert + "You must answer : Process Improvement.\n";
			}
			
			//////////////////////////////////////////////////
			//Compliance
			var cnt = -1;
			for (var i=document.questions.recCompliance.length-1; i > -1; i--) {
				if (document.questions.recCompliance[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recCompliance','');
			} else {
				showMissing('recCompliance','error');
strAlert = strAlert + "You must answer : Compliance.\n";
			}
			
			//////////////////////////////////////////////////
			//Quality of Hire
			var cnt = -1;
			for (var i=document.questions.recQualityOfHire.length-1; i > -1; i--) {
				if (document.questions.recQualityOfHire[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('recQualityOfHire','');
			} else {
				showMissing('recQualityOfHire','error');
strAlert = strAlert + "You must answer : Quality of Hire.\n";
			}
			
		} else if(part=='part5') {
			
			
			//////////////////////////////////////////////////
			//tm 10
			var cnt = -1;
			document.questions.arrTm10.value = "";
			for (var i=document.questions.tm10.length-1; i > -1; i--) {
				
				if (document.questions.tm10[i].checked) {										
					document.questions.arrTm10.value += document.questions.tm10[i].value + ",";					
				}
			}
			if (document.questions.arrTm10.value != '') {
				showMissing('tm10','');
			} else {
showMissing('tm10','error');
				strAlert = "You must answer all questions in this part.\n";
			}

			////alert(document.questions.arrTm10.value);
			
			//////////////////////////////////////////////////
			//tm 20
			var cnt = -1;
			for (var i=document.questions.tm20.length-1; i > -1; i--) {
				if (document.questions.tm20[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm20','');
			} else {
showMissing('tm20','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm30
			
			
			document.questions.arrTm30.value = "";
			var cnt = -1;			
			for (var i=document.questions.tm30.length-1; i > -1; i--) {
				
				if (document.questions.tm30[i].checked) {										
					document.questions.arrTm30.value += document.questions.tm30[i].value + ",";					
				}
			}
			
			//Automaticly answer the last answer
			if(document.questions.tm20[2].checked || document.questions.tm20[3].checked) {
				//document.questions.arrTm30.value = document.questions.tm30.length + ',';
			}
			
			if (document.questions.arrTm30.value != '' || document.questions.tm20[2].checked || document.questions.tm20[3].checked) {
				showMissing('tm30','');
			} else {
				showMissing('tm30','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm40
			var cnt = -1;
			for (var i=document.questions.tm40.length-1; i > -1; i--) {
				if (document.questions.tm40[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm40','');
			} else {
showMissing('tm40','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm50
			var cnt = -1;
			for (var i=document.questions.tm50.length-1; i > -1; i--) {
				if (document.questions.tm50[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			
			//Automaticly answer the last answer
			if(document.questions.tm40[3].checked || document.questions.tm40[4].checked) {
				//document.questions.tm50[document.questions.tm50.length-1].checked = true;
			}
			//alert(document.questions.tm50.value);
			
			if (cnt > -1 || document.questions.tm40[3].checked || document.questions.tm40[4].checked) {
				showMissing('tm50','');
			} else {
showMissing('tm50','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm60
			var cnt = -1;
			for (var i=document.questions.tm60.length-1; i > -1; i--) {
				if (document.questions.tm60[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm60','');
			} else {
showMissing('tm60','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm70
			var cnt = -1;
			for (var i=document.questions.tm70.length-1; i > -1; i--) {
				if (document.questions.tm70[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm70','');
			} else {
showMissing('tm70','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
		} else if(part=='part6') {
			
			//////////////////////////////////////////////////
			//tm80
			var cnt = -1;
			for (var i=document.questions.tm80.length-1; i > -1; i--) {
				if (document.questions.tm80[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm80','');
			} else {
showMissing('tm80','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm90
			
			document.questions.arrTm90.value = "";
			var cnt = -1;			
			for (var i=document.questions.tm90.length-1; i > -1; i--) {
				
				if (document.questions.tm90[i].checked) {										
					document.questions.arrTm90.value += document.questions.tm90[i].value + ",";					
				}
			}
			if (document.questions.arrTm90.value != ''  || document.questions.tm80[3].checked || document.questions.tm80[4].checked) {
				
				showMissing('tm90','');
			} else {
showMissing('tm90','error');
						
				strAlert = "You must answer all questions in this part.\n";
			}
			
			
			//////////////////////////////////////////////////
			//tm100
			var cnt = -1;
			for (var i=document.questions.tm100.length-1; i > -1; i--) {
				if (document.questions.tm100[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1  || document.questions.tm80[3].checked || document.questions.tm80[4].checked) {
				showMissing('tm100','');
			} else {
showMissing('tm100','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm110
			document.questions.arrTm110.value = "";
			var cnt = -1;			
			for (var i=document.questions.tm110.length-1; i > -1; i--) {
				
				if (document.questions.tm110[i].checked) {										
					document.questions.arrTm110.value += document.questions.tm110[i].value + ",";					
				}
			}
			if (document.questions.arrTm110.value != '') {
				showMissing('tm110','');
			} else {
showMissing('tm110','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			
			//////////////////////////////////////////////////
			//tm120
			var cnt = -1;
			for (var i=document.questions.tm120.length-1; i > -1; i--) {
				if (document.questions.tm120[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm120','');
			} else {
showMissing('tm120','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
		} else if(part=='part7') {
			
			//////////////////////////////////////////////////
			//tm130
			var cnt = -1;
			for (var i=document.questions.tm130.length-1; i > -1; i--) {
				if (document.questions.tm130[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm130','');
			} else {
showMissing('tm130','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm140
			var cnt = -1;
			for (var i=document.questions.tm140.length-1; i > -1; i--) {
				if (document.questions.tm140[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm140','');
			} else {
showMissing('tm140','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm150
			document.questions.arrTm150.value = "";
			var cnt = -1;			
			for (var i=document.questions.tm150.length-1; i > -1; i--) {
				
				if (document.questions.tm150[i].checked) {										
					document.questions.arrTm150.value += document.questions.tm150[i].value + ",";					
				}
			}
			if (document.questions.arrTm150.value != ''  || document.questions.tm140[2].checked) {
				showMissing('tm150','');
			} else {
showMissing('tm150','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm160
			var cnt = -1;
			for (var i=document.questions.tm160.length-1; i > -1; i--) {
				if (document.questions.tm160[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm160','');
			} else {
showMissing('tm160','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm170
			var cnt = -1;
			for (var i=document.questions.tm170.length-1; i > -1; i--) {
				if (document.questions.tm170[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm170','');
			} else {
showMissing('tm170','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm180
			document.questions.arrTm180.value = "";
			var cnt = -1;			
			for (var i=document.questions.tm180.length-1; i > -1; i--) {
				
				if (document.questions.tm180[i].checked) {										
					document.questions.arrTm180.value += document.questions.tm180[i].value + ",";					
				}
			}
			if (document.questions.arrTm180.value != '') {
				showMissing('tm180','');
			} else {
showMissing('tm180','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
		} else if(part=='part8') {
			
			//////////////////////////////////////////////////
			//tm190
			var cnt = -1;
			for (var i=document.questions.tm190.length-1; i > -1; i--) {
				if (document.questions.tm190[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm190','');
			} else {
showMissing('tm190','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm200
			document.questions.arrTm200.value = "";
			var cnt = -1;			
			for (var i=document.questions.tm200.length-1; i > -1; i--) {
				
				if (document.questions.tm200[i].checked) {										
					document.questions.arrTm200.value += document.questions.tm200[i].value + ",";					
				}
			}
			if (document.questions.arrTm200.value != '') {
				showMissing('tm200','');
			} else {
showMissing('tm200','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm210
			document.questions.arrTm210.value = "";
			var cnt = -1;			
			for (var i=document.questions.tm210.length-1; i > -1; i--) {
				
				if (document.questions.tm210[i].checked) {										
					document.questions.arrTm210.value += document.questions.tm210[i].value + ",";					
				}
			}
			if (document.questions.arrTm210.value != '') {
				showMissing('tm210','');
			} else {
showMissing('tm210','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			
			//////////////////////////////////////////////////
			//tm220
			var cnt = -1;
			for (var i=document.questions.tm220.length-1; i > -1; i--) {
				if (document.questions.tm220[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm220','');
			} else {
showMissing('tm220','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm230
			var cnt = -1;
			for (var i=document.questions.tm230.length-1; i > -1; i--) {
				if (document.questions.tm230[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm230','');
			} else {
showMissing('tm230','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm240
			document.questions.arrTm240.value = "";
			var cnt = -1;			
			for (var i=document.questions.tm240.length-1; i > -1; i--) {
				
				if (document.questions.tm240[i].checked) {										
					document.questions.arrTm240.value += document.questions.tm240[i].value + ",";					
				}
			}
			if (document.questions.arrTm240.value != '') {
				showMissing('tm240','');
			} else {
showMissing('tm240','error');
				strAlert = "You must answer all questions in this part.\n";
			}
		} else if(part=='part9') {
		
		
		//////////////////////////////////////////////////
			//tm250
			var cnt = -1;
			for (var i=document.questions.tm250.length-1; i > -1; i--) {
				if (document.questions.tm250[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm250','');
			} else {
showMissing('tm250','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm260
			var cnt = -1;
			for (var i=document.questions.tm260.length-1; i > -1; i--) {
				if (document.questions.tm260[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm250','');
			} else {
showMissing('tm260','error');
				strAlert = "You must answer all questions in this part.\n";
			}
		
		
		//////////////////////////////////////////////////
			//tm270
			var cnt = -1;
			for (var i=document.questions.tm270.length-1; i > -1; i--) {
				if (document.questions.tm270[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm250','');
			} else {
showMissing('tm270','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm280
			var cnt = -1;
			for (var i=document.questions.tm280.length-1; i > -1; i--) {
				if (document.questions.tm280[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm250','');
			} else {
showMissing('tm280','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm290
			var cnt = -1;
			for (var i=document.questions.tm290.length-1; i > -1; i--) {
				if (document.questions.tm290[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm250','');
			} else {
showMissing('tm290','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm300
			var cnt = -1;
			for (var i=document.questions.tm300.length-1; i > -1; i--) {
				if (document.questions.tm300[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm250','');
			} else {
showMissing('tm300','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm310
			var cnt = -1;
			for (var i=document.questions.tm310.length-1; i > -1; i--) {
				if (document.questions.tm310[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm250','');
			} else {
showMissing('tm310','error');
				strAlert = "You must answer all questions in this part.\n";
			}
			
			//////////////////////////////////////////////////
			//tm320
			var cnt = -1;
			for (var i=document.questions.tm320.length-1; i > -1; i--) {
				if (document.questions.tm320[i].checked) {
					cnt = i; 
					i = -1;
				}
			}
			if (cnt > -1) {
				showMissing('tm320','');
			} else {
showMissing('tm320','error');
				strAlert = "You must answer all questions in this part.\n";
			}
		}
		//Check if the strategy staffing is ok	
		if(document.questions.recFaster.value != '') {
			//alert('faster=' + document.questions.recFaster.value);
			//alert('improve=' + document.questions.recImprove.value);
			//alert('reduce=' + document.questions.recReduce.value);
			if(document.questions.recFaster.value == document.questions.recImprove.value || document.questions.recFaster.value == document.questions.recReduce.value || document.questions.recImprove.value == document.questions.recReduce.value) {
				strAlert += "\nThe Strategy Staffing Initiatives must have a unique number.\n";
				
			}			
		}
		
		//Check if the strategy staffing is ok	
		if(document.questions.tmInit10.value != '') {
			//alert("allo");
			if(document.questions.tmInit10.value == document.questions.tmInit20.value || document.questions.tmInit10.value == document.questions.tmInit30.value || document.questions.tmInit10.value == document.questions.tmInit40.value || document.questions.tmInit10.value == document.questions.tmInit50.value || document.questions.tmInit20.value == document.questions.tmInit30.value || document.questions.tmInit20.value == document.questions.tmInit40.value || document.questions.tmInit20.value == document.questions.tmInit50.value || document.questions.tmInit30.value == document.questions.tmInit40.value || document.questions.tmInit30.value == document.questions.tmInit50.value  || document.questions.tmInit40.value == document.questions.tmInit50.value) {
				strAlert += "\nThe Talent Management Initiatives must have a unique number.\n";
			}			
		}
		
		////alert(strAlert);
		if(strAlert=='') {
			//alert("allo");
			document.questions.submit();
			//alert("allo");
		} else {
			alert(strAlert);
		}
		
	}
	
	
}

function displayOrHide(action,div) {
	display = getLayer(div);
	if(action=='display') {	
		display.style.display="block";
	} else {
		display.style.display="none";
	}
	
	
}
