jQuery(document).ready(function($){

	$(window).bind('resize', function(){
		$("#aba_inner").css('height', $('#aba').innerHeight() - 25);
		body_height = $('body').height();
		body_width = $('body').width();		
	});	
	
	$(".equalHeights").equalHeights();
	$(".vAlign").vAlign();
	
	$('#aba_open, #aba_close').bind('click', function() { toggleSidebar(); });
	$('#onoff').bind('click', function(){ changeBrand(); return false; });
	
	$("ul.topnav > li").bind('mouseover', function() {	 
		if ( ! $(this).find("ul.subnav").is(":visible") ) 
		{
			$(this).find("ul.subnav").slideDown('fast').show();
	
			$(this).hover(function() {
			}, function(){
				$(this).find('ul.subnav').slideUp('slow');
			});
		}
	});	
	
	var scroller_height = $("#scroller").height();
	$("#aba_inner").css('height', $('#aba').innerHeight() - 25);
	makeScrollable("#aba_inner", "#scroller");

	if ( hasFlash )
	{
	    var onoffSwf = new Flash("/swf/onoff_"+BRAND+".swf", "onoffSwf", "100%", "60"); /*160x60*/
	    onoffSwf.addParameter("allowScale", "false");
	    onoffSwf.addParameter("wmode", "transparent");
	    onoffSwf.writeIn("onoff");		
	}
	
	$('.integracao').addClass('pointer').bind('click', function(){
		var link = $('h3 a', this).attr('href');
		changeBrand(link);
	});	

});

