var lastDivHeight = 0;
rodape = function()
{		
		var de = document.documentElement;		
		var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.offsetHeight;
		
		if(h > document.body.offsetHeight)
		{
			jQuery("#corpo").css({"height":(h-88).toString()+"px"});
			height = ((h - 220) < 0)?0:(h - 220);
			jQuery("p.idioma").css({"margin-top":(height).toString()+"px"});
		}
		else if(h < document.body.offsetHeight)
		{
			jQuery("#corpo").css({"height":lastDivHeight.toString()+"px"});
			jQuery("p.idioma").css({"margin-top":(0).toString()+"px"});
			if(h > document.body.offsetHeight)
			{
				jQuery("#corpo").css({"height":(h-88).toString()+"px"});
				height = ((h - 220) < 0)?0:(h - 220);
				jQuery("p.idioma").css({"margin-top":(height).toString()+"px"});
			}
		}
};

principal = function()
{
	document.write(
	'<object type="application/x-shockwave-flash" data="swf/principal.swf" id="principal" width="100%" height="100%">'+
	'	<param name="movie" value="swf/principal.swf" />'+
	'	<param name="allowScriptAcess" value="sameDomain" />'+
	'	<param name="quality" value="best" />'+
	'	<param name="bgcolor" value="#FFFFFF" />'+
	'	<param name="scale" value="noScale" />'+
	'	<param name="salign" value="TL" />'+
	'	<param name="wmode" value="transparent" />'+
	'	<param name="FlashVars" value="playerMode=embedded" />'+
	'</object>'			   
	);
};


abrirPopup = function(x)
{
	if(screen.availWidth == 800)
	{
		var w = screen.availWidth;
		var h = (document.all)?screen.availHeight-50:screen.availHeight;
		var t = 0;
		var l = 0;
		if (x == 'en'){
			window.open("home_eng.php", "bontempo","width="+w+",height="+h+",top="+t+",left="+l+",resizable=yes,scrollbars=yes,status=yes,dependent");
		} else {
			window.open("home.php", "bontempo","width="+w+",height="+h+",top="+t+",left="+l+",resizable=yes,scrollbars=yes,status=yes,dependent");
		}
	}
	else {
		if (x == 'en'){
			window.location.href = "home_eng.php";
		} else {
			window.location.href = "home.php";
		}
	}
}

jQuery(document).ready(function()
{
	lastDivHeight = document.body.offsetHeight-88;
	
	window.setTimeout('jQuery("p.mensagemErro").hide()',5000);
	
	jQuery("a").click(function(){this.blur();});
	
	rodape();

	jQuery(window).resize(function()
	{
		rodape();
	});
	
	jQuery("a.pt").hover(function(){jQuery("img",this).attr({"src":"imagens/pt_rollover.png"});},function(){jQuery("img",this).attr({"src":"imagens/pt.png"});});
	jQuery("a.en").hover(function(){jQuery("img",this).attr({"src":"imagens/en_rollover.png"});},function(){jQuery("img",this).attr({"src":"imagens/en.png"});});
});

if(jQuery.browser.msie)document.execCommand("BackgroundImageCache", false, true);