<!--
	
	/*   PARTOUCHE POKER TOUR   */
	/*     GROUPE PARTOUCHE     */
	
	/* Libraire necessaire : jQuery */
	
	PageSlider = function(fParams) {
		
		this.n = fParams["name"];
		
		this.container = "";
		this.loader = "";
		this.loading = "";
		
		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) {
			
			if (!fParams) {
				var fParams = new Array();
			}
			
			this.currentplay = fParams["item"] ? fParams["item"] : 0 ;
			
			var myContainer = this.e(this.container);
			var myLoader = this.e(this.loader);
			var myLoading = this.e(this.loading);
			
			var myStr = "";
			if (this.items[this.currentplay]["link"] != "") myStr += "<a href=\"" + this.items[this.currentplay]["link"] + "\" target=\"" + this.items[this.currentplay]["target"] + "\">";
			myStr += "<img src=\"" + this.items[this.currentplay]["src"] + "\" alt=\"\" id=\"pic_" + this.uid + "\" />";
			if (this.items[this.currentplay]["link"] != "") myStr += "</a>";
			myLoader.innerHTML = myStr;
			
			$(myLoader).css({ left:0 });
			$(myLoading).hide();
			
			$(this.e("pic_" + this.uid)).css({ opacity:0 });
			this.e("pic_" + this.uid).onload = function() {
				$(this).fadeTo("slow",1);
			};
			
		};
		
		this.goPrevious = function() {
			
			if (this.currentplay > 0) {
				
				this.currentplay--;
				
				var myContainer = this.e(this.container);
				var myLoader = this.e(this.loader);
				var myLoading = this.e(this.loading);
				
				var myStr = "";
				if (this.items[this.currentplay]["link"] != "") myStr += "<a href=\\\"" + this.items[this.currentplay]["link"] + "\\\" target=\\\"" + this.items[this.currentplay]["target"] + "\\\">";
				myStr += "<img src=\\\"" + this.items[this.currentplay]["src"] + "\\\" alt=\\\"\\\" id=\\\"pic_" + this.uid + "\\\" />";
				if (this.items[this.currentplay]["link"] != "") myStr += "</a>";
				
				var myAction = "";
				myAction += "$(myLoader).fadeTo(\"slow\",0,function() {";
				myAction += "   "+this.n+".e("+this.n+".loader).innerHTML = \""+myStr+"\";";
				//myAction += "   $("+this.n+".e("+this.n+".loader)).css({ \"left\":\"-"+myContainer.offsetWidth+"px\" });";
				//myAction += "   $("+this.n+".e("+this.n+".loader)).css({ \"opacity\":\"1\" });";
				myAction += "   $("+this.n+".e("+this.n+".loading)).fadeIn(\"slow\");";
				myAction += "   "+this.n+".e(\"pic_\" + "+this.n+".uid).onload = function() {";
				myAction += "      $("+this.n+".e("+this.n+".loader)).stop();";
				//myAction += "      $("+this.n+".e("+this.n+".loader)).animate({ \"left\":\"0px\" , \"opacity\":\"1\" },{ duration: \"slow\" });";
				myAction += "      $("+this.n+".e("+this.n+".loader)).animate({ \"opacity\":\"1\" },{ duration: \"slow\" });";
				myAction += "      $("+this.n+".e("+this.n+".loading)).fadeOut(\"fast\");";
				myAction += "   };";
				myAction += "   ";
				myAction += "   ";
				myAction += "   ";
				myAction += "});";
				eval(myAction);
				
			}
			
		};
		
		this.goNext = function() {
			
			if (this.currentplay < this.items.length - 1) {
				
				this.currentplay++;
				
				var myContainer = this.e(this.container);
				var myLoader = this.e(this.loader);
				var myLoading = this.e(this.loading);
				
				var myStr = "";
				if (this.items[this.currentplay]["link"] != "") myStr += "<a href=\\\"" + this.items[this.currentplay]["link"] + "\\\" target=\\\"" + this.items[this.currentplay]["target"] + "\\\">";
				myStr += "<img src=\\\"" + this.items[this.currentplay]["src"] + "\\\" alt=\\\"\\\" id=\\\"pic_" + this.uid + "\\\" />";
				if (this.items[this.currentplay]["link"] != "") myStr += "</a>";
				
				var myAction = "";
				myAction += "$(myLoader).fadeTo(\"slow\",0,function() {";
				myAction += "   "+this.n+".e("+this.n+".loader).innerHTML = \""+myStr+"\";";
				//myAction += "   $("+this.n+".e("+this.n+".loader)).css({ \"left\":\""+myContainer.offsetWidth+"px\" });";
				//myAction += "   $("+this.n+".e("+this.n+".loader)).css({ \"opacity\":\"1\" });";
				myAction += "   $("+this.n+".e("+this.n+".loading)).fadeIn();";
				myAction += "   "+this.n+".e(\"pic_\" + "+this.n+".uid).onload = function() {";
				myAction += "      $("+this.n+".e("+this.n+".loader)).stop();";
				//myAction += "      $("+this.n+".e("+this.n+".loader)).animate({ \"left\":\"0px\" , \"opacity\":\"1\" },{ duration: \"slow\" });";
				myAction += "      $("+this.n+".e("+this.n+".loader)).animate({ \"opacity\":\"1\" },{ duration: \"slow\" });";
				myAction += "      $("+this.n+".e("+this.n+".loading)).fadeOut(\"slow\");";
				myAction += "   };";
				myAction += "   ";
				myAction += "   ";
				myAction += "   ";
				myAction += "});";
				eval(myAction);
				
			}
			
		};
		
		this.e = function(fObj) { return( typeof(fObj) == "object" ? fObj : document.getElementById(fObj) ); }
		
	};
	
-->
