/* Copyright (c) 2008 Kean Loong Tan http://www.gimiti.com/kltan
 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * jFlow
 * Version: 1.1 (May 22, 2008)
 * Requires: jQuery 1.2+
 */
(function(A){A.fn.jFlow=function(D){var E=A.extend({},A.fn.jFlow.defaults,D);var F=0;var B=A(E.flow).length;A(this).find(E.flow).each(function(G){A(this).click(function(){A(E.flow).removeClass(E.step);A(this).addClass(E.step);var H=Math.abs(F-G);A(E.slides).animate({marginLeft:"-"+(G*A(E.slides).find(":first-child").width()+"px")},E.duration*(H));F=G})});A(E.slides).before(E.ext).appendTo(E.ind);A(E.slides).find("div").each(function(){A(this).before(E.ext2).appendTo(A(this).prev())});A(E.flow).eq(F).addClass(E.step);var C=function(G){A(E.ind).css({position:"relative",width:E.width,overflow:"hidden"});A(E.slides).css({position:"relative",width:A(E.ind).width()*A(E.flow).length+"px",height:A(E.ind).height()+"px",overflow:"hidden"});A(E.slides).children().css({position:"relative",width:A(E.ind).width()+"px",height:A(E.ind).height()+"px","float":"left"});A(E.slides).css({marginLeft:"-"+(F*A(E.slides).find(":first-child").width()+"px")})};C();A(window).resize(function(){C()});A(".jFlowPrev").click(function(){if(F>0){F--}else{F=B-1}A(E.flow).removeClass(E.step);A(E.slides).animate({marginLeft:"-"+(F*A(E.slides).find(":first-child").width()+"px")},E.duration);A(E.flow).eq(F).addClass(E.step)});A(E.next).click(function(){if(F<B-1){F++}else{F=0}A(E.flow).removeClass(E.step);A(E.slides).animate({marginLeft:"-"+(F*A(E.slides).find(":first-child").width()+"px")},E.duration);A(E.flow).eq(F).addClass(E.step)})};A.fn.jFlow.defaults={easing:"swing",duration:400,width:"100%"}})(jQuery);


