function PopupImage(titre, img) {
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}
function gopen(lien, w, h){
	var top = (screen.height-h) / 2;
    var left = (screen.width-w) / 2;
	window.open(lien,'','resizable=yes, location=no, top='+top+',left='+left+',width='+w+', height='+h+', menubar=no, status=no, scrollbars=no');
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
     window.open(theURL,winName,features);
}
function redirige (link) {
	var new_url = link;
	window.location = new_url;
}
function verifie_reglement(){
	var ok = window.document.cgessai.case_ok.checked;
	if (!ok) {
		alert("Vous n'avez pas approuvé les conditions d'utilisation.\n\nMerci de cocher la case correspondante...");
		return false;
	}
	return true;
}
function verifie_reglement2(){
	var ok = window.document.cgessai.case_ok.checked;
	if (!ok) {
		alert("Vous devriez avoir lu le contrat Programme-Partner \n\nMerci de cocher la case correspondante...");
		return false;
	}
	return true;
}
function LmOver(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#008000";
elem.style.cursor = 'hand'}

function LmOut(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#008000";}

function LmDown(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#008000";}

function LmUp(path)
{location.href = path;}

function LmOverSelected(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#800000";
elem.style.cursor = 'hand'}

function LmOutSelected(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#800000";}

function LmDownSelected(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#800000";}

function LmUpSelected(path)
{location.href = path;}

function verifie_salarie_demo(){
	var demo_salarie = window.document.salarie_demo.demo_salarie.selectedIndex; 
		if (demo_salarie == 0) {
			alert("Veuillez sélectionner un salarié pour la démo...");
    		window.document.salarie_demo.demo_salarie.focus();
			return false; 
		}
	return true;
}
function verifie_identification_admin(){
	var login = window.document.identification_admin.login.value;
	var pass = window.document.identification_admin.pass.value;
		if (login == "") {
			alert("Veuillez saisir votre pseudo...");
			window.document.identification_admin.login.focus();
    		return false; 
		}
		if (pass == "") {
			alert("Veuillez saisir votre mot de passe...");
			window.document.identification_admin.pass.focus();
    		return false; 
		}
	return true;
}
function calcul_abonnement() {
	var indice = 0;	var seuil_temp = effectif[indice];
	var cout_current = taux[indice]; 
	var nb_salarie = document.abonnement.elements["effectif_a_abonner"].value;
	var nb_echeance = document.abonnement.elements["echeances"].value;
	var montant_abo = 0; var echeance_mt = 0;
	for (i = 1; i <= nb_salarie; i++) {
		if (i > seuil_temp && indice < nb_tranche) {
			indice++;
			seuil_temp = effectif[indice];
			if (!isNaN(taux[indice])) cout_current = taux[indice];
		}
		montant_abo += cout_current;
	}
  	echeance_mt = montant_abo / nb_echeance;
	if (nb_echeance == 4) { montant_abo *= 1.03; echeance_mt *= 1.03; }
	document.abonnement.elements["abonnement_mt"].value = Math.floor(montant_abo);
	document.abonnement.elements["echeance_mt"].value = Math.floor(echeance_mt);
	document.abonnement.elements["cout_unitaire"].value = NUMaCAR(montant_abo / nb_salarie);
}  // fin calcul_abonnement

