/*
DESENVOLVIDO POR JUNIOR ARANTES.
MGDESIGNER.COM
*/	


/*
	ENDEREÇO 			   = ARQUIVO QUE VAI SER ABERTO
	NOME    			   = NOME DO POP-UP
	FULLSCREEN 			   = ABRE O POP-UP EM TELA CHEIA
	INDICE                 = CONTROLE DE FECHAMENDO DA TABELA
	TAMANHO_ALTURA         = ALTURA DO POP-UP
	TAMANHO_LARGURA        = LARGURA DO POP-UP
	ALINHAMENTO_HORIZONTAL = ALINHAMENTO HORIZONTAL DO POP-UP: C - CENTRALIZADO, R - DIREITA, L - ESQUERDA
	ALINHA_VERTICAL        = ALINHAMENTO VERTICAL DO POP-UP: C - CENTRALIZADO, U - ACIMA, D - ABAIXO
*/	



/*
JAVA ABRE JANELA CENTRO
*/	
function abreJanela(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=" + scroll + ",top=" + topo + ",left=" + esqu + ",resizable=yes" + ",menubar=no" + ",status=yes");
}	
function abreJanelaOptions(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=" + scroll + ",top=" + topo + ",left=" + esqu + ",resizable=yes" + ",menubar=yes" + ",status=yes");
}
function abreJanelaOptions(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=" + scroll + ",top=" + topo + ",left=" + esqu + ",resizable=yes" + ",menubar=yes" + ",status=yes");
}
function abreJanelaResizableNo(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=" + scroll + ",top=" + topo + ",left=" + esqu + ",resizable=no" + ",menubar=yes" + ",status=yes");
}
function abreJanelaMenuBarNo(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=" + scroll + ",top=" + topo + ",left=" + esqu + ",resizable=yes" + ",menubar=no" + ",status=yes");
}
function abreJanelaStatusNo(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=" + scroll + ",top=" + topo + ",left=" + esqu + ",resizable=yes" + ",menubar=yes" + ",status=no");
}
function abreJanelaNormal(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=no" + scroll + ",top=" + topo + ",left=" + esqu);
}
function abreJanelaGaleria(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=no" + scroll + ",top=" + topo + ",left=" + esqu);
}
function abreJanelaIntro(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=no" + scroll + ",top=" + topo + ",left=" + esqu);
}
function abreJanelaImg(url,nome,largura,altura,scroll){
    lTela = window.screen.width;
   aTela = window.screen.height;
   esqu = (lTela - largura) / 2;
   topo = (aTela - altura) / 2;
   window.open(url,nome,"width=" + largura + ",height=" + altura +
",scrollbars=no" + scroll + ",top=" + topo + ",left=" + esqu + ",resizable=yes" + ",menubar=no" + ",status=yes");
}
function abrir(endereco) {		
janela(endereco, 'PORTIFOLIO', '', 1, 1, 670, 500, 'C', 'U')
return(null)
}

// SCREEN RESOLUTION
if (screen.width >= 800) {
	document.write("<STYLE type=text/css>BODY {overflow-x:hidden;}</STYLE>");
}
// SHOW - HIDE
function showHide(layerName,layerStatus) {
if (document.getElementById) {
	var targetElement = document.getElementById(layerName);
	targetElement.style.visibility = layerStatus;
	}
}

/*
JAVA TB LINK
*/	

function LmOver(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#000000";
elem.style.cursor = 'hand'}

function LmOut(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#000000";}

function LmDown(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#000000";}

function LmUp(path)
{location.href = path;}


/*
JAVA JANELA DO JUNIOR
*/	

function redimensionar(objeto) {
var altura       = objeto.height + 110
var largura      = objeto.width  + 60
var altura_tela  = window.screen.availHeight - 50
var largura_tela = window.screen.availWidth  - 50
	if (altura  > altura_tela) 
		altura   = altura_tela
	if (largura > largura_tela) 
		largura  = largura_tela		
	window.resizeTo(largura, altura)
	window.moveTo(((largura_tela + 50) - largura) / 2, ((altura_tela + 50) - altura) / 2);
	window.focus()
}
var abertura_janela = new Array()
function janela(endereco, nome, fullscreen, indice, tipo_visualizacao, tamanho_altura, tamanho_largura, alinhamento_horizontal, alinhamento_vertical, tipo_janela, barra_rolagem, status, maximizar, botao, botao_menu, localizacao, diretorio) {
	if (fullscreen == 'S') {	
		if (tipo_visualizacao == 1) {
			if (abertura_janela[indice] && abertura_janela[indice].open && !abertura_janela[indice].closed) 
			abertura_janela[indice].close()
							
			abertura_janela[indice] = window.open(endereco, nome, 'fullscreen = yes')
 		    abertura_janela[indice].focus()		
		}else if (tipo_visualizacao == 2) {
			if (abertura_janela[indice] && abertura_janela[indice].open && !abertura_janela[indice].closed) {
				abertura_janela[indice].focus()
			}else {
				abertura_janela[indice] = window.open(endereco, nome, 'fullscreen = yes')
	 		    abertura_janela[indice].focus()
			}		
		}else {
			abertura_janela[0] = window.open(endereco, nome, 'fullscreen = yes')
 		    abertura_janela[0].focus()
		}	
	}else {				
	
		switch (alinhamento_horizontal) {
			case 'C':
				var largura 		= (screen.width / 2)
				var inicio_esquerda = (largura - (tamanho_largura / 2))
			break
			case 'L':
				var inicio_esquerda = 0
			break
			case 'R':				
				var inicio_esquerda = screen.width - tamanho_largura
			break
			default:
				var inicio_esquerda = alinhamento_horizontal
		}	
						
		switch(alinhamento_vertical) {
			case 'C':
				var altura		= (screen.height / 2)
				var inicio_topo = (altura - (tamanho_altura / 2))
			break
			case 'U':
				var inicio_topo = 0
			break
			case 'D':
				var inicio_topo = screen.height - tamanho_altura
			default:
				var inicio_topo = alinhamento_vertical
			break			
		}
			
		switch(barra_rolagem) {
			case 'S':
				barra_rolagem = 'yes'
			break
			case 'N':
				barra_rolagem = 'no'
			break
			case 'A':
				barra_rolagem = 'auto'
			break
			default:
				barra_rolagem = 'yes'			
		}
	
		switch(status) {
			case 'S':
				status = 'yes'
			break
			case 'N':
				status = 'no'
			break
			default:
				status  = 'yes'		
		}
		
		switch(maximizar) {
			case 'S':
				maximizar= 'yes'
			break
			case 'N':
				maximizar= 'no'
			break
			default:
				maximizar = 'no'
		}		
		
		switch(botao) {
			case 'S':
				botao = 'yes'
			break
			case 'N':
				botao = 'no'
			break
			default:
				botao = 'no'
		}
		
		switch(botao_menu) {
			case 'S':
				botao_menu = 'yes'
			break
			case 'N':
				botao_menu = 'no'
			break
			default:
				botao_menu = 'no'
		}	
		
		switch(localizacao) {
			case 'S':
				localizacao = 'yes'
			break
			case 'N':
				localizacao = 'no'
			break
			default:		
				localizacao = 'no'
		}		
		
		switch(diretorio) {
			case 'S':
				diretorio = 'yes'
				break
			case 'N':
				diretorio = 'no'
			break
			default:
				diretorio = 'no'
		}			
		if (tipo_janela == 1) {
			if (window.showModelessDialog) {
				if (alinhamento_horizontal == 'C'  && alinhamento_vertical == 'C')	
					window.showModalDialog(endereco, nome, 'dialogWidth:' + tamanho_largura + 'px; dialogHeight:' + tamanho_altura + 'px; center: yes; resizable: ' + maximizar + '; status: ' + status + '; scroll:' +  barra_rolagem + '; unadorned: yes; help: no')
				else
					window.showModalDialog(endereco, nome, 'dialogTop:' + inicio_topo + 'px; dialogLeft:' + inicio_esquerda + 'px; dialogWidth:' + tamanho_largura + 'px; dialogHeight:' + tamanho_altura + 'px; center: no; resizable: ' + maximizar + '; status: ' + status + '; scroll:' +  barra_rolagem + '; unadorned: yes; help: no')
			}else {				
				if (tipo_visualizacao == 1) {
					if (abertura_janela[indice] && abertura_janela[indice].open && !abertura_janela[indice].closed) 
					abertura_janela[indice].close()
								
					abertura_janela[indice] = window.open(endereco, nome, 'top = ' + inicio_topo + ', left = ' + inicio_esquerda + ', width = ' + tamanho_largura + ', height = ' + tamanho_altura + ', fullscreen = no, resizable = ' + maximizar + ', status = ' + status + ',  scrollbars = ' + barra_rolagem + ', toolbar = ' + botao + ', menubar = ' + botao_menu + ', location = ' + localizacao + ', directories = ' + diretorio)				
					abertura_janela[indice].focus()
				}else if (tipo_visualizacao == 2) {
					if (abertura_janela[indice] && abertura_janela[indice].open && !abertura_janela[indice].closed) {
						abertura_janela[indice].focus()
					}else {
						abertura_janela[indice] = window.open(endereco, nome, 'top = ' + inicio_topo + ', left = ' + inicio_esquerda + ', width = ' + tamanho_largura + ', height = ' + tamanho_altura + ', fullscreen = no, resizable = ' + maximizar + ', status = ' + status + ',  scrollbars = ' + barra_rolagem + ', toolbar = ' + botao + ', menubar = ' + botao_menu + ', location = ' + localizacao + ', directories = ' + diretorio)				
						abertura_janela[indice].focus()
					}		
				}else {
				   abertura_janela[0] = window.open(endereco, nome, 'top = ' + inicio_topo + ', left = ' + inicio_esquerda + ', width = ' + tamanho_largura + ', height = ' + tamanho_altura + ', fullscreen = no, resizable = ' + maximizar + ', status = ' + status + ',  scrollbars = ' + barra_rolagem + ', toolbar = ' + botao + ', menubar = ' + botao_menu + ', location = ' + localizacao + ', directories = ' + diretorio)				
 				   abertura_janela[0].focus()
				}
			}	
		}else {				
			if (tipo_visualizacao == 1) {
				if (abertura_janela[indice] && abertura_janela[indice].open && !abertura_janela[indice].closed) 
				abertura_janela[indice].close()
				abertura_janela[indice] = window.open(endereco, nome, 'top = ' + inicio_topo + ', left = ' + inicio_esquerda + ', width = ' + tamanho_largura + ', height = ' + tamanho_altura + ', fullscreen = no, resizable = ' + maximizar + ', status = ' + status + ',  scrollbars = ' + barra_rolagem + ', toolbar = ' + botao + ', menubar = ' + botao_menu + ', location = ' + localizacao + ', directories = ' + diretorio)				
				abertura_janela[indice].focus()
			}else if (tipo_visualizacao == 2) {
				if (abertura_janela[indice] && abertura_janela[indice].open && !abertura_janela[indice].closed) {
					abertura_janela[indice].focus()
				}else {
					abertura_janela[indice] = window.open(endereco, nome, 'top = ' + inicio_topo + ', left = ' + inicio_esquerda + ', width = ' + tamanho_largura + ', height = ' + tamanho_altura + ', fullscreen = no, resizable = ' + maximizar + ', status = ' + status + ',  scrollbars = ' + barra_rolagem + ', toolbar = ' + botao + ', menubar = ' + botao_menu + ', location = ' + localizacao + ', directories = ' + diretorio)				
					abertura_janela[indice].focus()
				}		
			}else {
			   abertura_janela[0] = window.open(endereco, nome, 'top = ' + inicio_topo + ', left = ' + inicio_esquerda + ', width = ' + tamanho_largura + ', height = ' + tamanho_altura + ', fullscreen = no, resizable = ' + maximizar + ', status = ' + status + ',  scrollbars = ' + barra_rolagem + ', toolbar = ' + botao + ', menubar = ' + botao_menu + ', location = ' + localizacao + ', directories = ' + diretorio)				
 			   abertura_janela[0].focus()
			}
		}	
	}
	return(abertura_janela[indice])
}
		
function fechar_janela(janela_aberta) {
var x 				 = null 
var janela_aberta    = janela_aberta.split(',')
	for (x = 0; x < janela_aberta.length; x ++) 
		if (abertura_janela[janela_aberta[x]] && abertura_janela[janela_aberta[x]].open && !abertura_janela[janela_aberta[x]].closed) 
			abertura_janela[janela_aberta[x]].close()
	return(null)
}


/*
JAVA PÁGINA BANCO DE IMAGENS IMAGEM DET
*/	

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('Erros ao tentar enviar o formulário:\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}

//login ajax e reposição de imagem
var usr;
var snh;

try {
ajax = new XMLHttpRequest();
} catch(ee) {
try {
ajax = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
ajax = new ActiveXObject("Microsoft.XMLHTTP");
} catch(E) {
ajax = false;
}
}
}

function login_dy(user,senha) {
if (document.getElementById && ajax) {
ajax.open("POST", "/login/login_ajax.asp", true);
ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
ajax.send('usuario='+user+'&senha='+senha);

ajax.onreadystatechange = function() {
if (ajax.readyState == 4) {
if(ajax.status == 200) {
var resultado = ajax.responseText;
resultado = resultado.replace(/\+/g," ");
resultado = unescape(resultado);
loginpart.innerHTML = resultado;

if(resultado.indexOf('anunciente aqui') > 0 ){
document.location = '/vip/';
}
if(resultado.indexOf('assinante aqui') > 0 ){
document.location = '/assinantes/';
}

} else {
loginpart.innerHTML = "<span align='right'>Ocorreu um erro!</span>";
}
}
}

}
}

function ck_form(){
var ok = true;

if (document.getElementById('usuario').value == ''){
	alert('Por favor, digite seu e-mail.');
	document.getElementById('usuario').focus();
	ok = false;
}
if (document.getElementById('senha').value == '' && ok == true){
	alert('Por favor, digite sua senha.');
	document.getElementById('senha').focus();	
	ok = false;	
}

if (ok == true){
usr = document.getElementById('usuario').value;
snh = document.getElementById('senha').value
loginpart.innerHTML = '&nbsp;<br><br><img src="/img/ajax-loader.gif"><input type="hidden" name="usuario"><input type="hidden" name="senha">';
setTimeout('login_dy(\''+usr+'\',\''+snh+'\')',4000);
}

}

function login_ent() {
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
if ( keyCode == 13 ) {
	ck_form();
    return false;
  }
  else
  return true;
  }
  
function bsca_ent() {
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
if ( keyCode == 13 ) {
	document.location = '/busca/search.asp?key='+document.getElementById('key').value;
    return false;
  }
  else
  return true;
  }  
  
function listener(e) { 
   if (!e) e = window.event; 
   var code; 
   if (e.keyCode) code = e.keyCode; 
   else if (e.which) code = e.which; // Netscape 4.? 
   if (code == 13) 
   { 
	document.location = '/busca/search.asp?key='+document.getElementById('key').value;
   } 
}  

  
window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
var menuActive = 0;
var menuOn = 0;
var onLayer;
var timeOn = null;

function showLayer(layerName,aa,obbj){

var x =document.getElementById(aa);
var tt =findPosX(x); 
var ww =findPosY(x)+20; 

if (NS4 || IE4) {
if (timeOn != null) {
clearTimeout(timeOn);
hideLayer(onLayer);

}
if (IE4) {
var layers = eval('document.all["'+layerName+'"].style');
layers.left = tt;
eval('document.all["'+layerName+'"].style.visibility="visible"');
}
if (NS4) {
if(document.getElementById){
var elementRef = document.getElementById(layerName);
if((elementRef.style)&& (elementRef.style.visibility!=null)){
elementRef.style.visibility = 'visible';
elementRef.style.left = tt;
elementRef.style.top = ww;
}
}
}
}

onLayer = layerName
obj = document.getElementById(layerName)
var conteudo = obj.innerHTML;
		for (i=0;i<9;i++){
if (conteudo.indexOf('mnu'+i) > 0) {
	obb = document.getElementById(i+1)
	coloca(obb,0);

}				}//for

}

function hideLayer(layerName){

if (menuActive == 0)
{
if (IE4){
eval('document.all["'+layerName+'"].style.visibility="hidden"');
obj = document.all[layerName];
} 
if (NS4){
if(document.getElementById){
var elementRef = document.getElementById(layerName);
if((elementRef.style)&& (elementRef.style.visibility!=null)){
elementRef.style.visibility = 'hidden';
obj = elementRef;
}
}
}
}

var obb;
var conteudo = obj.innerHTML;
		for (i=0;i<9;i++){
if (conteudo.indexOf('mnu'+i) > 0) {
	obb = document.getElementById(i+1)
	coloca(obb,3);

}				}//for

}

function btnTimer() {
timeOn = setTimeout("btnOut()",0)
}

function btnOut(layerName){
if (menuActive == 0){
hideLayer(onLayer)
}
}

var item;
function menuOver(itemName,ocolor){
item=itemName;
itemName.style.backgroundColor = ocolor; //background color change on mouse over 
clearTimeout(timeOn);
menuActive = 1
}

function menuOut(itemName,ocolor){
if(item)
itemName.style.backgroundColor = ocolor;
menuActive = 0
timeOn = setTimeout("hideLayer(onLayer)", 100)
}

function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}

function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}
function goURL(urll){
document.location = urll
}
function goURL_b(urll){
window.open(urll);
}
function coloca(obj,tipo){

if (tipo == 0) {
	obj.style.background = 'url(/imagens/bg_hover.gif)';
}

	if (tipo == 3) {
		obj.style.background = 'url(/imagens/bg_normal.gif)';
	}

}
function GerarSWF(arquivo,altura,largura,id){
    document.writeln('    <object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + largura + '" height="' + altura + '" id="' + id + '" name="' + id + '">');
    document.writeln('        <param name="movie" value="' + arquivo + '" />');
    document.writeln('        <param name="bgcolor" value="#ffffff" />');
    document.writeln('        <param name="menu" value="false" />');
    document.writeln('        <param name="quality" value="high" />');
    document.writeln('        <param name="salign" value="tl" />');
    document.writeln('        <param name="scale" value="noscale" />');
    document.writeln('        <param name="wmode" value="transparent" />');
    document.writeln('        <embed id="globalnav-embed" src="' + arquivo + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#ffffff" menu="false" quality="high" salign="tl" scale="noscale" id="' + id + '" width="' + largura + '" height="' + altura + '"></embed>');
    document.writeln('    </object>');
}