/*var mouseOver_menu ="#f0f0f0";
var mouseOut_menu = "#ffffff";
var mouseOver_option = "#f0f0f0";
var mouseOut_option = "#ffffff";
*/
function changeFondColor (itemid,itemfondcolor)
{
	
	
	
	if(document.getElementById(itemid))
	{
			
		document.getElementById(itemid).style.backgroundColor =itemfondcolor;
		//alert(document.getElementById(itemid).style.backgroundColor);
		//document.getElementById(itemid).style.backgroundColor ="#565656";
		//alert(document.getElementById(itemid).style.backgroundColor);
	//document.getElementById(itemid).style.backgroundColor = mouseOptionColor[itemfondcolor];
	}
	
}
function changeTextColor(id,color)
{
	;
	}
function changeCursor (itemid,cursorType)
{
	document.getElementById(itemid).style.cursor = cursorType;
	}
	

function goPage(numPage)
{
	
	var num = parseInt(numPage);
	window.location.href = listMenu[num];
	}
function addNewItem(type)
{
	if(document.getElementById('newitem').style.display == "block")
	document.getElementById('newitem').style.display = "none";
	else document.getElementById('newitem').style.display = "block"
	
	document.getElementById('newitemframe').src = optionList[type];
	}
	function showframe(frameid,url)
{
	
	document.getElementById(frameid).firstChild.src=url;
	
	if(document.getElementById(frameid).style.display == 'block')
	document.getElementById(frameid).style.display = 'none';
	else
	{
			//alert(frameid);
	document.getElementById(frameid).style.display = 'block';
	
	}
}
function goPage(num)
{
	window.location = listMenu[num];
	
	}
//pour afficher sous menu
var menuId = new Array("actu", "lelabo", "rech", "dev", "enseign", "publi");

var stoptout = false;

function timeouta(id)
{
	if ( stoptout )
		return;
		
	var d = document.getElementById(id);
	//alert(id);
	for (var i in menuId) 
	{
		if (document.getElementById(menuId[i])) 			
			{document.getElementById(menuId[i]).style.display='none';}		
	}
	document.form1.textfield.value += "H-("+id+")";
if (d) {d.style.display='block';}	
}


function montre3(id) 
{	
	stoptout = false
	if ( id != "" )
	{
		//alert( "moutre " + id );
		document.form1.textfield.value += id+"-";
		window.setTimeout( "window.timeouta('"+id+"')", 50 );
	}
		else		
		timeouta( id );
}

function montre2() 
{	
	stoptout = true;
}
function changeBgColorByObjet(obj,option)
{
	if(option == "over"){
			obj.style.color = '#e6f627';
	}
	else if(option =="out") {
		obj.style.color = '#000';
	}
}
function getElementsByName_iefix(tag, name) {
     
     var elem = document.getElementsByTagName(tag);
     var arr = new Array();
     for(i = 0,iarr = 0; i < elem.length; i++) {
          att = elem[i].getAttribute("name");
          
          if(att == name) {
               arr[iarr] = elem[i];
               iarr++;
          }
     }
     return arr;
}
function showLayout(contenu,legende)
{
	
	
	var contStr = "";
	var extensionParser = new Array("jpg", "png", "gif", "jpeg");
	var contenuSplit = contenu.split('.');
	var extension = contenuSplit[contenuSplit.length-1].toLowerCase();
	for(var i in extensionParser) {
			if(extensionParser[i] == extension) {
				contStr = "<img src='"+contenu+"' style='margin-top:20px'/>";
			}
	}
	if(contStr == "") {
/*contStr ="<embed type='video/quicktime' src='"+contenu+"' height='220' width='220'  autoplay='false' loop='false' showcontrols='1'></embed>";*/

/*contStr ="<object id='player' name='player' width='352' height='308'><param name='FileName' value='"+contenu+"'><param name='ShowControls' value='TRUE'><param name='AutoStart' value='TRUE'><param name='AnimationAtStart' value='TRUE'><param name='ShowDisplay' value='FALS'><param name='TransparentAtStart' value='FALSE'><param name='ShowStatusbar' value='TRUE'><param name='enableContextMenu' value='FALSE'><param name='AllowChangeDisplaySize' value='TRUE'><param name='AutoSize' value='FALSE'><param name='EnableFullScreenControls' value='TRUE'><embed type='video/quicktime' src='"+contenu+"' name='player' autostart='1' showcontrols='1' showdisplay='0' showstatusbar='1' animationatstart='1' transparentatstart='0' allowchangedisplaysize='1' autosize='0' displaysize='0' enablecontextmenu='0' windowless='1' width='352' height='308' enablefullscreencontrols='1'></embed></object>";*/

/*contStr ="<object id='player' name='player' width='352' height='308'><param name='FileName' value='"+contenu+"'><param name='ShowControls' value='TRUE'><param name='AutoStart' value='FALSE'><param name='AnimationAtStart' value='TRUE'><param name='ShowDisplay' value='FALSE'><param name='TransparentAtStart' value='FALSE'><param name='ShowStatusbar' value='TRUE'><param name='enableContextMenu' value='FALSE'><param name='AllowChangeDisplaySize' value='TRUE'><param name='AutoSize' value='FALSE'><param name='EnableFullScreenControls' value='TRUE'><embed type='video/quicktime' src='"+contenu+"' name='player' autostart='0' showcontrols='1' showdisplay='0' showstatusbar='1' animationatstart='1' transparentatstart='0' allowchangedisplaysize='1' autosize='0' displaysize='0' enablecontextmenu='0' windowless='1' width='352' height='308' enablefullscreencontrols='1'></embed></object>";*/

contStr ="<embed id='embedvideo' type='video/quicktime' src='"+contenu+"' name='player' autostart='true' showcontrols='1' showdisplay='0' showstatusbar='1' animationatstart='1' transparentatstart='0' allowchangedisplaysize='1' loop='true' autosize='0' displaysize='0' enablecontextmenu='0' windowless='1' width='352' height='308' enablefullscreencontrols='1'></embed>";

	}
	document.getElementById('lightbox_fond').style.display='block'; 
	document.getElementById('lightbox_contenu').style.display='block';
	document.getElementById('lightboximg').innerHTML=contStr; 
	document.getElementById('lightboximglegend').innerHTML=legende;
	
	
	}
function orderUp(id,type)
{
	if(type =="recherche")
	window.location.href = "changeresercheorder.php?type="+type+"&option=up&id="+id;
	else if(type =="sousrecherche"){
	var sousid = id.split('fils');
	window.location.href = "changeresercheorder.php?type="+type+"&option=up&id="+sousid[1];
	}
}
function orderDn(id,type)
{
	if(type =="recherche")
	window.location.href = "changeresercheorder.php?type="+type+"&option=dn&id="+id;
	else if(type =="sousrecherche"){
	var sousid = id.split('fils');
	window.location.href = "changeresercheorder.php?type="+type+"&option=dn&id="+sousid[1];
	}
}