var browserName = navigator.appName; 
var browserVer = parseInt(navigator.appVersion); 
var ns = (browserName == "Netscape" && browserVer <6);
var mz = (browserName == "Mozilla");
var Kq = (browserName == "Konqueror");
var Sa = (browserName == "Safari");
var ie4 = (browserName == "Microsoft Internet Explorer") && navigator.appVersion.indexOf('MSIE 4')>0;
var ie5 = (browserName == "Microsoft Internet Explorer") && navigator.appVersion.indexOf('MSIE 5')>0;
var ie = (browserName == "Microsoft Internet Explorer");


function ObjPreload(ImgOn, ImgOff){
	this.ImgOn = new Image();
	this.ImgOff = new Image();	
	this.ImgOn.src = ImgOn;
	this.ImgOff.src = ImgOff;
}

function ObjImg(LayerName, ImgName, ObjPreload){
	this.ImgName = ImgName;
	this.RollOn = RollOn;	
	this.RollOff = RollOff;	
	if (LayerName !== null){
		if (ns){
			this.LayerRoll = document.layers[LayerName];
			this.RollOn = RollOnN;
			this.RollOff = RollOffN;
		}
	}
	this.ObjPreload = ObjPreload;
}

function RollOnN(){
     this.LayerRoll.document[this.ImgName].src = this.ObjPreload.ImgOn.src;
}

function RollOn(){
     document[this.ImgName].src = this.ObjPreload.ImgOn.src;
}

function RollOffN(){
     this.LayerRoll.document[this.ImgName].src = this.ObjPreload.ImgOff.src;
}

function RollOff(){
     document[this.ImgName].src = this.ObjPreload.ImgOff.src;
}

//Permet de creer un objet Layer
function CreateLayer(id, Nested){
// Properties
	if(ns){
		//this.LeLayer = (Nested!==null)? document.layers[Nested].document.layers[id] : document.layers[id];
		//this.doc = this.LeLayer.document;
		this.LeLayer = document.all[id].style;
		this.doc = document.all[id]
	}else if (ie){
		this.LeLayer = document.all[id].style;
		this.doc = document.all[id]
	}
	
	
	
		this.id = id;
		this.x = this.LeLayer.left;
		this.y = this.LeLayer.top;
		this.EtatVisibility = this.LeLayer.visibility;
		this.Obj = "Layer"+id;
		this.cibleY = 0;
		this.vitesseY = 0;
		this.cibleX = 0;
		this.vitesseX = 0;
		this.SlideActive = false;
// Methods
		this.Show = ShowLayer;
		this.Hide = HideLayer;
}

//Show method
function ShowLayer(){
	this.LeLayer.visibility = "visible";
}

//Hide method
function HideLayer(){
	this.LeLayer.visibility = "hidden";
}