//retorna o dom do Browser
function domAtual(){        
 if(document.layers){
  return "layers";}

 if(document.all){
  return "all";}

 if(document.getElementById && !document.all){
  return "getElementById";}
}
    
//retorna a largura total do site
function areaVisualBrowserW(){
 dom = domAtual();
 //IE
 if(dom == "all"){
  return window.document.body.offsetWidth}
 //Netscape4
 if(dom == "layers"){
  return window.outerWidth}
 //Netscape6 ou +
 if(dom == "getElementById"){
  return window.outerWidth}
}

function areaVisualBrowserH(){
 dom = domAtual();
 //IE
 if(dom == "all"){
  return window.document.body.offsetHeight}
 //Netscape4
 if(dom == "layers") {
  return window.innerHeight}
 //Netscape6 ou +
 if(dom == "getElementById"){
  return window.innerHeight}
}

//retorna posição inicial do site no Browser em pixel
function posicionaLayer(layerId, w, h) {
 dom = domAtual();
 areaVisualW = areaVisualBrowserW();
 areaVisualH = areaVisualBrowserH();
 larguraSite = 778;
 alturaSite = 0;
 y = 0;
 x = 0;

 y = (areaVisualH - areaVisualH)/2;
 x = (areaVisualW - larguraSite)/2;

 if(dom == "layers"){
  eval("document."+dom+"['"+layerId+"'].top = "+ (y+h) +"");
  eval("document."+dom+"['"+layerId+"'].left = "+ (x+w) +"");}
  else{
  eval("document."+dom+"('"+layerId+"').style.top = "+ (y+h) +"");
  eval("document."+dom+"('"+layerId+"').style.left = "+ (x+w) +"");}
}

function resize(){
 posicionaLayer('menu', 205, 138);}
 
function resize2(){
posicionaLayer('menu', 77, 299);}
	
function exibirMenu(id,pExib){
 var menu = document.getElementById(id);
 if (pExib == 'on'){
  menu.style.visibility = 'visible';}
 else{
  menu.style.visibility ='hidden';}
}

function abre(janela) 	{
 window.open(janela,"fotos","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=350")
}