//
// INICIO MENU DESPLEGABLE
//

var empezar=false, capas=new Array("e1","e2","e3","e4","e5","e6","e7","e8"), retardo, ocultar, anclas=new Array ("ancla1","ancla2","ancla3","ancla4","ancla5","ancla6","ancla7","ancla8");

function muestra(capa) {
	xShow(capa);
}
function oculta(capa) {
	xHide(capa);
}
function posiciona (){
	for (i=0;i<capas.length;i++){
		posx= xOffsetLeft(anclas[i])
		posy= xOffsetTop (anclas[i])
		xMoveTo(capas[i],posx,posy+18) // Posic. relativa a los BOTONES
	}
}
window.onresize = function() {
	posiciona();
}
function muestra_coloca(capa) {
	if (empezar) {
		for (i=0;i<capas.length;i++) {
			if (capas[i] != capa) xHide(capas[i])
}

		clearTimeout(retardo);
		xShow(capa);
	}
}
function oculta_retarda(capa) {
	if (empezar) {
		ocultar=capa;
		clearTimeout(retardo);
		retardo=setTimeout("xHide('" + ocultar + "')",300) // Retardo=300
	}
}
function muestra_retarda(ind){
	if (empezar) {
		clearTimeout(retardo)
	}
}

//
// Version 3.15.2 (cross-browser)
//

var xNN4,xOp7,xOp5or6,xIE4Up,xIE4,xIE5,xMac,xUA=navigator.userAgent.toLowerCase();

if (window.opera) {
	xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
	if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else	if (document.all && xUA.indexOf('msie')!=-1) {
	xIE4Up=parseInt(navigator.appVersion)>=4;

	xIE4=xUA.indexOf('msie 4')!=-1;
	xIE5=xUA.indexOf('msie 5')!=-1;
	}
	else	if (document.layers) {
			xNN4=true;
		}
xMac=xUA.indexOf('mac')!=-1;

function xGetElementById(e) {
	if (typeof(e)!='string') return e;
	if(document.getElementById) e=document.getElementById(e);
	else 	if(document.all) e=document.all[e];
		else e=null;
	return e;
}
function xParent(e,bNode) {
	if (!(e=xGetElementById(e))) return null;
	var p=null;
	if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
	else 	if (xDef(e.parentNode)) p=e.parentNode;
		else if (xDef(e.parentElement)) p=e.parentElement;
	return p;
}
function xDef() {
	for(var i=0; i<arguments.length; ++i) {
		if(typeof(arguments[i])=='undefined') return false;
	}
	return true;
}
function xStr(s) {
	for(var i=0; i<arguments.length; ++i) {
		if (typeof(arguments[i])!='string') return false;
	}return true;
}
function xNum(n) {
	for(var i=0; i<arguments.length; ++i) {
		if (typeof(arguments[i])!='number') return false;
	}
	return true;
}
function xShow(e) {
	if(!(e=xGetElementById(e))) return;
	if(e.style && xDef(e.style.visibility)) e.style.visibility='visible';
}
function xHide(e) {
	if(!(e=xGetElementById(e))) return;
	if(e.style && xDef(e.style.visibility)) e.style.visibility='hidden';
}
function xZIndex(e,uZ) {
	if(!(e=xGetElementById(e))) return 0;
	if(e.style && xDef(e.style.zIndex)) {
		if(xNum(uZ)) e.style.zIndex=uZ;
			uZ=parseInt(e.style.zIndex);
		}
		return uZ;
}
function xMoveTo(e,iX,iY) {
	xLeft(e,iX);
	xTop(e,iY);
}
function xLeft(e,iX) {
	if(!(e=xGetElementById(e))) return 0;
	var css=xDef(e.style);
	if (css && xStr(e.style.left)) {
		if(xNum(iX)) e.style.left=iX+'px';
		else {
			iX=parseInt(e.style.left);
			if(isNaN(iX)) iX=0;
		}
	}
	else 	if(css && xDef(e.style.pixelLeft)) {
			if(xNum(iX)) e.style.pixelLeft=iX;
			else iX=e.style.pixelLeft;
			}
		return iX;
}
function xTop(e,iY) {
	if(!(e=xGetElementById(e))) return 0;
	var css=xDef(e.style);
	if(css && xStr(e.style.top)) {
		if(xNum(iY)) e.style.top=iY+'px';
		else {
			iY=parseInt(e.style.top);
			if(isNaN(iY)) iY=0;
		}

	}
	else 	if(css && xDef(e.style.pixelTop)) {
			if(xNum(iY)) e.style.pixelTop=iY;
			else iY=e.style.pixelTop;
		}
		return iY;
}
function xOffsetLeft(e) {
	if (!(e=xGetElementById(e))) return 0;
	if (xDef(e.offsetLeft)) return e.offsetLeft;
	else return 0;
}
function xOffsetTop(e) {
	if (!(e=xGetElementById(e))) return 0;
	if (xDef(e.offsetTop)) return e.offsetTop;
	else return 0;
}

//
// FIN MENU DESPLEGABLE
//

function i_x(x){
	document.images['xc'].src='imagenes/casino_girl_' + x + '.gif';
}
function cambiar_color_fondo(id, color) {
	objeto = document.getElementById(id);
	objeto.style.backgroundColor = color;
}
function Top_Window_00() {


  top.window.moveTo(0,0);
  if (document.all) top.window.resizeTo(940,screen.availHeight);
  else
    if (document.layers||document.getElementById)
      if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
        top.window.outerHeight = screen.availHeight;
top.window.outerWidth = 940;
}

//
// WINDOW.ONLOAD
//

window.onload = function() {
	posiciona();		// MENU DESPLEGABLE
	empezar = true;		// Flag Menú Desplegable
	Top_Window_00();	// Nav. Top en coord. 0,0
}

// SIN UTILIZAR

function abrirVentana(laURL,winNombre,caracteristicas,texto) {
	window.open(laURL,winNombre,caracteristicas);
}
function abrir_popup(s_url) {
	opciones = "toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0, width=500px, height=300px";
	window.open(s_url,'',opciones).focus();
}

// Ratón

function click() {
	if (event.button==2) {
		alert ('© Copyright Grupo Joker');
	}
}
function raton() {
	if (1==1) document.onmousedown=click;
}

// RESTO FUNCIONES

// abre--> 1 (Abre) ó 0 (No abre) (abre sólo en el mismo directorio)

function abrepagina(laURL,abre) {
	if (abre==1) document.location.href=laURL;
}

function aleatorio(superior) {
	numPosibilidades = superior - 1;
	aleat = Math.random() * numPosibilidades;
	return Math.round(parseInt(1) + aleat);
}
function pone_jackpot() {
b_depo=aleatorio(10);			// Número de Jackpots;
document.write('<img src="n/n/'  +   b_depo +  '.gif" width="120" height="21" alt="¡Espectacular Casino!">');
}