(function(){jQuery.fn.jqContentSlider=function(configs){var autoRun,currentSlide,childs,totChilds;configs=jQuery.extend({animSpeed:600,prev:'',next:'',autoSlide:false,autoSlideInterval:1000,autoSlideElement:'',autoSlideDirection:'next',slideNavigation:false,slideNavigationElement:'',buildNavigation:true,setNavigationElementWidth:true,stopAutoSlideWhenClick:false,startSlide:1,msiedetection:true},configs);return this.each(function(){childs=jQuery(this).children().hide();jQuery(childs[configs.startSlide-1]).show();currentSlide=configs.startSlide;totChilds=childs.length;if(configs.prev!=''){jQuery(configs.prev).click(function(){if(configs.autoSlide){clearInterval(autoRun);}
prevSlide();});};if(configs.next!=''){jQuery(configs.next).click(function(){if(configs.autoSlide){clearInterval(autoRun);}
nextSlide();});};if(configs.autoSlide){AutoSlide();};if(configs.autoSlideElement!=''){var i=-1;jQuery(configs.autoSlideElement).hover(function(){++i;if(i==0){if(configs.autoSlideDirection=='prev'){prevSlide();}
else if(configs.autoSlideDirection=='next'){nextSlide();}}
AutoSlide();},function(){i=-1;clearInterval(autoRun);});};if(configs.slideNavigation&&configs.slideNavigationElement!=''){if(configs.buildNavigation){childs.each(function(i){var elemClass;if(i==(configs.startSlide-1)){elemClass='sel';}
else{elemClass='unsel';}
jQuery(configs.slideNavigationElement).append(jQuery('<li></li>').html('<a class="'+elemClass+'"href="#" rel="'+i+'"></a>'));});if(configs.setNavigationElementWidth){var ulChilds=jQuery(configs.slideNavigationElement).children().length;var childWidth=jQuery(configs.slideNavigationElement+' li:last').outerWidth(true);jQuery(configs.slideNavigationElement).width(parseInt((ulChilds*childWidth),10));}}else{jQuery(configs.slideNavigationElement+' li:eq('+(configs.startSlide-1)+') a').attr('class','sel');}
jQuery(configs.slideNavigationElement+' li a').click(function(){clearInterval(autoRun);var that=jQuery(this);if(configs.msiedetection&&jQuery.browser.msie){jQuery(childs[currentSlide-1]).hide();}
else{jQuery(childs[currentSlide-1]).fadeOut('fast','linear');}
jQuery(configs.slideNavigationElement+' li a.sel').attr('class','unsel');currentSlide=parseInt(that.attr('rel'),10)+1;if(configs.msiedetection&&jQuery.browser.msie){jQuery(childs[currentSlide-1]).show();}
else{jQuery(childs[currentSlide-1]).fadeIn(configs.animSpeed,'linear');}
that.attr('class','sel');if(configs.autoSlide&&!configs.stopAutoSlideWhenClick){AutoSlide();}
return false;});};function prevSlide(){if(currentSlide==1){currentSlide=totChilds;if(configs.msiedetection&&jQuery.browser.msie){jQuery(childs[0]).hide();jQuery(childs[currentSlide-1]).show();}
else{jQuery(childs[0]).fadeOut('fast','linear');jQuery(childs[currentSlide-1]).fadeIn(configs.animSpeed,'linear');}
if(configs.slideNavigation&&configs.slideNavigationElement!=''){SlideNavigationCurrent(currentSlide-1);}}
else{if(configs.msiedetection&&jQuery.browser.msie){jQuery(childs[currentSlide-1]).hide();jQuery(childs[currentSlide-2]).show();}
else{jQuery(childs[currentSlide-1]).fadeOut('fast','linear');jQuery(childs[currentSlide-2]).fadeIn(configs.animSpeed,'linear');}
if(configs.slideNavigation&&configs.slideNavigationElement!=''){SlideNavigationCurrent(currentSlide-2);}
currentSlide--;}};function nextSlide(){if(currentSlide==totChilds){currentSlide=1;if(configs.msiedetection&&jQuery.browser.msie){jQuery(childs[totChilds-1]).hide();jQuery(childs[currentSlide-1]).show();}
else{jQuery(childs[totChilds-1]).fadeOut('fast','linear');jQuery(childs[currentSlide-1]).fadeIn(configs.animSpeed,'linear');}
if(configs.slideNavigation&&configs.slideNavigationElement!=''){SlideNavigationCurrent(currentSlide-1);}}
else{if(configs.msiedetection&&jQuery.browser.msie){jQuery(childs[currentSlide-1]).hide();jQuery(childs[currentSlide]).show();}
else{jQuery(childs[currentSlide-1]).fadeOut('fast','linear');jQuery(childs[currentSlide]).fadeIn(configs.animSpeed,'linear');}
if(configs.slideNavigation&&configs.slideNavigationElement!=''){SlideNavigationCurrent(currentSlide);}
currentSlide++;}};function AutoSlide(){if(configs.autoSlideDirection=='prev'){autoRun=setInterval(function(){prevSlide()},configs.autoSlideInterval);}
else if(configs.autoSlideDirection=='next'){autoRun=setInterval(function(){nextSlide()},configs.autoSlideInterval);}};function SlideNavigationCurrent(toCompare){jQuery(configs.slideNavigationElement+' li a.sel').attr('class','unsel');jQuery(configs.slideNavigationElement+' li a').filter(function(i){return(parseInt(jQuery(this).attr('rel'),10)==(toCompare))?true:false;}).attr('class','sel');};});};})(jQuery);
