function addOngletTitle(id,titletexte,active) 
{
	var d = document.getElementById('onglet');
	if (active=='1') d.innerHTML=d.innerHTML+"<div id='active_"+id+"'><a href=\"javascript:showonglet('"+id+"');\">"+titletexte+"<\/a><\/div>";
	else d.innerHTML=d.innerHTML+"<div id='inactive_"+id+"'><a href=\"javascript:showonglet('"+id+"');\">"+titletexte+"<\/a><\/div>";
}

function get1ElementById(id)
{
	var x=document.getElementById(id);
	return x;
}

function showonglet(id) 
{
	var d = get1ElementById(id);
	if (d)
	{
		var d2 = get1ElementById('active_'+id);
		if (d2==null) d2 = get1ElementById('inactive_'+id);
		for (var i = 1; i<=10; i++) 
		{
			if (get1ElementById('onglet'+i)) 
			{
				get1ElementById('onglet'+i).style.display='none';
			}
			if (get1ElementById('active_onglet'+i)) 
			{
				get1ElementById('active_onglet'+i).id='inactive_onglet'+i;
			}
		}
		if (d)  d.style.display='block';
		if (d2) d2.id='active_'+id;
	}  
}

function show(id) 
{
	var d = document.getElementById(id);
	
	for (var i = 1; i<=10; i++){
		if (document.getElementById('smenugauche'+i))
			document.getElementById('smenugauche'+i).style.display='none';
	}
	if (d) {d.style.display='block';} 
}

function launchTV()
{
	controlVideo('MyVideo','stop');
	window.open('../pages_autonomes/tvshow.html','nom','toolbar=0,titlebar=0,menubar=0,location=0,scrollbars=1,width=820,height=800,top=0,left=0');
}

function getObject(nom_obj)
{
	var my_obj;

	if      (document.getElementById)
	{ 
		my_obj = document.getElementById(nom_obj);
	}
	else if (document.layers        ) 
	{
		my_obj = document.layers[nom_obj];
	}
	else if (document.all           )
	{	
		my_obj = document.all[nom_obj];
	}
	return my_obj;
}

function controlVideo(objname,action)
{
	try
	{
		myVideo=getObject(objname);
		if (action=='stop') myVideo.stop();
		if (action=='start') myVideo.play();
		if (action=='rewind') myVideo.rewind();
	}
	catch(err)
	{	
		window.status = err.message;
	}
}

function myresize()
{
	var corps = document.getElementById('corps');
	var corps_contenu = document.getElementById('corps_contenu');
	var corpsleft = document.getElementById('corps-left');
	var corpsright = document.getElementById('corps-right');
	var header = document.getElementById('header');
	var menu = document.getElementById('menu');
	var footer = document.getElementById('footer');
	
	//alert("corpsright.clientHeight "+corpsright.clientHeight);
	
	footer.style.top=corps_contenu.clientHeight;
	
	if(corps_contenu.clientHeight<corpsright.clientHeight){
		footer.style.top=corpsright.clientHeight+1;
		corpsleft.style.height=corpsright.clientHeight;
	}
	else{
		corpsleft.style.height=corps_contenu.clientHeight;
		corpsright.style.height=corps_contenu.clientHeight;
		footer.style.top=corps_contenu.clientHeight+1;
	}
}

window.onload = myresize;
window.onresize = myresize;


