//Aņadido por Francisco Gonzalez
var empezar = false;
var capas = new Array("Ini", "Gal","Tv","Wa");
var retardo ;
var ocultar;

function submitForm(id){
	if(!(e=xGetElementById(id))) return;
	e.submit();
}
function muestra(capa){
	xShow(capa);
}
function oculta(capa){
	xHide(capa);
}
function muestra_oculta(uno, dos){
	xOculta(uno);
	xMuestra(dos);
}
function limpia(id, texto){
  if(!(e=xGetElementById(id))) return;
  if(e.value == texto){
	e.value = '';
	e.style.color = '#000000';
  }
}
function posiciona(){
	posx = xOffsetLeft("Ubica");
	posy = xOffsetTop("Ubica");
	for (i=0;i<capas.length;i++){
		xMoveTo(capas[i],posx,posy);
	}
}
function posicionaBusqueda(){
	posx = xOffsetLeft("PatroBtnCentBuscar");
	posy = xOffsetTop("PatroBtnCentBuscar");
	if(navigator.appName=="Microsoft Internet Explorer")
		y=30;
	else
		y=33;
	xMoveTo("DivBuscador",posx+64,posy+y);
	xMoveTo("Busca",posx+220,posy+33);
}
function posicionaRegRecUsu(){
	posx = xOffsetLeft("Ubica");
	posy = xOffsetTop("Ubica");
	xMoveTo("RegRecUsu",posx+744,posy);
}
window.onload = function() {
 	// HighSlide Variables
 	hs.graphicsDir = 'js/graphics/';
    hs.outlineType = 'rounded-white';
	hs.preloadImages();
	// Pagina
	posiciona();
	posicionaBusqueda();
	posicionaRegRecUsu();
	empezar = true;
}
window.onresize = function() {
	posiciona();
	posicionaBusqueda();
	posicionaRegRecUsu();
}
function muestra_coloca(capa, img){
 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 + "')",500);
 }
}
function muestra_retarda(ind){
 if (empezar){
	clearTimeout(retardo);
 }
}
function xOculta(e){
	if(!(e=xGetElementById(e))) return;
	if(e.style && xDef(e.style.display)) e.style.display = 'none';
}
function xMuestra(e){
	if(!(e=xGetElementById(e))) return;
	if(e.style && xDef(e.style.display)) e.style.display = 'block';
}
//FIN
// x_core.js, X v3.15.2, Cross-Browser.com DHTML Library
// Copyright (c) 2004 Michael Foster, Licensed LGPL (gnu.org)

// global vars still duplicated in xlib.js - I still don't know what I'm going to do about this
var xVersion='3.15.2',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;
}

// Funciones para ventanas
function RecClave() {
	var win = new Window("recClave", {overlayShowEffectOptions: null, overlayHideEffectOptions: null, className: "alphacube", width: 285, height: 180, minimizable: false, maximizable: false, resizable: false})
	win.setURL('mod?op=recClave')
	win.setZIndex(2000)
	win.setDestroyOnClose()
	win.setTitle('Revistawey.com')
	win.showCenter()
}
function NuevoUsuario() {
	var win = new Window("nuevoUsuario", {overlayShowEffectOptions: null, overlayHideEffectOptions: null, className: "alphacube", width: 426, height: 490, minimizable: false, maximizable: false, resizable: false})
	win.setURL('mod?op=nuevo_usuario')
	win.setZIndex(2000)
	win.setDestroyOnClose()
	win.setTitle('Revistawey.com')
	win.showCenter()
}
function Contacto() {
	var win = new Window("contacto", {overlayShowEffectOptions: null, overlayHideEffectOptions: null, className: "alphacube", width: 470, height: 235, minimizable: false, maximizable: false, resizable: false})
	win.setURL('mod?op=contacto')
	win.setZIndex(2000)
	win.setDestroyOnClose()
	win.setTitle('Revistawey.com')
	win.showCenter()
}
// Seccion para las quinielas
// -----------------------------------------------------------------
function BasesQuiniela() {
	var win = new Window("basesQuiniela", {overlayShowEffectOptions: null, overlayHideEffectOptions: null, className: "alphacube", width: 640, height: 480, minimizable: false, maximizable: false, resizable: false})
	win.setURL('mod?op=basesQuiniela')
	win.setZIndex(2000)
	win.setDestroyOnClose()
	win.setTitle('Revistawey.com')
	win.showCenter()
}
function ListaQuiniela() {
	var win = new Window("listadoQuiniela", {overlayShowEffectOptions: null, overlayHideEffectOptions: null, className: "alphacube", width: 730, height: 480, minimizable: false, maximizable: false, resizable: false})
	win.setURL('mod?op=listadoQuiniela')
	win.setZIndex(2000)
	win.setDestroyOnClose()
	win.setTitle('Revistawey.com')
	win.showCenter()
}


// Mostrar y ocultar flash
// ---------------------------------------------------

function showFlash(){
	var flashObjects = document.getElementsByTagName("object");
	for (i = 0; i < flashObjects.length; i++) {
		flashObjects[i].style.visibility = "visible";
	}

	var flashEmbeds = document.getElementsByTagName("embed");
	for (i = 0; i < flashEmbeds.length; i++) {
		flashEmbeds[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideFlash(){
	var flashObjects = document.getElementsByTagName("object");
	for (i = 0; i < flashObjects.length; i++) {
		flashObjects[i].style.visibility = "hidden";
	}

	var flashEmbeds = document.getElementsByTagName("embed");
	for (i = 0; i < flashEmbeds.length; i++) {
		flashEmbeds[i].style.visibility = "hidden";
	}

}
