jQuery(document).ready(function(){ var items = jQuery('.featured li'); var item_width = 568; var max_margin = items.length * item_width - item_width; var animstatus = false; var user_click = false; var animation_speed = 1000; var auto_speed = 4500; jQuery('.featured .fthumbs a').each(function(i,link) { var index = i+1; jQuery(link).click(function(e) { e.preventDefault(); user_click = true; moveFeature(index); }); }); function moveFeature(location) { if(animstatus == false) { animstatus = true; var feature = jQuery('.featured ul'); var pos = parseInt(jQuery(feature).css('left')); if(location) { if(location=='next') { if(pos == -max_margin){ left = 0; } else { left = pos-item_width; } } else if(location=='back') { if(pos == 0){ left = -max_margin; } else { left = pos+item_width; } } else { left = -(item_width*location)+item_width; } var item = Math.abs(left/item_width); jQuery('.featured .fthumbs a img').removeClass('active'); jQuery('.featured .fthumbs a:eq('+item+') img').addClass('active'); feature.animate({left: left},animation_speed,"swing",function() { animstatus = false; }); } } } function feature_automove() { if(user_click == true) { user_click = false; } else { moveFeature('next'); } } var feature_auto = setInterval(feature_automove, auto_speed); });
$(function () {var tabContainers = $('div#tabs > div');tabContainers.hide().filter(':first').show();$('div#tabs ul.boks-nav a').click(function () {tabContainers.hide();tabContainers.filter(this.hash).show();$('div#tabs ul.boks-nav a').removeClass('selectedd');$(this).addClass('selectedd');return false;}).filter(':first').click();});