var doh = "Le clic droit est interdit sur ce site.";

function noclick(scx) {
    if (navigator.appName == "Netscape" && scx.which == 3) {
	alert(doh);
	return false; 
    }
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
	alert(doh);
	return false; 
    } 
}



function prechargimg() {
    var doc=document;
	if(doc.images) {
       	    if(!doc.precharg)
               	doc.precharg=new Array();
	    var i,j=doc.precharg.length,x=prechargimg.arguments;
            for(i=0; i<x.length; i++) {
		if (x[i].indexOf("#")!=0) {
		    doc.precharg[j]=new Image; doc.precharg[j++].src=x[i];
		}
	    }
	}
}

function montre (adresseimage, placeimage) {
    document.images[placeimage].src = adresseimage;
}

function cache (adresseimage, placeimage) {
    document.images[placeimage].src = adresseimage;
}

function PopupImage(img) {
    titre="Popup Image";
    w=open("",'image','width=400,height=400,toolbar=no,scrollbars=yes,resizable=yes');	
    w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE>");
    w.document.write("<SC"+"RIPT language=java"+"script> function checksize()  { if (document.images['img'].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT></HEAD>");
    w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0 name='img'>");
    w.document.write("");
    w.document.write("</BODY></HTML>");
    w.document.close();
}

function PopupPdf(pdf) {
    titre="Popup Partition";
    w=open("",'image','width=400,height=400,toolbar=no,scrollbars=yes,resizable=yes');	
    w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE>");
    w.document.write("<SC"+"RIPT language=java"+"script> function checksize()  { if (document.images['img'].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT></HEAD>");
    w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0 name='img'>");
    w.document.write("");
    w.document.write("</BODY></HTML>");
    w.document.close();
}

function suivant() {
    document.presse.action = "princ.php?EX=3&LI=END";
    document.presse.target = "_self";
    document.presse.choix.value = "suivant";
    document.presse.submit();
}

function precedent() {
    document.presse.action = "princ.php?EX=3&LI=END";
    document.presse.target = "_self";
    document.presse.choix.value = "precedent";
    document.presse.submit();
}

function valider(name) {
    document.presse.action = "princ.php?EX=3&LI=END";
    document.presse.target = "_self";
    document.presse.Type.value = name;
    document.presse.submit();
}

function suppression_fichier(fichier, i, choix, page){
    if (window.confirm('Voulez-vous vraiment supprimer ce fichier : '+fichier)) 
    {
	document.Suppression.action = 'princ.php?EX='+page+'&LI=END';
	document.Suppression.target = "_self";
	document.Suppression.suppress.value = choix
	document.Suppression.type.value = fichier;
	document.Suppression.numero.value = i;
	document.Suppression.submit();
		
	return true;
    }
}

function supp(i, index){
    if (window.confirm('Voulez-vous vraiment supprimer ces photos ?')) 
    {
	document.Supp.action = 'princ.php?EX='+index+'&LI=END';
	document.Supp.target = "_self";
	document.Supp.numero.value = i;
	document.Supp.submit();

	return true;
    }
}

function download_banniere(nbr){
    document.Lien.nombre.value = nbr;
    document.Lien.enregistrer.value = "NON";
    document.Lien.submit();

    return true;
}

function download_nobanniere(nbr){
    document.Lien.nombre.value = nbr;
    document.Lien.enregistrer.value = "NON";
    document.Lien.submit();

    return true;
}

function deconnecte() {
    document.deconnexion.submit();
}

function change_type(nom, temp) {
    if(document.Lien.Bouton.value == "Change") {
	document.Lien.elements[nom].style.visibility = "visible";
	document.Lien.elements[temp].style.visibility = "hidden";
	document.Lien.Bouton.value = "No Change";
    }
    else {
	document.Lien.elements[nom].style.visibility = "hidden";
	document.Lien.elements[temp].style.visibility = "visible";
	document.Lien.Bouton.value = "Change";
    }
}
