<!--
	
	/*   PARTOUCHE POKER TOUR   */
	/*     GROUPE PARTOUCHE     */
	
	/* Libraire necessaire : jQuery */
	
	EventSlider = function(fParams) {
		
		this.n = fParams["name"];
		this.width = fParams["width"];
		
		this.container = "";
		this.loader = "";
		
		this.items = new Array();
		this.currentplay = 0;
		this.uid = new Date().getTime();
		
		this.add = function(fSrc,fLink,fTarget) {
			
			fSrc    = fSrc    ? fSrc    : "" ;
			fLink   = fLink   ? fLink   : "" ;
			fTarget = fTarget ? fTarget : "_self" ;
			
			this.items.push({ src:fSrc , link:fLink , target:fTarget });
			
		};
		
		this.init = function(fParams) {
			
			var myContainer = this.e(this.container);
			var myLoader = this.e(this.loader);
			
			var playMe = 0;
			if (fParams != null) {
				playMe = fParams["item"] ? fParams["item"] : 0 ;
			}
			
			this.currentplay = playMe;
			
			var myStr = "";
			for ( var i = 0 ; i < this.items.length ; i++ ) {
				if (this.items[i]["link"] != "") myStr += "<a href=\"" + this.items[i]["link"] + "\" target=\"" + this.items[i]["target"] + "\">";
				myStr += "<img src=\"" + this.items[i]["src"] + "\" alt=\"\" id=\"pic_" + this.uid + "_" + i + "\" />";
				if (this.items[i]["link"] != "") myStr += "</a>";
			}
			myLoader.innerHTML = myStr;
			for ( var i = 0 ; i < this.items.length ; i++ ) {
				$(this.e("pic_" + this.uid + "_" + i)).css({ opacity:0 });
				this.e("pic_" + this.uid + "_" + i).onload = function() {
					$(this).fadeTo("slow",1);
				};
			}
			
			myLoader.style.width = ( this.width * this.items.length ) + "px";
			
			myLoader.style.left = (playMe * this.width * -1) + "px";
			
		};
		
		this.goPrevious = function() {
			
			if (this.currentplay > 0) {
				
				this.currentplay--;
				
				var myLoader = this.e(this.loader);
				var myPos = this.currentplay * this.width * -1;
				$(myLoader).animate({ "left":myPos + "px" },{ duration: "normal" });
				
			}
			
		};
		
		this.goNext = function() {
			
			if (this.currentplay < this.items.length - 1) {
				
				this.currentplay++;
				
				var myLoader = this.e(this.loader);
				var myPos = this.currentplay * this.width * -1;
				$(myLoader).animate({ "left":myPos + "px" },{ duration: "normal" });
				
			}
			
		};
		
		this.e = function(fObj) { return( typeof(fObj) == "object" ? fObj : document.getElementById(fObj) ); }
		
	};
	
-->