<!--
// PRELOAD DE IMAGENES //

var status = 1;
var toc = new Array();

function item(off, over){
	this.off = new Image(); this.off.src = off;
	this.over = new Image(); this.over.src = over;
}
function cache(id, off, over){
	item[id] = new item(off, over);
	toc[toc.length] = id;
}
function over(id){
	document[id].src = item[id].over.src;
}
function out(id){
	document[id].src = item[id].off.src;
}

// FIN DE PRELOAD DE IMAGENES //

// Set Netscape up to run the "captureMousePosition" function whenever
// the mouse is moved. For Internet Explorer and Netscape 6, you can capture
// the movement a little easier.
if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position
        // reflects the position from the top/left of the screen the
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no
        // matter if the user has scrolled or not.
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}

var lastDiv = '';

function swicthDiv(nameid, hidelast) {
  if(document.getElementById(nameid) != 'null') {
    if(document.getElementById(nameid).style.visibility == 'hidden') {
      document.getElementById(nameid).style.visibility = 'visible';
      document.getElementById(nameid).style.display = '';
    } else {
      document.getElementById(nameid).style.visibility = 'hidden';
      document.getElementById(nameid).style.display = 'none';
    }
  }

  if(lastDiv != '' && hidelast && lastDiv != nameid) {
    if(document.getElementById(lastDiv) != 'null') {
      if(document.getElementById(lastDiv).style.visibility == 'hidden') {
        document.getElementById(lastDiv).style.visibility = 'visible';
        document.getElementById(lastDiv).style.display = '';
      } else {
        document.getElementById(lastDiv).style.visibility = 'hidden';
        document.getElementById(lastDiv).style.display = 'none';
      }
    }
  }

  lastDiv = nameid;
}

function codigoTecla(evento)
{
	return (evento.which?evento.which:evento.keyCode);
}

function apretoEnter(evento)
{
	return (13==codigoTecla(evento));
}

function OpenWin(pagina,parametros,nombre, Height, width) {
	window.open(pagina + "?" + parametros, nombre, "toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width="+ width +",height="+ Height +",top=100,left=100");
}


    // DETECTOR DE BROWSER //
	var dom = document.getElementById ? true:false;
	var nn4 = document.layers ? true:false;
	var ie4 = document.all ? true:false;

	var lastIdMenu = null;
	var lastMenuTimeout = 0;
	function mostrarMenu(idMenu)
	{
		var oMenu = null;
		ocultarMenu();
		if(ie4) { oMenu = document.all[idMenu].style; }
		else if(nn4) { oMenu = document.layers[idMenu]; }
		else if(dom) { oMenu = document.getElementById(idMenu).style; }

		if(oMenu !=null)
		{
			oMenu.visibility = "visible";
			oMenu.display = "block";
			lastIdMenu = idMenu;
		}
	}

	function ocultarMenuClear()
	{
		if(lastMenuTimeout>0)
			clearTimeout(lastMenuTimeout);
	}

	function ocultarMenuAuto()
	{
		ocultarMenuClear();
		lastMenuTimeout = setTimeout('ocultarMenu()', 750);
	}

	function ocultarMenu( )
	{
		ocultarMenuClear();
		if(lastIdMenu!=null)
		{
			var oMenu = null;
			var oIfr = null;
			var lastIdMenuFrame = 'ifr'+lastIdMenu.substr(3);

      oIfr  = document.getElementById(lastIdMenuFrame);

			if(ie4) {
			  oMenu = document.all[lastIdMenu].style;
			}

			else if(nn4) {
			   oMenu = document.layers[lastIdMenu];
			}

			else if(dom) {
			  oMenu = document.getElementById(lastIdMenu).style;
		  }

			if (oMenu!=null)
			{
				oMenu.visibility="hidden"
				lastIdMenu = null;
			}

			if (oIfr!=null)
			{
				oIfr.style.display="none"
			}

		}
	}

	function menuTdOver(o)
	{
		o.style.backgroundColor="#5BCBEC";
		o.style.cursor="pointer";
	}

	function menuTdOut(o)
	{
		o.style.backgroundColor="";
		o.style.cursor="";
	}
	
	function cambiopais(idxpais)
	{ 
  	var strHref = window.location.href;
  	strHref     = strHref.replace(/\&cambioPais=\d*/ig, '');	
  	window.location = strHref+'&cambioPais='+idxpais; 
	}

	//[PD]INCLUYO LOS FLASH para evitar el bug del Obj en IE;
	function _flash_object_include(ancho, alto, file, parametros, transparente, colorFondo, alineado, nombre, idobj)
	{
		WMode     = "";
  	BaGrColor = "";
  	Alin      = "";
  	Nomb      = "";
    idObjeto  = "";
    
  	objetoFlash = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+ancho+'" HEIGHT="'+alto+'" VIEWASTEXT>';
    objetoFlash += '<PARAM NAME=movie VALUE="'+file+parametros+'">';
    objetoFlash += '<PARAM NAME=quality VALUE=high>';
    
  	if(transparente == 1)
  	{
  	  objetoFlash += '<PARAM NAME="wmode" VALUE="transparent">';
  	  WMode = ' wmode="transparent" ';
  	}

    if(nombre != '')
  	  Nomb = ' name="' + nombre + '" ';

    if(alineado != '')
  	  Alin = ' align="' + alineado + '" ';
  	
  	if(idobj != 0)
  	  idObjeto = ' id="' + idobj + '" ';
  	
  	if(colorFondo != '')
  	{
  	  objetoFlash += '<param name="bgcolor" value="'+colorFondo+'" >';
  	  BaGrColor = ' bgcolor="' + colorFondo + '" ';
  	}
  	
  	objetoFlash += '<EMBED src="' + file + parametros + '" ' + WMode + BaGrColor + Nomb + idObjeto + Alin + '  quality=high WIDTH="'+ancho+'" HEIGHT="'+alto+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
  	
  	objetoFlash += '</OBJECT>';
  	document.write(objetoFlash);
  }
