// JavaScript Config
// Copyright © MMX - nwonline.co.uk


// Homepage Slider - www.css-tricks.com
function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",
                autoPlay: false,
                delay: 2000,
                startStopped: true,
                animationTime: 500,
                hashTags: false, 
                buildNavigation: false,
        		pauseOnHover: true, 
        		startText: "",  
		        stopText: "",
		        navigationFormatter: formatText  
            });
            
            $("#slide-jump").click(function(){
			$('.anythingSlider').anythingSlider(6);
	});
            
});

// Input Clear Contents
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

//Tabs
$(document).ready(function() {
	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
 
});

$(function() {
	$('#container-1').tabs();
	$('#container-2').tabs();
});

// redefine Cycle's updateActivePagerLink function
$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
    $(pager).find('li').removeClass('activeLI')
        .filter('li:eq('+currSlideIndex+')').addClass('activeLI');
};
 
$(function() {
    $('#slideshow_001').cycle({
        timeout: 0,
        pager:  '#thumbnails_001',
        pagerAnchorBuilder: function(idx, slide) {
            return '<li><a href="#"><img src="' + slide.src + '" /></a></li>';
        }
    });
});

