// JavaScript Document
var id_explorer=1;//---------1 internet explorer 2---- netscape 4.0  3---- netscape 6.0 o más
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	if(this.ie6 || this.ie5 || this.ie4) id_explorer=1;
	if( this.ns4 ) id_explorer=2;
	if( this.ns6 ) id_explorer=3;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()
var valor=1.0;
var ojo=1;
//------------  
function PonerImagen(name,orgW,orgH,borde,alt)
{
var window_height=window.screen.height;
var window_width=window.screen.width;

if( window_width>1024) factor=1;
else factor=valor;
if(window_width<=1024)
  document.write('<img src='+name+' alt='+alt+' border='+borde+' width='+orgW*factor+' height='+orgH*factor+'>'); 
 else
  document.write('<img src='+name+' alt='+alt+' border='+borde+' width='+orgW+' height='+orgH+'>');   
}
//------------
function PonerIframe(name,pag_web,orgW,orgH)
{
 var window_height=window.screen.height;
 var window_width=window.screen.width;
 if( window_width>1024) factor=1;
 else factor=valor;
  if(window_width<=1024)
   document.write(' <iframe width='+orgW*factor+' height='+orgH*factor+' scrolling=auto frameborder=0 name='+name+' src='+pag_web+'></iframe>');
  else
   document.write(' <iframe width='+orgW+' height='+orgH+' scrolling=auto frameborder=0 name='+name+' src='+pag_web+'></iframe>'); 
}
//-------------
function ConfiguracionDiv(id,left,top)
{
 height=window.screen.height;
 width=window.screen.width;
 if( width>1024) factor=1.0;
 else factor=valor;
       if(id_explorer==1){
	   document.all[id].style.left=left*factor;		
       document.all[id].style.top =top*factor;
	   if((id="divNombre")&&(factor<1)) document.all[id].style.fontSize=18;	
	   if((id="divMenu2")&&(factor<1)) document.all[id].style.fontSize=12;
	   if((id="divPie2")&&(factor<1)) document.all[id].style.fontSize=10;
	   if((id="divPie3")&&(factor<1)) document.all[id].style.fontSize=9;	
	   }
	  if(id_explorer==2)
	  {
	   document.layers[id].left=left*factor;			
       document.layers[id].top =top*factor;
	   if((id="divNombre")&&(factor<1)) document.layers[id].fontSize=18;	
	   if((id="divMenu2")&&(factor<1)) document.layers[id].fontSize=10;	
	   if((id="divPie2")&&(factor<1)) document.layers[id].fontSize=10;
	   if((id="divPie3")&&(factor<1)) document.layers[id].fontSize=9;	
	  }  
	 if(id_explorer==3){ 
	  document.getElementById(id).style.left=left*factor;			
      document.getElementById(id).style.top =top*factor;
	  if((id=="divNombre")&&(factor<1)) document.getElementById(id).style.fontSize=18;	
	  if((id=="divMenu2")&&(factor<1)) document.getElementById(id).style.fontSize=12;
	  if((id=="divPie2")&&(factor<1)) document.getElementById(id).style.fontSize=10;
	  if((id=="divPie3")&&(factor<1)) document.getElementById(id).style.fontSize=9;
	  } 
}
//-------------
function Init()
{
 height=window.screen.height;
 width=window.screen.width;
 
 if( width>1024) factor=1;
 else{ factor=valor;}
  if(id_explorer==1){
	   document.all["divPrincipal"].style.left=0;		
       document.all["divPrincipal"].style.top =0;
	   }
	  if(id_explorer==2)
	  {
	   document.layers["divPrincipal"].left=0;		
       document.layers["divPrincipal"].top =0;
	  }  
	 if(id_explorer==3){ 
	  document.getElementById("divPrincipal").style.left=0;		
      document.getElementById("divPrincipal").style.top =0;
	  } 
	 
}
//-------------------------------
//--- MOVIMIETO DEL OJICO

function timer_OJO()
{
 if(ojo==1)
  {
   imgname="images/ojo2.jpg";
   ojo=2;
  }
  else
   {
   imgname="images/ojo1.jpg";
   ojo=1;
   }

     if(id_explorer==1){
	   document.all["ID_IMG_OJO"].src=imgname;		
    
	   }
	  if(id_explorer==2)
	  {
	   document.layers["ID_IMG_OJO"].src=imgname;
    
	  }  
	 if(id_explorer==3){ 
	  document.getElementById("ID_IMG_OJO").src=imgname;		
	  } 
 setTimeout("timer_OJO()",850);
}
