function ImageTurnover(name, imgName, mapName) {
	function turnImg() {
		var found = document.cookie.indexOf(this.key);
		var intValue = 0;
		if (found != -1) {
			var n = (this.imgArray.length < 10) ? 1 : 2;
			var len = (this.key.length+1+n);
			var str = document.cookie.substr(found, len);
			var value = str.substr(str.length-n, n);
			intValue = parseInt(value, 10);
			if (intValue < this.imgArray.length-1) {
				intValue++;
			} else {
				intValue = 0;
			}
		}
		document.write('<img src="'+this.imgArray[intValue].src+'" name="hp_liste" width="' + this.imgArray[intValue].width + '" height="' + this.imgArray[intValue].height + '" border="0" usemap="#'+this.imgArray[intValue].useMap+'" id="hp_liste">');
		document.cookie = (this.key + "=" + (intValue) + ";");
	}
	this.turnImg = turnImg;
	
	function addImage(path, height, width, mapName) {
		var len = this.imgArray.length;
		this.imgArray[len] = new Image(width, height);
		this.imgArray[len].src = path;
		this.imgArray[len].useMap = mapName;
	}
	this.addImage = addImage;
	this.imgName = imgName;
	this.key = "imglst";
	this.imgArray = new Array();
}

var imgTurn = new ImageTurnover("imgTurn", "hp_liste", "liste");
imgTurn.addImage("/i/hp_liste1.gif", 124, 418, "liste");
imgTurn.addImage("/i/hp_liste2.gif", 124, 418, "liste2");
imgTurn.addImage("/i/hp_liste3.gif", 124, 418, "liste3");
imgTurn.addImage("/i/hp_liste4.gif", 124, 418, "liste3");

function winOpen(targ, loc) {
		if (!self[targ] || self[targ].closed) {
		self.widx = 660;
		self.heix = 600;
		var feax = "top=3,left=3,width=" + widx + ",height=" + heix + ",scrollbars=yes,resizable=no,location=no,menubar=no,toolbar=no";
		self[targ] = window.open(loc, targ, feax);
	}
}
function popup() {
	self.location.href = "/banner/banner_click.jhtml?idBanner=185";
}

function pop(n) {
	if (n) {
		self.pWin = window.open('/banner/banner_click.jhtml?idBanner='+n,'pWin','width=560,height=580,left=0,top=0,history=no,resizable=yes,status=no,scrollbars=yes,menubar=no,toolbar=no');
	} else {
		self.pWin = window.open('/banner/banner_click.jhtml?idBanner=194','pWin','width=560,height=580,left=0,top=0,history=no,resizable=yes,status=no,scrollbars=yes,menubar=no,toolbar=no');
	}
}

function trampOpen(src, name) {
	var feax = new Array(2);
	feax[(src.indexOf("132") == -1) && (src.indexOf("133") == -1) && (src.indexOf("145") == -1)] = 'width=560,height=700,scrollbars=no,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=30,top=30';
	feax[(src.indexOf("132") != -1) || (src.indexOf("133") != -1) || (src.indexOf("145") != -1)] = 'width=585,height=700,scrollbars=yes,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=30,top=30';
	feax[((src.indexOf("286") != -1) || (src.indexOf("311") != -1) || (src.indexOf("312") != -1))] = 'width=780,height=735,scrollbars=yes,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=0';
	if (self[name] && !self[name].closed) {
		self[name].close();
	}
	self[name] = window.open(src, name, feax[true]);
}
function trampup() {
	var feax = 'width=585,height=700,scrollbars=yes,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=30,top=30';
	if (self['New'] && !self['New'].closed) {
		self['New'].close();
	}
	self['New'] = window.open('/banner/banner_click.jhtml?idBanner=146', 'New', feax);
}
function ContainerManager() {
	function getDOMObj(DOM, objName) {
		if (document.all) {
			return DOM.all[objName];
		} else if (document.layers) {
			return DOM[objName];
		} else if (document.getElementById) {
			return DOM.getElementById(objName);
		}
	}
	function Container(idx, name, styleObj) {
		this.idx = idx;
		this.name = name;
		this.boxName = this.name+"Box";
		var outStr = " ";
		if (styleObj && styleObj != null && typeof(styleObj) == "object") {
			var x = 0;
			for (var el in styleObj) {
				var spc = (x == 0) ? "" : " ";
				outStr += (spc + el + "='" + styleObj[el] + "'");
				x++;
			}
		}
		this.style = (outStr.length > 1) ? outStr : "";
		this.domObj = null;
		function writeToDOM(content, win) {
			content = (content && content != null && content.length > 0) ? content : "&nbsp;";
			var out = "<" + this.box + " id='" + this.boxName + "' name='" + this.boxName + "'" + this.style + ">\n" + content + "</" + this.box + ">\n";
			if (win && win != null) {
				win.document.write(out);
				win.document.close();
				this.domObj = this.getDOMObj(win.document, this.boxName);
			} else {
				document.write(out);
				this.domObj = this.getDOMObj(document, this.boxName);
			}
		}
		this.writeToDOM = writeToDOM;
		function show() {
			if (this.domObj != null) {
				if (document.layers) {
					this.domObj.visibility = "show";
				} else {
					this.domObj.style.visibility = "visible";
				}
			}
		}
		this.show = show;
		function hide() {
			if (this.domObj != null) {
				if (document.layers) {
					this.domObj.visibility = "hide";
				} else {
					this.domObj.style.visibility = "hidden";
				}
			}
		}
		this.hide = hide;
		function fill(output) {
			if (this.domObj != null) {
				if (document.layers) {
					this.domObj.document.write(output);
					this.domObj.document.close();
				} else {
					this.domObj.innerHTML = output;
				}
			}
		}
		this.fill = fill;
	}

	function addContainer(name, styleObj, noReturn) {
		var idx = this.containers.length;
		this.containers[idx] = this.containers[name] = new Container(idx, name, styleObj);
		if (noReturn) {
			return this.containers[idx];
		}
	}
	this.addContainer = addContainer;
	function setContainer(name, styleObj) {
		return this.addContainer(name, styleObj, true);
	}
	this.setContainer = setContainer;
	function getBoxType() {
		if (document.layers) {
			return "layer";
		} else if (document.all || document.getElementById) {
			return "div";
		}
	}
	Container.prototype.box = getBoxType();
	Container.prototype.getDOMObj = getDOMObj;
	this.containers = new Array();
}
var boxManager = new ContainerManager();

function ContentRotator(name, container) {
	function ImagePosition(idx, src, width, height, link) {
		this.idx = idx;
		if (width != null && height != null) {
			this.width = width;
			this.height = height;
			this.img = new Image(this.width, this.height);
		} else {
			this.width = null;
			this.height = null;
			this.img = new Image();
		}
		this.img.src = src;
		this.link = link;
	}
	function addImage(src, width, height, link) {
		var imgArL = this.imagesStore.length;
		this.imagesStore[imgArL] = new ImagePosition(imgArL, src, width, height, link);
	}
	this.addImage = addImage;
	function removeImage(imageID) {
		if (imageID != null && imageID < this.imagesStore.length && this.imagesStore[imageID]) {
			this.imagesStore[imageID] = null;
		}
	}
	this.removeImage = removeImage;
	function startRotate(time) {
		if (time != null) {
			this.time = time;
			self[this.name+"Timer"] = self.setTimeout("self['" + this.name + "'].rotate(1)", this.time);
		}
	}
	this.startRotate = startRotate;
	function stopRotate() {
		self.clearTimeout(self[this.name+"Timer"]);
	}
	this.stopRotate = stopRotate;
	function rotate(idx) {
		if (this.imagesStore[idx] == null) {idx++;}
		var output = '<a href="'; 
		output += this.imagesStore[idx].link;
		output += '"><img src="' + this.imagesStore[idx].img.src + '" width="' + this.imagesStore[idx].img.width + '" height="' + this.imagesStore[idx].img.height + '" border="0"></a>\n';
		this.container.fill(output);
		var newIdx = (idx < (this.imagesStore.length-1)) ? (idx+1) : 0;
		self[this.name+"Timer"] = self.setTimeout("self['" + this.name + "'].rotate(" + newIdx + ")", this.time);
	}
	this.rotate = rotate;
	this.name = name;
	this.container = container;
	this.imagesStore = new Array();
}

function ImageRotator(name) {
	function ImagePosition(idx, src, width, height) {
		this.idx = idx;
		if (width != null && height != null) {
			this.width = width;
			this.height = height;
			this.img = new Image(this.width, this.height);
		} else {
			this.width = null;
			this.height = null;
			this.img = new Image();
		}
		this.img.src = src;
	}
	function addImage(src, width, height) {
		var imgArL = this.imagesStore.length;
		this.imagesStore[imgArL] = new ImagePosition(imgArL, src, width, height);
	}
	this.addImage = addImage;
	function removeImage(imageID) {
		if (imageID != null && imageID < this.imagesStore.length && this.imagesStore[imageID]) {
			this.imagesStore[imageID] = null;
		}
	}
	this.removeImage = removeImage;
	function startRotate(time) {
		if (time != null) {
			this.time = time;
			self[this.name+"Timer"] = self.setTimeout("self['" + this.name + "'].rotate(1)", this.time);
		}
	}
	this.startRotate = startRotate;
	
	function stopRotate() {
		self.clearTimeout(self[this.name+"Timer"]);
	}
	this.stopRotate = stopRotate;
	function rotate(idx) {
		if (this.imagesStore[idx] == null) {
			idx++;
		}
		document.images["img" + this.name].src = this.imagesStore[idx].img.src;
		var newIdx = (this.imagesStore.length < idx) ? (idx+1) : 0;
		self[this.name+"Timer"] = self.setTimeout("self['" + this.name + "'].rotate(" + newIdx + ")", this.time);
	}
	this.rotate = rotate;
	this.name = name;
	this.imagesStore = new Array();
}
