// Verif du format de l'email
function checkEmail() {
	if ((document.formEmail.email.value.indexOf ('@') == -1)||(document.formEmail.email.value.indexOf ('.') == -1)) {
		alert('Veuillez saisir une adresse email valide !');
		document.formEmail.email.focus();
	} else {
		document.formEmail.submit();
	}
}

function free (sBase64) {
	if ((sBase64 == undefined) || (sBase64 == "")) return "";
	
	var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
	var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
	var output = "";
	var i = 0;
	
	sBase64 = sBase64.replace(/-/g, "+").replace(/_/g, "=").replace(/\./g, "/");
	if (sBase64.match("/[^A-Za-z0-9+\\/=]/")) return "";

	do {
		enc1 = keyStr.indexOf(sBase64.charAt(i++));
		enc2 = keyStr.indexOf(sBase64.charAt(i++));
		enc3 = keyStr.indexOf(sBase64.charAt(i++));
		enc4 = keyStr.indexOf(sBase64.charAt(i++));
		chr1 = (enc1 << 2) | (enc2 >> 4);
		chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		chr3 = ((enc3 & 3) << 6) | enc4;
		output += String.fromCharCode(chr1);

		if (enc3 != 64) {
			output += String.fromCharCode(chr2);
		}
		if (enc4 != 64) {
			output += String.fromCharCode(chr3);
		}
		chr1 = chr2 = chr3 = enc1 = enc2 = enc3 = enc4 = "";
	}

	while (i < sBase64.length);

	output = output.replace(/&amp;/gi,"&");

	window.location.href = output;
}



function openPopupCenteredWindow(popupUrl, popupName, popupWidth, popupHeight, params) {
	var windowWidth = window.screen.width;
	var windowHeight = window.screen.height;
	var leftPos = (windowWidth - popupWidth) / 2;
	var topPos = ((windowHeight - popupHeight) / 2) - 50;
	window.open(popupUrl, popupName, 'width='+popupWidth+',height='+popupHeight+',left='+leftPos+',top=' + topPos +','+ params);
}