/* bxcarousel v1.0 plugin developed by: steven wanderski */ (function($){$.fn.bxcarousel=function(options){var defaults={move:3,display_num:4,speed:500,margin:0,auto:false,auto_interval:5000,auto_dir:'next',auto_hover:false,next_text:'next',next_image:'',prev_text:'prev',prev_image:'',controls:true};var options=$.extend(defaults,options);return this.each(function(){var $this=$(this);var li=$this.find('li');var first=0;var fe=0;var last=options.display_num-1;var le=options.display_num-1;var is_working=false;var j='';var clicked=false;li.css({'float':'left','liststyle':'none','marginright':options.margin});var ow=li.outerwidth(true);wrap_width=(ow*options.display_num)-options.margin;var seg=ow*options.move;$this.wrap('
').width(999999);if(options.controls){if(options.next_image!=''||options.prev_image!=''){var controls='';} else{var controls=''+options.prev_text+''+options.next_text+'';}} $this.parent('.bx_container').wrap('').css({'position':'relative','width':1200,'overflow':'hidden'}).before(controls);var w=li.slice(0,options.display_num).clone();var last_appended=(options.display_num+options.move)-1;$this.empty().append(w);get_p();get_a();$this.css({'position':'relative','left':-(seg)});$this.parent().siblings('.next').click(function(){slide_next();clearinterval(j);clicked=true;return false;});$this.parent().siblings('.prev').click(function(){slide_prev();clearinterval(j);clicked=true;return false;});if(options.auto){start_slide();if(options.auto_hover&&clicked!=true){$this.find('li').live('mouseenter',function(){if(!clicked){clearinterval(j);}});$this.find('li').live('mouseleave',function(){if(!clicked){start_slide();}});}} function start_slide(){if(options.auto_dir=='next'){j=setinterval(function(){slide_next()},options.auto_interval);}else{j=setinterval(function(){slide_prev()},options.auto_interval);}} function slide_next(){if(!is_working){is_working=true;set_pos('next');$this.animate({left:'-='+seg},options.speed,function(){$this.find('li').slice(0,options.move).remove();$this.css('left',-(seg));get_a();is_working=false;});}} function slide_prev(){if(!is_working){is_working=true;set_pos('prev');$this.animate({left:'+='+seg},options.speed,function(){$this.find('li').slice(-options.move).remove();$this.css('left',-(seg));get_p();is_working=false;});}} function get_a(){var str=new array();var lix=li.clone();le=last;for(i=0;i