/* Versión de navegador */
IS_DOM = (document.getElementById) ? true : false;
IS_IE = (document.all) ? true : false;
IS_IE50 = (navigator.userAgent.indexOf("IE 5.0") != -1);
IS_Mac = (navigator.appVersion.indexOf("Mac") != -1);
IS_IE5Mac = IS_IE && IS_Mac && IS_DOM;

/* funciones de movimiento de imagenes */
function iniciar() {
	Timer1 = setTimeout("mover_imagenesA()" ,4500);
	Timer2 = setTimeout("mover_imagenesB()" ,2500);
}
function parar() {
	clearTimeout(Timer1);
	clearTimeout(Timer2);
}
function mover_imagenesA()
{
	var iNum = aleatorio(0,iImg);
	cambioImagen("imgA", "img" + iNum);
	Timer1 = setTimeout("mover_imagenesA()" ,4000);
}
function mover_imagenesB()
{
	var iNum = aleatorio(0,iImg);
	cambioImagen("imgB", "img" + iNum);
	Timer2 = setTimeout("mover_imagenesB()" ,5500);
}

function aleatorio(inferior,superior) { 
    numPosibilidades = superior - inferior 
    aleat = Math.random() * numPosibilidades 
    aleat = Math.round(aleat) 
    return parseInt(inferior) + aleat 
}

/* Funciones de cambio de imagen */
function cambioImagen(imgName, imgAleatoria) {
  if (IS_DOM) {
    document.getElementById(imgName).src = eval(imgAleatoria + ".src");
  }
}


/* funciones de ventanas */
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

var popUpWin2=0;
function popUpWindow2(URLStr, left, top, width, height)
{
  if(popUpWin2)
  {
    if(!popUpWin2.closed) popUpWin2.close();
  }
  popUpWin2 = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}



