// JavaScript Document
	function sendCandidateProfile() {
		username =document.MAIN_FORM.username.value;
	 	pass1=document.MAIN_FORM.pw1.value;
	 	pass2=document.MAIN_FORM.pw2.value;
	if (controlUserName(username)==false)
	{
	 alert(" - Your username must contain at least 6 characters. \n - Spaces and special characters like: *,&,%,$,@,',... are not accepted.\n");
		document.MAIN_FORM.username.focus();
		return;
	 }
	 if (controlUserPassword(pass1)==false)
	 {
		 alert(" - Your password must contain at least 6 characters.\n - Spaces and special characters like: *,&,%,$,@,',... are not accepted.\n");
 		 document.MAIN_FORM.pw1.value="";
  		 document.MAIN_FORM.pw2.value="";
		 document.MAIN_FORM.pw1.focus();
		return;
	 }
	 if (pass1!=pass2)
	 {
		alert("Both passwords must be identical.");
 		 document.MAIN_FORM.pw1.value="";
  		 document.MAIN_FORM.pw2.value="";
		 document.MAIN_FORM.pw1.focus();
		return;
	 }
	 else
	 {
	
        document.MAIN_FORM.hiddenAction.value = "getNewCandidatStep1Page";
        document.MAIN_FORM.submit();
	  }
    }
	
	function controlUserName(src){
	  	var regex = /^[a-zA-Z0-9._-]{6,12}$/;
  		return regex.test(src);
	}
	function controlUserPassword(src){
	  	var regex = /^[a-zA-Z0-9]{6,12}$/;
  		return regex.test(src);
	}
//Javascript for Candidate subscription step2

function sendCandidateProfileStep1() {
	//Recuperation des donnees du formulaire
		lastName =document.MAIN_FORM.last_name.value;
		FirstName =document.MAIN_FORM.first_name.value;
		Country =document.MAIN_FORM.cboCountry.value;
		city = document.MAIN_FORM.city.value;
		zip = document.MAIN_FORM.zip.value;
		email = document.MAIN_FORM.email.value;
		phone1 = document.MAIN_FORM.phone1.value;
		phone2 = document.MAIN_FORM.phone2.value;
		
		if (controlFirstLastName(lastName)==false)
		 {
			 alert("The last name you have submitted is invalid."); 
			  document.MAIN_FORM.last_name.focus();
			return;
		 }
		 if (controlFirstLastName(FirstName)==false)
		 {
			 alert("The first name you have submitted is invalid."); 
			  document.MAIN_FORM.first_name.focus();
			return;
		 }
		 if (city!="")
		 {
			 if (controlVille(city)==false)
			 {
				 alert("The city name is invalid."); 
				  document.MAIN_FORM.city.focus();
				return;
			 }
		 }
/////Nouveau pour la France, Si autre que France, vérifier le code postal et le telephone avec l'indicatif regional//////
		if (parseInt(Country) == 1)
		{
			phone_ind1 = document.MAIN_FORM.phone_ind1.value;
			phone_ind2 = document.MAIN_FORM.phone_ind2.value;
			phone_ext2 = document.MAIN_FORM.phone_ext2.value;
		
			if (zip!="" && isPostCode(zip)==false)
		 	{
			 	 	alert("The Postal Code is invalid."); 
				  	document.MAIN_FORM.zip.focus();
					return;
			 }
		
			if (phone1=="" && phone2=="" && phone_ind1=="" && phone_ind2=="" && phone_ext2 =="")
		 	{
		 		alert("You have to submit at least one phone number"); 					 
				document.MAIN_FORM.phone_ind1.focus();
				return;			 
		 	}
		 	if(phone1=="" && phone_ind1!="" )
		 	{
		 		alert("You have to complete your phone number"); 
				document.MAIN_FORM.phone1.focus();
				return;
		 	}
		 	if(phone1!="" && phone_ind1=="" )
		 	{
		 		alert("You have to submit your regional phone code"); 
				document.MAIN_FORM.phone_ind1.focus();
				return;
		 	}
		if (phone1!="")
		 	{
			 	if (controlPhone(phone1)==false)
			 	{
				 	alert("The phone number is invalid"); 
				  	document.MAIN_FORM.phone1.focus();
					return;
			 	}
				if (phone_ind1=="")
		 		{
			 		alert("You have to submit your regional phone code"); 
					document.MAIN_FORM.phone_ind1.focus();
					return;
				}
				else
				{
					if (controlIndicatifPhone(phone_ind1)==false)
					{
						alert("The regional phone code is invalid");
						document.MAIN_FORM.phone_ind1.focus();
						return;
				 	}			 
			 	}			 
		 	}
		 	if(phone2=="" && phone_ind2!="" )
		 	{
		 		alert("You have to complete your phone number"); 
				document.MAIN_FORM.phone2.focus();
				return;
		 	}
		 	if(phone2!="" && phone_ind2=="" )
		 	{
		 		alert("You have to submit your regional phone code"); 
				document.MAIN_FORM.phone_ind2.focus();
				return;
		 	}
		 	if (phone2!="")
		 	{
			 	if (controlPhone(phone2)==false)
			 	{
				 	alert("The phone number is invalid"); 
				 	document.MAIN_FORM.phone2.focus();
					return;
				}
				if (phone_ind2=="")
		 	 	{
			 		alert("You have to submit your regional phone code");  
					document.MAIN_FORM.phone_ind2.focus();
					return;
			 	}
			 else
			 {
				 if (controlIndicatifPhone(phone_ind2)==false)
				 {
					  alert("The regional phone code is invalid"); 
					  document.MAIN_FORM.phone_ind2.focus();
					return;
				 }			 
			 }		 
			 }
		 if (phone_ext2!="")
		 {
			 if (phone_ind2=="" && phone2=="")
		 	 {
			 	alert("You have to submit the phone number first"); 
				document.MAIN_FORM.phone_ind2.focus();
				return;
			 }
			 if (controlExtPhone(phone_ext2)==false)
			 {
				  alert("The phone extension you submitted is invalid");  
				  document.MAIN_FORM.phone_ext2.focus();
				return;
			 }
		 }
		}
		else
		{
			if (phone1=="" && phone2=="" )
		 	{
		 		alert("You have to submit at least one phone number !"); 			 
				document.MAIN_FORM.phone1.focus();
				return;			 
		 	}
			
		 }
////////Fin Nouveau /////////////////////
		 if (controlEmail(email)==false)
		 {
			  alert("The email address you submitted is invalid"); 
			  document.MAIN_FORM.email.focus();
			return;
		 }
		 	
			document.MAIN_FORM.hiddenAction.value = "getNewCandidatStep2Page";
			document.MAIN_FORM.submit();
		 
    }
	
///Javascript for Employers
	function sendAction(action) {
		if(action =="getCreateEmployer1Page")
		{ //recuperer les donnees du formulaire
			username =document.frmCreateEmployer0.txtUserName.value;
	 		pass1=document.frmCreateEmployer0.txtPassword.value;
	 		pass2=document.frmCreateEmployer0.txtPassword2.value;
			if (controlUserName(username)==false)
	 		{
				 alert(" - Your username must contain at least 6 characters. \n - Spaces and special characters like: *,&,%,$,@,',... are not accepted.\n");
				 document.frmCreateEmployer0.txtUserName.focus();
				 return;
			}
			 if (controlUserPassword(pass1)==false)
			 {
				 alert(" - Your password must contain at least 6 characters.\n - Spaces and special characters like: *,&,%,$,@,',... are not accepted.\n");
				 document.frmCreateEmployer0.txtPassword.value="";
				 document.frmCreateEmployer0.txtPassword2.value="";
				 document.frmCreateEmployer0.txtPassword.focus();
				return;
			 }
			 if (pass1!=pass2)
			 {
				 alert("Both passwords must be identical.");
				 document.frmCreateEmployer0.txtPassword.value="";
				 document.frmCreateEmployer0.txtPassword2.value="";
				 document.frmCreateEmployer0.txtPassword.focus();
				return;
			 }			
		}
		//traitement fini envoyer a l'etape suivante
        document.frmCreateEmployer0.hiddenAction.value = action;
        document.frmCreateEmployer0.submit();
		}
		
		function sendActionStep1(action) {
		if(action =="createEmployer")
		{ //recuperer les donnees du formulaire
		//Recuperation des donnees du formulaire
		CompanyName =document.frmCreateEmployer1.txtCompanyName.value;
		city = document.frmCreateEmployer1.txtCity.value;
		zip = document.frmCreateEmployer1.txtZip.value;
		lastName = document.frmCreateEmployer1.txtContactLastName.value;
		FirstName = document.frmCreateEmployer1.txtContactFirstName.value;
		email = document.frmCreateEmployer1.txtEmail.value;
		txtPhoneInd = document.frmCreateEmployer1.txtPhoneInd.value;
		txtPhone = document.frmCreateEmployer1.txtPhone.value;
		txtPhoneExt = document.frmCreateEmployer1.txtPhoneExt.value;
		txtFaxInd = document.frmCreateEmployer1.txtFaxInd.value;
		txtFax = document.frmCreateEmployer1.txtFax.value;
		txtPhoneExt = document.frmCreateEmployer1.txtPhoneExt.value;
		txtWebSite = document.frmCreateEmployer1.txtWebSite.value;
		if (controlCompagnyName(CompanyName)==false)
		 {
			 alert("The company name you submitted is invalid"); 
			  document.frmCreateEmployer1.txtCompanyName.focus();
			return;
		 }

             if (city!="")
		 {
			 if (controlVille(city)==false)
			 {
				 alert("The city name is invalid"); 
				  document.frmCreateEmployer1.txtCity.focus();
				return;
			 }
		 }
		 if (zip!="" && isPostCode(zip)==false)
		 {
			 	alert("The Postal Code is invalid."); 
				document.frmCreateEmployer1.zip.focus();
				return;
		 }
		if (controlFirstLastName(lastName)==false)
		 {
			 alert("The last name you have submitted is invalid."); 
			  document.frmCreateEmployer1.txtContactLastName.focus();
			return;
		 }
		 if (controlFirstLastName(FirstName)==false)
		 {
			 alert("The first name you have submitted is invalid."); 
			  document.frmCreateEmployer1.txtContactFirstName.focus();
			return;
		 }
		 if (txtPhoneInd=="" && txtPhone=="")
		 {
		 	alert("You have to submit one phone number"); 
			document.frmCreateEmployer1.txtPhoneInd.focus();
			return;
		 }
		if (controlPhone(txtPhone)==false)
		{
			alert("The phone number is invalid"); 
			document.frmCreateEmployer1.txtPhone.focus();
			return;
		}
		if (txtPhoneInd=="")
		{
			alert("You have to submit your regional phone code"); 
			document.frmCreateEmployer1.txtPhoneInd.focus();
			return;
		}			
		if (controlIndicatifPhone(txtPhoneInd)==false)
		{
			alert("The regional phone code is invalid"); 
			document.frmCreateEmployer1.txtPhoneInd.focus();
			return;
		}
	    if (txtPhoneExt!="")
		{
			if (controlExtPhone(txtPhoneExt)==false)
			{
			   alert("The phone extension you submitted is invalid"); 
			   document.frmCreateEmployer1.txtPhoneExt.focus();
			   return;
			}
		}
		if (txtFax!="" || txtFaxInd!="")
		{
			 if (controlPhone(txtFax)==false)
			 {
				 alert("The Fax number is invalid"); 
				  document.frmCreateEmployer1.txtFax.focus();
				return;
			 }
			 if (txtFaxInd=="")
		 	 {
			 	alert("You have to enter your regional fax code"); 
				document.frmCreateEmployer1.txtFaxInd.focus();
				return;
			 }
			 else
			 {
				 if (controlIndicatifPhone(txtFaxInd)==false)
				 {
					 alert("The regional fax code is invalid"); 
					  document.frmCreateEmployer1.txtFaxInd.focus();
					return;
				 }			 
			 }			 
		 }
		 if (controlEmail(email)==false)
		 {
			 alert("The email address you submitted is invalid"); 
			  document.frmCreateEmployer1.txtEmail.focus();
			return;
		 }
		 if (txtWebSite!="")
		 {
			 if (ControleSiteName(txtWebSite)==false)
			 {
				 alert("The URL you submitted is invalid"); 
				  document.frmCreateEmployer1.txtWebSite.focus();
				return;
			 }
		 }	
		
		
		}
        document.frmCreateEmployer1.hiddenAction.value = action;
        document.frmCreateEmployer1.submit();
		}
		
	function controlFirstLastName(src){
	  	var regex = /^[a-zA-Z èéçêôîÈÉÇÊÔÎ'-]{1,}$/;
  		return regex.test(src);
	}
	function controlVille(src){
	  	//var regex = /^[a-zA-Z' -]{5,}$/;
		var regex = /^[\s\S]{2,}$/;
  		return regex.test(src);
	}
	function controlPhone(src){//j'ai changer ici
	  	var regex = /^[0-9 -]{7,8}$/;
		//var regex = /^[0-9]{1}+[0-9]{1}+[0-9]{1}+(\-{0,1})+[0-9]{1}+[0-9]{1}[0-9]{1}+[0-9]{1}$/;
  		return regex.test(src);
	}
	function controlIndicatifPhone(src){
	  	var regex = /^[0-9]{3}$/;
  		return regex.test(src);
	}
	function controlExtPhone(src){
	  	var regex = /^[0-9]{1,6}$/;
  		return regex.test(src);
	}
	function controlCompagnyName(src){
	  	//var regex = /^[a-zA-Z]{2,}$/;
		var regex = /^[\s\S]{2,}$/;
  		return regex.test(src);
	}
	function ControleSiteName(src) {
//	  var regex = /^[http:\/\/]{0,1}+[a-zA-Z0-9._-]+.[a-zA-Z]{2,4}$/;
	  var regex = /^[a-zA-Z0-9._-]+.[a-zA-Z]{2,4}$/;
	  return regex.test(src);
	}

	/*function controlCodePostal(src)
	{
	  	var regex = /^[a-zA-Z]{1}+[0-9]{1}+[a-zA-Z]{1}+(\-{0,1})+(\s{0,1})+[0-9]{1}+[a-zA-Z]{1}+[0-9]{1}$/;
  		return regex.test(src);
	}*/
	function controlEmail(src){
		var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
		return regex.test(src);
	}
/////////Fin Javascript canidate subscription 
function ValidateLogin(comeIn){
	var errorm = "";
	if(!validarEmail(comeIn.Email.value)){
		if(errorm == "")
			comeIn.Email.focus();
		errorm += "Le courriel n'est pas valide.\n";	
	}
	
	if(comeIn.Pass.value.replace(" ","").length  == 0){
		if (errorm == "")comeIn.Pass.focus();
		errorm += "- SVP Entrer votre mot de passe.\n";
	}
	else{
		if(comeIn.Pass.value.length <= 5){
			if (errorm == "")comeIn.Pass.focus();
			errorm += "Le mot de passe doit comporter au moins 6 caractères.\n - Les espaces et les caractères spéciaux tels que : *,&,%,$,@,',... ne sont pas accepté .\n";
		}
	}
	
	if(errorm == ""){
		comeIn.hiddenAction.value="login";
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

//Function that valid a email structure.
function validarEmail(email_p)
{
  var email = email_p;

  var regEx = new RegExp("^[\\w\.=-]+@([\\w\-]+\\.)+[a-z]{2,4}$");
  if(!regEx.test(email)) 
	return false
  else
	  return true;
}
// JavaScript Document



function validateContact(comeIn){
	var errorm = "";
	if(!validarEmail(comeIn.Email.value)){
		if(errorm == "")
			comeIn.Email.focus();
		errorm += "- Votre \"Email\" doit être valide.\n";	
	}
	

	
	if(replace_all_occurrences(comeIn.ContactDesc.value," ","").length == 0){
		if(errorm == "")
			comeIn.ContactDesc.focus();
		errorm += "- Entrez le \"message\".\n";
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}


function DeleteCart(InType, comeIn){
	comeIn.TypeDel.value = InType;
	comeIn.submit();
}

function addCart(chose, comeIn){
	var prix = 0;
	var Type = 0;
	var Province = comeIn.ProvinceState.value;
	var Quantity = 1;//comeIn.Quantity.value;
	var Domain = comeIn.DomainJobSearch.value;
	//alert('-->'+ Province +' -->> '+Quantity);
	switch (chose){
		case 1:
			prix = 3700 * Quantity;
			Type = 1;
		break;
		case 2:
			prix = 2800 * Quantity;
			Type = 2;
		break;
		case 3:
			prix = 1800 * Quantity;
			Type = 3;
		break;
		case 4:
			prix = 1200 * Quantity;
			Type = 4;
		break;
		default : alert("Rien");
	}
	document.getElementById("Cart").src = "cartShoping.asp?type=" + Type + "&province=" + Province + "&quantity=" + Quantity + "&prix=" + prix + "&domain=" + Domain;
}

function validatePostJob2(comeIn,OptAfter){
	var errorm = "";
	if(comeIn.TypePosition.value == 0){
		if(errorm == "")
			comeIn.TypePosition.focus();
		errorm += "- Entrez le \" type de position\"\n";	
	}
	
	if(replace_all_occurrences(comeIn.theDate.value," ","").length == 0){
		if(errorm == "")
			comeIn.theDate.focus();
		errorm += "- Entrez la \"date de début\".\n";	
	}
	
	if(replace_all_occurrences(comeIn.NumberWeek.value," ","").length == 0){
		if(errorm == "")
			comeIn.NumberWeek.focus();
		errorm += "- Entrez le\"nombre d’heures par semaine\"\n";	
	}
	
	if(comeIn.RequiredEducation.value == 0){
		if(errorm == "")
			comeIn.RequiredEducation.focus();
		errorm += "- Entrez la \"formation requise\"\n";	
	}
	
	if(comeIn.Experience.value == 0){
		if(errorm == "")
			comeIn.Experience.focus();
		errorm += "- Entrez \"l’expérience requise\"\n";	
	}
	
	if(OptAfter == 1)
		comeIn.Versions.value = "1";
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function validatePostJob(comeIn){
	var errorm = "";
	if(replace_all_occurrences(comeIn.JobTitle.value," ","").length == 0){
		if(errorm == "")
			comeIn.JobTitle.focus();
		errorm += "- Entrez le \"titre de l’emploi\"\n";	
	}
	
	if(comeIn.DomainJobSearch.value == 0){
		if(errorm == "")
			comeIn.DomainJobSearch.focus();
		errorm += "- Vous devez choisir \" un domaine d’activité \"\n";	
	}
	
	if(replace_all_occurrences(comeIn.JobDesc.value," ","").length == 0){
		if(errorm == "")
			comeIn.JobDesc.focus();
		errorm += "- Entrez la \" description de poste\"\n";	
	}
	
	if(replace_all_occurrences(comeIn.PostalCode.value," ","").length == 0){
		if(errorm == "")
			comeIn.PostalCode.focus();
		errorm += "- Entrez votre \"code postale\"\n";	
	}
	else{
		if(!isPostCode(comeIn.PostalCode.value)){
			if(errorm == "")
				comeIn.PostalCode.focus();
			errorm += "- Votre \"code postal\" doit être valide\n";	
		}
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function validateCreateCompany(comeIn){
	var errorm = "";
	if(replace_all_occurrences(comeIn.CompanyName.value," ","").length == 0){
		if(errorm == "")
			comeIn.CompanyName.focus();
		errorm += "-  Entrez le nom de \"votre entreprise \"\n";	
	}
	
	if(replace_all_occurrences(comeIn.CompanyDesc.value," ","").length == 0){
		if(errorm == "")
			comeIn.CompanyDesc.focus();
		errorm += "- Entrez votre \"description d’entreprise\"\n";	
	}
	
	if(replace_all_occurrences(comeIn.IndustrySector.value," ","").length == 0){
		if(errorm == "")
			comeIn.IndustrySector.focus();
		errorm += "- Entrez votre\"domaine d’activité\"\n";	
	}
	
	if(replace_all_occurrences(comeIn.Advantage.value," ","").length == 0){
		if(errorm == "")
			comeIn.Advantage.focus();
		errorm += "- Entrez vos\"avantages d’entreprise \"\n";	
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function validateCreateFiles(comeIn){
	var errorm = "";
	if(comeIn.archivo_1.value != "")
		{
		var temp = comeIn.archivo_1.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_1.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + "Le nom du fichier ne peut excéder 200 caractères.\n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "gif" && temp[temp.length-1].toLowerCase() != "jpg")
			errorm = errorm + "Vous pouvez uniquement télécharger les fichiers image .gif ou .jpeg\n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères\n";
		}
	
	if(comeIn.archivo_2.value != "")
		{
		var temp = comeIn.archivo_2.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_2.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères.\n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "doc" && temp[temp.length-1].toLowerCase() != "pdf" && temp[temp.length-1].toLowerCase() != "xls" && temp[temp.length-1].toLowerCase() != "ppt" && temp[temp.length-1].toLowerCase() != "pps")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers .doc, .pdf, .xls, .ppt ou .pps \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		}
	
	if(comeIn.archivo_3.value != "")
		{
		var temp = comeIn.archivo_3.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_3.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "doc" && temp[temp.length-1].toLowerCase() != "pdf" && temp[temp.length-1].toLowerCase() != "xls" && temp[temp.length-1].toLowerCase() != "ppt" && temp[temp.length-1].toLowerCase() != "pps")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers .doc, .pdf, .xls, .ppt ou .pps \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		}
	
	if(comeIn.archivo_4.value != "")
		{
		var temp = comeIn.archivo_4.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_4.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "doc" && temp[temp.length-1].toLowerCase() != "pdf" && temp[temp.length-1].toLowerCase() != "xls" && temp[temp.length-1].toLowerCase() != "ppt" && temp[temp.length-1].toLowerCase() != "pps")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers .doc, .pdf, .xls, .ppt ou .pps \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		}
	
	/*if(comeIn.archivo_5.value != "")
		{
		var temp = comeIn.archivo_5.value.split(".");
		temp2 = comeIn.archivo_5.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "doc" && temp[temp.length-1].toLowerCase() != "pdf" && temp[temp.length-1].toLowerCase() != "xls")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers .doc, .pdf ou .xls \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		}*/
	
	if(comeIn.archivo_6.value != "")
		{
		var temp = comeIn.archivo_6.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_6.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "gif" && temp[temp.length-1].toLowerCase() != "jpg")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers image .gif  ou .jpeg \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		}
	
	if(comeIn.archivo_7.value != "")
		{
		var temp = comeIn.archivo_7.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_7.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + "  Le nom du fichier ne peut excéder 200 caractères\n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "gif" && temp[temp.length-1].toLowerCase() != "jpg")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers image .gif  ou .jpeg \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères\n";
		}
	
	if(comeIn.archivo_8.value != "")
		{
		var temp = comeIn.archivo_8.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_8.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "gif" && temp[temp.length-1].toLowerCase() != "jpg")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers image .gif  ou .jpeg \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères \n";
		}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function validateRegEmp(comeIn){
	var errorm = "";
	if(!validarEmail(comeIn.Email.value)){
		if(errorm == "")
			comeIn.Email.focus();
		errorm += "- Votre \"Email\" doit être valide\n";	
	}
	
	if(comeIn.Password.value.replace(" ","").length  == 0){
		if (errorm == "")comeIn.Password.focus();
		errorm += "- Entrez votre\"mot de passe\".\n";
	}
	else{
		if(comeIn.Password.value.length <= 5){
			if (errorm == "")comeIn.Password.focus();
			errorm += "- Le \"mot de passe\" doit avoir un minimum de 6 caractères\n";
		}
		else{
			if(comeIn.Password.value != comeIn.ConfPassword.value){
				if (errorm == "")comeIn.Password.focus();
				errorm += "- Le \"mot de passe\" et \" votre confirmation de mot de passe\" doivent être les mêmes\n";
			}
		}
	}
	
	if(replace_all_occurrences(comeIn.FirstName.value," ","").length == 0){
		if(errorm == "")
			comeIn.FirstName.focus();
		errorm += "- Entrez votre\"prénom\".\n";	
	}
	
	if(replace_all_occurrences(comeIn.LastName.value," ","").length == 0){
		if(errorm == "")
			comeIn.LastName.focus();
		errorm += "- Entrez votre \"nom de famille\".\n";	
	}
	
	if(replace_all_occurrences(comeIn.CompanyName.value," ","").length == 0){
		if(errorm == "")
			comeIn.CompanyName.focus();
		errorm += "- Entrez le\"  nom de votre entreprise \"\n";	
	}
	
	var regex = /^[0-9]{1,7}$/;
	
	if(replace_all_occurrences(comeIn.Area.value," ","").length == 0 || replace_all_occurrences(comeIn.Phone.value," ","").length == 0){
		if(errorm == "")
			comeIn.Area.focus();
		errorm += "- Entrez votre \"numéro de téléphone d’ entreprise \"\n";	
	}
	else{
  		if(regex.test(comeIn.Area.value) == false || regex.test(comeIn.Phone.value) == false){
			if(errorm == "")
				comeIn.Area.focus();
			errorm += "- Le \" numéro de téléphone d’entreprise \" doit uniquement contenir des caractères numériques\n";	
		}
	}
	
	if(replace_all_occurrences(comeIn.City.value," ","").length == 0){
		if(errorm == "")
			comeIn.City.focus();
		errorm += "- Entrez la \"ville\".\n";	
	}
	
	if(replace_all_occurrences(comeIn.PostalCode.value," ","").length == 0){
		if(errorm == "")
			comeIn.PostalCode.focus();
		errorm += "- Entrez votre \"code postal\"\n";	
	}
	else{
		if(!isPostCode(comeIn.PostalCode.value)){
			if(errorm == "")
				comeIn.PostalCode.focus();
			errorm += "- S.V.P entrez un \"code postal valide\"\n";	
		}
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function validateApplyJob(comeIn){
	var errorm = "";
	
	if(!comeIn.cv_attach.disabled){
		if(replace_all_occurrences(comeIn.cv_attach.value," ","").length == 0){
			if(errorm == "")
				comeIn.cv_attach.focus();
			errorm += "- Sélectionnez votre CV\n";	
		}
		else{
			var temp = comeIn.cv_attach.value.split(".");
			/*Validate file length*/
			temp2 = comeIn.cv_attach.value.split("\\");
			temp2= temp2[temp2.length-1];
			if(temp2.length > 204 )errorm = errorm + "Le nom de votre CV ne peut excéder 200 caractères\n";
			temp2 = temp2.split(".");			
			temp2=temp2[temp2.length-2];
			
			if(temp[temp.length-1].toLowerCase() != "pdf" && temp[temp.length-1].toLowerCase() != "doc")
				errorm = errorm + " Vous pouvez uniquement télécharger les fichiers .doc, .pdf ou .xls \n";
			else
				if(replace_all_occurrences(temp2," ","").length>250)
					errorm = errorm + " Le nom du fichier ne peut excéder 200 caractères\n";
		}
	}
	
	if(comeIn.cboScolarite.value == '0'){
		if(errorm == "")
			comeIn.cboScolarite.focus();
		errorm += "- Faire un choix pour la question #1\n";	
	}
	if(comeIn.cboExperience.value == '0'){
		if(errorm == "")
			comeIn.cboExperience.focus();
		errorm += "- Faire un choix pour la question #2.\n";	
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

//test numeric
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

//Test code canada post codes 
function isPostCode(entry){ // CANADIAN CODES ONLY
	var CharValid = 0;
	strlen=entry.length; if(strlen!=5 && strlen!=6 && strlen!=7) {CharValid = 1;}
	entry=entry.toUpperCase();    // in case of lowercase characters
	// Check for legal characters in string - note index starts at zero
	
	if(CharValid == 0 && (strlen==6 || strlen==5)){
		if('ABCEGHJKLMNPRSTVXY'.indexOf(entry.charAt(0))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(1))<0) {CharValid = 1;}
		if('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(3))<0) {CharValid = 1;}
		if('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(4))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(5))<0) {CharValid = 1;}
		
		if(CharValid == 1){
			CharValid = 0;
			if('0123456789'.indexOf(entry.charAt(0))<0) {CharValid = 1;}
			if('0123456789'.indexOf(entry.charAt(1))<0) {CharValid = 1;}
			if('0123456789'.indexOf(entry.charAt(2))<0) {CharValid = 1;}
			if('0123456789'.indexOf(entry.charAt(3))<0) {CharValid = 1;}
			if('0123456789'.indexOf(entry.charAt(4))<0) {CharValid = 1;}
		}
	}
	
	if(CharValid == 0 && strlen==7){
		if('ABCEGHJKLMNPRSTVXY'.indexOf(entry.charAt(0))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(1))<0) {CharValid = 1;}
		if('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2))<0) {CharValid = 1;}
		if(' -'.indexOf(entry.charAt(3))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(4))<0) {CharValid = 1;}
		if('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(5))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(6))<0) {CharValid = 1;}
	}
	
	if(CharValid == 1 && strlen==5){
		CharValid = 0;
		if('23456789'.indexOf(entry.charAt(0))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(1))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(2))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(3))<0) {CharValid = 1;}
		if('0123456789'.indexOf(entry.charAt(4))<0) {CharValid = 1;}
	}
	
	if(CharValid == 0)
		return true;
	else
		return false;
}

//Function that valid RegCandidate.asp
function validateRegCan(comeIn){
	var errorm = "";
	if(!validarEmail(comeIn.Email.value)){
		if(errorm == "")
			comeIn.Email.focus();
		errorm += "- Votre \"Email\" doit être valide\n";	
	}
	
	if(comeIn.Password.value.replace(" ","").length  == 0){
		if (errorm == "")comeIn.Password.focus();
		errorm += "- Entrez votre \"mot de passe\"\n";
	}
	else{
		if(comeIn.Password.value.length <= 5){
			if (errorm == "")comeIn.Password.focus();
			errorm += "- Le \"mot de passe\" doit avoir un minimum de 6 caractères\n";
		}
		else{
			if(comeIn.Password.value != comeIn.ConfPassword.value){
				if (errorm == "")comeIn.Password.focus();
				errorm += "- Le \"mot de passe\" et \" votre confirmation de mot de passe\" doivent être les mêmes \n";
			}
		}
	}
	
	if(replace_all_occurrences(comeIn.FirstName.value," ","").length == 0){
		if(errorm == "")
			comeIn.FirstName.focus();
		errorm += "- Entrez votre \"prénom\"\n";	
	}
	
	if(replace_all_occurrences(comeIn.LastName.value," ","").length == 0){
		if(errorm == "")
			comeIn.LastName.focus();
		errorm += "- Entrez votre \"nom de famille\"\n";
	}
	
	/*if(replace_all_occurrences(comeIn.Area.value," ","").length != 0){
		if(!isInteger(comeIn.Area.value)){
			if(errorm == "")
				comeIn.Area.focus();
			errorm += "- Entrez votre \"numéro de téléphone\" valide\n";
		}
		if(!isInteger(comeIn.Phone.value) || replace_all_occurrences(comeIn.Phone.value," ","").length == 0){
			if(errorm == "")
				comeIn.Phone.focus();
			errorm += "- Entrez votre \" numéro de téléphone \" valide\n";
		}
	}*/
	
	if(replace_all_occurrences(comeIn.PostalCode.value," ","").length == 0){
		if(errorm == "")
			comeIn.PostalCode.focus();
		errorm += "- Entrez votre \"code postal\"\n";	
	}
	else{
		if(!isPostCode(comeIn.PostalCode.value)){
			if(errorm == "")
				comeIn.PostalCode.focus();
			errorm += "- S.V.P entrez un \"code postal valide\"\n";	
		}
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function validateRegCan2(comeIn){
	var errorm = "";
	if(comeIn.WantedPosition.value.replace(" ","").length  == 0){
		if(errorm == "")
			comeIn.WantedPosition.focus();
		errorm += "- Entrez le\"titre de l’emploi recherché";
	}
	
	DomainSelected = 0;
	for (var j = 0; j <= 22; j++) {
		box = eval("comeIn.DomainJobSearch" + j);
		if (box.checked == true) DomainSelected = 1;
	}
	if(DomainSelected == 0){
		if(errorm == "")
			comeIn.DomainJobSearch1.focus();
		errorm += "- Sélectionnez \"les domaines recherchés\".\n";
	}
	
	/*type of job*/
	TypePositionSelected = 0;
	for (var j = 0; j <= 10; j++) {
		box = eval("comeIn.TypePosition" + j);
		if (box.checked == true) TypePositionSelected = 1;
	}
	if(TypePositionSelected == 0){
		if(errorm == "")
			comeIn.TypePosition1.focus();
		errorm += "- Sélectionnez \"le type de position\".\n";
	}	
	
	if(comeIn.Salary.value.replace(" ","").length  == 0 && (comeIn.Salary1.value.replace(" ","").length  == 0 || comeIn.Salary2.value.replace(" ","").length  == 0) && comeIn.TypeSalaryChoix[2].checked == false){
		if(errorm == "")
			comeIn.Salary.focus();
		errorm += "- Sélectionnez \"le salaire\".\n";	
	}
	
	if(comeIn.Education.value == 0){
		if(errorm == "")
			comeIn.Education.focus();
		errorm += "- Sélectionnez votre \"formation\"\n";	
	}
	
	if(comeIn.Experience.value == 0){
		if(errorm == "")
			comeIn.Experience.focus();
		errorm += "- Sélectionnez votre \"expérience\"\n";	
	}
	
	if(comeIn.archivo_1.value != "")
		{
		var temp = comeIn.archivo_1.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_1.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + "Le nom de votre CV ne peux excéder 200 caractères\n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "pdf" && temp[temp.length-1].toLowerCase() != "doc")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers .doc ou .pdf \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + "Le nom du fichier ne peut excéder 200 caractères\n";
		}
	
	if(replace_all_occurrences(comeIn.TgsJob.value," ","").length != 0){
		ErrorMaxChart = 0;
		chaine = comeIn.TgsJob.value;
		reg = new RegExp("[,;]+", "g");
		tableau = chaine.split(reg);
		for (var i = 0; i < tableau.length; i++) {
			s = tableau[i];
			ValSize = s.length;
			if(ValSize > 25)ErrorMaxChart = 1;
		}
		if(ErrorMaxChart == 1){
			if(errorm == "")
				comeIn.TgsJob.focus();
			errorm += "- Les \" Tag d’emploi\" ne peuvent excéder 25 caractères\n";
		}
	}
	
	if(replace_all_occurrences(comeIn.TgsPersonal.value," ","").length != 0){
		ErrorMaxChart = 0;
		chaine = comeIn.TgsPersonal.value;
		reg = new RegExp("[,;]+", "g");
		tableau = chaine.split(reg);
		for (var i = 0; i < tableau.length; i++) {
			s = tableau[i];
			ValSize = s.length;
			if(ValSize > 25)ErrorMaxChart = 1;
		}

		if(ErrorMaxChart == 1){
			if(errorm == "")
				comeIn.TgsPersonal.focus();
			errorm += "- Les \" Tag personnels\" ne peuvent excéder 25 caractères\n";
		}
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

//Function that valid uploadFiles.asp
function validateUpdFiles(comeIn){
	var errorm = "";
	
	if(comeIn.archivo_1.value != "")
		{
		var temp = comeIn.archivo_1.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_1.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + "Le nom du logo ne peut excéder 200 caractères \n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "gif" && temp[temp.length-1].toLowerCase() != "jpg")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers image .gif  ou .jpeg \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + "Le nom du fichier ne peut excéder 200 caractères\n";
		}
	
	if(comeIn.archivo_2.value != "")
		{
		var temp = comeIn.archivo_2.value.split(".");
		/*Validate file length*/
		temp2 = comeIn.archivo_2.value.split("\\");
		temp2= temp2[temp2.length-1];
		if(temp2.length > 204 )errorm = errorm + "Le nom du fichier video ne peut exéder 200 caractères \n";
		temp2 = temp2.split(".");			
		temp2=temp2[temp2.length-2];
		
		if(temp[temp.length-1].toLowerCase() != "avi" && temp[temp.length-1].toLowerCase() != "mpg" && temp[temp.length-1].toLowerCase() != "wmv" && temp[temp.length-1].toLowerCase() != "mov")
			errorm = errorm + " Vous pouvez uniquement télécharger les fichiers vidéos en.avi, .wmv, .mov ou .mpg \n";
		else
			if(replace_all_occurrences(temp2," ","").length>250)
				errorm = errorm + "Le nom du fichier ne peut excéder 200 caractères\n";
		}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function validRefer(comeIn){
	var errorm = "";
	if(!validarEmail(comeIn.emailTxt.value)){
		if(errorm == "")
			comeIn.emailTxt.focus();
		errorm += "- Le \"Email\" doit être valide\n";	
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

//Function that valid a chain of characters.
function replace_all_occurrences(str,str_rep,str_fin){
	while(str.indexOf(str_rep) > -1){
		str = str.replace(str_rep,str_fin);
	}
	return str;
}

//Function that valid a email structure.
function validarEmail(email_p)
{
  var email = email_p;

  var regEx = new RegExp("^[\\w\.=-]+@([\\w\-]+\\.)+[a-zA-Z]{2,4}$");
  if(!regEx.test(email)) 
	return false
  else
	  return true;
}

function NumberLang(comeIn){
if(comeIn.NumberLenguages.value == 1){
	document.getElementById("LanguageNumber2").style.display = 'none';
	document.getElementById("LanguageNumber3").style.display = 'none';
	document.getElementById("LanguageNumber4").style.display = 'none';
}
else if(comeIn.NumberLenguages.value == 2){
	document.getElementById("LanguageNumber2").style.display = '';
	document.getElementById("LanguageNumber3").style.display = 'none';
	document.getElementById("LanguageNumber4").style.display = 'none';
}
else if(comeIn.NumberLenguages.value == 3){
		document.getElementById("LanguageNumber2").style.display = '';
	document.getElementById("LanguageNumber3").style.display = '';
	document.getElementById("LanguageNumber4").style.display = 'none';
	}
else if(comeIn.NumberLenguages.value == 4){
		document.getElementById("LanguageNumber2").style.display = '';
	document.getElementById("LanguageNumber3").style.display = '';
	document.getElementById("LanguageNumber4").style.display = '';
	}
}

function CVedit(comeIn){
	if(document.getElementById("CV").style.display == 'none'){
		document.getElementById("CV").style.display = '';
		document.getElementById("ImageFlecha").src = '../images/prev-active.gif';
	}
	else{
		document.getElementById("CV").style.display = 'none';
		document.getElementById("ImageFlecha").src = '../images/next-active.gif';
	}
}

function ShowTextCommentary(){
	if(document.getElementById("Comentarios").style.display == 'none'){
		document.getElementById("Comentarios").style.display = '';
		document.getElementById("ImageFlecha").src = '../images/left.gif';
		if(document.getElementById("Comentarios2"))document.getElementById("Comentarios2").style.display = 'none';
	}
	else{
		document.getElementById("Comentarios").style.display = 'none';
		document.getElementById("ImageFlecha").src = '../images/right.gif';
		if(document.getElementById("Comentarios2"))document.getElementById("Comentarios2").style.display = '';
	}
}

function makeUppercase(Income){
	Income.value = Income.value.toUpperCase();
}

//Function that valid My Messajes Form
function validateMessaje(comeIn){
	var errorm = "";
	
	if(comeIn.contact.value == 0){
		if(errorm == "")
			comeIn.contact.focus();
		errorm += "- Sélectionnez \"To\"\n";	
	}
	
	if(replace_all_occurrences(comeIn.subject.value," ","").length == 0){
		if(errorm == "")
			comeIn.subject.focus();
		errorm += "- Entrez le\"sujet de votre message\".\n";	
	}
	
	if(replace_all_occurrences(comeIn.messaje.value," ","").length == 0){
		if(errorm == "")
			comeIn.messaje.focus();
		errorm += "- Entrez votre \"message\".\n";
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function validateSuggestion(comeIn){
	var errorm = "";
	
	if(replace_all_occurrences(comeIn.subject.value," ","").length == 0){
		if(errorm == "")
			comeIn.subject.focus();
		errorm += "- Entrez le \"sujet de votre message\".\n";	
	}
	
	if(replace_all_occurrences(comeIn.messaje.value," ","").length == 0){
		if(errorm == "")
			comeIn.messaje.focus();
		errorm += "- Entrez votre \"message\".\n";
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function OpenVideo(){
	window.open('videoEmployer.asp','Video','height=500,width=300,status=yes,toolbar=no');
}

function OpenFile(FileAddress){
	window.open(FileAddress,'File','height=500,width=300,status=yes,toolbar=no');
}

function ChangeInfoBarTiker(ID,FileAddress){
	ID = ID - 1000;
	document.getElementById("txtClicker").innerHTML="<table width='190'><tr align='center'><td><img src='../files/"+FileAddress+"' alt='LOGO' width='56' height='58'></td></tr></table>";
}

function showAccionNet(comeIn,Type,ID,Funct,Name){
	var answer = confirm("Êtes-vous sûr de "+Funct+" "+Name+" à votre réseau?");	
	if (answer){
		ID = ID - 1000;
		comeIn.action = "../includes/asp/ProcessNetwork.asp";
		comeIn.Type.value = Type;
		comeIn.ID.value = ID;
		comeIn.Name.value = Name;
		comeIn.Funct.value = Funct;
		comeIn.submit();
	}
}

function showInvitation(comeIn,Type,ID,Funct,Name){
	if(Type < 3)
			var answer = confirm("Êtes-vous sûr de "+Funct+" "+Name+" à ce group?");
		else
			var answer = confirm("Êtes-vous sûr de "+Funct+" "+Name+" à votre réseau?");	
	if (answer){
		ID = ID - 1000;
		if(Type < 3)
			comeIn.action = "../includes/asp/ProcessComunity.asp";
		else
			comeIn.action = "../includes/asp/ProcessNetwork.asp";
		comeIn.Type.value = Type;
		comeIn.ID.value = ID;
		comeIn.Name.value = Name;
		comeIn.Funct.value = Funct;
		comeIn.submit();
	}
}

function showProfil(comeIn,Type,ID){
	ID = ID - 1000;
	if(Type == 4)
		comeIn.action = "ProfilCandidate.asp";
	else
		comeIn.action = "ProfilEmployer.asp";
	comeIn.Type.value = Type;
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.submit();
}

function SendMessaje(comeIn,Type,ID,TypeUser,Name){
	ID = ID - 1000;
	comeIn.action = "SendMessaje.asp";
	comeIn.Type.value = Type;
	comeIn.ID.value = ID;
	comeIn.Name.value = Name;
	comeIn.Funct.value = TypeUser;
	comeIn.Menu2.value = "Messaje";
	comeIn.submit();
}

//Function that valid Invitation Form in My Comunity
function validateInvitation(comeIn){
	var errorm = "";
	var varReplace = comeIn.emailCatcher.value;
	comeIn.emailCatcher.value = varReplace.replace(" ","");
	if(replace_all_occurrences(comeIn.emailCatcher.value," ","").length == 0){
		if(errorm == "")
			comeIn.emailCatcher.focus();
		errorm += "- s.v.p entrez une \"adresse email valide\".\n";	
	}
	else{
		var chaine = comeIn.emailCatcher.value;
		var reg = new RegExp("[,;]+", "g");
		var tableau = chaine.split(reg);
		if(tableau.length > 10){
			if(errorm == "")
				comeIn.emailCatcher.focus();
			errorm += "- Vous pouvez inclure un maximum de 10 emails par invitation\n";	
		}
		else{
			for (var i = 0; i < tableau.length; i++) {
				s = tableau[i];
				if(!validarEmail(s)){
					if(errorm == "")
						comeIn.emailCatcher.focus();
					errorm += "- Les \" emails\" doivent être valide\n";	
					i = tableau.length;
				}
			}
		}
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

//Function that valid Links.asp
function validateLink(comeIn){
	var errorm = "";
	var pailas = 1;
	
	if(replace_all_occurrences(comeIn.links.value," ","").length == 0){
		if(errorm == "")
			comeIn.links.focus();
		errorm += "- Vos \"favoris\"\n";	
	}
	
	if(replace_all_occurrences(comeIn.tags.value," ","").length != 0){
		pailas = 2;
		var ErrorMaxChart = 0;
		var chaine = comeIn.tags.value;
		var reg = new RegExp("[,;]+", "g");
		var tableau = chaine.split(reg);
		for (var i = 0; i < tableau.length; i++) {
			s = tableau[i];
			ValSize = s.length;
			if(ValSize > 25)ErrorMaxChart = 1;
		}
		if(ErrorMaxChart == 1){
			if(errorm == "")
				comeIn.tags.focus();
			errorm += "- Un \"Tag\" peut avoir un maximum de 25 caractères\n";
			pailas = 1;
		}
	}
	
	if(replace_all_occurrences(comeIn.links.value," ","").length != 0 || pailas == 2)
		errorm = "";
		
	if(errorm == ""){
		comeIn.links.value = comeIn.links.value.toLowerCase();
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function DeleteMessaje (comeIn,IDMsg){
	var answer = confirm("Are you sure that you want to delete this ?");
	if (answer){
		IDMsg = IDMsg - 101979;
		comeIn.Type.value = "DELETE";
		comeIn.ID.value = IDMsg;
		comeIn.submit();
	}
}

function showThisComunity(comeIn,ID,Permition){
	ID = ID - 1000;
	comeIn.action = "../content/ProfilComunity.asp";
	comeIn.Type.value = Permition;
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "Comunity";
	comeIn.submit();
}

function showThisComunity2(comeIn,ID,Permition){
	ID = ID - 1000;
	if(comeIn.action == "")
		comeIn.action = "../content/ProfilComunity.asp";
	comeIn.Type.value = Permition;
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "Comunity";
	comeIn.submit();
}

function showJobs(comeIn,Lang,ID){
	ID = ID - 1000;
	comeIn.action = "ProfilJob.asp";
	comeIn.Type.value = "";
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.submit();
}

function showJobsScrap(comeIn,Lang,ID){
	ID = ID - 1000;
	comeIn.action = "ProfilJobScrape.asp";
	comeIn.Type.value = "";
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.submit();
}

function validateCommentary(comeIn){
	var errorm = "";
	if(replace_all_occurrences(comeIn.coment.value," ","").length == 0){
		if(errorm == "")
			comeIn.coment.focus();
		errorm += "- Entrez vos \"commentaires\"\n";	
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function SearchEngine(comeIn,TypeSearch,WhereClick){
	if(WhereClick == 0){
		if(document.getElementById("txt").value != "Recherche >> " && replace_all_occurrences(document.getElementById("txt").value," ","").length != 0){
			comeIn.action = "SearchAdvance.asp";
			comeIn.Type.value = TypeSearch;
			comeIn.ID.value = document.getElementById("txt").value;
			comeIn.submit();
		}
		else{
			alert("Entrez une donnée valide.");
			document.getElementById("txt").focus();
		}
	}
	else{
		if(document.Reg.txt.value != "Recherche >> " && replace_all_occurrences(document.Reg.txt.value," ","").length != 0){
			comeIn.action = "SearchAdvance.asp";
			if(document.Reg.types[0].checked == true) comeIn.Type.value = 2;
			if(document.Reg.types[1].checked == true) comeIn.Type.value = 3;
			if(document.Reg.types[2].checked == true) comeIn.Type.value = 1;
			if(document.Reg.types[0].checked == true && document.Reg.types[1].checked == true) comeIn.Type.value = 4;
			if(document.Reg.types[0].checked == true && document.Reg.types[2].checked == true) comeIn.Type.value = 5;
			if(document.Reg.types[1].checked == true && document.Reg.types[2].checked == true) comeIn.Type.value = 6;
			if(document.Reg.types[0].checked == false && document.Reg.types[1].checked == false && document.Reg.types[2].checked == false) comeIn.Type.value = 0;
			if(document.Reg.types[0].checked == true && document.Reg.types[1].checked == true && document.Reg.types[2].checked == true) comeIn.Type.value = 0;
			comeIn.ID.value = document.Reg.txt.value;
			comeIn.submit();
		}
		else{
			alert("Entrez une donnée valide.");
			document.getElementById("txt").focus();
		}
	}
}



function SearchEngineTag(comeIn,TypeSearch,SearchText){
	document.location.href = "SearchAdvance.asp?ID="+SearchText+"&Type="+TypeSearch;
}

function CallFunctionAld(Func,str,lng,ID)
{
ID = ID - 1000;
var url="../content/Maps.asp";
url=url+"?funct="+Func+"&q="+str+"&Type="+lng+"&ID="+ID;
var ventana = window.open(url,"Mapa","width=630,height=475,status=no,toolbar=no");
ventana.focus();
}

function CallFunctionAldcp(){
	var errorm = "";
	var CodePostal = document.FindCP.CodePostal.value;
	if(replace_all_occurrences(CodePostal," ","").length == 0){
		if(errorm == "")
			document.FindCP.CodePostal.focus();
		errorm += "- S.V.P entrez un \"code postal valide\"\n";	
	}
	else{
		if(!isPostCode(CodePostal)){
			if(errorm == "")
				document.FindCP.CodePostal.focus();
			errorm += "- S.V.P entrez un \"code postal valide\"\n";	
		}
	}
	
	if(errorm == ""){
		var url="../content/MapsCP.asp";
		url=url+"?funct=&q="+CodePostal+"&Type=&ID=";
		var ventana = window.open(url,"Mapa","width=630,height=475,status=no,toolbar=no");
		ventana.focus();
	}
	else{
		alert(errorm);
	}
}

function SaveSalon(comeIn){
	if(comeIn.province.value == "Qu")msgProvince = "Québec"
	if(comeIn.province.value == "Al")msgProvince = "Alberta"
	if(comeIn.province.value == "On")msgProvince = "Ontario"
	var answer = confirm("Êtes-vous sure de vouloir changer de " + msgProvince + "  section?");	
	if (answer){
		comeIn.submit();
	}
}

function ConfirmSalon(comeIn){
	if(comeIn.province.value == "Qu")msgProvince = "Québec";
	if(comeIn.province.value == "Al")msgProvince = "Alberta";
	if(comeIn.province.value == "On")msgProvince = "Ontario";
	var answer = confirm("Êtes vous sure  ce nombre de kiosque par" + msgProvince + " section?");	
	if (answer){
		comeIn.confirmado.value = "1";
		comeIn.submit();
	}
}

function ConfirmSuggestion(comeIn){
	var answer = confirm("confirmez  la suggestion?");	
	if (answer){
		comeIn.confirmado.value = "1";
		comeIn.submit();
	}
}

function OpenLogo(Logo){
	window.open('Logo.asp?Logo='+Logo,'AdminLogo','height=500,width=600,status=no,toolbar=no');
}

function Filter(comeIn,TypeUser,TypeFilter){
	if(TypeFilter == 'LastSession' || TypeFilter == 'Sector'){
		if(TypeUser == 'CA')
			comeIn.action = "ListCandidate.asp";
		if(TypeUser == 'EM')
			comeIn.action = "ListEmployer.asp";
	}
	comeIn.Type.value = TypeFilter;
	comeIn.submit();
}

function ShowNetwork(comeIn,ID,TypeUser){
	ID = ID - 1000;
	comeIn.action = "Network.asp";
	comeIn.Type.value = TypeUser;
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.submit();
}

function ShowListJobsByEmployer(comeIn,ID){
	ID = ID - 1000;
	comeIn.action = "ListJobs.asp";
	comeIn.Type.value = "FromEmployer";
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.submit();
}

function ShowListJobsByApplication(comeIn,ID){
	ID = ID - 1000;
	comeIn.action = "ListCandidate.asp";
	comeIn.Type.value = "FromApplication";
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.submit();
}

function AplyJob(comeIn,ID){
	ID = ID - 1000;
	comeIn.action = "ApplyJob.asp";
	comeIn.Type.value = "";
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.submit();
}

function openCV(comeIn,ID,TypeDoc){
	ID = ID - 1000;
	CV = window.open('../files/Candidates/'+ID+'/CV_'+ID+'.'+TypeDoc,'CV','height=500,width=600,status=no,toolbar=no');
	//setTimeout(CV.close(),3000);
	//window.open('openCV.asp?ID='+ID+'&TypeDoc='+TypeDoc+'','CV','height=5,width=5,status=no,toolbar=no');
}

function openFile(comeIn,ID,NameDoc,TypeDoc,TypeUser){
	ID = ID - 1000;
	if(TypeUser == 'EM')
		FILE = window.open('../files/Employers/'+ID+'/'+NameDoc+'_'+ID+'.'+TypeDoc,'CV','height=500,width=600,toolbar=no');
	if(TypeUser == 'CA')
		FILE = window.open('../files/Candidates/'+ID+'/'+NameDoc+'_'+ID+'.'+TypeDoc,'CV','height=500,width=600,toolbar=no');
}

function ValidatePassForget(comeIn){
	var errorm = "";
	if(!validarEmail(comeIn.Email.value)){
		if(errorm == "")
			comeIn.Email.focus();
		errorm += "- Votre \"Email\" doit être valide\n";	
	}
	
	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function Registration(comeIn,Type){
	comeIn.action = "Registry.asp";
	comeIn.Type.value = Type;
	comeIn.ID.value = "";
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.submit();
}

function ChangetypeRegister(){
	if(document.Reg.TypeReg[0].checked)window.frames[0].location = "RegCandidate.asp?v=WHDFG5DFG41";
	if(document.Reg.TypeReg[1].checked)window.frames[0].location = "RegEmployer.asp";
	/*if(document.Reg.TypeReg[1].checked)window.frames[0].location = "RegCandidate.asp?v=WHDFO5DhG41";
	if(document.Reg.TypeReg[2].checked)window.frames[0].location = "RegEmployer.asp";*/
}

function ShowEmployer(comeIn,ID){
	comeIn.action = "../content/ProfilEmployer.asp";
	window.open("", "popup", "height=640,width=900,menubar='no',toolbar='no',location='no',status='no'");
	comeIn.Type.value = "";
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.target = "popup";
	comeIn.submit();
}

function ShowCandidate(comeIn,ID){
	comeIn.action = "../content/ProfilCandidate.asp";
	window.open("", "popup", "height=640,width=900,menubar='no',toolbar='no',location='no',status='no'");
	comeIn.Type.value = "";
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.target = "popup";
	comeIn.submit();
}

function ConfirmEmployer(comeIn, ID, Type){
	comeIn.action = "ConfirmEmployer.asp";
	if(Type == "0") comeIn.Type.value = "Innactif";
	if(Type == "1") comeIn.Type.value = "Actif";	
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = "";
	comeIn.Menu2.value = "";
	comeIn.target = "popup";
	comeIn.submit();
}

function validatePrivacy(comeIn, Type){
	var ValidCheck = 0;
	if(comeIn.privacy[0].checked) ValidCheck = 1;
	if(comeIn.privacy[1].checked) ValidCheck = 1;
	if(Type == "CA")
		if(comeIn.privacy[2].checked) ValidCheck = 1;
	if(ValidCheck == 0)
		alert("Sélectionnez vos options de confidentialité");
	else
		comeIn.submit();
}

function NotAppropriate(comeIn,ID,Type,Filter){
	ID = ID - 1000;
	comeIn.action = "../includes/asp/NotAppropriate.asp";
	window.open("", "popup", "height=50,width=50,menubar='no',toolbar='no',location='no',status='no'");
	comeIn.Type.value = Type;
	comeIn.ID.value = ID;
	comeIn.Name.value = "";
	comeIn.Funct.value = Filter;
	comeIn.Menu2.value = "";
	comeIn.target = "popup";
	comeIn.submit();
	alert("Votre message à été envoyé à l’équipe EfairJob")
}

function Appropriate(comeIn,ID,Type,Filter,ID_Active){
	ID = ID - 1000;
	comeIn.action = "../includes/asp/Appropriate.asp";
	window.open("", "popup", "height=50,width=50,menubar='no',toolbar='no',location='no',status='no'");
	comeIn.Type.value = Type;
	comeIn.ID.value = ID;
	comeIn.Name.value = ID_Active;
	comeIn.Funct.value = Filter;
	comeIn.Menu2.value = "";
	comeIn.target = "popup";
	comeIn.submit();
	alert("File Active.")
}

function checkChoise(comeIn){
	/*if(comeIn.Choice[3].checked)document.getElementById("Opp").style.display = '';
	else document.getElementById("Opp").style.display = 'none';*/
}

function secureCheckOut(comeIn){
	var errorm = "";
	if(document.AddCart1.depend.value.replace(" ","").length  != 0){
		if(!validarEmail(document.AddCart1.depend.value)){
			if(errorm == "")
				document.AddCart1.depend.focus();
			errorm += "- The Associated Email must be valid.\n";	
		}
	}
	
	if(errorm == ""){
		var answer = confirm("Submit information?");	
		if (answer){
			comeIn.action = "../includes/asp/secureCheckOut.asp";
			comeIn.Type.value = "";
			comeIn.ID.value = "";
			comeIn.Name.value = "";
			comeIn.Funct.value = "";
			comeIn.Menu2.value = "";
			comeIn.submit();
		}
	}
	else{
		alert(errorm);
	}
}

function saveCheckOut(){
	Save = window.open("../includes/asp/SaveCart.asp", "save", "height=50,width=50,menubar='no',toolbar='no',location='no',status='no'");
}

function ValidCountry(){
	if(document.Register.Country.value != "1"){
		document.getElementById("FirstOpt").style.display = 'none';
		document.getElementById("SecondOpt").style.display = '';
	}
	else{
		document.getElementById("FirstOpt").style.display = '';
		document.getElementById("SecondOpt").style.display = 'none';
	}
}

function ValidCountryPost(){
	if(document.PostJob.Country.value != "1"){
		document.getElementById("FirstOpt").style.display = 'none';
		document.getElementById("SecondOpt").style.display = '';
	}
	else{
		document.getElementById("FirstOpt").style.display = '';
		document.getElementById("SecondOpt").style.display = 'none';
	}
}

function GoAddress(comeIn, ID, Action, OtherField, OtherField2){
	ID = ID - 1000;
	comeIn.action = Action;
	comeIn.ID.value = ID;
	comeIn.Name.value = OtherField;
	comeIn.Funct.value = OtherField2;
	comeIn.Menu2.value = "";
	comeIn.submit();
}

function GoAddressConfirm(comeIn, ID, Action, OtherField, OtherField2){
	ID = ID - 1000;
	if(OtherField == "Delete")OtherField = "Supprimer";
	var answer = confirm("Êtes-vous sûr de vouloir "+OtherField+"?");
	if (answer){
		comeIn.action = Action;
		comeIn.ID.value = ID;
		comeIn.Name.value = OtherField;
		comeIn.Funct.value = OtherField2;
		comeIn.Menu2.value = "";
		comeIn.submit();
	}
}

function createContact(comeIn) {
	var errorm = "";
	
	if(!validarEmail(comeIn.txtEmail1.value)){
		if(errorm == "")
			comeIn.txtEmail1.focus();
		errorm += "- Your email must be valid.\n";	
	}
	if(comeIn.txtPassword1_1.value.replace(" ","").length  == 0){
		if (errorm == "")comeIn.txtPassword1_1.focus();
		errorm += "- Please type your Password.\n";
	}
	else{
		if(comeIn.txtPassword1_1.value.length <= 5){
			if (errorm == "")comeIn.txtPassword1_1.focus();
			errorm += "- The Password must have 6 or more characters.\n";
		}
		else{
			if(comeIn.txtPassword1_1.value != comeIn.txtPassword2_1.value){
				if (errorm == "")comeIn.txtPassword1_1.focus();
				errorm += "- The Password and Confirm Password must be the same.\n";
			}
		}
	}		
	if(comeIn.txtLastName1.value.replace(" ","").length  == 0){
		if(errorm == "")
			comeIn.txtLastName1.focus();
		errorm += "- Your last name must be valid.\n";
	}
	if(comeIn.txtFirstName1.value.replace(" ","").length  == 0){
		if(errorm == "")
			comeIn.txtFirstName1.focus();
		errorm += "- Your name must be valid.\n";
	}
	if (comeIn.txtPhone1_1.value.replace(" ","").length  == 0 && comeIn.txtPhone2_1.value.replace(" ","").length  == 0){
		if(errorm == "")
			comeIn.txtPhone1_1.focus();
		errorm += "- Please type a telephone number.\n";
	}

	if(errorm == ""){
		comeIn.submit();
	}
	else{
		alert(errorm);
	}
}

function AddFavorite(comeIn,TypeUser,ID){
	ID = ID - 1000;
	if(TypeUser == 4)
		Favorite = window.open("../includes/asp/AddFavorite.asp?ID="+ID, "Favorite", "height=50,width=50,menubar='no',toolbar='no',location='no',status='no'");
}

function DelFavorite(comeIn,TypeUser,ID){
	ID = ID - 1000;
	if(TypeUser == 4)
		Favorite = window.open("../includes/asp/DelFavorite.asp?ID="+ID, "Favorite", "height=50,width=50,menubar='no',toolbar='no',location='no',status='no'");
}

function validSearchText(comeIn){
	if(comeIn.TagJob.value.replace(" ","").length  == 0 && comeIn.DomainJobSearch.value == 0 && comeIn.Language.value == "" && comeIn.Education.value == "" && comeIn.TypePosition.value == "" && comeIn.Experience.value == 0 && comeIn.Country.value == 1 && comeIn.City.value == 0 && comeIn.PostalCode.value.replace(" ","").length  == 0){
		alert("Merci de choisir une option.");
	}
	else
		comeIn.submit();
}

function validSearchTextJob(comeIn){
	if(comeIn.TagJob.value.replace(" ","").length  == 0 && comeIn.DomainJobSearch.value == 0 && comeIn.Language.value == "" && comeIn.TypePosition.value == "" && comeIn.Country.value == 1 && comeIn.City.value == 0 && comeIn.PostalCode.value.replace(" ","").length  == 0){
		alert("Merci de choisir une option.");
	}
	else
		comeIn.submit();
}

function JobCounterScrape(ID_Job,Link){
	Counter = window.open("../includes/asp/JobCounterScrape.asp?ID_Job="+ID_Job+"&Link="+Link, "save", "height=600,width=800,menubar='yes',toolbar='yes',location='no',status='yes',resizable=1, scrollbars=1");
}

// GESTION POPUP
function loadPopup(popURI,width_,height_) {
	inlinePop('embedpopup','on',width_,height_);
	document.getElementById('popupiframe').src = popURI
	scrollTo(0, 0);
}

// TOGGLE INLINE DISPLAY OF IMAGE USING SHADED BACKGROUND
function inlinePop(layerId,state,objWidth,objHeight) {	

	document.location = "#top";
	
	if (state == 'on') {
		// store available page width and height into variables
		pageWidth = document.documentElement.clientWidth;
		pageHeight = document.documentElement.clientHeight;	
		
		// calculate centered position for element
		// + 30 = height of div containing close button
		popLeft = (pageWidth - objWidth) / 2;
		popTop = (pageHeight - objHeight) / 2;	
		
		// position element centered (x,y) on page
		document.getElementById(layerId).style.left = popLeft + "px";
		document.getElementById(layerId).style.top = popTop + "px";
	}

	switch(state) {
		case (state = "on"):
			showShader(1);
			document.getElementById(layerId).style.display = "block";
		break
		case (state = "off"):
			document.getElementById(layerId).style.display = "none";
			showShader(0);
		break		
	}
}

// APPLY SHADER TO PAGE FOR POPUP DISPLAY
function showShader(status) {
   var x,y;
   var arrbody = document.getElementsByTagName("body");
   var test1 = arrbody[0].scrollHeight;
   var test2 = arrbody[0].offsetHeight;
    
   if (test1 > test2) // all but Explorer Mac
   {
      x = arrbody[0].scrollWidth;
      y = arrbody[0].scrollHeight;
   }
   else // Explorer Mac;
        //would also work in Explorer 6 Strict, Mozilla and Safari
   {
      x = arrbody[0].offsetWidth;
      y = arrbody[0].offsetHeight;
   }
   
	document.getElementById('shaderdiv').style.width = x + "px";
	document.getElementById('shaderdiv').style.height = (y + 100) + "px";
   
	if (status == 1) {
		document.getElementById('shaderdiv').style.display = "block";
	}
	else {
		document.getElementById('shaderdiv').style.display = "none";
	}

}