
// copyright - begin
//
//   Copyright (C) 2005 Espace Courbe inc.
//   You are free to modify and redistribute this code as long
//   as the following message is included:
//
//   Last modified:
//   $Date: 2006/05/09 16:25:59 $
//
//   Portions Copyright (C) 2006 Espace Courbe inc.
//   Home Page: http://www.espacecourbe.com/
//
//   Author: Christian Fecteau -- christian.fecteau@espacecourbe.com
//   Creation:  2005/12/06 17:05:02
//
// copyright - end


// $Id: listCollapseInit.js,v 1.4 2006/05/09 16:25:59 christian Exp $

if (typeof window.mapIsCollapsable == 'function' && window.mapIsCollapsable())
{
	var list_old_onload = null;
	if (typeof window.onload == "function")
	{
		list_old_onload = window.onload;
	}
	window.onload = function()
	{
		if (list_old_onload)
		{
			list_old_onload();
			list_old_onload = null;
		}
		var leUL = document.getElementById('divPlanEC').getElementsByTagName('UL')[0];
		leUL.id = rootID;
		leUL.style.display = 'none';
		setTimeout('Init(document.getElementById(rootID))',500);
	}
	var list_old_onunload = null;
	if (typeof window.onunload == "function")
	{
		list_old_onunload = window.onunload;
	}
	window.onunload = function()
	{
		if (list_old_onunload)
		{
			list_old_onunload();
			list_old_onunload = null;
		}
		setCookie(temoinEC, stateToFromStr(rootID));
	}
}
function Init(leUL)
{
	navTout(leUL);
	applyStyle(leUL, cssUL);
	firstStateImageEC = (firstStateEC=='none' ? plusHtmlEC : moinsHtmlEC);
	compactMenu(rootID, nePasRetenirEC, firstStateImageEC, true);
	if ((retrieveCookie(temoinEC) != null))
	{
		stateToFromStr(rootID, retrieveCookie(temoinEC));
	}
	else
	{
		stateToFromStr(rootID, etatParDefaut);
	}
	leUL.style.display = 'block';
	document.getElementById('plan-nav').style.display = 'block';
	if (typeof IDEC == 'string') setTimeout('removeChildCheck(document.getElementById(rootID), IDEC)',1);
	if (location.search.match(/set=1/) && (retrieveCookie(temoinEC) == stateToFromStr(rootID)))
	{
		var displayStr = window.open('');
		displayStr.document.open();
		displayStr.document.write('<form><textarea style="width:100%;height:100%">'+stateToFromStr(rootID)+'</textarea></form>');
		displayStr.document.close();
		displayStr.document.forms[0][0].select();
	}
}