// RETORNA VERDADEIRO OU FALSO DE ACORDO COM A ESCOLHA
function abremenu(url,nomepopup,detalhes){
  window.open(url,nomepopup,detalhes);
   }

// ALERTA COM RESPOSTA
function alerta(msg){
  if(confirm(msg)){
      return true;
       }
        else {  return false;
      }
  }
// ALERTA COM RESPOSTA
function nega_associa(msg) { //v1.0
  alert(msg);
  return false;
}  
// DESTACA JANELA
function janelafrente() { //v1.0
  window.top();
}  

// ABRE JANELA POP-UP
function abrejanela(theURL,winName,features) {
   window.open(theURL,winName,features);
  }

// FECHA JANELA POP-UP
function fechajanela(wiName) {
       window.close("winName");
    }

function resizeImage(evt,name){
	newX=100
	newY=75
	eval("document."+name+".width=newX")
	eval("document."+name+".height=newY")
}
function backImage(evt,name){
	newX=50
	newY=33
	eval("document."+name+".width=newX")
	eval("document."+name+".height=newY")
}
function exibe(TheTR)
  {
  var DataTR = eval('document.all.' + TheTR);
    DataTR.style.display="block";
 } 

//////////////////////////////////////////////////////////////////////////////////////////
//// VISUALIZAÇÃO DA IMAGENS ANTES DO UPLOAD
<!--
var z=0;
var ext=new Array('jpeg','.jpg','.gif');

var sVersao	= navigator.appVersion;
var bIsIE = ( (sVersao.indexOf("IE") > -1) || (sVersao.indexOf("Mac") > -1) ) ;


function gid(elemento){

	if ( bIsIE ){
		return document.all[elemento];
	} else {	
		return document.getElementById(elemento);
	}
	
}

function in_array(x,y){
 var z=false;
 for(var i=0;i<y.length;i++) if(y[i] == x) z=true;
 return z;
}


function finfo(imagem,campo){
 var fl=document.upload.imagem_grande.value;
 var ex=fl.substr(fl.length - 4).toLowerCase();
 if(fl.length < 1) alert('Você deve selecionar a foto antes de prosseguir.\n\nClique em Procurar...');
 else if(in_array(ex,ext)){
 gid("imagem").src='';

 if(fl.charAt(0) == '/') fl=fl.substring(1);
   gid("imagem").src="file://"+fl;
 }
 else {
  alert("O tipo de arquivo que você selecionou não é aceito neste sistema. \n Somente arquivos no formato .bmp, .gif, .jpeg, .jpg e .png são aceitos.");
  window.location.reload();
  gid("campo").focus();
 }
}

function setsize(imagem){
if(gid("imagem").fileSize > 600000){
  if(confirm("O tamanho do arquivo que você selecionou ultrapassou o limite de 600Kb .\n\n Isso pode deixar a operação lenta. Remondamos que você cancele a operação e escolha uma foto menor ou edite esta em um Programa Gráfico. \n\n Deseja continuar?")){
     return true;
  }
  else {  
    window.location.reload();
   return false;
  }
 }
 var h=gid("imagem").height;
 var v=gid("imagem").width;
 if(h > 333 && h > v ) { 
  gid('imagem').height=333;
 }
 else if(v > 250) gid('imagem').width=250;
}

