



document.onclick = fermer_menu;

clickOui = false;
bloc_x = 300;
bloc_y = 300;


function test_hauteur(){
	document.getElementById("pop_options").style.height = '28px';
}

function testClick() {
		base_x = access_X-bloc_x;
		base_y = access_Y-bloc_y;
		clickOui=true;
}
	
function testClick2() {
		clickOui=false;
}	
	
function close_pop(){
 	//non visible
 	if(document.getElementById){
 		parent.document.getElementById("pop_options").style.visibility = 'hidden';
 		parent.document.getElementById("pop_options_frame").style.visibility = 'hidden';
 		parent.dd.elements.pop_options.moveTo(-4000, -4000);
 	}
 		
	
}

//access_mode=>visible=1
function view_pop(access_mode, mon_url, largeur, hauteur, fenetre){
	//alert(mon_url)
	///////////////////////////////////////////////////////////
access_list_haut = "<table width='100%' border='0' cellpadding='0' cellspacing='0'> <tr><td colspan='2' rowspan='2'>"
+ "<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' bgcolor='#ffffff'>"
+ "<tr><td valign=top><table width='100%' cellpadding=3 cellspacing=1 border=0><tr>"
+ "<TD BGCOLOR=#006699 width=330 ><FONT  SIZE=1 color=ffffff><B id=\"view_pop_title\"></B></FONT></TD>"
+ "<TD BGCOLOR=#006699 width='20' align='right'><A HREF=# onClick=\"view_pop(0);return(false)\"><font color='white'>Fermer</font></A></TD></TR>"
+ "<TR><TD  colspan=2>";

access_list_bas = "</TD></TR></TABLE></TD></TR></TABLE>"
+ "</td>"
+ "<td width='7' height='10' valign='bottom'><img src='/kbx/sys_ext/themeGraphic/images/ombre_droite_haut.png' width='10' height='13' /></td>"
+ "</tr>"
+ "<tr>"
+ "<td style='background-image:url(/kbx/sys_ext/themeGraphic/images/ombre_droite.png);background-repeat:repeat-y'>&nbsp;</td>"
+ "</tr>"
+ "<tr>"
+ "<td width='20' align='right' valign='top'><img src='/kbx/sys_ext/themeGraphic/images/ombre_gauche_bas.png' width='13' height='10' /></td>"
+ "<td width='98%' height='10'  style='background-image:url(/kbx/sys_ext/themeGraphic/images/ombre_bas.png);background-repeat:repeat-x'>&nbsp;</td>"
+ "<td valign='top'><img src='/kbx/sys_ext/themeGraphic/images/ombre_droite_bas.png' width='10' height='10' /></td>"
+ "</tr>"
+ "</table>";			
 								
 								
 	///////////////////////////////////////////////////////////
 	
 	if((hauteur<0) || (hauteur==undefined)){	hauteur=200;}
 	if((largeur<0) || (largeur==undefined)){	largeur=450;}
 	
 	//non visible
 	if(access_mode == 0 && document.getElementById){
 		document.getElementById("pop_options").style.visibility = 'hidden';
 		document.getElementById("pop_options_frame").style.visibility = 'hidden';
 		dd.elements.pop_options.moveTo(-4000, -4000);
 	}
 	

 	//pour afficher une fenetre
 	if(access_mode == 1 && document.getElementById){
 		html="";
		if(fenetre!=0) html= access_list_haut;
		html+=iFrame = "<iframe id='pop_options_frame'  width='" + largeur + "' height='"+hauteur+"' frameborder='0' marginwidth='0' scrolling='auto' src='"+mon_url+"'></iframe>";
		if(fenetre!=0) html+=access_list_bas;
		if(navigator.appName.substring(0,3) == "Net"){
	 		screenlargeur = window.innerWidth;
	 		screenhauteur = window.innerHeight;
 		}else{
	 		screenlargeur = document.body.offsetWidth;
	 		screenhauteur = document.body.offsetHeight;
 		}
 		
 		
 		//if((access_X+largeur) > (screenlargeur )){
 			access_X = ((screenlargeur/2) - (largeur/2));
 		//}
 		//if((access_Y+hauteur) > (screenhauteur )){
 			access_Y = ((screenhauteur/2) - (hauteur/2));
 		//}
 		if(access_X <50){
 			access_X=50;
 		}
 		if(access_Y <50){
 			access_Y=50;
 		}
 		/*ouvrir_winActions(mon_url,largeur)*/
 		
 		document.getElementById("pop_options").innerHTML = html;
 		
 		/*document.getElementById("pop_options").style.left = access_X+'px';
 		document.getElementById("pop_options").style.top = access_Y+'px';*/
 		$('#pop_options').css({left: access_X+'px',top: access_Y+'px'});
 		//dd.elements.pop_options.moveTo(access_X, access_Y);
 		document.getElementById("pop_options").style.width = largeur+'px';
 		document.getElementById("pop_options").style.visibility = 'visible';
 
 		
 	} 	//execution en tache de fond
 	if(access_mode == 2 && document.getElementById){
 		
		html= access_list_haut;
		html+=iFrame = "<iframe frameborder='0' marginwidth='0' scrolling='no' src='"+mon_url+"'></iframe>";
		html+=access_list_bas;
 		document.getElementById("pop_options").style.visibility = 'hidden';	
 		document.getElementById("pop_options").innerHTML = html;
 		//document.getElementById("pop_options").style.top = access_Y-1000;
 		pause(600);
 		//parent.document.location.reload();
 		TJS_ExtractAllUrl();
 		
 	} 	
 	if(!document.getElementById)
 		alert('Cette fonction n\'est pas compatible avec votre navigateur.\nMettez ŕ jour votre matériel :)\nIE 5+ / NN6 +\n')
}
/*
 if(document.getElementById)
 	document.write('<DIV  ID="pop_options" STYLE="top:0;left:0;height:200px;width:450px;position:absolute;z-index:9;visibility:hidden;overflow: visible;"></DIV>')
*/


//access_mode=>visible=1
function view_popTexte(access_mode, mon_url, largeur, hauteur, fenetre, texteToDisplay){
	//alert(mon_url)
	///////////////////////////////////////////////////////////
access_list_haut = "<table width='100%' border='0' cellpadding='0' cellspacing='0'> <tr><td colspan='2' rowspan='2'>"
+ "<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='1' bgcolor='#ffffff'>"
+ "<tr><td valign=top><table width='100%' cellpadding=3 cellspacing=1 border='0'><tr>"
+ "<TD BGCOLOR=grey width=330 ><FONT  SIZE=1 color=white><B>"+texteToDisplay+" :</B></FONT></TD>"
+ "<TD BGCOLOR=grey width='20' align='right'><A HREF=# onClick=\"view_pop(0);return(false)\"><font color='white'>Fermer</font></A></TD></TR>"
+ "<TR><TD  colspan=2>";

access_list_bas = "</TD></TR></TABLE></TD></TR></TABLE>"
+ "</td>"
+ "<td width='7' height='10' valign='bottom'><img src='/kbx/sys_ext/themeGraphic/images/ombre_droite_haut.png' width='10' height='13' /></td>"
+ "</tr>"
+ "<tr>"
+ "<td style='background-image:url(/kbx/sys_ext/themeGraphic/images/ombre_droite.png);background-repeat:repeat-y'>&nbsp;</td>"
+ "</tr>"
+ "<tr>"
+ "<td width='20' align='right' valign='top'><img src='/kbx/sys_ext/themeGraphic/images/ombre_gauche_bas.png' width='13' height='10' /></td>"
+ "<td width='98%' height='10'  style='background-image:url(/kbx/sys_ext/themeGraphic/images/ombre_bas.png);background-repeat:repeat-x'>&nbsp;</td>"
+ "<td valign='top'><img src='/kbx/sys_ext/themeGraphic/images/ombre_droite_bas.png' width='10' height='10' /></td>"
+ "</tr>"
+ "</table>";			
 								
 								
 	///////////////////////////////////////////////////////////
 	
 	if((hauteur<0) || (hauteur==undefined)){	hauteur=200;}
 	if((largeur<0) || (largeur==undefined)){	largeur=450;}
 	
 	//non visible
 	if(access_mode == 0 && document.getElementById){
 		document.getElementById("pop_options").style.visibility = 'hidden';
 		document.getElementById("pop_options_frame").style.visibility = 'hidden';
 		dd.elements.pop_options.moveTo(-4000, -4000);
 	}
 	
 	//pour afficher une fenetre
 	if(access_mode == 1 && document.getElementById){
 		html="";
		if(fenetre!=0) html= access_list_haut;
		html+=iFrame = "<iframe id='pop_options_frame'  width='" + largeur + "' height='"+hauteur+"' frameborder='0' marginwidth='0' scrolling='auto' src='"+mon_url+"'></iframe>";
		if(fenetre!=0) html+=access_list_bas;
		if(navigator.appName.substring(0,3) == "Net"){
	 		screenlargeur = window.innerWidth;
	 		screenhauteur = window.innerHeight;
 		}else{
	 		screenlargeur = document.body.offsetWidth;
	 		screenhauteur = document.body.offsetHeight;
 		}
 		
        access_X = 400;
		/*// Old method for BO:
		if((access_X+largeur) > (screenlargeur )){
		access_X = (screenlargeur - largeur)-150;
		}*/

		if((access_Y+hauteur) > (screenhauteur )){
			access_Y = (access_Y - hauteur)-50;
		} else {
			access_Y = access_Y + 20;
		}
		/*ouvrir_winActions(mon_url,largeur)*/
 		
 		//access_X=(screenlargeur/2)-(largeur/2);
 		//access_Y=(screenhauteur/2)-(hauteur/2);
 		
 		
 		document.getElementById("pop_options").innerHTML = html;
 		
 		//document.getElementById("pop_options").style.left = access_X;
 		//STYLE="top:0;left:0;height:200px;width:450px;position:absolute;z-index:9;visibility:hidden;overflow: visible;cursor:move;
 		document.getElementById("pop_options").setAttribute("style",'top:'+access_Y+'px;left:'+access_X+'px;height:200px;width:'+largeur+'px;position:absolute;z-index:9;overflow: visible;cursor:move;');
 		//alert(access_Y)
 		//dd.elements.pop_options.moveTo(access_X, access_Y);
 		//document.getElementById("pop_options").style.width = largeur+'px';
 		document.getElementById("pop_options").style.visibility = 'visible';
 		
 		
 		
 		
 		
 		
 		
 		
 		
 		
 		
 	} 	//execution en tache de fond
 	if(access_mode == 2 && document.getElementById){
 		
		html= access_list_haut;
		html+=iFrame = "<iframe frameborder='0' marginwidth='0' scrolling='no' src='"+mon_url+"'></iframe>";
		html+=access_list_bas;
 		document.getElementById("pop_options").style.visibility = 'hidden';	
 		document.getElementById("pop_options").innerHTML = html;
 		//document.getElementById("pop_options").style.top = access_Y-1000;
 		pause(600);
 		//parent.document.location.reload();
 		TJS_ExtractAllUrl();
 		
 	} 	
 	if(!document.getElementById)
 		alert('Cette fonction n\'est pas compatible avec votre navigateur.\nMettez ŕ jour votre matériel :)\nIE 5+ / NN6 +\n')
}

