/* ------------------------------------------------------------------------
	s3Slider
	
	Developped By: Boban Karišik -> http://www.serie3.info/
        CSS Help: Mészáros Róbert -> http://www.perspectived.com/
	Version: 1.0
	
	Copyright: Feel free to redistribute the script/modify it, as
			   long as you leave my infos at the top.
------------------------------------------------------------------------- */
(function(A){A.fn.s3Slider=function(H){var E=this;var L=(H.timeOut!=undefined)?H.timeOut:4000;var G=null;var D=null;var K=true;var F=false;var I=A("#"+E[0].id+"Content ."+E[0].id+"Image");var B=A("#"+E[0].id+"Content ."+E[0].id+"Image span");I.each(function(M){A(I[M]).mouseover(function(){F=true});A(I[M]).mouseout(function(){F=false;C(true)})});var C=function(M){var N=(M)?(L/2):L;N=(K)?10:N;if(I.length>0){D=setTimeout(J,N)}else{console.log("Poof..")}};var J=function(){G=(G!=null)?G:I[(I.length-1)];var M=jQuery.inArray(G,I)+1;M=(M==I.length)?0:(M-1);var N=A(E).width()*M;if(K==true){if(!F){A(I[M]).fadeIn((L/6),function(){if(A(B[M]).css("bottom")==0){A(B[M]).slideUp((L/6),function(){K=false;G=I[M];if(!F){C(false)}})}else{A(B[M]).slideDown((L/6),function(){K=false;G=I[M];if(!F){C(false)}})}})}}else{if(!F){if(A(B[M]).css("bottom")==0){A(B[M]).slideDown((L/6),function(){A(I[M]).fadeOut((L/6),function(){K=true;G=I[(M+1)];if(!F){C(false)}})})}else{A(B[M]).slideUp((L/6),function(){A(I[M]).fadeOut((L/6),function(){K=true;G=I[(M+1)];if(!F){C(false)}})})}}}};J()}})(jQuery);