
	
/**************************************** light box pascal *******************************/
	  
/* appel box global */
	 
	var req = control_httprequest();
	  
function openApp(dossier, nom_app, box_height, box_width, option){

//openApp('./_html/', 'html_pop_probleme.php', '445', '538', 'load_fl')

	// req.open('GET', url, false);
	req.open('GET', dossier + nom_app , false);
    req.send(null);
    // element.innerHTML = req.responseText;

	document.getElementById(option).innerHTML = req.responseText;

	//appel de la box
	option == "load_festi" ? lightclip('2', 'block', box_height, box_width) : "";
	option == "load_fl" ? lightclip('1', 'block', box_height, box_width) : "";


}


function lightclip(IdClip, TypeDisp, DimH, DimW){

	document.getElementById('ClipFront_'+IdClip).style.display = TypeDisp;
	document.getElementById('ClipFront_'+IdClip).style.height = DimH + 'px';
	document.getElementById('ClipFront_'+IdClip).style.width = DimW + 'px';
	
	

	if(TypeDisp == "block" ) { 
	
	TypeDispOp = "none"; 
	document.getElementById('ClipVign_'+IdClip).style.visibility = "hidden"; 
	document.getElementById('ClipBack').style.display = "block";
	
	}else{ 
	
	TypeDispOp = "block"; 
	document.getElementById('ClipVign_'+IdClip).style.visibility = "visible"; 
	document.getElementById('ClipBack').style.display = "none";
	
	}
	
	 document.getElementById('ClipFront_'+IdClip).style.opacity = 0;
     document.getElementById('ClipFront_'+IdClip).style.filter = "alpha(opacity=" + (0) + ")";
			 
	setTimeout("animationClipLight('0', '"+IdClip+"', '"+DimH+"', '"+DimW+"')",1);
	
	 


			 
}

function lightclose(IdClip, TypeDisp){

	document.getElementById('ClipFront_'+IdClip).style.display = TypeDisp;
	
	TypeDispOp = "block"; 
	document.getElementById('ClipVign_'+IdClip).style.visibility = "visible"; 
	document.getElementById('ClipBack').style.display = "none";
	
}


function animationClipLight (x, IdClip, DimH, DimW) {
			
			 // largeur_ecran_ideal = ((window.innerWidth-DimW)/2);
			 // hauteur_ecran_ideal = ((window.innerHeight-DimH)/2);
			
			 // largeur_ecran_ideal = ((screen.availWidth-DimW)/2);
			 // hauteur_ecran_ideal = ((screen.availHeight-DimH)/4);

			 
			 largeur_ecran_ideal = ((document.body.clientWidth-DimW)/2);
			 
			 if((Number(window.innerHeight) <= 800)||(Number(window.innerHeight) > 900)){
			    hauteur_ecran_ideal = 150;
			 }else{
				hauteur_ecran_ideal = ((Number(screen.height)-DimH)/2);
			 }
			 
			 // var largeur_ecran_ideal = ((document.body.clientWidth-DimW)/2);
			 // var hauteur_ecran_ideal = ((document.body.clientHeight-DimH)/4);

			//alert("hauteur : " + hauteur_ecran_ideal + "px" + "\n" + "largeur : " + largeur_ecran_ideal + "px");

			 document.getElementById("ClipFront_"+IdClip).style.left = (largeur_ecran_ideal-(x*2)) + "px";
             document.getElementById("ClipFront_"+IdClip).style.top = (hauteur_ecran_ideal)  + "px";
			 
             document.getElementById('ClipFront_'+IdClip).style.opacity = x*0.1;
             document.getElementById('ClipFront_'+IdClip).style.filter = "alpha(opacity=" + (x*20) + ")";

			//x+1;
		
			if (x < 10) {
                       var appelSuivant = 'animationClipLight(' + (x+1) +', '+IdClip+', '+DimH+', '+DimW+')';
                       setTimeout(appelSuivant, 50);
				
             }
			
			 
}




function openVideoHome(dossier, nom_flv, box_height, box_width){
					
	// génération du flash
	var ValFlash = "";
	
	ValFlash += "<object id=\"Object1\" type=\"application/x-shockwave-flash\" data=\"" + dossier + "player_flv_maxi.swf\" width=\"618\" height=\"348\">";
	ValFlash += "<noscript></noscript>";
	ValFlash += "<param name=\"movie\" value=\"" + dossier + "player_flv_maxi.swf\" />\n";
	ValFlash += "<param name=\"allowFullScreen\" value=\"true\" />\n";
	ValFlash += "<param name=\"wmode\" value=\"opaque\" />\n";
	ValFlash += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n";
	ValFlash += "<param name=\"quality\" value=\"high\" />\n";
	ValFlash += "<param name=\"menu\" value=\"false\" />\n";
	// ValFlash += "<param name=\"FlashVars\" value=\"configxml=" + dossier + nom_flv + ".xml\" />\n";		
	ValFlash += "<param name=\"FlashVars\" value=\"configxml=" + dossier + "conf.xml&flv=./global/" + nom_flv + "\" />\n";		
	// ValFlash += "<param name=\"FlashVars\" value=\"configxml=" + dossier + "conf.xml&flv=./global/" + nom_flv + "\"/>\n";		
	
	ValFlash += "</object>";

	document.getElementById('load_fl').innerHTML = ValFlash;
			 
	 PosOriX = document.getElementById('divFlash').offsetLeft ;
	 PosOriY = document.getElementById('divFlash').offsetTop ;
	 
	 
	//appel de la box
	lightclipAnimate('1', 'block', box_height, box_width, PosOriX, PosOriY);
	
	
	
}



/* en dev */




function lightclipAnimate(IdClip, TypeDisp, DimH, DimW, PosOriX, PosOriY){

	document.getElementById('ClipFront_'+IdClip).style.display = TypeDisp;
	document.getElementById('ClipFront_'+IdClip).style.height = DimH + 'px';
	document.getElementById('ClipFront_'+IdClip).style.width = DimW + 'px';
	
	

	if(TypeDisp == "block" ) { 
	
	TypeDispOp = "none"; 
	document.getElementById('ClipVign_'+IdClip).style.visibility = "hidden"; 
	document.getElementById('ClipBack').style.display = "block";
	
	}else{ 
	
	TypeDispOp = "block"; 
	document.getElementById('ClipVign_'+IdClip).style.visibility = "visible"; 
	document.getElementById('ClipBack').style.display = "none";
	
	}
	
	 document.getElementById('ClipFront_'+IdClip).style.opacity = 0;
     document.getElementById('ClipFront_'+IdClip).style.filter = "alpha(opacity=" + (0) + ")";
	 
	 // PosOriX = document.getElementById('DivBtPlay').offsetLeft ;
	 // PosOriYTmp = document.getElementById('DivBtPlay').offsetTop ;
	 PosOriYTmp = PosOriY;
	 
// document.getElementById('debug_clip').innerHTML = "";

	if((Number(DimH) + Number(PosOriYTmp)) < ((Number(window.innerHeight)-100))){
		// PosOriY = (Number(document.getElementById('DivBtPlay').offsetTop)-20);
		PosOriY = (Number(PosOriYTmp)-20);
		// document.getElementById('debug_clip').innerHTML += "option 1 : " + (Number(DimH) + Number(PosOriYTmp)) + "<br/>";
	}else{
		PosOriY = 50;
		// document.getElementById('debug_clip').innerHTML += "option 2<br/>";
	}
	 
	// alert (PosOriX + " - " + PosOriY);

	setTimeout("animationClipLight_2('0', '"+IdClip+"', '"+DimH+"', '"+DimW+"', '"+PosOriX+"', '"+PosOriY+"')",1);

	// document.getElementById('debug_clip').innerHTML += "window.innerHeight : " + (Number(window.innerHeight)-100) + "<br/>";
	// document.getElementById('debug_clip').innerHTML += "DimH : " + DimH + "<br/>";
	// document.getElementById('debug_clip').innerHTML += "PosOriYTmp : " + PosOriYTmp + "<br/>";
	// document.getElementById('debug_clip').innerHTML += "PosOriY : " + PosOriY + "<br/>";
	// document.getElementById('debug_clip').innerHTML += "PosOriY 2 : " + (Number(document.getElementById('DivBtPlay').offsetTop)-10) + "<br/>";

			 
}



function animationClipLight_2 (x, IdClip, DimH, DimW, PosOriX, PosOriY) {
			
			 // largeur_ecran_ideal = ((window.innerWidth-DimW)/2);
			 // hauteur_ecran_ideal = ((window.innerHeight-DimH)/2);
			
			// alert (PosOriX + " - " + PosOriY);

			 // largeur_ecran_ideal = ((screen.availWidth-DimW)/2);
			 // hauteur_ecran_ideal = ((screen.availHeight-DimH)/4);

			 // var largeur_ecran_ideal = ((document.body.clientWidth-DimW)/2);
			 // var hauteur_ecran_ideal = ((document.body.clientHeight-DimH)/4);

			//alert("hauteur : " + hauteur_ecran_ideal + "px" + "\n" + "largeur : " + largeur_ecran_ideal + "px");

			 // document.getElementById("ClipFront_"+IdClip).style.left = (largeur_ecran_ideal-(x*2)) + "px";
             // document.getElementById("ClipFront_"+IdClip).style.top = (hauteur_ecran_ideal)  + "px";
			 
			 
			 
			 document.getElementById("ClipFront_"+IdClip).style.width = (x*8) + "px";
             document.getElementById("ClipFront_"+IdClip).style.height = (x*4)  + "px";
			 
			 document.getElementById("ClipFront_"+IdClip).style.left = ((PosOriX+345)-(x*9)) + "px";
			 
             // document.getElementById("ClipFront_"+IdClip).style.top = ((PosOriY) + (x*0.7))  + "px";
             document.getElementById("ClipFront_"+IdClip).style.top = ((PosOriY) + (x*0.7))  + "px";
			 
			 
             document.getElementById('ClipFront_'+IdClip).style.opacity = x*0.01;
             document.getElementById('ClipFront_'+IdClip).style.filter = "alpha(opacity=" + (x*1) + ")";
 

			//x+1;
		
			if (x < 100) {
                       var appelSuivant = 'animationClipLight_2(' + (x+1) +', '+IdClip+', '+DimH+', '+DimW+', '+PosOriX+', '+PosOriY+')';
                       setTimeout(appelSuivant, 0);
				
             }
			
			 
}



/************************  *******************************/


function openVideoSimple(dossier, nom_flv, box_height, box_width, PosOriX, PosOriY){
					
	// génération du flash
	var ValFlash = "";
	
	ValFlash += "<object id=\"Object1\" type=\"application/x-shockwave-flash\" data=\"" + dossier + "player_flv_maxi.swf\" width=\"618\" height=\"348\">";
	ValFlash += "<noscript></noscript>";
	ValFlash += "<param name=\"movie\" value=\"" + dossier + "player_flv_maxi.swf\" />\n";
	ValFlash += "<param name=\"allowFullScreen\" value=\"true\" />\n";
	ValFlash += "<param name=\"wmode\" value=\"opaque\" />\n";
	ValFlash += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n";
	ValFlash += "<param name=\"quality\" value=\"high\" />\n";
	ValFlash += "<param name=\"menu\" value=\"false\" />\n";
	// ValFlash += "<param name=\"FlashVars\" value=\"configxml=" + dossier + nom_flv + ".xml\" />\n";		
	// ValFlash += "<param name=\"FlashVars\" value=\"width=518&height=338&configxml=" . $dossier_swf . "conf.xml&flv=" . PATHURL . $dossier . $nom_flv . "&startimage=" . PATHURL . $dossier . $nom_dossier_video . "/002.jpg\"/>\n";		
	ValFlash += "<param name=\"FlashVars\" value=\"configxml=" + dossier + "conf.xml&flv=./global/" + nom_flv + "\"/>\n";		
	
	
	ValFlash += "</object>";

	document.getElementById('load_fl').innerHTML = ValFlash;

	// alert(dossier + nom_flv);
		 
	 PosOriX = document.getElementById('DivBtPlay').offsetLeft ;
	 PosOriY = document.getElementById('DivBtPlay').offsetTop ;
	 
	 
	//appel de la box
	lightclipAnimate('1', 'block', box_height, box_width, PosOriX, PosOriY);
	
	
}


function openPhotoSimple(dossier, nom_flv, box_height, box_width){

	var MonImg = new Image();
	MonImg.src = dossier + nom_flv;
	  
	MonImg.onload = function(){

	var ValFlash = "";
  
	// ValFlash += "<div style=\"height:500px; width:500px; border:1px solid #ff0000; overflow:hidden;\"><img src=\"" + dossier + nom_flv + "\" width=\""+MonImg.width+"\" height=\""+MonImg.height+"\"/></div>";
	ValFlash += "<img src=\"" + dossier + nom_flv + "\" width=\""+MonImg.width+"\" height=\""+MonImg.height+"\"/>";

	document.getElementById('load_fl').innerHTML = ValFlash;

	//appel de la box
	lightclip('1', 'block', box_height, box_width);
	
	}
}



function stop_play_swf(arg, langue){
			
				// document.getElementById('FlashID').style.visibility = "hidden";
				// if((langue == "undefined")||(langue == "")) { langue = ""; }

				if(arg == "stop"){
				 document.getElementById('divFlash').innerHTML = "<img src=\"./images/index/flash_fixe.jpg\" width=\"384\" height=\"505\" />";
				}
				
				if(arg == "play"){
				
				BFlash = "";
				BFlash += "\n";
				
				BFlash += "<object id=\"FlashID\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"384\" height=\"505\">\n";
				BFlash += "<param name=\"movie\" value=\"./_rubrique/" + langue + "index/home/media/home.swf\" />\n";
				BFlash += "<param name=\"quality\" value=\"high\" />\n";
				BFlash += "<param name=\"menu\" value=\"false\" />\n";
				BFlash += "<param name=\"wmode\" value=\"transparent\" />\n";
				BFlash += "<param name=\"swfversion\" value=\"6.0.65.0\" />\n";
				// BFlash += "> \n";
				BFlash += "<!--[if !IE]>--";
				BFlash += ">\n";
				BFlash += "<object type=\"application/x-shockwave-flash\" data=\"./_rubrique/" + langue + "index/home/media/home.swf\" width=\"384\" height=\"505\">\n";
				BFlash += "<!--<![endif]--";
				BFlash += ">\n";
				BFlash += "<param name=\"quality\" value=\"high\" />\n";
				BFlash += "<param name=\"wmode\" value=\"transparent\" />\n";
				BFlash += "<param name=\"menu\" value=\"false\" />\n";
				BFlash += "<param name=\"swfversion\" value=\"6.0.65.0\" />\n";

				BFlash += "<!--[if !IE]>--\n";
				BFlash += ">\n";
				BFlash += "</object>\n";
				BFlash += "<!--<![endif]--\n";
				BFlash += ">\n";
				BFlash += "</object>\n";
				
				
				document.getElementById('divFlash').innerHTML = BFlash;
				
				}
				
}

