var imagAtual = new Object();
var imagAtual2 = new Object();
var osrcAtual2 = new Object();
imagAtual="";
imagAtual2="";

var img = new Object();
img.stA="_A.gif";
img.stB="_B.gif";

//-------------------------------------------------------------------------------------------
// PRECARREGAR IMAGENS

function CarregaImag() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=CarregaImag.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_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;
}

//-------------------------------------------------------------------------------------------
// VOLTA IMAGEM
function ImagA(){
	document.images[imagAtual].src=img.camtopo + imagAtual +img.stA;
}

function ImagA2(){
	document.images[imagAtual2].src=img.camlista + osrcAtual2 +img.stA;
}

//-------------------------------------------------------------------------------------------
// STATUS onOver DA IMAGEM
function ImagB(imagID){
	document.images[imagID].src=img.camtopo + imagID + img.stB;
	imagAtual=imagID;
}

function ImagB2(imagID,osrc){
	document.images[imagID].src=img.camlista + osrc + img.stB;
	imagAtual2=imagID;
	osrcAtual2=osrc;
}

//-------------------------------------------------------------------------------------------
// VER RESOLUÇÃO DO MONITOR
function VerRes(){
    fonteBody=document.body.style;
    if (screen.availWidth <= 800) {
        fonteBody.fontSize = "12px";
    } else {
        fonteBody.fontSize = "14px";
    }
}


/***************************************************************************************************************
Abrir Janela */

function AbreJan(pag,nomejan,menu,rolagem,LargJan,AltJan) {
	posEsq=(screen.availWidth / 2) - (LargJan / 2);
	posTopo=(screen.availHeight / 2) - (AltJan / 2);
	window.open(pag,nomejan,'menubar=' + menu + ', scrollbars=' + rolagem + ', width=' + LargJan + ', height=' + AltJan + ', top=' + posTopo + ', left=' + posEsq);
}

/***************************************************************************************************************
Abrir janela simples */
function AbreJan2(pag,nomejan,scroll,LargJan,AltJan) {
	window.open(pag,nomejan,'scrollbars=' + scroll + ', width=' + LargJan + ', height=' + AltJan + ', top=0, left=0');
}


/***************************************************************************************************************
Funciona como tag de link */

function SubForm(acao, vlr1, vlr2){
	oForm = document.forms["formulario"];

	oForm.acao.value = acao;
  	oForm.vlr1.value = vlr1;
   oForm.vlr2.value = vlr2;
  
	oForm.submit();
}



/***************************************************************************************************************
Esconde Layer */
function DesatVisLayer(qual){
	document.getElementById(qual).style.visibility = "hidden";
}

function MostraEscLayer(qual, mostraesc){
	hidvis = new Array();
	hidvis[0] = "hidden";
	hidvis[1] = "visible";
   
	document.getElementById(qual).style.visibility = hidvis[mostraesc];
}


var linha_ant = new Object();
this.linha_ant = "";


function DestacaLinha(esta_linha){
	if (this.linha_ant != "") document.getElementById(this.linha_ant).style.backgroundColor="#ffffff";
	document.getElementById(esta_linha).style.backgroundColor="#efefef";
	this.linha_ant = esta_linha;
}
