//<!--
// for send this offer to friend
function checkValidate_Mail2Friend()
{
	var frm = document.frmcontact;
	if (frm.yourname.value == "")
	{
		alert("Please enter your name.");
		frm.yourname.focus();
		return ;
	}
	if (frm.youremail.value == "")
	{
		alert("Please enter your email.");
		frm.youremail.focus();
		return ;
	}
	else
	{
		if(!CheckEmailAddress(frm.youremail.value))
		{
			alert("Your email is invalid. Please check again.");
			frm.youremail.focus();
			return ;
		}
	}

	if (frm.email.value == "")
	{
		alert("Please enter email of your friend.");
		frm.email.focus();
		return ;
	}
	else
	{
		if(!CheckEmailAddress(frm.email.value))
		{
			alert("Email of your friend is invalid. Please check again.");
			frm.email.focus();
			return ;
		}
	}
	
	frm.submit();
}

// for apply job offer
function checkValidate_apply_joboffer()
{
	var frm = document.frmcontact;
	if (frm.firstname.value == "")
	{
		alert("Please write your first name.");
		frm.firstname.focus();
		return ;
	}

	if (frm.lastname.value == "")
	{
		alert("Please write your last name.");
		frm.lastname.focus();
		return ;
	}
	

	if (frm.phonenum.value == "")
	{
		alert("Please write your phone number.");
		frm.phonenum.focus();
		return ;
	}

	if (frm.email.value == "")
	{
		alert("Please write your email.");
		frm.email.focus();
		return ;
	}
	else
	{
		if(!CheckEmailAddress(frm.email.value))
		{
			alert("Your email is invalid. Please check again.");
			frm.email.focus();
			return ;
		}
	}
	
	if ((frm.uploadCV.value == "") || (frm.uploadCV.value.length ==0))
	{
		alert("Please upload your CV.");
		frm.uploadCV.focus();
		return ;
	}
	else
	{
		var filename_0 = frm.uploadCV.value;
		// get full file name. for example: .doc of .pbf
		filename_0 = filename_0.substring(filename_0.lastIndexOf("\\")+1, filename_0.length);
		// get dot.
		var dotpos_0 = filename_0.lastIndexOf('.');
		// get extention.
		var ext_0 = filename_0.substr(dotpos_0+1, (filename_0.length-dotpos_0));
		ext_0 = ext_0.toLowerCase();

		// get only file name.
		fname_0=filename_0.substr(0,dotpos_0);
		
		if(dotpos_0==-1||dotpos_0==0)
		{
			alert("The file you are trying to upload does not seem to have a valid format. Please upload a file .doc or .pdf.");
			frm.uploadCV.focus();
			return;
		}
		
		if (ext_0!="")
		{	
			if ((ext_0!="doc") && (ext_0!="pdf"))
			{
				alert("The file you are trying to upload does not seem to have a valid format. Please upload a file .doc or .pdf.");
				frm.uploadCV.focus();
				return;
			}
		}
	}
	
	if (frm.uploadmotivation.value != "")
	{
		var filename_0 = frm.uploadmotivation.value;
		// get full file name. for example: .doc of .pbf
		filename_0 = filename_0.substring(filename_0.lastIndexOf("\\")+1, filename_0.length);
		// get dot.
		var dotpos_0 = filename_0.lastIndexOf('.');
		// get extention.
		var ext_0 = filename_0.substr(dotpos_0+1, (filename_0.length-dotpos_0));
		ext_0 = ext_0.toLowerCase();

		// get only file name.
		fname_0=filename_0.substr(0,dotpos_0);
		
		if(dotpos_0==-1||dotpos_0==0)
		{
			alert("The file you are trying to upload does not seem to have a valid format. Please upload a file .doc or .pdf.");
			frm.uploadmotivation.focus();
			return;
		}
		
		if (ext_0!="")
		{	
			if ((ext_0!="doc") && (ext_0!="pdf"))
			{
				alert("The file you are trying to upload does not seem to have a valid format. Please upload a file .doc or .pdf.");
				frm.uploadmotivation.focus();
				return;
			}
		}
	}
	
	if (frm.mchkbox.checked == false)
	{
		alert("Please check legal mention.");
		return;
	}
	
	frm.submit();
}

// for submit CV
function checkValidate_submitCV()
{
	var frm = document.frmcontact;
	var isChecked=false;
	
	if (frm.firstname.value == "")
	{
		alert("Please write your first name.");
		frm.firstname.focus();
		return ;
	}
	
	if (frm.lastname.value == "")
	{
		alert("Please write your last name.");
		frm.lastname.focus();
		return ;
	}
	
	if (frm.email.value == "")
	{
		alert("Please write your email.");
		frm.email.focus();
		return ;
	}
	else
	{
		if(!CheckEmailAddress(frm.email.value))
		{
			alert("Your email is invalid. Please check again.");
			frm.email.focus();
			return ;
		}
	}

	if (!checkMultiSelect(frm.graduation))
	{
		alert("Please select at least one your graduation.");
		return;
	}

	if (!checkMultiSelect(frm.Mobility))
	{
		alert("Please select at least one your mobility.");
		return;
	}

	if (!checkMultiSelect(frm.Availability))
	{
		alert("Please select at least one your availability.");
		return;
	}

	if (!checkMultiSelect(frm.Experience))
	{
		alert("Please select at least one your experience.");
		return;
	}

	if (!checkMultiSelect(frm.contract))
	{
		alert("Please select at least one the type of contract.");
		return;
	}

	if(frm.field.value =="")
	{
		alert("Please select your field of activity.");
		frm.field.focus();	
		return;
	}
	
	if (frm.lookfor.value=="")
	{
		alert("Please write what is the job are you looking for.")
		frm.lookfor.focus();
		return;
	}
	
	if ((frm.uploadCV.value == "") || (frm.uploadCV.value.length ==0))
	{
		alert("Please upload your CV.");
		frm.uploadCV.focus();
		return ;
	}
	else
	{
		var filename_0 = frm.uploadCV.value;
		// get full file name. for example: .doc of .pbf
		filename_0 = filename_0.substring(filename_0.lastIndexOf("\\")+1, filename_0.length);
		// get dot.
		var dotpos_0 = filename_0.lastIndexOf('.');
		// get extention.
		var ext_0 = filename_0.substr(dotpos_0+1, (filename_0.length-dotpos_0));
		ext_0 = ext_0.toLowerCase();

		// get only file name.
		fname_0=filename_0.substr(0,dotpos_0);
		
		if(dotpos_0==-1||dotpos_0==0)
		{
			alert("The file you are trying to upload does not seem to have a valid format. Please upload a file .doc or .pdf.");
			frm.uploadCV.focus();
			return;
		}
		
		if (ext_0!="")
		{	
			if ((ext_0!="doc") && (ext_0!="pdf"))
			{
				alert("The file you are trying to upload does not seem to have a valid format. Please upload a file .doc or .pdf.");
				frm.uploadCV.focus();
				return;
			}
		}
	}
	
	if (frm.uploadMotv.value !="")
	{
		var filename_0 = frm.uploadMotv.value;
		// get full file name. for example: .doc of .pbf
		filename_0 = filename_0.substring(filename_0.lastIndexOf("\\")+1, filename_0.length);
		// get dot.
		var dotpos_0 = filename_0.lastIndexOf('.');
		// get extention.
		var ext_0 = filename_0.substr(dotpos_0+1, (filename_0.length-dotpos_0));
		ext_0 = ext_0.toLowerCase();

		// get only file name.
		fname_0=filename_0.substr(0,dotpos_0);
		
		if(dotpos_0==-1||dotpos_0==0)
		{
			alert("The file you are trying to upload does not seem to have a valid format. Please upload a file .doc or .pdf.");
			frm.uploadMotv.focus();
			return;
		}
		
		if (ext_0!="")
		{	
			if ((ext_0!="doc") && (ext_0!="pdf"))
			{
				alert("The file you are trying to upload does not seem to have a valid format. Please upload a file .doc or .pdf.");
				frm.uploadMotv.focus();
				return;
			}
		}
	}
	
	if (frm.mchkbox.checked == false)
	{
		alert("Please check legal mention.");
		return;
	}

	frm.submit();
}


// for contact us
function checkValidate_ContactUs()
{
	var frm = document.frmcontact;
	
	if (frm.slttheme.value == "")
	{
		alert("Please select at least one theme of your request.");
		frm.slttheme.focus();
		return;
	}
	
	if (frm.firstname.value == "")
	{
		alert("Please write your first name.");
		frm.firstname.focus();
		return ;
	}
	
	if (frm.lastname.value == "")
	{
		alert("Please write your last name.");
		frm.lastname.focus();
		return ;
	}
	
	if (frm.email.value == "")
	{
		alert("Please write your email.");
		frm.email.focus();
		return ;
	}
	else
	{
		if(!CheckEmailAddress(frm.email.value))
		{
			alert("Your email is invalid. Please check again.");
			frm.email.focus();
			return ;
		}
	}
	
	if (frm.country.value =="")
	{
		alert("Please select at least one country.");
		frm.country.focus();
		return;
	}
	
	if (frm.phonenum.value =="")
	{
		alert("Please write your phone number.");
		frm.phonenum.focus();
		return;
	}
	
	if (frm.msg.value == "")
	{
		alert("Please write your message.");
		frm.msg.focus();
		return ;
	}
	
	frm.submit();
}

function checkMultiSelect(obj)
{
	var get_obj = eval(obj);
	var isChecked = false;
	for(var i=0; i<get_obj.length; i++)
	{
		if (get_obj[i].checked == true)
		{
			isChecked=true;
			break;
		}
	}
	
	if (isChecked==false) return false;
	
	return true;
}
//-->

