/**
 * @author Stephane
 */
var currentSel = null;

function init()
{
	currentSel = 0;
}

function myMouseover(branch)
{
	branch.txt.style.color = 'red';
	branch.txt.style.background = 'white';
	branch.setIconsSelected("folderopen.gif");
}

function myMouseout(branch)
{
	branch.txt.style.color = 'black';
	branch.txt.style.background = '#007FF0';
}

function changeVid(vid)
{
	if (currentSel != vid)
	{
		currentSel = vid;

		new Ajax.Updater('vid1', "getVid.php",
			{
				method :'post',
				parameters :
					{
						action :vid
					},
				evalScripts :true
			});

		DivStatus('vid1', true)
	} else
	{
		currentSel = 0;
		DivStatus('vid1', false)

	}

}

function DivStatus(divID, bView)
{
	// Pour les navigateurs récents
	if (document.getElementById && document.getElementById(divID))
	{
		Pdiv = document.getElementById(divID);
		PcH = true;
	}
	// Pour les veilles versions
	else if (document.all && document.all[divID])
	{
		Pdiv = document.all[divID];
		PcH = true;
	} // Pour les
	else if (document.layers && document.layers[divID])
	{
		Pdiv = document.layers[divID];
		PcH = true;
	}

	else
	{
		PcH = false;
	}
	if (PcH)
	{
		if (bView == false)
		{
			Pdiv.className = 'cachediv';
			return;
		}

		if ((Pdiv.className == 'cachediv') && (bView == true))
		{
			Pdiv.className = '';
			return;
		}
		else 
			return;

		if (Pdiv.className == 'cachediv')
		{
			Pdiv.className = '';
		} else
		{
			Pdiv.className = 'cachediv';
		}
	}
}

Event.observe(window, "load", init);
