function confirm_message(strMessage) {
	var blnConfirmation = confirm(strMessage)
	if (blnConfirmation == true) {
		return true
	}
	else {
		return false
	}
}

function validate_user_login_form() {

	var user_lastname = document.getElementById("user_lastname").value
	var user_firstname = document.getElementById("user_firstname").value
	var user_company = document.getElementById("user_company").value
	var user_email = document.getElementById("user_email").value
	var user_apa_code = document.getElementById("user_apa_code").value
	var user_telephone = document.getElementById("user_telephone").value
	var user_mobilephone = document.getElementById("user_mobilephone").value

	if (user_firstname.length < 1)
	{
		alert("Veuillez entrer un prénom")
		return false
	}

	if (user_lastname.length < 1)
	{
		alert("Veuillez entrer un nom")
		return false
	}

	if (user_company.length < 1)
	{
		alert("Veuillez entrer un nom de société")
		return false
	}

	// un email fait au moins 5 charactères : x@y.zz
	if (user_email.length < 6)
	{
		alert("Veuillez entrer un email")
		return false
	}

	return true
}

function validate_email_form() {

	var sender_firstname = document.getElementById("sender_firstname").value
	var sender_lastname = document.getElementById("sender_lastname").value
	var sender_email = document.getElementById("sender_email").value
	var receiver_email = document.getElementById("receiver_email").value

	//~ if (sender_firstname.length == 0 && sender_lastname.length == 0 && sender_email.length < 6)
	//~ {
		//~ alert("Veuillez entrer au moins votre prénom et votre nom ou votre email.")
		//~ return false
	//~ }

	//~ if (sender_firstname.length > 0 && sender_lastname.length == 0 && sender_email.length < 6)
	//~ {
		//~ alert("Vous avez entré votre prénom.\nVeuillez entrer votre nom.")
		//~ return false
	//~ }

	//~ if (sender_firstname.length == 0 && sender_lastname.length > 0 && sender_email.length < 6)
	//~ {
		//~ alert("Vous avez entré votre nom.\nVeuillez entrer votre prénom.")
		//~ return false
	//~ }

	//~ if (sender_firstname.length < 1)
	//~ {
		//~ alert("Veuillez entrer votre prénom")
		//~ return false
	//~ }

	//~ if (sender_lastname.length < 1)
	//~ {
		//~ alert("Veuillez entrer votre nom")
		//~ return false
	//~ }

	// un email fait au moins 5 charactères : x@y.zz
	if (sender_email.length < 6)
	{
		alert("Veuillez entrer votre email")
		return false
	}

	// un email fait au moins 5 charactères : x@y.zz
	if (receiver_email.length < 6)
	{
		alert("Veuillez entrer l'email de votre collègue")
		return false
	}

	return true
}

function login(url) {
	var popup = window.open(url,'_blank','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=412, height=400')
}

function email(url) {
	var popup = window.open(url,'_blank','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=412, height=525')
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function open_video(strUrl)
{
	videoWin = window.open("","video","width=240, height=220");
	videoWin.document.write("<html><body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0><!-- Début | Lecteur -->"+
	"<object id=\"NSPlay\" width=\"240\" height=\"220\" classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" standby=\"Chargement...\" type=\"application/x-oleobject\" align=\"middle\">"+
	"<PARAM NAME=\"AutoStart\" VALUE=\"True\">"+
	"<PARAM NAME=\"FileName\" VALUE=\""+ strUrl +"\">"+
	"<PARAM NAME=\"ShowControls\" VALUE=\"true\">"+
	"<PARAM NAME=\"ShowStatusBar\" VALUE=\"false\">"+
	"<EMBED type=\"application/x-mplayer2\""+
	"pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\""+
	"SRC=\""+ strUrl +"\""+
	"name=\"NSPlay\""+
	"width=240"+
	"height=220"+
	"autostart=1"+
	"showcontrols=1"+
	"showdisplay=1"+
	"ShowStatusBar=0>"+
	"</EMBED>"+
	"</OBJECT></body></html>");
}

