var activeSub=0;
var SubNum=0;

//Define global variables

var timerID = null;
var timerOn = false;
var timecount = 1000;
var what = null;
var newbrowser = true;
var check = false;

var x, y;
var xLayer, yLayer;

function init() {
	//Mouse Position
	//Mis en commentaire à cause que ça cause un bug JS dans Axis.
	/*
	if (window.Event) {
		document.captureEvents(Event.MOUSEMOVE);
	}
	document.onmousemove = getXY;
	*/
	//END MOUSE POSITION

	if (document.layers) {
		//alert ("Running Netscape 4");
		layerRef="document.layers";
		styleSwitch="";
		visibleVar="show";
		//screenSize = window.innerWidth;
		what ="ns4";
	} else if(document.all){
		//alert ("Running IE");
		layerRef="document.all";
		styleSwitch=".style";
		visibleVar="visible";
		//screenSize = document.body.clientWidth + 18;
		what ="ie";
	} else if(document.getElementById){
		//alert ("Running Netscape 6");
		layerRef="document.getElementByID";
		styleSwitch=".style";
		visibleVar="visible";
		what="moz";
	} else{
		//alert("Older than 4.0 browser.");
		what="none";
		newbrowser = false;
	}

	//window.status='status bar text to go here';
	check = true;
}

// Turns the layers on and off
function showLayer(layerName){
	//unused in AxisTemplate
}
function showLayerPage(layerName, anchorName){
	//unused in AxisTemplate
}
		
function showLayerPosition(layerName, anchorName){
	getXY_Anchor2(anchorName);
	if(check){
		if (what =="none"){
			return;
		} else if (what == "moz"){
			document.getElementById(layerName).style.visibility="visible";
			document.getElementById(layerName).style.top = yLayer+"px";
			document.getElementById(layerName).style.left = xLayer+"px";
		} else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top='+yLayer);
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left='+xLayer);
		}
	} else { // alert ("Please wait for the page to finish loading.");
		return;
	}
}
		
function showLayerPositionLeft(layerName, anchorName){
	//unused in AxisTemplate
}

function hideLayer(layerName){
	if(check){
		if (what =="none"){
			return;
		} else if (what == "moz"){
			document.getElementById(layerName).style.visibility="hidden";
		} else{
          eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
		}
	}
	else {// alert ("Please wait for the page to finish loading.");
		return;
	}
}

function startTime() {
    if (timerOn == false) {
        timerID=setTimeout( "hideAll()" , timecount);
        timerOn = true;
    }
}
function stopTime() {
    if (timerOn) {
        clearTimeout(timerID);
        timerID = null;
        timerOn = false;
    }
}

function onLoad(){
	//unused in AxisTemplate
}
function getXY_Anchor(anchorName) {
	//unused in AxisTemplate
}
		
function getXY_Anchor2(anchorName) {
	var coordinates=new Object();

	coordinates = getAnchorPosition(anchorName);
	y = coordinates.y-3;
	x = coordinates.x-3;
	
	xLayer = x ;
	yLayer = y ;
}
	
function getXY_Anchor3(anchorName) {
	//unused in AxisTemplate
}
function getXY(e) {
	x = (window.Event) ? e.pageX : event.clientX;
	y = (window.Event) ? e.pageY : event.clientY;

	xLayer = x + 50 ;
	yLayer = y ;

	//window.status = "xMousePos=" + xLayer + ", yLayer=" + yLayer ;
}

init();