
/*' ***Bug del Navigator cuando realiza un onLoad/onResize***
	' Problema:
	' Cuando se realiza un resize de la pantalla		
	' todas las capas pierden su posición.
	' Solución:
	' Volver a recargar la página cuando se realiza un onResize
	' Problema 2:		
	' El Navigator siempre que dispara el evento onLoad dispara el evento onResize
	
	' El siguiente código intenta solucionar este problema*/
		
	if (document.layers) 
	{      
		origWidth = innerWidth;      
		origHeight = innerHeight;   
	}
		
	function reDo() 
	{
	 if (innerWidth != origWidth || innerHeight != origHeight)
		{
	    location.reload();		
	    return false;    
	    }
	}
		    
	if (document.layers) onresize = reDo;


	//Inicializaciones ----------------------------------------------
	var iButton = new Array(8);
	iButton[0]="0"; iButton[1]="0"; iButton[2]="0"; iButton[3]="0";
	iButton[4]="0"; iButton[5]="0"; 
	
	
	var iPosMenus = new Array(7);
	iPosMenus[0]=3; iPosMenus[1]=0; iPosMenus[2]=5;
	iPosMenus[3]=4; iPosMenus[4]=0; iPosMenus[5]=0;	
	
	var iAux = 0;
	var iOpc="";
	
	//--------------------------------------------------------------
	
	//Funciones de la HOME------------------------------------------
	
	
	function openNewWin(url,target,params)
	{
		window.open(url,target,params);
	}	
	
	function imageRoll(sLogImg,sPhyImg,iImg,sLayer) 
	{
		var a;
	
		if (document.all || document.getElementById) 
		{
			a="document";
		}
		else 
		{
			if (sLayer!='')
			{
				a="document." + sLayer + ".document";
			}
			else
			{
				a="document";
			}
		}
	
		if (iButton[iImg-1]=="0") 
			eval(a + ".images['" + sLogImg + iImg + "'].src = " + "'images/" + sPhyImg + iImg + "_r.gif'");
	}
	
	function imagePush(sLogImg,sPhyImg,iImg,sLayer) 
	{
		var a;
	
		if (document.all || document.getElementById) 
		{
			a="document";
		}
		else 
		{
			if (document.layers)
			{
				
				if (sLayer!='')
				{
					a="document." + sLayer + ".document";
				}		
				else
				{
					a="document";
				}
			}
		}
	
		if (iButton[iImg-1]=="0") 
			eval(a + ".images['" + sLogImg + iImg + "'].src = " + "'images/" + sPhyImg + iImg + "_p.gif'");
	}

	function imageOut(sLogImg,sPhyImg,iImg,sLayer) 
	{
		var a;
	
		if (document.all || document.getElementById) 
		{
			a="document";
		}
		else 
		{
			if (sLayer!='')
			{
				a="document." + sLayer + ".document";
			}
			else
			{
				a="document";
			}
		}
	
		if (iButton[iImg-1]=="0")
			eval(a + ".images['" + sLogImg + iImg + "'].src = " + "'images/" + sPhyImg + iImg + "_n.gif'");
	}	

	function showhideLayer(sLogDiv,iDiv,sAction) 
	{
		var a,b;
				
		if (document.all) 
		{	
			a=sLogDiv + iDiv; 
			b = ".style";	
			eval(a + b + ".visibility = '" + sAction + "'");
		}
		else
		if (document.layers) 
		{	
			a="document." + sLogDiv + iDiv; 
			b = ""; 
			eval(a + b + ".visibility = '" + sAction + "'");
		}	
		else
		if (document.getElementById)
		{			
			var ele = null;
			ele=document.getElementById(sLogDiv + iDiv);
			if (ele!=null)
			{
				ele.visibility= "'" + sAction + "'";
			}
		}
	}
		
	function HideAllLayers() 
	{
		showhideLayer("mn",1,"hidden");
		showhideLayer("mn",2,"hidden");
		showhideLayer("mn",3,"hidden");
	}
		
	function preload(imgObj,imgSrc) {

		if (document.images) 
		{
			eval('imgObj = new Image()');
			eval('imgObj.src = "'+imgSrc+'"');
		}

	}

	function launch(iOpc,iOpc2,smode)
	{
		top.menu = iOpc;
		top.submenu = iOpc2;
		top.mode = smode;
				
		if (document.all || document.getElementById)
			parent.location.href = "init2.htm";
		else
			top.frames[4].location.href = "init2.htm";
	}
		
	//--------------------------------------------------------------

	document.onclick = HideAllLayers;

	top.inHome = "1";

	//Preloading de imagenes----------------------------------------

	var iCount = 0;
	
	preload("images/mn_emp_1_n.gif");	
	preload("images/mn_emp_1_r.gif");
		
	preload("images/mn_ref_2_n.gif");	
	preload("images/mn_ref_2_r.gif");
		
	preload("images/mn_sol_3_n.gif");	
	preload("images/mn_sol_3_r.gif");
		
	preload("images/mn_pro_4_n.gif");	
	preload("images/mn_pro_4_r.gif");
	
	preload("images/mn_par_5_n.gif");	
	preload("images/mn_par_5_r.gif");
			
	preload("images/mn_not_7_n.gif");	
	preload("images/mn_not_7_r.gif");

	preload("images/mn_cur_8_n.gif");	
	preload("images/mn_cur_8_r.gif");
				
	preload("images/logo.gif");
	preload("images/img_noticias.gif");
	
	//--------------------------------------------------------------
	
	
	
	function openWin(codi_noticia)
	{		
		window.open('noticia.asp?site=2&noticia='+ codi_noticia,'3imultimedia','left=0,top=0,width=720,height=540,resizable=no,scrollbars=yes,menubar=no,locationbar=no,statusbar=no,toolbar=no,left=0,top=50');		
	}	
	
	function show(theCapa, modo)
	{
		if (document.all)
		{
			document.all["capa"+theCapa].style.visibility = modo;
		}
		else if (document.getElementById)
		{
			var ele=null;
			ele = document.getElementById("capa"+theCapa);

			if (ele!=null)
				ele.visibility=modo;
		}
		
    }
	
	
	function showAllNews(modo)
	{
		var i;
		for (i=0;i<numCapas;i++)
			show(i,modo);
	}

	var posCapaIni = 85;
	var posCapa = posCapaIni*2;
	var stp = 1;
	var uprlimit = -posCapaIni;
	
	if (numCapas>2)
		uprlimit = -posCapaIni*(numCapas-2);
	
	var upr = posCapaIni;
	var tim;
	var cont = 0;	

	function scrollCapa(theCapa,pos)
	{
		if (document.all)
		{
			document.all["capa"+theCapa].style.top = (posCapaIni * theCapa) + pos;
		}
		else if (document.getElementById)
		{
			var ele=null;
			ele = document.getElementById("capa"+theCapa);

			if (ele!=null)
				ele.style.top = (posCapaIni * theCapa) + pos;
		}
		
    }

		
	function scroll_up() 
	{
		var i;

		for (i=0;i<numCapas;i++)
			scrollCapa(i,posCapa);

		if (posCapa > uprlimit) 
			posCapa = posCapa - stp;
			
		if (posCapa == uprlimit) 
			posCapa = posCapaIni*2;
		
		cont = cont + 1;
		
		if (cont == upr)
		{
			cont = 0;
			tim = setTimeout("scroll_up()",2000);
		}
		else 
			tim = setTimeout("scroll_up()",10);
		
		
	}
		
	
		

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


