// [FONCTION] tof v4
// popUp dynamique image
function tof(monImage){

    // cherche XP pr agrandir les popUp
    var chercheXP 	= new RegExp("Windows NT 5.1","gi");
    cestXP	= chercheXP.test(navigator.appVersion);

    var AddXPH = 0;
    if (cestXP==true){AddXPH = 25;}
    Lwindow = 700;
    Hwindow = 500;
	posX = (((screen.width)-Lwindow)/2);
	posY = (((screen.height)-Hwindow)/2);
    
	w = window.open('','chargement','width='+Lwindow+',height='+Hwindow+',scrollbars=1,status=no,top='+posY+',left='+posX);
	w.document.write( "<html><head><title>Photo</title>\n" );
	w.document.write( "<script language='JavaScript'>\n");
	w.document.write( "IE5=NN4=NN6=false;\n");
	w.document.write( "if(document.all)IE5=true;\n");
	w.document.write( "else if(document.getElementById)NN6=true;\n");
	w.document.write( "else if(document.layers)NN4=true;\n");
	w.document.write( "function autoSize() {\n");
	w.document.write( "LI = document.images[0].width; HI = document.images[0].height;\n");     // Image
	w.document.write( "LS = screen.width; HS = screen.height;\n");                             // Screen
	w.document.write( "LF = LI; HF = HI+50;\n");                                                  // Fenetre (si on ajoute pas de la hauteur, l'image est coupe)
	w.document.write( "moveToX = ((LS-LF)/2); moveToY = ((HS-HF)/2);\n");                        // Position Fenetre
	w.document.write( "if (LI>=LS){LF=LS-10;moveToX=0;}\n");
	w.document.write( "if (HI>=HS){HF=HS-30;moveToY=0;}\n");
	w.document.write( "self.moveTo(moveToX,moveToY);\n");  // on deplace avant de redimentionner sinon Pb
	w.document.write( "if(IE5) self.resizeTo(LF+10, HF+"+AddXPH+" );\n");
	w.document.write( "else window.resizeTo(LF, HF+15+"+ AddXPH+" );\n");
	w.document.write( "self.focus();\n");
	w.document.write( "document.getElementById('photo').style.display = 'none';\n");
	w.document.write( "if (moveToX!=0 && moveToY!=0) {document.body.style.overflow='hidden';}\n");
	w.document.write( "" );
	w.document.write( "}\n</scri");
	w.document.write( "pt>\n");
    w.document.write( "<meta http-equiv='imagetoolbar' content='no'>\n");
	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" );
	w.document.write( "<div id=photo style='position:absolute;top:0;left:0;z-index:10;width:"+Lwindow+";text-align:center;background-color:#FF6600;color:#000000;font-weight:bold;'><br>Chargement...<br><br></div>" );
	w.document.write( "<a href='javascript:window.close();'><img src='"+monImage+"' border=0 alt='Cliquez pour FERMER'></a>");
	w.document.write( "</body></html>" );
	w.document.close();
	}


function ingredients(ik){
	ing = window.open ('ingredients_popup.php?ik='+ik, 'ingre', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=500');
	window.ing.focus();
      }



// [FONCTION] coolPopUp 1.7.5 [12/08/2003 03:26] (n'est plus compatible avec les versions precedents 1.5)
/* www.studio-de-la.com */

// ex : javascript:goPopUp('../html/video.htm', l=200, h=100, nf=maFenetre, st=1, rs=1, mov=0, x=0, y=0)
//						l pour la largeur souhaité
//						h pour la hauteur souhaité
//						nf pour non de la fenetre
//						st=1 pour le status
//						rs=1 pour le resize
//						mov=1 pour center et/ou actionner

// document.body.style.overflow='hidden';

var largeur = 500;
hauteur = 400;


var nomDeFenetre = "maFenetre";
var statu = "no";
var resize = "no";
var gomove = 0;
var dejaBouge = 0;

largeurEcran = screen.width;
hauteurEcran = screen.height;

// cherche XP pr agrandir les popUp
var chercheXP 	= new RegExp("Windows NT 5.1","gi");
cestXP	= chercheXP.test(navigator.appVersion);

function goPopUp (quelPage, l, h, nf, st, rs, mov, x, y) {

	if ( typeof l   == 'undefined' || l  == '' ) { l   = largeur; } if (cestXP == true) { l = parseInt(l)+5;}
	if ( typeof h   == 'undefined' || h  == '' ) { h   = hauteur; } if (cestXP == true) { h = parseInt(h)+5;}
	if ( typeof nf  == 'undefined' || nf  == '') { nf  = nomDeFenetre; } 
	if ( typeof st  == 'undefined' || st  == '') { st  = statu; } else {st = "yes";}
	if ( typeof rs  == 'undefined' || rs  == '') { rs  = resize; } else {rs = "yes";}
	if ( typeof mov == 'undefined' || mov == '') { mov = gomove; }

	posX = ((largeurEcran - l) / 2);
	posY = ((hauteurEcran - h) / 2);
	if ( typeof x  == 'undefined' || x  == '') { x  = posX; } else if ( x == 'd' && largeurEcran <= 1024 ){ x = largeurEcran - l; } else { x = 1024 - l; }

	if ( typeof y  == 'undefined' || y  == '') { y  = posY; }

	var adressePage       = quelPage;
	var parametresFenetre = "toolbar=no,location=no,directories=no,status="+st+",menubar=no,scrollbars=yes,resizable="+rs+",width="+l+",height="+h+"'";
	coucou = window.open (adressePage, nf, parametresFenetre);
	
	window.coucou.resizeTo(l,h);
	if (mov == 1 && dejaBouge == 0) { window.coucou.moveTo(x,y); dejaBouge = 1;}
	mov = gomove;
	
	window.coucou.focus();
	}


// [FONCTION] c2lazik_player v2.4
function c2lazik_player(zik, swf, L, H, divID, couleur, param, ext){
    
    Lswf = 160;
    Hswf = 16;
    if(L){Lswf = L;}
    if(H){Hswf = H;}
    if(swf){SWFFILE = swf;}else{SWFFILE = 'c2lazik_player';}
   	if ( typeof divID == 'undefined') { divID  = ''; }
   	if ( typeof couleur == 'undefined') { couleur  = ''; }
   	if ( typeof param == 'undefined') { param  = ''; }
   	if (ext) { zik  = zik+'.'+ext; }	// stop aspi
    Fswf = SWFFILE+'.swf?son='+zik+'&'+param;

    var codeFlash = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
    + 'WIDTH="'+Lswf+'" HEIGHT="'+Hswf+'"'
    + 'CODEBASE="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="c2lazik_player" align="middle" />'
    + '<PARAM NAME="MOVIE" VALUE="'+Fswf+'" />'
    + '<PARAM NAME="QUALITY" VALUE="high" />'
    + (couleur==''?'<PARAM NAME="WMODE" VALUE="transparent"> ':'<PARAM NAME="BGCOLOR" VALUE="'+couleur+'" />')
    + '<PARAM NAME="SCALE" VALUE="noscale" />'
    + '<PARAM NAME="allowScriptAccess" VALUE="sameDomain" />'
    + '<EMBED SRC="'+Fswf+'" ' 
    + 'WIDTH="'+Lswf+'" HEIGHT="'+Hswf+'" ' 
    + 'name="video" '
    + 'align="middle" '
    + 'allowScriptAccess="sameDomain" '
    + 'QUALITY="high" ' 
    + (couleur==''?'WMODE="transparent" ':'bgcolor="'+couleur+'" ')
    + 'SCALE="noscale" ' 
    + 'TYPE="application/x-shockwave-flash" ' 
    + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" /> '
    + '</OBJECT>';
    document.getElementById("c2lazikplayer"+divID).innerHTML = codeFlash;
    }

// [FONCTION] c2lavideo_player v2.9
function c2lavideo_player(file, swf, L, H, divID, color, hidebar, rembobine, justreturn, transparent, ext){
   	if ( typeof hidebar == 'undefined') { hidebar  = 0; }
   	if ( typeof justreturn == 'undefined') { justreturn  = 0; }
  	if(hidebar==1){Hbar = 0;}else{Hbar = 16;}
   	if ( typeof rembobine == 'undefined') { rembobine  = 'n'; }
    Lswf = 320;
    Hswf = Number(240)+Number(Hbar);
    if(L){Lswf = L;}
    if(H){Hswf = Number(H)+Number(Hbar);}
    if(color){couleur = color;}else{couleur = '#FFFFFF';}
   	if ( typeof color == 'undefined') { color  = ''; }
    if(swf){SWFFILE = swf;}else{SWFFILE = 'c2lavideo_player';}
	if(ext){file=file+'.'+ext;}	// stop aspi
    Fswf = SWFFILE+'.swf?file='+file+'&color='+color+'&Lv='+Lswf+'&Hv='+Hswf+'&hidebar='+hidebar+'&rembobine='+rembobine;
   	if ( typeof divID == 'undefined') { divID  = ''; }
   	if ( typeof transparent == 'undefined') { transparent  = ''; }

    var codeFlash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+Lswf+'" height="'+Hswf+'" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="c2lavideo_player" align="middle" />'
    + '<param name="movie" value="'+Fswf+'" />'
    + '<param name="quality" value="high" />'
    + '<param name="scale" value="noscale" />'
    + '<param name="bgcolor" value="'+couleur+'" />'
    + '<param name="allowScriptAccess" value="sameDomain" />'
    + (transparent==1?'<param name="wmode" value="transparent">':'')
    + '<embed src="'+Fswf+'" ' 
    + 'width="'+Lswf+'" height="'+Hswf+'" ' 
    + 'bgcolor="'+couleur+'" ' 
    + (transparent==1?'wmode="transparent" ':'')
    + 'name="video" '
    + 'align="middle" '
    + 'allowScriptAccess="sameDomain" '
    + 'quality="high" ' 
    + 'scale="noscale" ' 
    + 'type="application/x-shockwave-flash" ' 
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer" /> '
    + '</object>';
    if (justreturn==1){
        return codeFlash;
        }else{
        document.getElementById("c2lavideoplayer"+divID).innerHTML = codeFlash;
        }
    }

