        startp = 0;
        flg=0;
        lmhs='#e9e7e1';
        lmbs='#39c3ff';
        clcb='#cea998';
function start(){
        rt=unescape("%0D");
		compte=0;
        mphotoaff=document.getElementById("photoaff");
        mphotoplan=document.getElementById("photoplan");
        mphotoplan.style.visibility="hidden";
  	loadimg();
   		flg=1;
 	if (typeof(pathimg) == "undefined") {pathimg = ".";}
 	if (typeof(pathimp) == "undefined") {pathimp = "";}
	if (typeof(startpage) == "function") {startpage();}

}
function loadimg() {
		img=0;
	while(document.images[img]){
			url=document.images[img].name;
			ext=url.substr(url.length-3,3);
			ok=0;
		if (ext=="jpg" || ext=="gif"){document.images[img].src=url;}
			img+=1;
	}
}
function idimg(butt){
        id=false;
    if (document.getElementById){
	    id=document.getElementById(butt);
    } else{
            img=0;
        while(document.images[img]){
            if(document.images[img].id==butt){id=document.images[img];}
                img++;
        }
    }
    return id;
}
function tdon(td,coul) {
        td.idcell=td.style.backgroundColor;
        td.style.backgroundColor=coul;
}
function tdoff(td) {
    td.style.backgroundColor=td.idcell;
}

function afm(td,coul,menu,opt) {
    tdon(td,coul);
    af(menu,opt);
}
function efm(td,menu,opt) {
    tdoff(td);
    af(menu,opt);
}

function lance(url) {
    document.location=url;
}

function movieobject(nommovie){
	if(navigator.appName.indexOf("Microsoft")!=-1){return window[nommovie]}else{return document[nommovie]}
}
function imprimer(url,fl,ht){
        fl2=fl+40;
        param="";
        url2=url;
		qm=url.indexOf('?');
	if (qm>0) {
            param="&"+url.substr(qm+1);
            url2=basename(url);
    }
        xdec=Math.round((screen.width-fl2)/2);
        ydec=Math.round((screen.height-ht)/2)-30;
    if(xdec<0){xdec=0;}
    if(ydec<0){ydec=0;}
        options='resizable=0,toolbar=0,status=1,scrollbars=1,menubar=0,location=0,width='+fl2+',height='+ht+',left='+xdec+',top='+ydec;
        loc=pathimp+"imprimer.phtml?page="+url2+param+"&Xlarg="+fl;
        newin=window.open('','imp',options);
        newin.location=loc;
    waitimp();
}
function waitimp(){
	if (window.newin.flg == 1){
    	if (typeof(copimp) == "function") {copimp();}
	} else {
        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 photo(phot){
    if (flg) {
        mphotoaff.src=pathimg+"./img/"+phot;
        waitphoto();
    }
}
function waitphoto(){
	if (mphotoaff.width!=1 && mphotoaff.height!=1){
            xpos=Math.round((screen.width-mphotoaff.width)/2)+document.body.scrollLeft;
        if(xpos<0){xpos=0;}
            ypos=Math.round((screen.height-mphotoaff.height)/2)-150+document.body.scrollTop;
        if(ypos<0){ypos=0;}
        mphotoplan.style.left=xpos;
        mphotoplan.style.top=ypos;
        mphotoplan.style.visibility="visible";
	} else {
        setTimeout("waitphoto()",200);
	}
}
function effphoto(){
    mphotoaff.src=pathimg+"./img/px.gif";
    mphotoplan.style.visibility="hidden";
}
