// JavaScript Document
var shownMedia = new Array();

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
		if(el.style.display == "none"){
			el.style.display = "block";
		}else{
			saveFteBeforeHide(obj, '');
			el.style.display = "none";
		}
	}
}

function SwitchMenuPlus(field, idGal){
	var el = document.getElementById('Sub'+field+idGal);
	if(el.style.display == "none"){
		if (field=="Thumbs") {
			showMedia(shownMedia[idGal]);
		}
		el.style.display = "block";
		document.getElementById(field+idGal).className = 'sectionsubtxtbtminus';
	}else{
		if (field=="Texte") {
			fteVisible[idGal]=false;
			readFlashText(idGal);
		} else if (field=="Thumbs") {
			hideMedia(shownMedia[idGal]);
			fteVisible[shownMedia[idGal]]=false;
		}
		el.style.display = "none";
		document.getElementById(field+idGal).className ='sectionsubtxtbtplus';
	}
}
function SwitchMedia(idGal, id){
	hideMedia(shownMedia[idGal]);
	if (shownMedia[idGal] != id) {
		shownMedia[idGal] = id;
		showMedia(id);
	} else {
		shownMedia[idGal] = undefined;
	}
}
function showMedia(id) {
	if (id!=undefined) {
		document.getElementById('SubTextThumbs'+ id).style.display = "block";
		document.getElementById('FTETextThumbs'+ id).style.display = "block";
		document.getElementById('Thumbs' + id).style.borderColor = "#" + fteColor[id].substr(2);
	}
}
function hideMedia(id) {
	if (id!=undefined) {
		//window.alert("hide:"+id)
		fteVisible[id]=false;
		readFlashText(id);
		document.getElementById('SubTextThumbs'+ id).style.display = "none";
		document.getElementById('FTETextThumbs'+ id).style.display = "none";
		document.getElementById('Thumbs' + id).style.borderColor = '';
	}
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height){
	  if(popUpWin){
	    if(!popUpWin.closed) popUpWin.close();
	  }
	  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbar=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function showSegment(where){
	location.hash = "#" + where;
	}

function color_selected(i,c,d){
	var MyId= i;
	document[MyId].hexvalueUpdte.value = c;
	var onerow=document.getElementById(d);
	onerow.style.backgroundColor=c;
	}


