﻿function pagesetup() {
    var mywindow =   document.body.clientHeight-340;
    //alert("height: " +document.body.clientHeight + " mywindw: "  +mywindow);
    var setupframe = document.getElementById("mainframe");
    var getHleftpage = document.getElementById("left_page");
    var setCleftpage = document.getElementById("left_pagecont");
    var setleftmenu = document.getElementById("left_menu");
       
     setupframe.style.height = mywindow+"px";
     setleftmenu.style.height = (mywindow-30)+"px";
   
     
     
}

/* AUTEUR: CONTROLE HYBRIDE LR */
/* DATE DE CREATION: 09/19/03 */
function openpage(pg,ww,hh,ll,tt,sig){
 var page = pg
 var pwidth = ww
 var pheight = hh
 var pleft = ll
 var ptop = tt
 var signet = sig
 if (typeof pwidth == "undefined"){
   var pwidth=150;
  }
 if (typeof pheight == "undefined"){
   var pheight=150;
  }
 if (typeof pleft == "undefined"){
   var pleft=0;
  }
 if (typeof ptop  == "undefined"){
   var ptop=0;
  }
 if (typeof signet == "undefined"){
   var signet = "";
  }
 if (typeof signet != "undefined"){
   var signet = "#" +signet;
  }

if (typeof page != "undefined"){
 var texte = "scrollbars=yes,status=no,resizable=yes,width="+pwidth+",height="+pheight+",top="+ptop+",left=" +pleft;
 ipopop = window.open(page + signet, "ipop", texte);
 fSetFocus("ipopop");
 }
 else{alert("OUPS! votre fenetre pop pop n'est pas bien configuré\n Vous devez spécifier le nom de votre fichier.")}
}

function fSetFocus(fp){
	 if (document.images){
	  ipopop.focus();
   }
 }
function imgview(imgname,ww,hh,lf,tp){
if(ww==""){ww=500}
if(hh==""){hh=450}
if(lf==""){lf=2}
if(tp==""){tp=2}
var hst = document.location.host
imgopen=open("","imgviewer","scrollbars=yes,resizable=yes,width="+ww+",height="+hh+",left="+lf+",top="+tp);
imgopen.document.open();
imgopen.document.write('<HTML><HEAD><TITLE>Album photo</TITLE><style>a {text-decoration:none;} a:hover {text-decoration: underline}</style></HEAD><BODY LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" OnLoad="this.focus();">');
imgopen.document.write('<CENTER><a href="javascript:window.close()" ><img src="http://'+hst+'/w02/images/'+imgname+'" border=0><br>Fermer</a>');
imgopen.document.write("</CENTER></BODY></HTML>");
imgopen.document.close();
}

function popup(strpath) {
    var theTop = 10;
       
    if (parent.window.document.getElementById("Wpopup")) {
        var winpop = parent.window.document.getElementById("Wpopup");
        if (document.documentElement.scrollTop > 0) {
            theTop = document.documentElement.scrollTop;
        }
        if (document.body.scrollTop > 0) {
            theTop = document.body.scrollTop;
        }
    }
    else {
        if (window.top.frames.length == 2) {
            var winpop = window.parent.window.parent.frames[2].document.getElementById("Wpopup");
            if (window.parent.window.parent.frames[2].document.documentElement.scrollTop > 0) {
                theTop = window.parent.window.parent.frames[2].document.documentElement.scrollTop;
            }
            if (window.parent.window.parent.frames[2].document.body.scrollTop > 0) {
                theTop = window.parent.window.parent.frames[2].document.body.scrollTop;
            }
            
        }
        if (window.top.frames.length == 1) {
            //alert("window.top.frames[0].length:" + window.top.frames[0].length);
            var winpop = window.top.frames[0].window.frames[2].document.getElementById("Wpopup");
            if (window.top.frames[0].window.frames[2].document.documentElement.scrollTop > 0) {
                theTop = window.top.frames[0].window.frames[2].document.documentElement.scrollTop;
            }
            if (window.top.frames[0].window.frames[2].document.body.scrollTop > 0) {
                theTop = window.top.frames[0].window.frames[2].document.body.scrollTop;
            }
        }
    
    }
    if (winpop) {
        var imgpopup = strpath;
        var pos1 = imgpopup.indexOf("/thumb", 0);
        var pos2 = imgpopup.indexOf("/", pos1 + 1);
        var str01 = imgpopup.substring(pos1, pos2);
        var pos3 = imgpopup.indexOf("mac", 0);
        var pos4 = imgpopup.indexOf("/", pos3 + 1);
        var str02 = imgpopup.substring(pos3, pos4);
        imgpopup = imgpopup.replace(str01, "");
        winpop.style.backgroundColor = "#3E92AE";
        winpop.style.borderWidth = "4px";
        winpop.style.borderStyle = "ridge";
        winpop.style.borderColor = "gray"
        //winpop.style.posLeft = "10px";
        winpop.style.top = "10px";
        winpop.style.position = 'absolute';
        winpop.style.overflow = "auto";
        winpop.tabIndex = "auto";
        winpop.style.display = 'block';
        winpop.innerHTML = '<table><tr><td align="right"><img  style="cursor: pointer;" onclick="popclose()" src="images/button/close.gif"></td></tr><tr><td><img alt="Click pour fermer" src="' + imgpopup + '" onclick="popclose()"></td></tr></table>'
    } 
}
function popclose(){
var winpop=document.getElementById("Wpopup");
 winpop.style.display ='none';

}


