ScreenWidth = screen.availWidth;
ScreenHeight = screen.availHeight;




// fonctions qui renvoient la hauteur et la largeur de la fenetre que
// le flash "liste des sites" doit récupérer sous IE ou Firefox
function getWindowHeight() 
{
    if (document.all)
    {
        //ScreenHeight = document.body.offsetHeight;
		return document.body.offsetHeight; 
    } 
    else 
    { 
		//ScreenHeight = window.innerHeight;
        return window.innerHeight; 
    } 
} 

function getWindowWidth() 
{ 
    if (document.all) 
    { 
        return document.body.offsetWidth; 
    } 
    else 
    { 
        return window.innerWidth; 
    } 
} 



//ScreenWidth = getWindowWidth();//screen.availWidth;
//ScreenHeight = getWindowHeight();//screen.availHeight;


var sens=1;

function BandeauUpDown(dy)
{

	if(sens == 1)
	{
		maDiv = document.getElementById('bandeau');
		if(maDiv) 
		{
//		Effect.toggle('bandeau','appear');
			new Effect.Move('bandeau',{x: 0, y: getWindowHeight()-dy, mode: 'absolute',transition: Effect.Transitions.sinoidal });
		}
		maDiv = document.getElementById('open_close');
		maDiv.innerHTML = '<a href="javascript:void(0);" onClick="javascript:BandeauUpDown(120);" ><img src="gallery/PiBeeOpen.gif" alt="ouvrir le panneau" border="0"></a>';
		sens=-1;
		return true;
	}
		
	if(sens == -1)
	{
		maDiv = document.getElementById('bandeau');
		if(maDiv) 
		{
//		Effect.toggle('bandeau','appear');
			new Effect.Move('bandeau',{x: 0, y: getWindowHeight()-dy, mode: 'absolute',transition: Effect.Transitions.sinoidal });
		}
		maDiv = document.getElementById('open_close');
		maDiv.innerHTML = '<a href="javascript:void(0);" onClick="javascript:BandeauUpDown(50);" ><img src="gallery/PiBeeClose.gif" alt="fermer le panneau" border="0"></a>';
		sens=1;
		return true;
	}

//	if(dy==118) dy=50;
	

}




function replace_objects()
{
//alert("width=" + getWindowWidth() + "  height="+ getWindowHeight());
	maDiv = document.getElementById('URLSite');
	if(maDiv) 
	{
		new Effect.Move('URLSite',
						{x: getWindowWidth()-618, y: 20, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}
	
	maDiv = document.getElementById('PiBeeConnexion');
//	if(maDiv) PiBeeConnexion.style.left = getWindowWidth()-102;
	if(maDiv) 
	{
		if(IE5)
		new Effect.Move('PiBeeConnexion',
						{x: getWindowWidth()-106, y: 0, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
		else
		new Effect.Move('PiBeeConnexion',
						{x: getWindowWidth()-100, y: 0, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}
		
	
	maDiv = document.getElementById('PiBeeDeco');
	//if(maDiv) PiBeeDeco.style.left = getWindowWidth()-128;
	if(maDiv) 
	{
		if(IE5)
		new Effect.Move('PiBeeDeco',
						{x: getWindowWidth()-126, y: 16, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
		else
		new Effect.Move('PiBeeDeco',
						{x: getWindowWidth()-116, y: 16, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}
	
	maDiv = document.getElementById('PiBeeModif');
	//if(maDiv) PiBeeModif.style.left = getWindowWidth()-164;
	if(maDiv) 
	{
		if(IE5)
		new Effect.Move('PiBeeModif',
						{x: getWindowWidth()-162, y: 0, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
		else
		new Effect.Move('PiBeeModif',
						{x: getWindowWidth()-146, y: 0, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}
	
	maDiv = document.getElementById('PiBeeHome');
	//if(maDiv) PiBeeHome.style.left = getWindowWidth()-92;
	if(maDiv) 
	{
		if(IE5)
		new Effect.Move('PiBeeHome',
						{x: getWindowWidth()-88, y: 0, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
		else
		new Effect.Move('PiBeeHome',
						{x: getWindowWidth()-88, y: 0, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}

	maDiv = document.getElementById('bandeau');
	if(maDiv) 
	{
			new Effect.Move('bandeau',
						{x: 0, y: getWindowHeight()-120, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}

	maDiv = document.getElementById('logo');
	if(maDiv) 
	{
			new Effect.Move('logo',
						{x: getWindowWidth()-88, y: 10, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}

	maDiv = document.getElementById('open_close');
	if(maDiv) 
	{
			new Effect.Move('open_close',
						{x: getWindowWidth()-80, y: 2, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}

	maDiv = document.getElementById('PiBeeAide');
	if(maDiv) 
	{
			new Effect.Move('PiBeeAide',
						{x: getWindowWidth()-90, y: 100, mode: 'absolute',
						 transition: Effect.Transitions.sinoidal });
	}

}




if (location.href.indexOf("maj",0) <0)
{
	PathGeneral = "";	
}
else
{
	PathGeneral = "../";	
}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////// INTERACTION JACASCRIPT / ACTIONSCRIPT  en utilisant ExternallCallBack
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function start()
{
//alert('Vous êtes ici - Merci');
}

function ouvrirImg_V2(str) 
{
	//debugger;

// SOLUTION 1
	var popUpProps = 'titlebar=0,dependent=0,personalbar=0,directories=0,menubar=0,location=0,status=0,toolbar=0,scrollbars=1,resizable=1,left=0,top=0,width=300,height=200';
	
	w = window.open(PathGeneral+'PiBeeLoadImg2.php5?args='+str,'PiBeeIMG',popUpProps);
	w.focus();

// SOLUTION 2
/*
	var container = document.getElementById("PiBeePhoto");
	container.style.visibility='visible';

	var maDiv;
	maDiv = document.createElement("iframe");
	maDiv.id = "FramePiBeePhoto";
	maDiv.style.visibility='visible';
	maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
	maDiv.style.zIndex = 9933; //Pour mettre un border à ta div, par exemple
	 
	container.appendChild(maDiv);
	
	//maDiv = document.getElementById("PiBeePhoto");
	maDiv.style.display='none';
	maDiv.style.left=20;
	maDiv.style.top=10;
	//larg = 900;
	//haut = 600;		
	var larg = document.body.offsetWidth-50;
	var haut = document.body.offsetHeight-20;
	maDiv.style.width = larg;
	maDiv.style.height = haut;
	maDiv.src = PathGeneral+'PiBeeLoadImg2.php5?args='+str;

	Effect.toggle(maDiv,'appear');
	//var comp = (setTimeout("start()",50000));
	//clearTimeout(comp);
*/

}




function fermerImg_V2(v)
{
	//debugger;

//SOLUTION 1	
	this.close();


//SOLUTION 1	
/*

//	alert(v);
	var container = document.getElementById("PiBeePhoto");

//	div = document.getElementById("ModifTexte")
//	Effect.toggle(div,'appear');


	//document.getElementById("ModifTexte").style.visibility="hidden";
	//container.style.visibility='hidden';

	//var iframe = document.getElementById("FramePiBeePhoto");
	// iframe.style.visibility="hidden";
	var comp = (setTimeout("start()",500));

	
	//container.removeChild(iframe);
	Effect.toggle(container,'blind');
	clearTimeout(comp);
	
*/
	

}


	IE5=NN4=NN6=false;
	if(document.all)
		IE5=true;
	else if(document.getElementById)
		NN6=true;
	else if(document.layers)
		NN4=true;

/*  on déclare un variable globale pour rediriger vers les bons répertoires */

if (location.href.indexOf("maj",0) <0)
{
///////////////////////////////////////////////////////////
//////////////////// ON resize la page
///////////////////////////////////////////////////////////
/*

	if(IE5) 
	{
		self.moveTo(0,0);
		self.resizeTo(screen.availWidth ,screen.availHeight);
	}
	else if(NN6) 
	{
		self.moveTo(0,0);
		self.resizeTo(screen.availWidth ,screen.availHeight);
	}
	else 
	{
		self.moveTo(0,0);
		self.resizeTo(screen.availWidth ,screen.availHeight);
	}
*/
/*
	if(unefois)
	{
//		window.moveTo(0,0);
//		window.resizeTo(ScreenWidth,ScreenHeight);

//		window.resizeTo(1024,770);
//ScreenWidth = screen.availWidth;
//ScreenHeight = screen.availHeight;

	}
*/
}




////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// fonction pour afficher l'adresse dans gogleMaps
////////////////////////////////////////////////////////////////////////////////////////////

var map;
var geocoder;

function initialize(adr) 
{
	map_canvas.style.visibilty = "hidden";
	map = new GMap2(document.getElementById("map_canvas"));
	map.setCenter(new GLatLng(48.858205,2.294359), 1);
	map.setUIToDefault();
	map.setMapType(G_HYBRID_MAP );
	geocoder = new GClientGeocoder();
	geocoder.getLocations(adr, addAddressToMap);
}

// addAddressToMap() is called when the geocoder returns an
// answer.  It adds a marker to the map with an open info window
// showing the nicely formatted version of the address and the country code.
function addAddressToMap(response) 
{
	map.clearOverlays();
	if (!response || response.Status.code != 200) 
	{
		alert("L'adresse n'est pas assez précise pour être affichée.");
		map_canvas.style.visibilty = "hidden";
	} 
	else 
	{
		place = response.Placemark[0];
		point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
		marker = new GMarker(point);
		map.addOverlay(marker);
		var p = '<font face="arial">Mon adresse : <br>' + '' + place.address + '</font>';
		marker.openInfoWindowHtml(p);
		map_canvas.style.visibilty = "visible";
		map.setCenter(new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]), 16);

	}
}


function afficheMap(str) 
{
	var maDiv;
	var liste = str.split("||");
		
	var contenu=liste[0];
	var etat=liste[1];
	var xx=parseInt(liste[2]);
	var yy=parseInt(liste[3]);
	var nom=liste[4];
	var n=liste[5];
	var W=liste[6];
	var H=liste[7];
	var StandAlone=liste[8];

	r = Math.floor(Math.random() * 10) + 930;
	
	if(etat != 'hidden')
	{
		
		maDiv = document.createElement("div");

		if(StandAlone == "true")
		{

			var DivCurrent = "StandAloneHTML"+n;
			var container = document.getElementById(DivCurrent);
			container.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			container.appendChild(maDiv);
			maDiv.style.left = 6;
			maDiv.style.top = 10;
			

		}
		else
		{
			
			
			maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			document.body.appendChild(maDiv);		
			maDiv.style.left = xx;
			maDiv.style.top = yy;
			

		}

		maDiv.id = "map_canvas";
//		maDiv.style.border="1px solid #FF0000";
//		alert(maDiv.style.left);
		
		
		
		if(W == "") W=400;
		if(H == "") H=300;
		var larg = parseInt(W);//500;
		var haut = parseInt(H);//400;		
		
		maDiv.innerHTML = '';		


		maDiv.style.border='1px solid #CCCCCC';
		maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
		maDiv.style.width=larg;
		maDiv.style.height=haut;
		maDiv.style.zIndex = 1+parseInt(n);//parseInt(2+n); //Pour mettre un border à ta div, par exemple
		//alert(contenu);
		if(contenu != "") 
		{
			maDiv.style.visibility=etat;
			initialize(contenu);
		}
		else
		{
			maDiv.style.visibility="hidden";
		}
				
	} 
	else 
	{
		maDiv = document.getElementById('map_canvas');
		//maSkin = document.getElementById('Skin'+n);
		if ( maDiv )
		{
			maDiv.style.visibility=etat;
			document.body.removeChild(maDiv);
			maSkin.style.visibility=etat;
			document.body.removeChild(maSkin);
		}
	}	
	
	
}  // fin fonction afficheMap









////////////////////////////////////////////////////////////////////////
//////////////////// Affichage de div pour l'administration ////////////
////////////////////////////////////////////////////////////////////////


function fermeIframe(iframe)
{
	//debugger;
	var container = document.getElementById("iFrameDiv");

//	div = document.getElementById("ModifTexte")
//	Effect.toggle(div,'appear');


	document.getElementById("ModifTexte").style.visibility="hidden";
	container.style.visibility='hidden';

	var iframe = document.getElementById("iFrameEdit");
	// iframe.style.visibility="hidden";

	container.removeChild(iframe);
	document.forms['FormVide'].submit();	
//	elt = document.getElementById("YLBiFrame");
//	alert(elt);

}

function Affiche_iFrame(type,params)
{

// debugger;
	var container = document.getElementById("iFrameDiv");
	document.getElementById("ModifTexte").style.visibility='visible';
	container.style.visibility='visible';

	var maDiv;
	
	etat = 'visible';
	
	maDiv = document.createElement("iframe");
	maDiv.id = "iFrameEdit";
	maDiv.style.visibility='visible';
	maDiv.style.position = 'relative'; //Pour mettre un border à ta div, par exemple
	maDiv.style.zIndex = 9933; //Pour mettre un border à ta div, par exemple
	 
	maDiv.style.backgroundColor = 'transparent';
		

	container.appendChild(maDiv);
		
//alert(type);

	document.getElementById("ModifTexte").style.left=10;
	document.getElementById("ModifTexte").style.top=10;
	var larg = document.body.offsetWidth-50;
	var haut = document.body.offsetHeight-100;
	maDiv.style.width = larg;
	maDiv.style.height = haut;

//alert(params);


	// Attribution de l'url à la source de l'IFRAME
	// APRES que cette IFRAME ai été affecté à la page
	
	if(type == "ModifFond")
	{		
		document.getElementById("ModifTexte").style.display='none';
		
		document.getElementById("ModifTexte").style.left=20;
		document.getElementById("ModifTexte").style.top=20;

		//larg = 900;
		//haut = 600;		
		var larg = document.body.offsetWidth-50;
		var haut = document.body.offsetHeight-100;
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifFond.php5?"+params;
		
		
		div = document.getElementById("ModifTexte")
		Effect.toggle(div,'appear');

	}
	else if(type == "ModifProfile")
	{		
		document.getElementById("ModifTexte").style.display='none';

		document.getElementById("ModifTexte").style.left=20;
		document.getElementById("ModifTexte").style.top=20;

		//larg = 900;
		//haut = 600;		
		var larg = document.body.offsetWidth-50;
		var haut = document.body.offsetHeight-100;
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifProfil.php5?"+params;

		div = document.getElementById("ModifTexte")
		Effect.toggle(div,'appear');
	}
	else if(type == "ModifTitre")
	{		
		document.getElementById("ModifTexte").style.display='none';

		document.getElementById("ModifTexte").style.left=20;
		document.getElementById("ModifTexte").style.top=20;
		//larg = 900;
		//haut = 600;		
		var larg = document.body.offsetWidth-50;
		var haut = document.body.offsetHeight-100;
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifTitre.php5?"+params;

		div = document.getElementById("ModifTexte")
		Effect.toggle(div,'appear');
	}
	/*
	else if(type == "ModifMusic")
	{
		
		document.getElementById("ModifTexte").style.left=20;
		document.getElementById("ModifTexte").style.top=20;

		//larg = 900;
		//haut = 600;		
		larg = screen.availWidth-60 ;
		haut = 550;
		var larg = document.body.offsetWidth-50;
		var haut = document.body.offsetHeight-100;
//alert(larg);
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifAlbum.php5?"+params;
		
	}
	*/
	else if(type == "ModifMenu")
	{		
		document.getElementById("ModifTexte").style.display='none';

		document.getElementById("ModifTexte").style.left=500;//Math.floor(getWindowWidth()/4);//20;
		document.getElementById("ModifTexte").style.top=50;//Math.floor(getWindowHeight()/4);//20;

		//larg = 900;
		//haut = 600;		
		var larg = document.body.offsetWidth-50;
		var haut = document.body.offsetHeight-100;
		var larg = 400;
		var haut = 300;
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifMenu.php5?"+params;

		div = document.getElementById("ModifTexte")
		Effect.toggle(div,'appear');
	}
	else if(type == "iFrame")
	{		
		alert("modifiez le contenu de cet objet en changeant le lien se trouvant dans les caractéristiques de l\'objet");
		document.getElementById("ModifTexte").style.left=20;
		document.getElementById("ModifTexte").style.top=20;

		//larg = 900;
		//haut = 600;		
		larg = 200;
		haut = 200;
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		//maDiv.src = "modifiez le contenu de cet objet en changeant le lien se trouvant dans les caractéristiques ";
	}
	else if(type == "videos")
	{		
		document.getElementById("ModifTexte").style.left=20;
		document.getElementById("ModifTexte").style.top=20;

		//larg = 900;
		//haut = 600;		
		larg = screen.availWidth-100 ;
		haut = screen.availHeight-100;
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifVideos.php?"+params;
	}
	else if(type == "photos")
	{
		
		document.getElementById("ModifTexte").style.left=10;
		document.getElementById("ModifTexte").style.top=20;

		//larg = 900;
		//haut = 600;		
		larg = screen.availWidth-60 ;
		haut = 550;
		var larg = document.body.offsetWidth-45;
		var haut = document.body.offsetHeight-100;
//alert(larg);
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifAlbum.php5?"+params;
//		maDiv.src = "YLB_upload/index.php5?"+params;
		
	}
	else if(type == "mp3")
	{
		
		document.getElementById("ModifTexte").style.left=10;
		document.getElementById("ModifTexte").style.top=20;

		//larg = 900;
		//haut = 600;		
		larg = screen.availWidth-60 ;
		haut = 550;
		var larg = document.body.offsetWidth-45;
		var haut = document.body.offsetHeight-100;
//alert(larg);
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifMP3.php5?"+params;
//		maDiv.src = "YLB_upload/index.php5?"+params;
		
	}
	else if(type == "infos")
	{
		document.getElementById("ModifTexte").style.left=20;
		document.getElementById("ModifTexte").style.top=20;

		//larg = 900;
		//haut = 600;		
		var larg = document.body.offsetWidth-50;
		var haut = document.body.offsetHeight-100;
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = "ModifProfil.php5?"+params;
	}
	else if( (type != "photos") && (type != "videos") && (type != "infos") )
	{
//		document.getElementById("ModifTexte").style.display='none';

		document.getElementById("ModifTexte").style.left=10;
		document.getElementById("ModifTexte").style.top=10;

		larg = 780;
		haut = 450;		
		var larg = document.body.offsetWidth-50;
		var haut = document.body.offsetHeight-100;
//		var larg = document.body.offsetWidth-50;
//		var haut = document.body.offsetHeight-100;
//alert(larg);
		maDiv.style.width = larg;
		maDiv.style.height = haut;

//		maDiv.style.height = haut;
		// si on veut éditer un texte dans un flash alors TXT_Rubrique ne doit pas contenir HTM et ainsi on prend
		// le format txt qui lance l'editeur PiBee. Pour le format HTM on lance l'éditeur Default.
		if (type.indexOf("HTM",0) <0) maDiv.src = "ModifText.php5?format=txt&"+params;
		else maDiv.src = "ModifText.php5?format=htm&"+params;

//		div = document.getElementById("ModifTexte")
//		Effect.toggle(div,'appear');

	}

	
	

	

/* * methode FULL URL *  * *
	maDiv.src = location.protocol + '//'
			+ location.host
			+ (location.port ? ':' + location.port : '')
			+ location.pathname.substr( 0, location.pathname.lastIndexOf('/'))
			+ "/ModifText.php?"+params;
		//alert(maDiv.src);
		//maDiv.style.visibility=etat;
*  */
		

}


//// fonction utilisée pour un nouvel élément //////
function afficheNewElement(elt)
{
	if(document.getElementById('NewElement').style.visibility=='hidden')
		document.getElementById('NewElement').style.visibility='visible';
	else
		document.getElementById('NewElement').style.visibility='hidden';

}

//// fonction utilisée pour affiche les infos d'un objet //////

//// fonction utilisée pour modifier un élément //////
function DragDiv(cpt,obj)
{
//alert("drag");
	var theHandle = document.getElementById("DragDiv"+cpt);
	var theRoot = document.getElementById("BlocModifElement"+cpt);
	document.getElementById("Element"+cpt).style.visibility='hidden';
//	obj.imgModif.src='./images/menu_ModifElement.V3.jpg';
	
//	theHandle.zIndex="99999";

//	document.getElementById("Element"+cpt).style.zIndex=6;
//	document.getElementById("BlocModifElement"+cpt).style.zIndex=7;
	
//if(theHandle.zIndex >= 5) theHandle.zIndex = 5;
//	alert(theHandle+"-"+theRoot);
	Drag.init(theHandle, theRoot);

}

function ChangeIndex(elt,index)
{
	//alert(index);
	document.getElementById(elt).style.zIndex=index;
}


function OpenDiv(n,i)
{
	
	if(document.getElementById('Element'+n).style.visibility=='hidden')
	{
		//alert("plop");
		ChangeIndex('Element'+n,parseInt(i)+9000);
		ChangeIndex('EnteteModifElement'+n,parseInt(i)+9001);
		ChangeIndex('BlocModifElement'+n,parseInt(i)+9002);
		document.getElementById('Element'+n).style.visibility='visible';
		//e = document.getElementById('BlocModifElement'+n).style.zIndex;
		//alert(e);//=index;
		
	}
	else
	{
		ChangeIndex('Element'+n,i);
		ChangeIndex('EnteteModifElement'+n,i+1);
		ChangeIndex('BlocModifElement'+n,i+2);
		document.getElementById('Element'+n).style.visibility='hidden';
	}
}



////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// fonction pour lire dans un IFRAME un fichier
////////////////////////////////////////////////////////////////////////////////////////

function ObjExternalPHP(str) 
{
	var maDiv;
	var liste = str.split("||");
		
	var contenu=liste[0];
	var etat=liste[1];
	var xx=liste[2];
	var yy=liste[3];
	var nom=liste[4];
	var n=liste[5];
	var WW=liste[6];
	var HH=liste[7];
	var StandAlone=liste[8];
		
	r = Math.floor(Math.random() * 10) + 930;
	
	if(etat != 'hidden')
	{
		maDiv = document.createElement("iframe");

		if(StandAlone == "true")
		{
			var DivCurrent = "StandAloneIFrame"+n;
			//alert(DivCurrent);
			var container = document.getElementById(DivCurrent);
			
			//document.getElementById("TText"+n).style.visibility='visible';
			container.style.visibility='hidden';
			maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			container.appendChild(maDiv);
		}
		else
		{
			maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			document.body.appendChild(maDiv);		
		}

		maDiv.id = "idiv"+n;
		//maDiv.style.visibility='hidden';
		maDiv.style.zIndex = 9873; //Pour mettre un border à ta div, par exemple
	 
		//maDiv.style.backgroundColor = 'transparent';
		//maDiv.style.backgroundColor = '#FFFF00';
		maDiv.style.left = xx;
		maDiv.style.top= yy;
	
		
		larg = 340;
		haut = 245;		
		if(WW == "") WW=350;
		if(HH == "") HH=250;
		var larg = parseInt(WW);//500;
		var haut = parseInt(HH);//400;		
		
		//alert(WW + "||" + HH);
		
		maDiv.style.width = larg;
		maDiv.style.height = haut;
		maDiv.src = contenu;
		maDiv.style.visibility=etat;
		//maDiv.style.frameborder=0;
		maDiv.scrolling=0; 

		
	} 
	else 
	{
		maDiv = document.getElementById('idiv'+n);
		if ( maDiv )
		{
			maDiv.style.visibility=etat;
			document.body.removeChild(maDiv);
		}
	}	
}



///////////////////////////////////////////////////////////////////
//////////////////// Fonction de scrolling d'un TEXT dans UN DIV
////////////////////////////////////////////////////////////////////

function init_scrollBar(n,rep,h) 
{
	//scrollablediv 1
	//alert(n);
	//scrollablediv 2
	var scroller2 = new Bs_ScrollableDiv();
	scroller2.init('divContainer_2'+n, 'divContent_2'+n);
		
	var sliderObj2 = new Bs_Slider();
	sliderObj2.attachOnChange(Bs_ScrollableDiv_sliderChange);
	sliderObj2.width          = 11;
	sliderObj2.height         = h;//'auto';
	sliderObj2.arrowMouseOver = true;
	sliderObj2.valueDefault   = 0; //we don't start at position 0 by default. this is in percent.
	sliderObj2.direction      = 1;
	sliderObj2.imgDir         = rep;
	sliderObj2.setBackgroundImage('scroll_ln.gif', 'repeat');
	sliderObj2.setSliderIcon('scroll_knob.gif', 11, 5);
	sliderObj2.setArrowIconLeft('vertical_arrowUp.gif', 11, 10);
	sliderObj2.setArrowIconRight('vertical_arrowDown.gif', 11, 10);
	sliderObj2.useInputField = 0;
		
	scroller2.setSliderObject(sliderObj2, 'sliderDiv2'+n);
	scroller2.setSlideSpeed(150, 'pixel'); //50 pixel per second
	scroller2.setWheelSpeed(120, 'pixel'); //20 pixel per tick
}


////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// fonction pour afficher un texte HTML dans un DIV avec scrollBar
////////////////////////////////////////////////////////////////////////////////////////////
	String.prototype.replaceAll = function(pcFrom, pcTo)
	{	
		var i = this.indexOf(pcFrom);	
		var c = this; 	
		while (i > -1)
		{		
			c = c.replace(pcFrom, pcTo); 		
			i = c.indexOf(pcFrom);	
		}	

		return c;
	}


function afficheHTML(str) 
{

	var maDiv;
	var liste = str.split("||");
		
	var contenu=liste[0];
	var etat=liste[1];
	var xx=parseInt(liste[2]);
	var yy=parseInt(liste[3]);
	var nom=liste[4];
	var n=liste[5];
	var W=liste[6];
	var H=liste[7];
	var StandAlone=liste[8];
	var Skin=liste[9];


//alert("StandAlone="+StandAlone);
// n sert à numéroter les différents div contenant le texte
	r = Math.floor(Math.random() * 10) + 930;
//	alert("etat="+etat);
	
	if(etat != 'hidden')
	{
		
		maDiv = document.createElement("div");
//		alert(contenu);

		if(StandAlone == "true")
		{

			var DivCurrent = "StandAloneHTML"+n;
			var container = document.getElementById(DivCurrent);
			container.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			container.appendChild(maDiv);
			maDiv.style.left = 6;
			maDiv.style.top = 10;
			

		}
		else
		{
			
			
			maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			document.body.appendChild(maDiv);		
			maDiv.style.left = xx;
			maDiv.style.top = yy;
			

		}

		maDiv.id = "PHPDiv"+n;
//		maDiv.style.border="1px solid #FF0000";
//		alert(maDiv.style.left);
		
		
		
		if(W == "") W=400;
		if(H == "") H=300;
		var larg = parseInt(W);//500;
		var haut = parseInt(H);//400;		
		
		var larg1 = larg-12;
		var haut1 = haut;//400;		
		var haut0 = haut-30;//400;		
		var larg3 = larg + 10;
	

//alert("xx="+xx);
		
		if(IE5) 
		{
			var larg_skin = larg+30;
			var haut_skin = haut+30;
			var xContent = 24;
			var yContent = 10;
			var xSkin = 20;
			var ySkin = 0;
			var larg2 = 10;
			var haut3 = haut;
			contenu_new = contenu;

		}
		else
		{
			//alert("fire");
			var larg_skin = larg+50;
			var haut_skin = haut+30;
			var xContent = 20;
			var yContent = 10;
			var xSkin = 10;
			var ySkin = 0;
			var larg2 = -14;
			var haut3 = haut-30;
			contenu_new = contenu.replaceAll("x-small","12px"); //ok
			contenu_new = contenu_new.replaceAll("small","16px");
			contenu_new = contenu_new.replaceAll("medium","18px");
			contenu_new = contenu_new.replaceAll("large","24px"); //ok
		}



		maDiv.innerHTML = '';		

//alert(contenu);
maDiv.innerHTML += '<div id="ContainerHTML'+n+'" style="position:relative; left:'+xContent+'px; top:'+yContent+'px;">';
maDiv.innerHTML += '<div style="float:left; position:relative;">';
maDiv.innerHTML += '<div id="divContainer_2'+n+'" style="padding-left:12px; padding-right:14px; padding-top:8px; padding-bottom:8px; float:left; position:relative; width:'+larg+'; height:'+haut3+'; overflow:hidden;"><div id="divContent_2'+n+'" style="border:0px solid #00FF00;width:'+larg1+'px; float:left; position:relative;">'+contenu_new+'</div></div><div id="sliderDiv2'+n+'" style="padding-top:6px;float:left; position:relative; left:'+larg2+'px; top: 0px;"></div></div></div>';

//maDiv.innerHTML += '<div id="ContainerHTML'+n+'" style="position:relative;left:'+xContent+'px;top:'+yContent+'px;"><div style="float:left; position:relative;"><div id="divContainer_2'+n+'" style="padding-left:12px; padding-right:14px; padding-top:8px; padding-bottom:8px; float:left; position:relative; width:'+larg+'; height:'+haut+'; overflow:hidden;"><div id="divContent_2'+n+'" style="border:1px solid #00FF00;width:'+larg1+'px; float:left; position:relative;">'+contenu+'</div></div><div id="sliderDiv2'+n+'" style="padding-top:6px;float:left; position:relative; left:'+larg2+'px; top: 0px;"></div></div></div>';



		maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple

		maDiv.style.width=larg+30;
		maDiv.style.height=haut;
//		maDiv.style.border='1px solid #FF0000';
		
		maDiv.style.zIndex = 6765+parseInt(n);//parseInt(2+n); //Pour mettre un border à ta div, par exemple
		
		maDiv.style.visibility="visible";
//		maDiv.style.visibility="hidden";
/*
		var b = setTimeout("function(){};",500);
		clearTimeout(b);
		Effect.Fade(maDiv.id);
//		return false;		

		
//		return false;		
		var a = setTimeout("function(){Effect.Appear(maDiv.id);};",50);
		clearTimeout(a);
*/		
//		alert("maDiv.style.visibility="+maDiv.style.visibility);
//	alert(Skin);	

	if (Skin == undefined) Skin = "burp"; 
	if( (Skin != "undefined") )
		r = PathGeneral+'maj/scroll_barre/img/'+Skin+'/';
	else
		r = PathGeneral+'maj/scroll_barre/img/burp/';
		
		init_scrollBar(n,r,haut0);
		
	} 
	else 
	{
		maDiv = document.getElementById('PHPDiv'+n);
		//maSkin = document.getElementById('Skin'+n);
		if ( maDiv )
		{
			maDiv.style.visibility=etat;
			document.body.removeChild(maDiv);
			maSkin.style.visibility=etat;
			document.body.removeChild(maSkin);
		}
	}	
	
	
}  // fin fonction afficheHTML


/*
function afficheHTML_old(str) 
{

	var maDiv;
	var liste = str.split("||");
		
	var contenu=liste[0];
	var etat=liste[1];
	var xx=liste[2];
	var yy=liste[3];
	var nom=liste[4];
	var n=liste[5];
	var W=liste[6];
	var H=liste[7];
	var StandAlone=liste[8];
	var Skin=liste[9];



//		alert(">>"+liste[1]+"-"+liste[2]+"-"+liste[3]+"-"+liste[4]+"-"+liste[5]+"-"+liste[6]+"-"+liste[7]+"-"+liste[8]+"-"+liste[9]);

		
	r = Math.floor(Math.random() * 10) + 930;
	
	if(etat != 'hidden')
	{
		
		maDiv = document.createElement("div");

		if(StandAlone == "true")
		{

		
			
			
			var DivCurrent = "StandAloneHTML"+n;
			var container = document.getElementById(DivCurrent);
			container.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			container.appendChild(maDiv);
			

		}
		else
		{
			
			alert("StandAlone="+StandAlone);

			maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			document.body.appendChild(maDiv);		
			maDiv.style.left = xx;
			maDiv.style.top= yy;

		}
//		alert("path="+PathGeneral+" skin="+Skin);

//		alert("W="+W);

//		maDiv.id = "idiv"+n;
		maDiv.id = "PHPDiv"+n;
		
		
		if(W == "") W=400;
		if(H == "") H=300;
		var larg = parseInt(W);//500;
		var haut = parseInt(H);//400;		
		
		var larg1 = larg-30;
		var haut1 = haut;//400;		
		var haut0 = haut-30;//400;		
		var larg3 = larg + 10;
	

		
		if(IE5) 
		{
			var larg_skin = larg+30;
			var haut_skin = haut+30;
			var xContent = 24;
			var yContent = 10;
			var xSkin = 20;
			var ySkin = 0;
			var larg2 = 10;
		}
		else
		{
			var larg_skin = larg+50;
			var haut_skin = haut+30;
			var xContent = 20;
			var yContent = 10;
			var xSkin = 10;
			var ySkin = 0;
			var larg2 = -34;
	}

//		maDiv.style.left = parseInt(xx) ;
//		maDiv.style.top= parseInt(yy) ;
		
		
		maDiv.innerHTML = '';		
		if(Skin)
		{
			Skin=PathGeneral+Skin;
		}
		else
		{
			Skin=PathGeneral+"PiBeeObj/fond_transparent.swf";
		}
//alert(Skin);
		
//	maSkin.innerHTML += '<div style="border:0px solid red;position:absolute;width:'+larg+'; height:'+haut+';left:'+xSkin+'px; top:'+ySkin+'px;" >';


		maDiv.innerHTML += '<div style="border:0px solid red;position:absolute;width:'+larg+'; height:'+haut+';left:'+xSkin+'px; top:'+ySkin+'px;" >';
		maDiv.innerHTML += '<embed id="plop" src="'+Skin+'" type="application/x-shockwave-flash" wmode="transparent" width='+larg_skin+' height='+haut_skin+' >';


		maDiv.innerHTML += '<div id="ContainerHTML'+n+'" style="position:absolute;left:'+xContent+'px;top:'+yContent+'px; "><div style="float:left; position:relative;"><div id="divContainer_2'+n+'" style="padding-left:12px;padding-right:14px;padding-top:8px;padding-bottom:8px;float:left; position:relative; width:'+larg+'; height:'+haut+'; overflow:hidden;"><div id="divContent_2'+n+'"  style="width:'+larg1+'px; float:left; position:relative; "> '+contenu+'</div></div><div id="sliderDiv2'+n+'" style="	padding-top:6px;float:left; position:relative; left: '+larg2+'px; top: 0px;"></div></div></div>';
		maDiv.innerHTML += '</embed></div>';



		maDiv.style.width=larg;
		maDiv.style.height=haut;
		//maDiv.style.border='1px solid #00FFFF';
		
		maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
		maDiv.style.zIndex = parseInt(1+n);//parseInt(2+n); //Pour mettre un border à ta div, par exemple
		maDiv.style.visibility=etat;

		
		r = PathGeneral+'maj/scroll_barre/img/burp/';
		
		init_scrollBar(n,r,haut0);
		
	} 
	else 
	{
		maDiv = document.getElementById('PHPDiv'+n);
		maSkin = document.getElementById('Skin'+n);
		if ( maDiv )
		{
			maDiv.style.visibility=etat;
			document.body.removeChild(maDiv);
			maSkin.style.visibility=etat;
			document.body.removeChild(maSkin);
		}
	}	
	
	
}
*/

/*
function afficheHTML(str) 
{

	var maDiv;
	var liste = str.split("||");
		
	var contenu=liste[0];
	var etat=liste[1];
	var xx=liste[2];
	var yy=liste[3];
	var nom=liste[4];
	var n=liste[5];
	var StandAlone=liste[6];

//alert(">>"+str);
//		alert(">>"+liste[1]+"-"+liste[2]+"-"+liste[3]+"-"+liste[4]+"-"+liste[5]+"-"+liste[6]);

		
	r = Math.floor(Math.random() * 10) + 930;
	
//		alert("StandAlone="+StandAlone);
	if(etat != 'hidden')
	{
		
		maDiv = document.createElement("div");
//			var maDiv = "PHPdiv"+n;
		var larg = 600;
		var haut = 400;		
		var larg2 = larg + 10;
		var larg3 = larg + 120;

		maDiv.style.backgroundColor = 'transparent';
		//maDiv.style.backgroundColor = '#FFFFFF';
		maDiv.style.left = xx;
		maDiv.style.top= yy;

		maDiv.style.width = larg;
		maDiv.style.height = haut;
		//maDiv.style.overflow='auto';
		//maDiv.style.padding='0px';

		if(StandAlone == "true")
		{
			maDiv.id = "PHPDiv"+n;
			maDiv.innerHTML = '';		
			maDiv.innerHTML += '<div style="position:relative; "><div id="divContainer_2" style="position:absolute; width:'+larg+'; height:'+haut+'; overflow:hidden;"><div id="divContent_2" style="position:absolute; left: '+larg3+'px; top: 3px;  z-index:641; "> '+contenu+'</div></div><div id="sliderDiv2" style="position:absolute; left: '+larg2+'; top: 3px;"></div></div>';

		//alert("contenu="+contenu);
			maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			maDiv.style.zIndex = 642; //Pour mettre un border à ta div, par exemple
			maDiv.style.visibility=etat;
		}
		else
		{
			maDiv.id = "div"+n;
			maDiv.innerHTML = '';		
			maDiv.innerHTML += '<div style="position:absolute; "><div id="divContainer_2" style="position:absolute; width:'+larg+'; height:'+haut+'; overflow:hidden;"><div id="divContent_2" style="position:absolute; left: '+larg3+'px; top: 3px;  z-index:641; "> '+contenu+'</div></div><div id="sliderDiv2" style="position:absolute; left: '+larg2+'; top: 3px;"></div></div>';

		//alert("contenu="+contenu);
			maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			maDiv.style.zIndex = 642; //Pour mettre un border à ta div, par exemple
			maDiv.style.visibility=etat;
		}

		//maDiv.style.visibility='hidden';
	 
		
		document.body.appendChild(maDiv);
		
		//maDiv.innerHTML = contenu;
		
		if(StandAlone == "true") r = 'scroll_barre/img/burp/';
		else r = 'maj/scroll_barre/img/burp/';
		
		init_scrollBar(r);
		
	} 
	else 
	{
		maDiv = document.getElementById('div'+n);
		if ( maDiv )
		{
			maDiv.style.visibility=etat;
			document.body.removeChild(maDiv);
		}
	}
	
	
}
*/

///////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// fonction pour afficher une VIDEO de type Embed importé de YouTube ou DailyMotion
///////////////////////////////////////////////////////////////////////////////////////////////////////////

function VideoEmbed(str) 
{

	var maDiv;
	var liste = str.split("||");
		
	var contenu=liste[0];
	var etat=liste[1];
	var xx=liste[2];
	var yy=liste[3];
	var nom=liste[4];
	var n=liste[5];
	
	var StandAlone=liste[6];
//	alert(">>"+str);
	
		
	r = Math.floor(Math.random() * 10) + 930;
	
	if(etat != 'hidden')
	{
		if(StandAlone == "true")
		{
			//alert(" n="+n);
			var dd = "TVideo"+n;
			document.getElementById(dd).innerHTML = contenu;
			document.getElementById(dd).style.zIndex = 1;
			//document.getElementById("TVideo").style.visibility=etat;
			
		}
		else
		{
			maDiv = document.createElement("div");
			maDiv.id = "div"+n;
			maDiv.style.visibility='hidden';
			maDiv.style.position = 'absolute'; //Pour mettre un border à ta div, par exemple
			maDiv.style.zIndex = r; //Pour mettre un border à ta div, par exemple
	 
		//maDiv.style.backgroundColor = 'transparent';
		maDiv.style.left = xx;
		maDiv.style.top = yy;
		document.body.appendChild(maDiv);
		
		maDiv.innerHTML = contenu;
		maDiv.style.visibility=etat;
		}
	} 
	else 
	{
		if(StandAlone == "true")
		{
		}
		else
		{
			maDiv = document.getElementById('div'+n);
			if ( maDiv )
			{
				maDiv.style.visibility=etat;
				document.body.removeChild(maDiv);
			}
		}
	
	}
	
	
}

////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// fonction pour valider un code AlloPass
////////////////////////////////////////////////////////////////////////////////////////


function valide(ar)
{
//alert(ar);
//a = ar.elements[0].value;
//b = ar.elements[1].value;
//c = ar.elements[2].value;



a = ar.elements['zeid'].value;
b = ar.elements['nom'].value;
c = ar.elements['chemin'].value;
d = ar.elements['ext'].value;
e = ar.elements['siteid'].value;


w = window.open('acheter.php?zeid='+a+'&nom='+b+'&chemin='+c+'&ext='+d+'&siteid='+e,'AlloPass','status=0,scrollbars=0,resizable=1,left=400,top=100,width=450,height=460');
w.focus();


}


////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// Code et fonctions pour afficher une IMAGE DE FOND
////////////////////////////////////////////////////////////////////////////////////////

/*
var imgload=new Array();


imgload[1]= new Image(); 
imgload[2]= new Image(); 
imgload[3]= new Image(); 
imgload[4]= new Image(); 
imgload[5]= new Image(); 

imgload[1].src="fond/fond1.jpg";
imgload[2].src="fond/fond2.jpg";
imgload[3].src="fond/fond3.jpg";
imgload[4].src="fond/fond4.jpg";
imgload[5].src="fond/fond5.jpg";

*/

function preload()
{

}

function change_fond(pic)
{

//alert("pic="+pic);
this.document.body.background = pic;
this.document.body.background = imgload[pic].src;


}



////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// fonction pour ouvrir une PopUp
////////////////////////////////////////////////////////////////////////////////////////


function ouvrir(monurl)
{
	wino = window.open(monurl,"",'scrollbars=1,width=510,height=600,left=300,top=10');
	wino.focus();
}

/*
function grand_format()
{
*/
//alert("IE5="+IE5+" NN6="+NN6+" NN4="+NN4);
/*
}
*/
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;


/*
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) 
{
//alert("InternetExplorer="+InternetExplorer);
document.write('<script language=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub PiBeeFlash_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call PiBeeFlash_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</script\> \n');
}
*/

/*
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) 
{
  document.write('<script LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub PiBeeFlash_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call PiBeeFlash_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
}
*/

var ns4 = (document.layers)? true:false;         //NS 4
var ie4 = (document.all)? true:false;         //IE 4
var dom = (document.getElementById)? true:false;   //NS 6 ou IE 5




/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////// INTERACTION JACASCRIPT / ACTIONSCRIPT    << obsolete a priori au 08/07/2009
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function PiBeeFlash_DoFSCommand(command, args)                
{
//	alert("command="+command+" args="+args);
	
  var myFlashObj = InternetExplorer ? PiBeeFlash : document.PiBeeFlash;

  if(command == "loadfond") 
  {
  	//alert(args);
  	change_fond(args);
  }  

  //alert("fscommand=" + command);
  if(command == "max") 
  {
	
	//alert("plop");
	self.moveTo(0,0);
	IE5=NN4=NN6=false;
	if(document.all)
	{
		IE5=true;
	}
	else if(document.getElementById)
	{
		NN6=true;
	}
	else if(document.layers)
	{
		NN4=true;
		//alert("NN4");
	}
	if(IE5) 
	{
		self.resizeTo(screen.availWidth ,screen.availHeight);
		//alert("IE5");
	}
	else if(NN6) 
	{
		self.resizeTo(screen.availWidth ,screen.availHeight);
		//alert("NN6");
	}
	else 
	{
		self.resizeTo(screen.availWidth ,screen.availHeight);
		//alert("inconnu");
	}
	//self.moveTo(0,0);
	//self.resizeTo(screen.availWidth ,screen.availHeight);
  }
  
  //grand_format();
  if(command == "shopMP3") 
  {
		var liste = args.split("||");
//		alert(args);

		w = window.open('lecteur.php?picture='+liste[0]+'&urlimg='+liste[1]+'&titre='+liste[2]+'&desc='+liste[3]+'&numero='+liste[4]+'&dim='+liste[5],'PiBeeMP3','status=1,scrollbars=1,resizable=1,left=200,top=200,width=400,height=250');
		w.focus();

//alert(liste[5]);
	  
  }



  if(command == "shopIMG") 
  {
		var liste = args.split("||");
//		alert(args);

		w = window.open('PiBeeShopImg.php?picture='+liste[0]+'&urlimg='+liste[1]+'&titre='+liste[2]+'&desc='+liste[3]+'&numero='+liste[4]+'&dim='+liste[5],'PiBeeIMG','status=1,scrollbars=1,resizable=1,left=0,top=0,width=300,height=200');
		w.focus();
//	  alert(liste[5]);
  }


  if((command == "Caddy")  || (command == "caddy"))
  {
    var liste = args.split("||");
//	alert(args);
		w = window.open('PiBeeCaddie.V4.XML.php?fic='+liste[0]+'&id='+liste[1]+'&type='+liste[2]+'&IDProd=ID'+liste[1]+'&sens=ajouter','PiBeeShop','status=1,scrollbars=1,resizable=1,left=0,top=0,width=screen.availWidth,height=500');
		w.focus();
	
  }
  
  
  if(command == "ouvrirImg") 
  {
	  //alert("-" );
	  var liste = args.split("||");
	//alert("3");


var popUpProps = 'titlebar=0,dependent=0,personalbar=0,directories=0,menubar=0,location=0,status=0,toolbar=0,scrollbars=1,resizable=1,left=0,top=0,width=300,height=200';
w = window.open('PiBeeLoadImg.php?picture='+liste[0]+'&urlimg='+liste[1]+'&titre='+liste[2]+'&desc='+liste[3]+'&numero='+liste[4]+'&dim='+liste[5],'PiBeeIMG',popUpProps);
//w.disable_window_open_feature.menubar.location = true;
w.focus();

  }
//  window.open('PiBeeLoadImg.php?imgcur='+args[1],'PiBee','status=0,scrollbars=0,resizable=0,left=0,top=0,width=10,height=10');
//  ouvrir_photo(args);
}

function ouvrir_anim(monurl,nn,x,y)
{
var ox = x;
var oy = y;
var n = nn;
//alert(n);	
	winp = window.open(monurl,n,'width=' + ox+ ',height=' + oy + ',left=10,top=10,directories=0,location=no,status=no,scrollbars=0,menubar=0,resizable=1,toolbar=0');
	winp.focus();
}




//////////////////////////////////////////////////////////////////////////////
//////////////////////////:: fonction pour lire un fichier XML
//////////////////////////////////////////////////////////////////////////////


function lire_xml(flag,f,oXmlDom)
{
	oXmlDom.async = false;
	oXmlDom.load(f);   
   var contenu = "";
	
	cptGeneral = oXmlDom.documentElement.childNodes.length;
	for (var i=0; i < cptGeneral; i++)
	{
		// on test si le noeud n'est pas undefined .. on trouve intro, entete, corps du fichier contenu.xml
		var Noeud = oXmlDom.documentElement.childNodes[i]; 
		if(Noeud.tagName)
		{
			if(Noeud.tagName == 'corps')
			{
				cptCorps = Noeud.childNodes.length;
				for (var j=0; j < cptCorps; j++)
				{
					// on test si le noeud n'est pas undefined .. on trouve les menus corps du fichier contenu.xml
					NodeCorps = Noeud.childNodes[j];
					if(NodeCorps.tagName)
					{
 						//contenu += "<br>> NOM du Menu="+NodeCorps.getAttribute('nom_FR')+"<br>";
						cptMenu = NodeCorps.childNodes.length;
            		for (var k=0; k < cptMenu; k++)
						{
							NodeMenu = NodeCorps.childNodes[k];
							if(NodeMenu.tagName == 'sousmenu') 
							{
								//contenu += ">> NOM du SouMenu="+NodeMenu.getAttribute('nom_FR')+"<br>";
								NodeSousMenu = NodeMenu.childNodes;
								cptSousMenu = NodeSousMenu.length;
											
								for (var l=0; l < cptSousMenu; l++)
								{
									NodeSousElt = NodeMenu.childNodes[l];												
												
									if(NodeSousElt.tagName == 'rub') 
									{
										if(NodeSousElt.getAttribute('Nom_FR') == flag)
										{
											contenu += "[[["+NodeSousElt.getAttribute('Nom_FR')+"]]]<br>";
										}
											
										//contenu += "--- nom rub="+NodeSousElt.getAttribute('Nom_FR')+"<br>";
										SousElt = NodeSousElt.childNodes;
													
										// lecture des noms des éléménts													
										var zecpt=0;
										for (var m=0; m < SousElt.length; m++)
										{
											if(NodeSousElt.childNodes[m].tagName)
											{
												if(NodeSousElt.getAttribute('Nom_FR') == flag)
												{
												// ici on récupère tous les parametres des élements des menus	
												zecpt++;
												//contenu += "&nbsp;&nbsp;&nbsp;&nbsp;";
												contenu += "Val de eltDIV de élément["+zecpt+"]="+NodeSousElt.childNodes[m].getAttribute('eltDIV') + "<br>";
												contenu += "Val de TXT_FR de élément["+zecpt+"]="+NodeSousElt.childNodes[m].getAttribute('TXT_FR') + "<br>";
												contenu += "val de nom de élément["+zecpt+"]="+NodeSousElt.childNodes[m].getAttribute('nom') + "<br>";
												contenu += "Val de X de élément["+zecpt+"]="+NodeSousElt.childNodes[m].getAttribute('X') + "<br>";
												contenu += "Val de Y de élément["+zecpt+"]="+NodeSousElt.childNodes[m].getAttribute('Y') + "<br>";
												}
											}
										}
										
									}
												
								}
							} // fin sousMenu
	
	
							if(NodeMenu.tagName == 'rub') 
							{
								if(NodeMenu.getAttribute('Nom_FR') == flag)
								{
									contenu += "[[["+NodeMenu.getAttribute('Nom_FR')+"]]]<br>";
								}
										
								//contenu += ">> nom rub="+NodeMenu.getAttribute('Nom_FR')+"<br>";
								nodeElt = NodeMenu.childNodes;
											
								// lecture des noms des éléménts
								zecpt=0;
								for (var l=0; l < nodeElt.length; l++)
								{
									if(NodeMenu.childNodes[l].tagName)
									{
										if(NodeMenu.getAttribute('Nom_FR') == flag)
										{
											elt = NodeMenu.childNodes[l];
											if(elt.getAttribute('eltDIV') && (elt.getAttribute('eltDIV') != ""))
											{
											zecpt++;
											// ici on récupère tous les parametres des élements des menus	
											//contenu += "Val de eltDIV de élément["+zecpt+"]="+NodeMenu.childNodes[l].getAttribute('eltDIV') + "<br>";
											//contenu += "val de TXT_FR de élément["+zecpt+"]="+NodeMenu.childNodes[l].getAttribute('TXT_FR') + "<br>";
											//contenu += "val de nom de élément["+zecpt+"]="+NodeMenu.childNodes[l].getAttribute('nom') + "<br>";
											//contenu += "val de X de élément["+zecpt+"]="+NodeMenu.childNodes[l].getAttribute('X') + "<br>";
											//contenu += "val de Y de élément["+zecpt+"]="+NodeMenu.childNodes[l].getAttribute('Y') + "<br>";
											contenu = NodeMenu.childNodes[l].getAttribute('TXT_FR');
											
											}
										}
									}
								}
							}
										
									
						}
            	} // fin boucle sur les menus            			
         	}
     		}
		}
  	}
  	return contenu;
}// fin function

