/*
 ______________________________________________________
/ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ\
|           Folder Navigation 2.0 by EAE               |
|                                                      |
|   Based on a cross browser outline sample found      |
|   at 'www.webreference.com/dhtml'                    |
|                                                      |
|   Feel free to copy, use and change this script as   |
|   long as this part remains unchanged.               |
|                                                      |
|   If you have any questions and or comments please   |
|   E-mail me 'eae@eae.net'. If you're looking for     |
|   more JavaScripts etc, please check out my webpage  |
|                 'www.eae.net/weebfx'                 |
|                                                      |
|              Last Updated: 17 July 1998              |
\______________________________________________________/
 ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
*/

//RCT+ - D
function mOver(aEvent) {
if(aEvent){
	var myEvent=aEvent;
	var eSrc = myEvent.target;
}
else{
	var myEvent=window.event;
	var eSrc = myEvent.srcElement;
}
  
 if (eSrc.className == "item") {
  eSrc.className = "highlight";
 }
}
 
function mOut(aEvent) {
if(aEvent){
	var myEvent=aEvent;
	var eSrc = myEvent.target;
}
else{
	var myEvent=window.event;
	var eSrc = myEvent.srcElement;
}
 if (eSrc.className == "highlight") {
  eSrc.className = "item";
 }
}
document.onmouseover = mOver;
document.onmouseout = mOut ;
//RCT+ - F

var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;

ver4 = (NS4 || IE4) ? true : false;
ver4=true; //!!! RCT forcé pour affichage FireFox

isExpanded = false;

function getIndex($1) {
	ind = null;
	for (i=0; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		if (whichEl.id == $1) {
			ind = i;
			break;
		}
	}
	return ind;
}

function arrange() {
	nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
	for (i=firstInd+1; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		if (whichEl.visibility != "hide") {
			whichEl.pageY = nextY;
			nextY += whichEl.document.height;
		}
	}
}

function FolderInit(){
	if (NS4) {
	firstEl = "mParent";
	firstInd = getIndex(firstEl);
	showAll();
		for (i=0; i<document.layers.length; i++) {
			whichEl = document.layers[i];
			if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
		}
		arrange();
	}
	else {
		tempColl = document.all.tags("DIV");
		//tempColl=document.div;
		for (i=0; i<tempColl.length; i++) {
			//RCT if (tempColl(i).className == "child") tempColl(i).style.display = "none";
			if (tempColl[i].className == "child") tempColl[i].style.display = "none";
		}
	}
}


function FolderExpand($1,$2) {
	if (!ver4) return;
	if (IE4) { ExpandIE($1,$2) } 
	else{
		if(!NS4) { ExpandFF($1,$2) } //RCT
		else { ExpandNS($1,$2) }
	}
}

//RCT-D
function ExpandFF($1,$2) {
	ExpandChild = eval($1 + "Child");
        if ($2 != "top") { 
		ExpandTree = eval($1 + "Tree");
		//ExpandFolder = eval($1 + "Folder");
	}
	if (ExpandChild.style.display == "none") {
		ExpandChild.style.display = "block";
                if ($2 != "top") { 
			setchemin($1);
			document.lanceur.tree_der_ouvert.value=$1;
                	//if ($2 == "last") { ExpandTree.src = "max/francais/images/treeview/Lminus.gif"; }
			//else { ExpandTree.src = "max/francais/images/treeview/Tminus.gif"; }
		//	ExpandFolder.src = "max/francais/images/treeview/openfoldericon.gif";	
		}
		else { //mTree.src = "max/francais/images/treeview/topopen.gif"; }
			a=1;
		}
	}
	else {
		ExpandChild.style.display = "none";
                if ($2 != "top") { 
	               // if ($2 == "last") { ExpandTree.src = "max/francais/images/treeview/Lplus.gif"; }
			//else { ExpandTree.src = "max/francais/images/treeview/Tplus.gif"; }
		//	ExpandFolder.src = "max/francais/images/treeview/foldericon.gif";
		}
		else { a=1; //mTree.src = "max/francais/images/treeview/top.gif"; 
		}
	}
}
//RCT-F

function ExpandIE($1,$2) {
	Expanda = eval($1 + "a");
	Expanda.blur()
	ExpandChild = eval($1 + "Child");
        if ($2 != "top") { 
		ExpandTree = eval($1 + "Tree");
		//ExpandFolder = eval($1 + "Folder");
	}
	if (ExpandChild.style.display == "none") {
		ExpandChild.style.display = "block";
                if ($2 != "top") { 
			setchemin($1);
			document.lanceur.tree_der_ouvert.value=$1;
                	if ($2 == "last") { 
				a=1;
				//ExpandTree.src = "max/francais/images/treeview/Lminus.gif"; 
			}
			else { a=2;
			//ExpandTree.src = "max/francais/images/treeview/Tminus.gif"; 
			}
		//	ExpandFolder.src = "max/francais/images/treeview/openfoldericon.gif";	
		}
		else { a=3;
			//mTree.src = "max/francais/images/treeview/topopen.gif"; 
			}
	}
	else {
		ExpandChild.style.display = "none";
                if ($2 != "top") { 
					if ($2 == "last") 
					{
					a=1;
					//ExpandTree.src = "max/francais/images/treeview/Lplus.gif"; 
					}
				else {a=1;
					//ExpandTree.src = "max/francais/images/treeview/Tplus.gif"; 
				}
		//	ExpandFolder.src = "max/francais/images/treeview/foldericon.gif";
		}
		else { a=1;
			//mTree.src = "max/francais/images/treeview/top.gif"; 
			}
	}
}
function ExpandNS($1,$2) {
	ExpandChild = eval("document." + $1 + "Child")
        if ($2 != "top") { 
		ExpandTree = eval("document." + $1 + "Parent.document." + $1 + "Tree")
		//ExpandFolder = eval("document." + $1 + "Parent.document." + $1 + "Folder")
	}	
	if (ExpandChild.visibility == "hide") {
		ExpandChild.visibility = "show";
                if ($2 != "top") { 
               		if ($2 == "last") { 
				ExpandTree.src = "max/francais/images/treeview/Lminus.gif"; }
			else { ExpandTree.src = "max/francais/images/treeview/Tminus.gif"; }
			//ExpandFolder.src = "max/francais/images/treeview/openfoldericon.gif";	
		}
		else { mTree.src = "max/francais/images/treeview/topopen.gif"; }
	}
	else {
		ExpandChild.visibility = "hide";
                if ($2 != "top") { 
               		if ($2 == "last") { ExpandTree.src = "max/francais/images/treeview/Lplus.gif"; }
			else { ExpandTree.src = "max/francais/images/treeview/Tplus.gif"; }
			//ExpandFolder.src = "max/francais/images/treeview/foldericon.gif";	
		}
		else { mTree.src = "max/francais/images/treeview/top.gif"; }
	}
	arrange();
}

function showAll() {
	for (i=firstInd; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		whichEl.visibility = "show";
	}
}


with (document) {
	write("<STYLE TYPE='text/css'>");
	if (NS4) {
		write(".parent { color: black; font-size:9pt; line-height:0pt; color:black; text-decoration:none; margin-top: 0px; margin-bottom: 0px; position:absolute; visibility:hidden }");
		write(".child { text-decoration:none; font-size:9pt; line-height:15pt; position:absolute }");
	        write(".item { color: black; text-decoration:none }");
	        write(".highlight { font: 12px/13px; Verdana; text-decoration: none; color: black }");
	}
	else {
		write(".parent { font: 12px/13px; Verdana; text-decoration: none; color: black }");
		write(".child { font:12px/13px Verdana; display:none }");
	        write(".item { font: 12px/13px; Verdana; text-decoration: none; color: black }");
	        write(".highlight { font: 12px/13px; Verdana; text-decoration: none; color: black }");
	        write(".icon { margin-right: 5 }")
	}
	write("</STYLE>");
}

onload = FolderInit;
