function e(ppId) {
	return window.document.getElementById(ppId);
}

function loadImage(ppElement, ppSrc) {
	var vvImage = new Image();
		
	ppElement.style.background = 'transparent url(images/ajax-loading.gif) no-repeat center';
	
	vvImage.onload = function() {
		ppElement.innerHTML = '';
		ppElement.style.background = 'transparent url('+ppSrc+') no-repeat scroll 0 0';
	}
	vvImage.src = ppSrc;
}

function loadVideo(ppElement, ppSrc) {
	//var vvImage = new Image();
		
	//ppElement.style.background = 'transparent url(images/ajax-loading.gif) no-repeat center';
	
	//vvImage.onload = function() {
		//ppElement.style.background = 'transparent url('+ppSrc+') no-repeat scroll 0 0';
		
		var ppVideo;
		
		//ppVideo = '<BOUCLE_video(DOCUMENTS) {id_article} {mode=document} {extension==(mov|avi|mpeg|flv|mpe)}> <object type="application/x-shockwave-flash" width="510" height="510" wmode="transparent" data="repro/flvplayer.swf?file=../'+ppSrc+'"><param name="movie"	value="repro/flvplayer.swf?file=../'+ppSrc+'"/>	<param name="wmode" value="transparent" />	</object>	</BOUCLE_video>';
		//ppVideo = '<object type="application/x-shockwave-flash" wmode="transparent" data="http://www.spip-es.net/IMG/swf/flvplayer.swf?file=http://www.alg-a.org/IMG/flv/270622.flv" height="510" width="510"><param name="movie" value="http://www.spip-es.net/IMG/swf/flvplayer.swf?file=http://www.alg-a.org/IMG/flv/270622.flv"><param name="wmode" value="transparent"></object>';
		//ppVideo = '<script type="text/javascript" src="flowplayer/flowplayer-3.0.6.min.js"></script><a href="'+ppSrc+'" id="player" style="display:block;width:510px;height:510px"><img src="/img/home/flow_eye.jpg" alt="Search engine friendly content" /></a><script>flowplayer("player", "flowplayer/flowplayer-3.0.7.swf");</script>';
		//alert(ppVideo);
		ppVideo = '<OBJECT data="'+ppSrc+'" type="video/x-ms-wmv" width="510" height="510"><param name="src" value="'+ppSrc+'"><param name="autostart" value="0"><param name="volume" value="5"><param name="showcontrols" value="1"><param name="showdisplay" value="0"><param name="showstatusbar" value="0"></OBJECT>';
		//ppVideo = '<embed width="510" height="510" src="'+ppSrc+'" style="z-index:500;"></embed>';
		ppElement.style.background = 'white';
		ppElement.innerHTML = ppVideo;
	//}
	//vvImage.src = ppSrc;
}

/*
function lightWindow_DoneLoading(page,n_width,n_height,n_top,n_left) {
	loadLightWindow(page,n_width,n_height,n_top,n_left)
}
*/

function loadLightWindow(page,n_width,n_height,n_top,n_left){
	myLightWindow.activateWindow({
	href: page,
	title: "",  
	width:n_width, 
	height:n_height, 
	top: n_top, 
	left: n_left});
}

function loadEditTextWindow(ppParams) {
	loadLightWindow('EditText.php?'+ppParams,700,390,300,500);
}

function loadEditImageWindow(ppParams) {
	loadLightWindow('Edit_image.php?'+ppParams,800,600,350,500);
}

function loadEditFileWindow(ppParams) {
	loadLightWindow('Edit_fileFR.php?'+ppParams,600,350,300,500);
}

function loadEditFileLanguesWindow(ppParams) {
	loadLightWindow('Edit_fileLANG.php?'+ppParams,600,350,300,500);
}

function loadEditTextReviewWindow(ppParams) {
	loadLightWindow('Edit_review_file.php?'+ppParams,700,490,300,500);
}

function loadImages_waitForComplete(ppImages, ppFunction) {
	window.setTimeout(function() {
		vvCompleted = true;
		vvFadeshowParameter = new Array();
		for(i=0; i<ppImages.length; i++){
			if(ppImages[i].complete == false) {vvCompleted = false;}
		}
		if(vvCompleted == true) {
			ppFunction();
		}
		else {
			loadImages_waitForComplete(ppImages, ppFunction);
		}
	}, 100);
}

function loadImages(ppImageSources, ppElement, ppFunction) {
	var vvImage = new Image();
	
	var vvImages = new Array();
	
	ppElement.style.background = 'transparent url(images/ajax-loading.gif) no-repeat center';
				          
	for(i=0; i<ppImageSources.length; i++){
		vvImages[i] = new Image();
		vvImages[i].src = ppImageSources[i];
		vvImages[i].onerror = function() {alert('error');}
	}
	
	loadImages_waitForComplete(vvImages, ppFunction);
}

function loadMentionsLegalesWindow(){
	loadLightWindow('mentionslegales.php',400,400,320,500);
}

function loadEditMentionsLegalesWindow(){
	loadLightWindow('Edit_mentionslegales.php',450,460,320,500);
}

function loadConfirmWindow(tit, parr, btnyes, btnno, funct){
	loadLightWindow('confirminfo.php?tit='+tit+'&parr='+parr+'&funct='+funct+'&btnY='+btnyes+'&btnN='+btnno,400,400,300,600);
}
function loadAlertWindow(tit, parr){
	loadLightWindow('alertinfo.php?tit='+tit+'&parr='+parr,400,400,300,600);
}