(function($) {

	$.fn.passosNav = function(options) {
	
		options = $.extend({
			overlap : 20,
			speed : 500,
			reset : 1500,
			//color : 'transparent',
			easing : 'easeOutExpo'
		}, options);
	
		return this.each(function() {
		
		 	var nav = $(this),
		 		currentPageItem = $('#here', nav),
		 		blob,
		 		reset;
		 		
		 	$('<li id="blob"></li>').css({
		 		//width : currentPageItem.outerWidth(),
		 		//height : currentPageItem.outerHeight() + options.overlap,
		 		left : currentPageItem.position().left,
		 		top : currentPageItem.position().top - options.overlap / 2,
		 		//backgroundColor : options.color
		 	}).appendTo(this);
		 	
		 	blob = $('#blob', nav);
					 	
			$('.active', nav).hover(function() {
				// mouse over
				clearTimeout(reset);
				blob.animate(
					{
						left : $(this).position().left,
						//width : $(this).width()
					},
					{
						duration : options.speed,
						easing : options.easing,
						queue : false
					}
				);
			}, function() {
				// mouse out	
				reset = setTimeout(function() {
					blob.animate({
						//width : currentPageItem.outerWidth(),
						left : currentPageItem.position().left
					}, options.speed)
				}, options.reset);
				
			});
		 
		
		}); // end each
	
	};

})(jQuery);

jQuery.fn.shineWarn = function() {
	$(this).hover( function() {
		$(".warn").animate({ color: "#CC0000" }, 800 );		
		$(this).stop(true, false).animate({ backgroundColor: "#CC0000", color: "#FFFFFF" }, 800 ).css('cursor','help');	
	 }, function() {
		$(".warn").animate({ color: "#000000" }, 300 );
		$(this).stop(true, false).animate({ backgroundColor: "#F8F8F8", color: "#000000" }, 300 ).css('cursor','default');	
	 }
	);
}

$(document).ready(function(){

	//When page loads...
	$(".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 href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

	$('#nav-socio').passosNav();
	$('.warning-box').shineWarn();

	$('.exp-list .exp-list-trigger').click(function() {
		$(this).next().slideToggle('slow');
		return false;
	}).next().hide();
	
    $('.exp-list .exp-list-triggerLabel : radiobox').click(function(event) {
            if( $(this).attr("checked")){
                       $(this).parents(".exp-list-triggerLabel").next().slideDown('slow');
                } else{
                       $(this).parents(".exp-list-triggerLabel").next().slideUp('slow');
                       }
    }).parents(".exp-list-triggerLabel").next().hide();
});

