function centraliza(largura,altura){
	window.moveTo((window.screen.width-largura)/2,(window.screen.height-altura)/2);
}
function abreJanela(arquivo,nome,barra,largura,altura) {
	window.open(arquivo,nome,"resizable=no,toolbar=no,status=no,menubar=no,scrollbars="+barra+",width="+largura+",height="+altura);
}
function redimenciona(){
	var i=0;
	function resize() {
		if (navigator.appName == 'Netscape') i=40;
		if (document.images[0]) window.resizeTo(document.images[0].width +50, document.images[0].height+80-i);
		if (window.moveTo((window.screen.width-document.images[0].width)/2,(window.screen.height-document.images[0].height)/2));
	}
}
var css_browser_selector = function() {
	var 
		ua = navigator.userAgent.toLowerCase(),
		is = function(t){ return ua.indexOf(t) != -1; },
		h = document.getElementsByTagName('html')[0],
		b = (!(/opera|webtv/i.test(ua)) && /msie (\d)/.test(ua)) ? ((is('mac') ? 'ieMac ' : '') + 'ie ie' + RegExp.$1)
			: is('gecko/') ? 'gecko' : is('opera') ? 'opera' : is('konqueror') ? 'konqueror' : is('applewebkit/') ? 'webkit safari' : is('mozilla/') ? 'gecko' : '',
		os = (is('x11') || is('linux')) ? ' linux' : is('mac') ? ' mac' : is('win') ? ' win' : '';
	var c = b+os+' js';
	h.className += h.className?' '+c:c;
}();

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace
	(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

function init(numero, opcao) {
    var vCookie = getCookie("MenuPanel" + numero);
    oLayer = document.getElementById("MenuPanel" + numero);
    
    if (vCookie == null) {
        if (opcao == "0") {
            oLayer.style.display = "none";
            setCookie('MenuPanel' + numero, 'none');
        }
        else {
            setCookie('MenuPanel' + numero, '');
            oLayer.style.display = "";
        }
    }
    else {
        if (vCookie == "none") {
	        oLayer.style.display = "none";
		    setCookie('MenuPanel' + numero, 'none');
		}
		else {
		    setCookie('MenuPanel' + numero, '');
		    oLayer.style.display = "";
		}
    }
}

function ShowMenuLateral(number) {
	oLayer = document.getElementById("MenuPanel" + number);
	if (oLayer.style.display == "") {
		setCookie('MenuPanel' + number, 'none');
		oLayer.style.display = "none";
	} else {
		setCookie('MenuPanel' + number, '');
		oLayer.style.display = "";
	}
}

function setCookie(nome,valor) {
    document.cookie = nome + "=" + escape(valor);
}

function getCookie(nome) {
    var dc = document.cookie;
    var prefix = nome + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

function StartShowHide(Name) {
	var vCookie = getCookie("ShowHide" + Name);
	oObject  = document.getElementById(Name);
	
	if (vCookie != null) {
		if (vCookie == "") {
			oObject.style.display = "";
		}
		else {
			oObject.style.display = "none";
		}
	}
	else
	{
		oObject.style.display = "none";
		setCookie('ShowHide' + Name, 'none');
	}
}

function ShowHide(Name) {
	var vCookie = getCookie("ShowHide" + Name);
	oObject  = document.getElementById(Name);
	if (oObject.style.display == "") {
		setCookie('ShowHide' + Name, 'none');
		oObject.style.display = "none";
	}
	else {
		setCookie('ShowHide' + Name, '');
		oObject.style.display = "";
	}
}

function google() {
    f = document.forms[0];
    window.open('http://www.google.com/search?q=' + encodeURIComponent(f.txtBusca.value) + '&hl=en&btnG=Buscar');
    return false;
}

function expandir(i) {
    if (document.getElementById("exp" + i).style.display == "none") {
        document.getElementById("exp" + i).style.display = '';
    }
    else {
        document.getElementById("exp" + i).style.display = 'none';
    }
}