$(document).ready(function(){
		   
	// Tabs On Load			   
	$("#posts-gallery-gadget .tab-content").hide(); //Hide all content
	$("#posts-gallery-gadget ul.tabs li:first").addClass("active").show(); //Activate first tab
	$("#posts-gallery-gadget .tab-content:first").show(); //Show first tab content

	// Tabs On Click
	$("#posts-gallery-gadget ul.tabs li").click(function() {

		$("#posts-gallery-gadget ul.tabs li.active").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$("#posts-gallery-gadget .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;
	});
	
	// Hover Menu
	$(".hover").mouseover(function(){
		$(this).addClass('active');
		$(this).removeClass('inactive');
		$('#top-stories').addClass('disable');
		$(this).children(".sub-nav").removeClass('inactive');
		$(this).children(".sub-nav").addClass('active');
	}).mouseout(function(){
		$(this).removeClass('active');
		$(this).addClass('inactive');
		$(this).children(".sub-nav").removeClass('active');
		$(this).children(".sub-nav").addClass('inactive');
		$('#top-stories').removeClass('disable');
	});
	
	// Fancybox Implementation
	$("a.mobile-link").fancybox({ 
		'width': 485,
		'height': 425, 
		'hideOnContentClick': false,
		'autoDimensions': false
	}); 
	
	$("div.gallery a").fancybox({
		'titleShow': false,
		'transitionIn': 'elastic',
		'transitionOut': 'elastic'
	});
	


// Retained from Bitstream 

  $("div.gallery-page").hide();
  $("div.specs").hide();
  $("a.gallery-page").click(function () { 
    $("div.gallery-page").show();
    $("div.specs").hide();
    $("div.review").hide();
    $(this).addClass("activate");
    $("a.specs").removeClass("activate");
    $("a.review").removeClass("activate");
  });
  $("a.specs").click(function () { 
    $("div.gallery-page").hide();
    $("div.specs").show();
    $("div.review").hide();
    $(this).addClass("activate");
    $("a.review").removeClass("activate");
    $("a.gallery-page").removeClass("activate");
  });
  $("a.review").click(function () { 
    $("div.gallery-page").hide();
    $("div.specs").hide();
    $("div.review").show();
    $(this).addClass("activate");
    $("a.specs").removeClass("activate");
    $("a.gallery-page").removeClass("activate");
  });
  			
 
});
 