/*
function envoyer(liste,id) {
        Pleft = (window.screen.availWidth/2) - (popup_width/2);
        Ptop = (window.screen.availheight/2) - (popup_height/2);
        window.open(liste + "_envoyer.php?id=" + id,liste + "envoyer" + id,"left=" + Pleft + ",top=" + Ptop + ",width=" + popup_width + ",height=" + popup_height + ",scrollbars=yes");
        }

function supprimer(liste,id) {
        question = "Confirmez-vous la suppression définitive ?";
        if(confirm(question)) {
                location = liste + "_supprimer.php?id=" + id;
                }
        }

function repondre(liste,id) {
        Pleft = (window.screen.availWidth/2) - (popup_width/2);
        Ptop = (window.screen.availheight/2) - (popup_height/2);
        window.open(liste + "_repondre.php?id=" + id,liste + "repondre" + id,"left=" + Pleft+",top=" + Ptop + ",width=" + popup_width + ",height=" + popup_height + ",scrollbars=yes");
        }

function ajouter(liste) {
        Pleft = (window.screen.availWidth/2) - (popup_width/2);
        Ptop = (window.screen.availheight/2) - (popup_height/2);
        window.open(liste + "_ajouter.php",liste + "ajouter","left=" + Pleft+",top=" + Ptop + ",width=" + popup_width + ",height=" + popup_height + ",scrollbars=yes");
        }

function voir(liste,id) {
        Pleft = (window.screen.availWidth/2) - (popup_width/2);
        Ptop = (window.screen.availheight/2) - (popup_height/2);
        window.open(liste + "_voir.php?id=" + id,liste + "voir" + id,"left=" + Pleft + ",top=" + Ptop + ",width=" + popup_width + ",height=" + popup_height + ",scrollbars=yes");
        }

function modifier(liste,id) {
        Pleft = (window.screen.availWidth/2) - (popup_width/2);
        Ptop = (window.screen.availheight/2) - (popup_height/2);
        window.open(liste + "_modifier.php?id=" + id,liste + "modifier" + id,"left=" + Pleft+",top=" + Ptop + ",width=" + popup_width + ",height=" + popup_height + ",scrollbars=yes");
        }
*/

function loaded() {
        document.getElementById("nowLoading").innerHTML = "<font color='#FFDB74'>TRAITEMENT EN COURS...</font>";
        }

function IsNumeric(strString) { // check for valid numeric strings
        var strValidChars = "0123456789.- ";
        var strChar;
        var blnResult = true;
        if(strString.length == 0) return false; // test strString consists of valid characters listed above
        for(i = 0; i < strString.length && blnResult == true; i++) {
                strChar = strString.charAt(i);
                if(strValidChars.indexOf(strChar) == -1) blnResult = false;
                }
        return blnResult;
        }

function puce_on(element) {
        document.getElementById(element).innerHTML = "<img src=\"images/puce_on.gif\" width=24 height=25 border=0>";
        }

function puce_off(element) {
        document.getElementById(element).innerHTML = "<img src=\"images/puce_off.gif\" width=24 height=25 border=0>";
        }
		
function facade() {
	window.open('pop_facade.php','facade','width=420,height=320');
}

function grande() {
	window.open('pop_grand.php','grande','width=420,height=320');
}

function petite() {
	window.open('pop_petit.php','petite','width=420,height=320');
}
function mailing_valider() {
        mail = document.mailing.mail.value;
        if(mail == "" || mail.indexOf("@") == "-1" || mail.indexOf(".") == "-1") {
                alert("Vous n'avez pas saisi de mail correct.\n");
                document.mailing.mail.focus();
                return;
                }
        popup("mailing_valid.php?mail="+ mail,320,220);
//        document.location.href = "mailing_valid.php?mail="+ mail;
        }

function popup(pop_url,pop_width,pop_height) {
        pop_name = pop_url.substring(0,pop_url.indexOf("."));
        pop_left = (window.screen.availWidth / 2) - (pop_width / 2);
        pop_top = (window.screen.availheight / 2) - (pop_height / 2);
        window.open(pop_url,pop_name,"left=" + pop_left + ",top=" + pop_top + ",width=" + pop_width + ",height=" + pop_height + ",scrollbars=no,noresize");
        }

function agrandir(img_src,link_color,bg_color) {
        var pop_width = 607;
        var pop_height = 459;
        var pop_img = new Image();
        pop_img.src = img_src;
        pop_win = window.open("","","width="+ pop_width +",height="+ pop_height +",scrollbars=no");
        pop_win.document.open();
        pop_win.document.write("<head><title>"+ pop_img.src +"</title></head>");
        pop_win.document.write("<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0");
        pop_win.document.write(" link='"+ link_color +"' bgcolor='"+ bg_color +"'>");
        pop_win.document.write("<table width='100%' height='100%' border=0>");
        pop_win.document.write("<tr><td align=center valign=middle><img src='"+ pop_img.src +"'></td></tr>");
        pop_win.document.write("<tr><td align=center valign=middle><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>");
        pop_win.document.write("<a href='javascript:window.close();'>Fermer la fen&ecirc;tre</a>");
        pop_win.document.write("</font></td></tr>");
        pop_win.document.write("</table>");
        pop_win.document.write("</body>");
        pop_win.document.close();
        if(pop_img.width != 0 || pop_img.height != 0) {
                pop_width = pop_img.width + 50;
                pop_height = pop_img.height + 100;
                pop_win.resizeTo(pop_width,pop_height);
                }
        pop_left = (window.screen.availWidth / 2) - (pop_width / 2);
        pop_top = (window.screen.availHeight / 2) - (pop_height / 2);
        pop_win.moveTo(pop_left,pop_top);
        }

