function rolloverImg(obj){
	var found = obj.src.search(/_off/);
	if (found != -1 ){
		obj.src = obj.src.replace(/_off/, "_on");
		return true;
	} 
	
	var found = obj.src.search(/_on/);
	if (found != -1 ){
		obj.src = obj.src.replace(/_on/, "_off");
		return true;
	}
}

function OpenEditor( IdText , obj){
	var handler = window.open  ("./tinymce/Editor.php?IdText="+IdText+"&idpage="+obj.id,"Editor","width=450,height=280,left=0,top=0,resizable = yes");
	handler.focus();
}

function OpenActu( IdText , obj){
	var handler = window.open  ("./tinymce/Actu.php?IdText="+IdText+"&idpage="+obj.id,"Editor","width=550,height=580,left=0,top=0,resizable = yes");
	handler.focus();
}


function OpenActuImg( idactu ){
	var handler = window.open  ("./EditorActuIMG.php?idactu="+idactu,"Editor","width=550,height=480,left=0,top=0,resizable = yes");
	handler.focus();
}

function EditorIMG( spage ){
	var handler = window.open  ("./EditorIMG.php?spage="+spage,"Editor","width=450,height=280,left=0,top=0,resizable = yes");
	handler.focus();
}

function EditorIMGtiny(){
	var handler = window.open  ("./EditorIMGtiny.php","Editor","width=450,height=280,left=0,top=0,resizable = yes");
	handler.focus();
}

function EditorArtiste(NumArtiste){
	var handler = window.open  ("./tinymce/EditorArtiste.php?artiste="+NumArtiste,"Editor","width=450,height=280,left=0,top=0,resizable = yes");
	handler.focus();
}

function EditorIMGArtiste(artiste){
	var handler = window.open  ("./EditorIMGArtiste.php?artiste="+artiste,"Editor","width=450,height=380,left=0,top=0,resizable = yes");
	handler.focus();
}

function EditorIMGVisite(){
	var handler = window.open  ("./EditorIMGVisite.php","Editor","width=690,height=480,left=0,top=0,resizable = yes");
	handler.focus();
}

function OpenEvent(){
	var handler = window.open  ("./EditorEvent.php","Editor","width=390,height=280,left=0,top=0,resizable = yes");
	handler.focus();
}

function OpenEvent2(){
	var handler = window.open  ("./EditorEvent2.php","Editor","width=390,height=280,left=0,top=0,resizable = yes");
	handler.focus();
}


function loadMusic(obj){
	var handler = window.open  ("./PopUp_Music.php?name="+obj.id,"Music","width=410,height=355,left=0,top=0,resizable = yes");
	handler.focus();
}

function viewPicture(NumArtiste, NumPhoto){
	var img = document.getElementById('Zoom');
	img.src = "../expophotos/artiste_"+NumArtiste+"_"+NumPhoto+".jpg?"+Math.random();
	img.style.width = "326px";
	img.style.height = "284px";
	img.style.display = "";
}

function viewLieux(IdLieu, NumPict){
	var img = document.getElementById('Zoom2');
	img.src = "../visiteslieux/visite_lieux_"+IdLieu+"_"+NumPict+".jpg?"+Math.random();
	img.style.width = "650px";
	img.style.height = "284px";
	img.style.display = "";
}

function ImgOn(obj){
	var found = obj.src.search(/_off/);
	if (found != -1 ){
		obj.src = obj.src.replace(/_off/, "_on");
		return true;
	}
}

function clearField(obj){
	obj.value = "";
}

var URLImg = new Array();
function loadIMG(typeLoad, IdImgCur){
	if( typeLoad == "visitelieux" && IdImgCur == "1_1" ){
			loadEventVisitelieux();
	} else if( typeLoad == "prog_musical" ){
		loadEventProgmusical();
	}
	document.getElementById(IdImgCur).src = URLImg[IdImgCur];
}

function loadEventVisitelieux(){

	document.getElementById("1_1").onload = function(){ loadIMG('visitelieux', '1_2') };
	document.getElementById("1_2").onload = function(){ loadIMG('visitelieux', '1_3') };
	document.getElementById("1_3").onload = function(){ loadIMG('visitelieux', '1_4') };
	document.getElementById("1_4").onload = function(){ loadIMG('visitelieux', '2_1') };
	document.getElementById("2_1").onload = function(){ loadIMG('visitelieux', '2_2') };
	document.getElementById("2_2").onload = function(){ loadIMG('visitelieux', '2_3') };
	document.getElementById("2_3").onload = function(){ loadIMG('visitelieux', '2_4') };
	document.getElementById("2_4").onload = function(){ loadIMG('visitelieux', '3_1') };
	document.getElementById("3_1").onload = function(){ loadIMG('visitelieux', '3_2') };
	document.getElementById("3_2").onload = function(){ loadIMG('visitelieux', '3_3') };
	document.getElementById("3_3").onload = function(){ loadIMG('visitelieux', '3_4') };
	
	URLImg['1_1'] = "../visiteslieux/visite_lieux_1_1.jpg?"+Math.random();
	URLImg['1_2'] = "../visiteslieux/visite_lieux_1_2.jpg?"+Math.random();
	URLImg['1_3'] = "../visiteslieux/visite_lieux_1_3.jpg?"+Math.random();
	URLImg['1_4'] = "../visiteslieux/visite_lieux_1_4.jpg?"+Math.random();
	URLImg['2_1'] = "../visiteslieux/visite_lieux_2_1.jpg?"+Math.random();
	URLImg['2_2'] = "../visiteslieux/visite_lieux_2_2.jpg?"+Math.random();
	URLImg['2_3'] = "../visiteslieux/visite_lieux_2_3.jpg?"+Math.random();
	URLImg['2_4'] = "../visiteslieux/visite_lieux_2_4.jpg?"+Math.random();
	URLImg['3_1'] = "../visiteslieux/visite_lieux_3_1.jpg?"+Math.random();
	URLImg['3_2'] = "../visiteslieux/visite_lieux_3_2.jpg?"+Math.random();
	URLImg['3_3'] = "../visiteslieux/visite_lieux_3_3.jpg?"+Math.random();
	URLImg['3_4'] = "../visiteslieux/visite_lieux_3_4.jpg?"+Math.random();

}

function loadEventProgmusical() {
	URLImg['ProgMusical'] = "../images/event/event.jpg?";
}

function LoadFooter(){
	document.getElementById('footerIMG').src = "../images/index_03.gif";
}
