function galeria(URL) {
  var width = 644;
  var height = 425;
  var left = 50;
  var top = 10
  window.open(URL, 'ema3', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

function AbreJanelaEnsaio(URL) {
  var width = 555;
  var height = 395;
  var left = 50;
  var top = 10
  window.open(URL, 'ensaio', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

function AbreAlbum(URL) {
  var width = 550;
  var height = 355;
  var left = 50;
  var top = 10
  window.open(URL, 'Album', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

function indica(url) {
  window.open(url,'indica','width=448, height=218, top=12, left=15, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')
}

function Comprar(url) {
  window.open(url,'comprar','width=535, height=280, top=12, left=15, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')
}

function AddAlbum(url) {
  window.open(url,'addalbum','width=535, height=218, top=12, left=15, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')
}

function cores(url) {
  window.open(url,'cores','width=225, height=169, top=10, left=10, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')
}

function Amplia(url) {
  window.open(url,'amplia','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function AbreCartoon(url) {
  window.open(url,'cartoon','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=25,height=25,screenX=150,screenY=150,top=15,left=15')
}

function AbreFotoMural(url) {
  window.open(url,'muralfotos','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function AbreFotoAgenda(url) {
  window.open(url,'fotoagenda','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function fotos_noticias(url) {
  window.open(url,'popupImageWindow','width=400, height=300, screenX=0, screenY=0, top=150, left=20, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no')
}
// 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 sistems. \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;
}

