jQuery(document).ready(function() {
   
	jQuery('.project-item').hover(function(){
		jQuery(this).children(".project-info").fadeTo("fast", 0.9);
	   
	}, function() {
	    jQuery(".project-info", this).stop().fadeTo("slow", 0);

	});
	
	jQuery('.grid-item').hover(function(){
		jQuery(this).children(".grid-info").fadeTo("fast", 0.9);
	   
	}, function() {
	    jQuery(".grid-info", this).stop().fadeTo("slow", 0);

	});
	
	jQuery("#toggle-l1").click(function(){
		jQuery(".t1-slide-1").toggle("fast");
		jQuery(".t2-slide-1").toggle("fast");
		jQuery(this).toggleClass("active"); return false;
		
	});
	
	jQuery("#toggle-l2").click(function(){
		jQuery(".t1-slide-2").toggle("fast");
		jQuery(".t2-slide-2").toggle("fast");
		jQuery(this).toggleClass("active"); return false;
		
	});
	
	jQuery("#toggle-l3").click(function(){
		jQuery(".t1-slide-3").toggle("fast");
		jQuery(".t2-slide-3").toggle("fast");
		jQuery(this).toggleClass("active"); return false;
		
	});
	
	jQuery("#toggle-l4").click(function(){
		jQuery(".t1-slide-4").toggle("fast");
		jQuery(".t2-slide-4").toggle("fast");
		jQuery(this).toggleClass("active"); return false;
		
	});
	
	jQuery(".theme-toggle-fade").click(function(){
		jQuery(".t1-slide").fadeToggle("slow", "linear");
		
	});
	
	
	
	
	 jQuery('div.hide-show:eq(0)> div:gt(0)').hide();  
	 
	jQuery('div.hide-show:eq(0)> h3').click(function() {
	    jQuery(this).next('div:hidden').slideDown('fast')
	    .siblings('div:visible').slideUp('fast');
	  });
	
	
				
	/* Initialize Tabs */
	jQuery("#tabs-main").tabs("#main-tabs > div");
	jQuery("#tabs-1").tabs("#tabPanes-1 > div", { effect: 'fade' });
	jQuery("#tabs-2").tabs("#tabPanes-2 > div", { effect: 'fade' });
	jQuery("#tabs-media").tabs("#tabPanes-side > div", { effect: 'fade' });
	jQuery("#tabs-side-cal").tabs("#tabPanes-side-cal > div", { effect: 'fade' });

	
		jQuery("div.scrollable").scrollable({size:1, easing: 'custom', speed: 700, circular: true}).autoscroll(4000);
		
		jQuery("div.navi a").each(function(i) { 
			 jQuery(this).html('Tab ' + (i+1)); 
			}); 
		

		jQuery.easing.custom = function (x, t, b, c, d) {
			if (t == 0) return b;
			if (t == d) return b + c;
			if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
			return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
		};

		jQuery.easing.quart = function (x, t, b, c, d) {
			return -c * ((t=t/d-1)*t*t*t - 1) + b;
		};

			
		
	
		
		/* Initialize Scrollable "Coda Slider" */
		jQuery("div.scroll-2").scrollable({size:1, easing: 'custom', speed: 700, circular: true}).navigator({

		// select #flowtabs to be used as navigator
		navi: "#flowtabs",
		// select A tags inside the navigator to work as items (not direct children)
		naviItem: 'a',
		// assign "current" class name for the active A tag inside navigator
		activeClass: 'current',
		// make browser's back button work
		history: true
		
	});
	
 	jQuery('a[href=#head]').click(function(){
        jQuery('html, body').animate({scrollTop:0}, 'quart');
        return false;
    });
	
	jQuery("a#[rel=group]").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titlePosition' 	: 'inside',
		
	});
    

});


