$(document).ready(function(){
	// SETUP NAVIGATION
	$('#navigation > ul > li').hover(
			function(){
				$(this).addClass('active');
				$('.subnav', this).show();
			},
			function(){
				$(this).removeClass('active');
				$('.subnav', this).hide();
			}
		);
	
	// SETUP COVER TABS
	var tabs = $('#cover_tabs > ul').tabs({fx:{opacity: 'toggle'}}).tabs('rotate',5000);
	
	// SETUP MODULI
	$('.module').hover(
		function(){
			el = $(this);
			module_timeout = window.setTimeout("el.css({zIndex: 10}).animate({width: 430, height: 260}, 150);", 300);
		},
		function(){
			if(module_timeout){ 
				clearTimeout(module_timeout);
				$(this).animate({width: 210, height: 125, zindex: 10}, 50, null, function(){ $(this).css({zIndex: 5})});
			} else {
				$(this).animate({width: 210, height: 125, zindex: 10}, 50, null, function(){ $(this).css({zIndex: 5})});
			}
		}
	);
	
	// SETUP FACEBOX
	$('a[rel*=facebox]').facebox();
});


if(typeof(wta) == "undefined") {
	var wta = {};
}
wta.StretchBg = function(){

	var c = null;
	
	function _init(){
		$(document).ready(function(){
			c = $('#content');
		});
	}
	
	function _hideContent(){
		c.css('opacity', 0);
	}
	
	function _showContent(){
		c.css('opacity', 1);
	}
	
	return{
		init: _init,
		show: _showContent,
		hide: _hideContent
	}
}();
wta.StretchBg.init();

function hideC(){
	if(typeof(wta) != "undefined"){
		wta.StretchBg.hide();
	}
	
};
function showC(){
	if(typeof(wta) != "undefined"){
		wta.StretchBg.show();
	}
};