/* Script do Flash */
function por()
{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="270" height="232" id="menu" align="middle">\n');
    document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    document.write('<param name="movie" value="flash/menu.swf" />\n');
	 document.write('<param name="quality" value="high" />\n');
	 document.write('<param name=bgcolor value=#FFFFFF />\n');
	 document.write('<embed src="flash/menu.swf" quality="high" bgcolor="#ffffff" width="270" height="232" name="menu" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
    document.write('</object>\n');
	 document.write('</EMBED>\n');
}
function esp()
{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="270" height="200" id="menu" align="middle">\n');
    document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    document.write('<param name="movie" value="flash/es/menu.swf" />\n');
	 document.write('<param name="quality" value="high" />\n');
	 document.write('<param name=bgcolor value=#FFFFFF />\n');
	 document.write('<embed src="flash/es/menu.swf" quality="high" bgcolor="#ffffff" width="270" height="200" name="menu" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
    document.write('</object>\n');
	 document.write('</EMBED>\n');
}
function fra()
{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="270" height="232" id="menu" align="middle">\n');
    document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    document.write('<param name="movie" value="flash/fr/menu.swf" />\n');
	 document.write('<param name="quality" value="high" />\n');
	 document.write('<param name=bgcolor value=#FFFFFF />\n');
	 document.write('<embed src="flash/fr/menu.swf" quality="high" bgcolor="#ffffff" width="270" height="232" name="menu" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
    document.write('</object>\n');
	 document.write('</EMBED>\n');
}
function ing()
{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="270" height="232" id="menu" align="middle">\n');
    document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    document.write('<param name="movie" value="flash/in/menu.swf" />\n');
	 document.write('<param name="quality" value="high" />\n');
	 document.write('<param name=bgcolor value=#FFFFFF />\n');
	 document.write('<embed src="flash/in/menu.swf" quality="high" bgcolor="#ffffff" width="270" height="232" name="menu" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
    document.write('</object>\n');
	 document.write('</EMBED>\n');
}


loaded=false;

function cB(){
	var b=navigator.appName;
	var v=navigator.appVersion;
	var u=navigator.userAgent;
	if(u==null)return;
	if(b=='Netscape')this.b='ns';
	else if(b=='Microsoft Internet Explorer')this.b='ie';
	else this.b=b;
	this.v=parseInt(v);
	this.ns=(this.b=='ns'&&this.v>=4);
	this.ns4=(this.b=='ns'&&this.v==4);
	this.ie=(this.b=='ie'&&this.v>=4);
	this.ie4=(u.indexOf('MSIE 4')>0);
}
is = new cB();

function getElm(id){
    var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
    if (el) el.css = el.style? el.style: el;
    return el;
}

var MNS = [];
function MN(id) {
	this.elm = this.event = getElm('mn' + id + 'Div');
	this.pO = [];
	this.name = id;
	this.obj = 'mn' + id + 'DL';
	this.pMn = getElm(id);
	
	this.css = this.elm.style;
	this.l = this.elm.offsetLeft;
	this.t = this.elm.offsetTop;
	this.tm = null;
	
	this.sh = MNsh;
	this.hd = MNhd;
	this.mv = MNmv;
	MNS[MNS.length] = this;
	
	p = getObjPos(this.pMn);
	this.mv(p.l ,p.t);
}

function MNsh(o) {
	var name = "";
	for(i=0;i<this.pO.length;i++){
		this.pO[i].css.visibility = 'visible';

		if (!/^1/.test(this.pO[i].name))
			document.getElementById(this.pO[i].name +'l').className = 'menu-hover';
		name += getElm(this.pO[i].name).className +"\n";
		//clearTimeout(this.pO[i].tm);
	}
}

function MNhd() {
	for(i=0;i<this.pO.length;i++){
		//this.pO[i].tm=setTimeout(this.pO[i].obj + '.css.visibility = "hidden"',2000);
		if (!/^1/.test(this.pO[i].name))
			document.getElementById(this.pO[i].name +'l').className = 'menu';
		this.pO[i].css.visibility = 'hidden';
	}
}

function MNmv(l,t) {
	if (this.name == 1)
		return;
	if (l != null) {
		this.l = l;
		if (!is.ie) this.css.left = this.l;
		else this.css.pixelLeft = this.l;
	}
	if (t != null) {
		this.t = t;
		if (!is.ie) this.css.top = this.t;
		else this.css.pixelTop = this.t;
	}
}

function getObjPos(o){
	if (o == null)
		return false;
	var l = o.offsetLeft;
	var t = o.offsetTop;
	while (o.offsetParent) {
		l += o.offsetParent.offsetLeft;
		t += o.offsetParent.offsetTop;
		o = o.offsetParent;
	}
	getObjPos.l = l;
	getObjPos.t = t;
	return getObjPos;
}
function alinhaObjeto(guia,lyr,difT,difL) {
	//document.write("<pre style=\"color: #000000\">"+ navigator.platform   +"</pre>");
	if (navigator.platform == "MacPPC") {
		if (navigator.appName == "Netscape") {
			difT -= 10;
			difL -= 10;
		} else {
			difT += 10;
			difL += 30;
		}
	}
	obj = document.images[guia];
	if (guia != "outras_secoes") {
		if (obj != null)
			difL += obj.width;
		if (navigator.appName == "Netscape")
			difL -= 5;
	}
	p = getObjPos(obj);
	var mn4Div = getElm(lyr);
	moveLayer(mn4Div,p.l+difL,p.t+difT);
}

function moveLayer(o,l,t){
	if(l != null) o.style.left = l +'px';
	if(t != null) o.style.top = t +'px';
}


function readParentElements(){
	// get parent element
	for(j=0;j<MNS.length; j++){
		numarr = MNS[j].name.split('_');
		name = numarr[0];
		for(i=0;i<numarr.length;i++){
			if( (eval('mn' + name + 'DL')) ){
				MNS[j].pO[MNS[j].pO.length] = eval('mn' + name + 'DL');
			}
			name += '_' + numarr[i+1];
		}
	}
}

function sh(id){
	if(loaded) {
		hdo(id);
		eval('mn' + id + 'DL.sh()');
	}
}
function hd(id){
	if(loaded) eval('mn' + id + 'DL.hd()');
}
function hdo(id) {
	regx = new RegExp("^"+ id);

	if (loaded) {
		for(var i=0;i<MNS.length;i++) {
			if (!regx.test(MNS[i].name)) {
				//alert(MNS[i].obj)
				MNS[i].elm.style.visibility = 'hidden';
			}
		}
	}
}

/* Abre Popup */

function abre_popup( vsize, hsize, turl )
{
	vpos = (screen.availHeight / 2) - (vsize / 2);
	hpos = (screen.availWidth / 2) - (hsize / 2);
	nome = "popupsb"+vsize;
	
	ne4 = (navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)==4);
	jan_padrao_nosb = window.open(turl,nome,"maximized=no,status=no,history=no,scrollbars=no,width="+hsize+",height="+vsize+",left="+hpos+",top="+vpos);
	jan_padrao_nosb.focus();
}

//
function writeLayer(obj, txt) {
	if (typeof obj.innerHTML != "undefined") {
		obj.innerHTML = txt;
	} else if (document.layers) {
		obj.document.write(txt);
		obj.document.close();
	}
}

function readLayer(obj) {
	return obj.innerHTML;
}