jQuery.noConflict();

jQuery(document).ready(function(){	
	menu_init();

	//When page loads...
	jQuery(".tab_content").hide(); //Hide all content
	jQuery("div#tabs a:first").addClass("active").show(); //Activate first tab
	jQuery(".tab_content:first").show(); //Show first tab content

	//On Click Event
	jQuery("div#tabs a").click(function() {

		jQuery("div#tabs a").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".tab_content").hide(); //Hide all tab content

		var activeTab = jQuery(this).attr("href"); //Find the href attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active ID content
			
		Scroller.resetToTop();	
			
		return false;
	});


});

function menu_init()
{	
	jQuery(" #topnav-menu ul ").css({display: "none"}); // Opera Fix
	
	jQuery("#topnav-menu li").each(function()
	{	
		var $sublist = jQuery(this).find('ul:first');
		
		var the_width = jQuery(this).find("a").width();
		var child_width = $sublist.width();
		var width = parseInt((child_width - the_width)/2);
		$sublist.css('left', -width);
	
		jQuery(this).hover(function(width)
		{	
			$sublist.stop().css({overflow:"hidden", height:"auto", display:"none", padding:"8px 0 0 0"}).slideDown(400, function()
			{
				jQuery(this).css({overflow:"visible", height:"auto"});
			});
		},
		function()
		{	
			$sublist.stop().slideUp(400, function()
			{	
				jQuery(this).css({overflow:"hidden", display:"none"});
			});
		});	
	});
}

