        flg = 0;
        effmsgboxauto = 0; suiteopmsgbox = "";
        erreurajax = 0; reponseajax = "";
        moverall = "";
        qt = unescape("%22"); rt = unescape("%0D");
        isie = 0; isie6 = 0;
function start() {
        mpwait = document.getElementById("pwait");
        moverall = document.getElementById("overall");
        mphotoaff = document.getElementById("idphotoaff");
        mphotoplan = document.getElementById("idphotoplan");
        mphotoz = document.getElementById("idphotoz");
        mphotoplaneff = document.getElementById("idphotoeff");
        mvideoplan = document.getElementById("idvideoplan");
        mvideoplancont = document.getElementById("idvideoplancont");
        mvideoplaneff = document.getElementById("idvideoeff");
        mmsgbox = document.getElementById("msgbox");
        mmsgconfirm = document.getElementById("msgconfirm");
    	flg = 1;
    if (navigator.appName == "Microsoft Internet Explorer") {isie = 1; if (navigator.appVersion.indexOf("MSIE 6") != -1) {isie6 = 1;}}
    if (document.addEventListener) {document.addEventListener("mousemove", positionmouse, true);} else if (document.attachEvent){document.attachEvent("onmousemove", positionmouse);}
        window.onresize = windowonresize;
	if (typeof(startpage) == 'function') {startpage();}
}
function movieobject(nommovie){if(navigator.appName.indexOf("Microsoft")!=-1){return window[nommovie]}else{return document[nommovie]}}
function imprimer(url, typ){
        param = "";
        url2 = url;
		qm = url.indexOf('?');
	if (qm > 0) {
            param = "&" + url.substr(qm + 1);
            url2 = basename(url);
    }
        fl = 1002; ht = Math.round(get_WindowHeight() / 5) * 3;
        xdec = Math.round((get_WindowWidth() - fl) / 2);
        ydec = Math.round((get_WindowHeight() - ht) / 2) - 30;
        options = 'resizable=0,toolbar=0,status=1,scrollbars=1,menubar=0,location=0,width=' + fl + ',height=' + ht + ',left=' + xdec + ',top=' + ydec;
    if (typ == 0) {loc = "imprimer.phtml";} else if (typ == 1) {loc = "imprimer-document.phtml";}
        loc = loc + "?page=" + url2 + param;
        newinimp = window.open('', 'imp', options);
        newinimp.location = loc;
        wimp = 0;
    waitimp();
}
function waitimp(){
	if (window.newinimp.flg == 1) {
	    if (typeof(copimp) == 'function') {copimp();}
	} else {
    	wimp++;
        setTimeout("waitimp()", 200);
	}
}
function basename(url) {
		basen = escape(url);
		cr = basen.indexOf('%3F');
	if (cr >= 0) {basen = basen.substr(0, cr);}
		basen = unescape(basen);
		okk = 1;
	while (okk > 0) {
   			cr = basen.indexOf('/');
		if (cr >= 0) {basen = basen.substr(cr + 1);} else {okk = 0;}
	}
	return basen;
}
function affmsgbox(message, suiteop) {
        maffmsgbox = document.getElementById("messageaff");
        suiteopmsgbox = suiteop;
        maffmsgbox.innerHTML = message;
    centre_vertical_div(maffmsgbox, document.getElementById("messageaffcont"));
    aff_centre_div (mmsgbox);
    if (effmsgboxauto > 0) {setTimeout("effmsgbox()", effmsgboxauto);}
}
function affmsgboxajout(message2, suiteop) {effmsgboxauto = 2000; affmsgbox (message2, suiteop);}
function effmsgbox() {mmsgbox.style.visibility = "hidden"; effmsgboxauto = 0;}
function effmsgboxsuiteop(suiteop) {effmsgbox(); if (suiteop) {setTimeout(suiteop, 20);}}
function affmsgconfirm(message, suiteop) {
    affoverall();
        maffmsgconfirm = document.getElementById("confirmaff");
        suiteopmsgconfirm = suiteop;
        maffmsgconfirm.innerHTML = message;
    centre_vertical_div(maffmsgconfirm, document.getElementById("confirmaffcont"))
    aff_centre_div (mmsgconfirm);
}
function effmsgconfirm() {effoverall(); mmsgconfirm.style.visibility = "hidden"}
function effmsgconfirmsuiteop(suiteop) {effmsgconfirm(); if (suiteop) {setTimeout(suiteop, 20);}}
function setcookie(nom,valeur) {document.cookie = nom + "=" + escape(valeur);}
function emailverif(emailv, verif) {
        emailv2 = emailv.toLowerCase();
        reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,4}$/;
        resultemail = reg.exec(emailv2) != null;
    if (verif && resultemail) {affmsgbox("Pour être s&ucirc;r de recevoir nos emails<br />nous vous conseillons d'ajouter<br /><br /><strong>contact@delrieux.com</strong><br /><br />dans votre liste d'adresses autorisées.<br /><br />Veuillez bien vérifier votre adresse email avant de valider.<br />", "");} 
    return (resultemail);
}
function affoverall() {
        moverall.style.visibility = "hidden";
        moverall.style.display = "block";
        var overH = 0; var overHS = get_ScrollHeight(); var overHW = get_WindowHeight();
    if (overHS < overHW) {overH = overHW;} else {overH = overHS;}
        moverall.style.height = overH + "px";
        moverall.style.width = get_ScrollWidth() + "px";
        moverall.style.visibility = "visible";
}
function effoverall() {moverall.style.display = "none";}
function windowonresize() {
    if (moverall.style.display == "block") {affoverall();}
}
function photo(phot){
    if (flg) {
            mphotoaff.src = domainref + phot;
        affoverall();
        affpwait();
        waitphoto();
    }
}
function waitphoto(){
        var largeur = get_Width(mphotoaff);
        var hauteur = get_Height(mphotoaff);
	if (largeur > 1 && hauteur > 1) {
	    effpwait();
            mphotoplan.style.width = largeur + 2 + "px";
            mphotoplan.style.height = hauteur + 2 + "px";
            mphotoz.style.width = largeur + "px";
            mphotoz.style.height = hauteur + "px";
            mphotoplaneff.style.left = largeur - 58 + "px";
	    aff_centre_div(mphotoplan, "fixed");
	} else {
        setTimeout("waitphoto()", 200);
	}
}
function effphoto(){
    mphotoaff.src = domainref + "img/px.gif";
    mphotoplan.style.visibility = "hidden";
    effoverall();
}
function noop() {}
function get_ScrollLeft() {
        var Y1 = 0; var Y2 = 0; var Yleft = 0;
    if (document.documentElement) {Y1 = document.documentElement.scrollLeft;}
    if (document.body) {Y2 = document.body.scrollLeft;}
    if (Y2 != Y1) {if (Y1 > 0) {Yleft = Y1;} else if (Y2 > 0) {Yleft = Y2;}} else {Yleft = Y1;}
    return Yleft;
}
function get_ScrollTop() {
        var X1 = 0; var X2 = 0; var Xtop = 0;
    if (document.documentElement) {X1 = document.documentElement.scrollTop;}
    if (document.body) {X2 = document.body.scrollTop;}
    if (X2 != X1) {if (X1 > 0) {Xtop = X1;} else if (X2 > 0) {Xtop = X2;}} else {Xtop = X1;}
    return Xtop;
}
function set_ScrollTop(scrollval) {
    if (document.documentElement) {
        // Positionne la page avec documentElement
            document.documentElement.scrollTop = scrollval;
        // Si la page n'a pas scrollé, tente avec body
        if (document.body && document.documentElement.scrollTop != scrollval) {document.body.scrollTop = scrollval;}
    } else if (document.body) {
        // Positionne la page avec body
            document.body.scrollTop = scrollval;
    } 
}
function get_ScrollWidth() {return document.documentElement.scrollWidth;}
function get_ScrollHeight() {return document.documentElement.scrollHeight;}
function get_WindowWidth() {
    var windowWidth = 0;
    if (typeof(window.innerWidth) == 'number') {
            windowWidth = window.innerWidth;
    } else {
        if (document.documentElement && document.documentElement.clientWidth) {windowWidth = document.documentElement.clientWidth;} else {if (document.body && document.documentElement.clientWidth) {windowWidth = document.documentElement.clientWidth;}}
    }
    return windowWidth;
}
function get_WindowHeight() {
    var windowHeight = 0;
    if (typeof(window.innerHeight) == 'number') {
            windowHeight = window.innerHeight;
    } else {
        if (document.documentElement && document.documentElement.clientHeight) {windowHeight = document.documentElement.clientHeight;} else {if (document.body && document.documentElement.clientHeight) {windowHeight = document.documentElement.clientHeight;}}
    }
    return windowHeight;
}
function get_Height(divact) {
    var heightact = 0;
    if (divact) {
        if (!heightact) {heightact = parseInt(divact.offsetHeight);}
        if (!heightact) {heightact = parseInt(divact.scrollHeight);}
        if (!heightact) {heightact = parseInt(divact.clientHeight);}
    }
    return heightact;
}
function get_Width(divact) {
    var widthact = 0;
    if (divact) {
        if (!widthact) {widthact = parseInt(divact.offsetWidth);}
        if (!widthact) {widthact = parseInt(divact.scrollWidth);}
        if (!widthact) {widthact = parseInt(divact.clientWidth);}
    }
    return widthact;
}
function findPosY(obj){
    var curtop = 0;
    if (obj.offsetParent) {
        while (1) {
              curtop+= obj.offsetTop;
          if (!obj.offsetParent) {break;}
              obj = obj.offsetParent;
        }
    } else if (obj.y) {
            curtop+= obj.y;
    }
    return curtop;
}
function findPos(obj) {
        var curleft = obj.offsetLeft || 0;
        var curtop = obj.offsetTop || 0;
    while (obj = obj.offsetParent) {curleft+= obj.offsetLeft; curtop+= obj.offsetTop;}
    return {x:curleft, y:curtop};
}
function positionmouse(e) {xmouse = e.clientX; ymouse = e.clientY;}
function centre_vertical_div(div_contenu, div_contenant) {
        var div_contenu_h = get_Height(div_contenu);
        var div_contenant_h = get_Height(div_contenant);
        var div_top = Math.round((div_contenant_h - div_contenu_h) / 2);
    if (div_top > 0) {div_contenu.style.top = div_top + "px";}
}
function aff_centre_div(divcentre) {
        divcentre.style.visibility = "hidden";
        divcentre.style.display = "block";
        divcentre.style.position = "fixed";
        var xpos = Math.round((get_WindowWidth() - get_Width(divcentre)) / 2);
        var ypos = Math.round((get_WindowHeight() - get_Height(divcentre)) / 2);
    if (xpos < 0){xpos = 0;}
    if (ypos < 0){ypos = 0;}
    if (isie6) {ypos+= get_ScrollTop(); divcentre.style.position = "absolute";}
        divcentre.style.left = xpos + "px";
        divcentre.style.top = ypos + "px";
        divcentre.style.visibility = "visible";
}
function affpwait() {aff_centre_div(mpwait);}
function effpwait() {mpwait.style.display = "none";}
function nwin(Xlarg, Yhaut, EcX, EcY, loc, nom) {
        lf = Math.round((screen.width - 10 - Xlarg) / 2) + EcX;
        tp = Math.round((screen.height - 40 - Yhaut) / 2) + EcY;
	options = "resizable=1,width=" + Xlarg + ",height=" + Yhaut + ",left=" + lf + ",top=" + tp + ",toolbar=0,status=1,scrollbars=1,menubar=0,location=0";
	newin = window.open('', nom, options);
    if (loc) {newin.location = loc;}
}
