/*
	Assec 2002 ixPP  1.0  ( acesso )
 // 	
 // 
 //
 //       Coder  ppires@assec.pt
 //       file ixmenu.js( da  pagina principal)

*/
 
    
//window.captureEvents(event.RESIZE);   
window.onresize=ixredimensiona;

    
      
window.onscroll=ixscroll;
 function ixscroll(){
 // posicionaIMGTopo();
     
       }


function LayerVis(layer,modo){
   if (!layer) return;
   
 /* 
   if ((modo=='') or (modo == 'true')) var visivel = 'visible';
     else var  visivel = 'none';
*/

     if (document.all) 
         layer.style.display= modo;
      else 
          layer.display= modo;
     
}


function LayerWH(layer, w, h){
	if (!layer) return;

	/* 
	if ((modo=='') or (modo == 'true')) var visivel = 'visible';
		else var  visivel = 'none';
	*/
	
	layer.style.width = w;
	layer.style.height = h;
      
	if (document.all){ 
		layer.style.width = w;
		layer.style.height = h;
	} else {
		//layer.display = modo;
		layer.width = w;
		layer.height = h;
	}
}

function PosicionaLayer(layer,pposx,pposy){
	this.pposx = pposx;
	this.pposy = pposy;

	if (!layer) return;
     
	layer.style.left=pposx+"px"; 
	layer.style.top=pposy+"px"; 

	if (document.all) {
		layer.style.left = pposx+"px"; 
		layer.style.top = pposy+"px"; 
		layer.style.visibility= "visible";
	} else {
		layer.left = this.pposx;
		layer.top  = this.pposy;
		layer.style.visibility= "visible";
	} 
}


function GetHeight(layer){
        
     if (!layer) return 0;
     if (document.all) {
       if (false && layer.style.pixelHeight)
              return (layer.style.pixelHeight);
            else
               return (layer.clientHeight);
        }
      else {
            if (false && layer.style.pixelHeight)
              return (layer.style.pixelHeight);
            else
               return (layer.clientHeight);
        }
     return (-1);
      
}       

function posicionaIMGTopo(){
	var l = new Object ;
	var posx = 0;
	var posy = 0;
     
	if (document.all) { 
		l =  document.all;  
	} else {
		l =  document;
	};
     
	var largura = parseInt(document.body.clientWidth) || parseInt(document.documentElement.clientWidth ); 
	if (largura > 790)  posx = (largura - 790)/2;

	var altura = parseInt(document.body.clientHeight) || parseInt(document.documentElement.clientHeight );    
	if (altura > 450 )  posy = ( altura - 450)/2

	if (posy < 0  ) posy = 0;
	if (posx < 0  ) posx = 0;

	window.posx = posx;
	window.posy = posy;

	LayerWH(getObj('Layerlateral'), posx, 211);
	PosicionaLayer(getObj('Layerlateral'), posx+790, posy );

	LayerWH(getObj('LayerlateralEsq'), posx, 211);
	PosicionaLayer(getObj('LayerlateralEsq'), 0, posy );

};  

         
         
function ixredimensiona(){
	posicionaIMGTopo();
}


     
function getObj(valor){
	var ultObj = document.getElementById( valor );
	return  ultObj;
}




