/**
*	This is the main JavaScript page that fires off the drop up menu, the main page content tabs, and the right column tabs.
*/

$(function() { 

	//$(document).pngFix();

	/**
	*	Sets a new instance of DropUpMenu object with the id of the targeted div.
	*	@param	element	Div id'ed navWrapper contains the whole main navigation.
	*/
	var dropUpMenu = new DropUpMenu($('#navWrapper'));
	
	/**
	*	Binds the tabs UI event to the targeted UL containing LIs for their corresponding content.
	*/
	$("#tabs").tabs({ selected: null, fx: { opacity: 'toggle' } });
	
	/**
	*	Sets callback to a variable to be called later on non-link tags.
	*/
	var $tabs = $('#tabs').tabs();
	
	/**
	*	Binds an click event to targeted H3 to fire the tab of the Li link in the 0 place.
	*/
	$('#defaultTabH3').click(function() { // bind click event to link
		$tabs.tabs('select', 0); 
		return false;
	});
	
	/**
	*	Binds the tabs UI event to the right column content.
	*/
	$("#rightTabs").tabs({ fx: { opacity: 'toggle' } }); 
	
	$('h1').click(function() {
		window.location = 'index.php';
	});
	
	$("div.button").click(function() {
		var pageName = $(this).attr('id');
		window.location = pageName + ".php";
	});
	
	$('.overBigButton').css('opacity', 0);
	
	$("div.button").bind('mouseenter', function(){
	 	$('div.overBigButton', this).stop().animate({'opacity': 1}, 500);
	 	$(this).addClass('overSupportText');
	});
	
	$("div.button").bind('mouseleave', function(){
	 	$(this).removeClass('overSupportText');
		$('div.overBigButton', this).stop().css('opacity', 0);
	});
	
});