<!--

// browser less than 4.x redirect
if (parseInt(navigator.appVersion) >=4) {
	if (document.layers && (navigator.appName == "Netscape")) {
		var hidden = "hide";
		var visible = "show";
		var NS = true;
	} 
	else if (document.all) {
		var hidden = "hidden";
		var visible = "visible";
		var IE = true;
	}
	else if (!document.all && !document.layers && document.getElementById) {
		var hidden = "hidden";
		var visible = "visible";
		var GECKO = true;
	}
}

if (!NS && !IE && !GECKO) {
	top.location.href = "oldversions/oldversion.html";
}

var toggle = "toggle";

// browser check
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}

bw=new checkBrowser()
var speed=50
var loop, timer

function makeObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
	this.up=goUp;this.down=goDown;
	this.moveIt=moveIt; this.x; this.y;
	this.obj = obj + "Object";
	eval(this.obj + "=this");
	return this;
}

//Navigator Window Resizing fix
FormResubmitGlobalControl = "";

function netscapeFix() {
	if (innerWidth != origWidth || innerHeight != origHeight) {
		if (FormResubmitGlobalControl != "" && (location.href.indexOf("?") < 0)) {
			submitForm(FormResubmitGlobalControl);
		}
		else {
			window.location.reload();
		}
	}
}

if (NS) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	window.onresize = netscapeFix;
}

// animate layers - used for scrolling?
function moveIt(x,y) {
	this.x=x;this.y=y;
	this.css.left=this.x;
	this.css.top=this.y;
}

// scroll down
function goDown(move) {
	if(this.y>-this.scrollHeight+oCont.clipHeight) {
		this.moveIt(0,this.y-move);
		if(loop) setTimeout(this.obj+".down("+move+")",speed);
	}
}

// scroll up
function goUp(move) {
	if(this.y<0) {
		this.moveIt(0,this.y-move);
		if(loop) setTimeout(this.obj+".up("+move+")",speed);
	}
}

// scroll functions for scrolling layers
function scrollLoop(speed) {
	if(loaded) {
		loop=true;
		if(speed>0) oScroll.down(speed);
		else oScroll.up(speed);
	}
}

function noScroll() {
	loop=false;
	if(timer) clearTimeout(timer);
}

var loaded;

function scrollInit() {
	oCont=new makeObj('divCont');
	oScroll=new makeObj('divText','divCont');
	oScroll.moveIt(0,0);
	oCont.css.visibility='visible';
	loaded=true;
}
// end scrolling layers related functions


// toggles a layer on; pass the name of the layer to be turned on;
function JCL(myLayer) {
	if (NS) {
		if (document.layers[myLayer].visibility == visible) {
		   document.layers[myLayer].visibility = hidden;
		}
		else {
		   document.layers[myLayer].visibility = visible;
		}
	}
	else if (IE) {
		if (document.all[myLayer].style.visibility == visible) {
		   document.all[myLayer].style.visibility = hidden;
		}
		else {
		  document.all[myLayer].style.visibility = visible;
		}
	}
	else if (GECKO) {
		if (document.getElementById(myLayer).style.visibility == visible) {
			document.getElementById(myLayer).style.visibility = hidden;
		}
		else {
			document.getElementById(myLayer).style.visibility = visible;
		}
	}
}

// toggles a layer off; pass the name of the layer to be turned on;
function JCLoff(myLayer) {
	if (NS) {
		document.layers[myLayer].visibility = hidden;
	}
	else if (IE) {
		document.all[myLayer].style.visibility = hidden;
	}
	else if (GECKO) {
		document.getElementById(myLayer).style.visibility = hidden;
	}
}

//test to see if dropdown1 layer is covering ddMenuFix form layer
function formFix() {
	if (NS) {
		if (document.layers['dropdown1'].clip.height + 124 > document.layers['ddMenuFix'].top) {
			if (document.layers['ddMenuFix'].visibility == visible) {  		
				document.layers['ddMenuFix'].visibility = hidden;
			} 
			else {
				document.layers['ddMenuFix'].visibility = visible;
			}
		}
	}
	else if (IE) {
		if (document.all['dropdown1'].clientHeight + 124 > parseInt(document.all['ddMenuFix'].style.top)) {
			if (document.all['ddMenuFix'].style.visibility == visible) {
				document.all['ddMenuFix'].style.visibility = hidden;
			}
			else {
				document.all['ddMenuFix'].style.visibility = visible;
			}
		}
	}
	else if (GECKO) {
		if (document.getElementById('dropdown1').clientHeight + 124 > parseInt(document.getElementById('ddMenuFix').style.top)) {
			if (document.getElementById('ddMenuFix').style.visibility == visible) {
				document.getElementById('ddMenuFix').style.visibility = hidden;
			}
			else {
				document.getElementById('ddMenuFix').style.visibility = visible;
			}
		}
	}

}

//spaces contentTable layer 20px bellow content layer
function contentFix() { 
	if (NS) {
		document.layers['contentTable'].top = (document.layers['content'].document.layers['contentText'].clip.height + 134);
		document.layers['ddMenuFix'].top = (document.layers['contentTable'].top + 17);
	}
	else if (IE) { 
		document.all['contentTable'].style.top = (document.all['contentText'].clientHeight + 144) + "px";
		document.all['ddMenuFix'].style.top = (parseInt(document.all['contentTable'].style.top) + 18) +"px";
	}
	else if (GECKO) {
		document.getElementById('contentTable').style.top = (document.getElementById('contentText').clientHeight + 144) + "px";
		document.getElementById('ddMenuFix').style.top = (parseInt(document.getElementById('contentTable').style.top) + 18) +"px";
	}
}

function loadSource(id,nestref,url) {
	if (NS) {
		var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id];
		lyr.load(url,lyr.clip.width);
	}
	else if (IE) { // A vérifier pour GECKO
		parent.bufferFrame.document.location = url;
	}
}

function loadSourceFinish(id) {
	if (IE) document.all[id].innerHTML = parent.bufferFrame.document.body.innerHTML // A vérifier pour GECKO
}
// end of loading functions

function lyrroll(layer,imgName,imgObj) {
	if (document.images) {
		if (NS && layer!=null) 
			eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
		else 
			document.images[imgName].src = eval(imgObj+".src")
	}
}

// image swaps that work across layers; pass layer name, image name and the name of the image 
// object for that image file preloaded in the document head
function changeRoll(layer,imgName,imgObj) {
	if (document.images) {
		if (NS && layer!=null)
			eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
		else
			document.images[imgName].src = eval(imgObj+".src")
	}
}


// preloads the image objects for the changeRoll and changeMod functions
function preload_roll(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

// hides and shows layers by passing the layer name and the command
function MM_showHideLayers() { //v2.0
	var i, visStr, args, theObj;
	args = MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
		visStr   = args[i+2];
		if (NS) {
			theObj = eval(args[i]);
			if (theObj)
				theObj.visibility = visStr;
		}
		else if (IE || GECKO) {
			if (visStr == 'show')
				visStr = visible; //convert vals
			if (visStr == 'hide')
				visStr = hidden;
			theObj = eval(args[i+1]);
			if (theObj)
				theObj.style.visibility = visStr;
		}
	}
}		

function submitForm(name,id){
	if (NS) {
		if (id != null){ 
			document.layers["content"].document.forms[name].formid.value = id;
		}
		document.layers["content"].document.forms[name].submit();
	} else {  // A vérifier pour GECKO
		if (id != null){
			document.forms[name].formid.value = id;
		}
		document.forms[name].submit();
	}
}

// open an external url in a new browser window
// Passed values:
// ==============
// path = 				path of new window
// windowFeatures = 	optional values passed
// standardFeatures = 	instead of passing values, use default values
// 						with all properties set on. 
// 						You can pass width & string as arguments
// 						in a comma-separeted string.
//						Ex. '800,600' = width=800 & height=600.

function openExternalWindow(path, windowFeatures, standardFeatures) {
	if ( (windowFeatures == '' || windowFeatures == null) && !standardFeatures) {
		window.open(path, 'newWin');
	}
	else if (standardFeatures)
	{
		if (standardFeatures.length > 0) {
			if(standardFeatures.indexOf(",") > -1) {
				var size = standardFeatures.split(",");
				var w = parseInt(size[0]);
				var h = parseInt(size[1]); 
				if (IE) { 
					w += 12;
					h += 125;
				}
			}
		}
		else {
			var w = 800;
			var h = 600;
		}
		window.open(path, 'newWin', 'width='+w+',height='+h+',left=0, top=0, screenX=0, screenY=0, resizable=yes,scrollbars=yes,toolbar=yes,titlebar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes');
	}
	else {
		window.open(path, 'newWin', windowFeatures);
	}
}


// layer show/hide functions that work in all browsers (IE 4.x, NS 4.x & Netscape 6.x)
// Passed values:
// ==============
// object = 			layer name

function show(object) {
	if (GECKO) {
		document.getElementById(object).style.visibility = visible;
	}
	else if (NS && document.layers[object]) {
		document.layers[object].visibility = visible;
	}
	else if (IE) {
		document.all[object].style.visibility = visible;
	}
}

function hide(object) {
	if (GECKO) {
		document.getElementById(object).style.visibility = hidden;
	}
	else if (NS && document.layers[object]) {
		document.layers[object].visibility = hidden;
	}
	else if (IE) {
		document.all[object].style.visibility = hidden;
	}
}

// Layer Write Method
function LayerWrite(div, html, couleur) {
 if (IE) {
		document.all[div].innerHTML = html;
		document.all[div].style.backgroundColor=couleur;
	}
 else if (GECKO) {	
		document.getElementById(div).innerHTML = html;
		document.getElementById(div).style.backgroundColor=couleur;
	}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}


// -->
