// +----------------------------------------------------- J. Eusebio Bolon [SEBI] - 17/07/2007 ---+
// |   REALIZADO EN | HOBERON DESARROLLO E INNOVACION                                             |
// |        VERSION | apuesta10 1.00                                                            |
// |        ARCHIVO | funciones.js                                                                |
// |    DESCRIPCION | Archivo que contiene todas las funciones JavaScript.                        |
// +----------------------------------------------------------------------------------------------+
//INI SCRIPT PARA EL TEXTO EN STATUS BAR
window.defaultStatus="Welcome www.apuesta10.com ";


function FJSfavoritos(){
// +----------------------------------------------------- J. Eusebio Bolon [SEBI] - 77/08/2007 ---+
// | Función que agrega a la carpeta de favoritos la página                                       |
// +----------------------------------------------------------------------------------------------+
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4))
	{
		window.external.AddFavorite("http://www.apuesta10.com", "www.apuesta10.com - Comunidad de Juego Online");
	}
	else
	{ 
		if(navigator.appName == "Netscape") 
		{
			alert("Presione Crtl+D para agregar este sitio en sus Bookmarks");
		}
	}
} 

/*11/05/2010 10:42:27
//-------------------------------------------------------------------------------------------------
//INI FUNCIONES PARA EL MENU DESPELGABLE
//Variable que contiene la altura del menu
var HEIGHT = 20;

function FJSmenuOn(IdMenu){
	element = document.getElementById("des-"+IdMenu);
	
	for (i=1; i<=NUMENU; i++)
	{
		//vuelvo el menu a su estado normal
		//document.getElementById("sec"+i).className="menuOff";
		//oculto el menu desplegable
		elementAux = document.getElementById("des-sec"+i);
		if (elementAux)
		{
			elementAux.style.visibility = "hidden";	
			elementAux.style.display="none";
		}
	}
		
	if (element)
	{
		//Cambio el stilo del menu
		//document.getElementById(IdMenu).className="menuOn";
		//Calculo la posicion del menu
		var pos = getAbsoluteElementPosition(IdMenu);
		//Muestro el menu
		element.style.visibility= "visible";
		element.style.display	= "Inline";
		element.style.left	= (pos.left -5)+ "px" ;
		element.style.top	= (pos.top + HEIGHT) + "px" ;
	}
}


function getAbsoluteElementPosition(element) {
  if (typeof element == "string"){element = document.getElementById(element);}
    
  if (!element) return { top:0,left:0 };
  
  var y = 0;
  var x = 0;
  while (element.offsetParent)
  {
    x += element.offsetLeft;
    y += element.offsetTop;
    element = element.offsetParent;
  }
  return {top:y,left:x};
}
//FIN FUNCIONES PARA EL MENU DESPELGABLE
//-------------------------------------------------------------------------------------------------
*/

function FJSvalidoComentarios(nameForm){
// +----------------------------------------------------------------------------------------------+
// | Función que valida que los campos obligatorios del formulario de comentarios se cubran       |
// +----------------------------------------------------------------------------------------------+
	if (!document.forms[nameForm].elements["autor"].value){
		alert ("El campo NOMBRE es obligatorio.");
		document.forms[nameForm].elements["autor"].focus();
		return false;
	}else if (document.forms[nameForm].elements["autor"].value.length<5){
		alert ("El tamaño mínimo del campo NOMBRE es de 5 caracteres.");
		document.forms[nameForm].elements["autor"].focus();
		return false;
	}
//	if (!document.forms[nameForm].elements["email"].value){
//		alert ("O campo E-MAIL é obligatorio.");
//		document.forms[nameForm].elements["email"].focus();
//		return false;
//	}else{
//		var email = document.forms[nameForm].elements["email"].value;
//		var ind1, ind2, ind3;
//		ind1 = email.indexOf("@");
//		ind2 = email.indexOf(".");
//		ind3 = email.lastIndexOf("@");
//		if ((ind1<=0) || (ind3 != ind1)){
//			alert ("O campo E-MAIL tem de ter: nome@dominio.com");
//			document.forms[nameForm].elements["email"].focus();
//			return false;
//		}
//	}
	if (!document.forms[nameForm].elements["comentario"].value){
		alert ("El campo COMENTARIO es obligatorio.");
		document.forms[nameForm].elements["comentario"].focus();
		return false;
	}else if (document.forms[nameForm].elements["comentario"].value.length<10){
		alert ("El tamaño mínimo del campo COMENTARIO es de 10 caracteres.");
		document.forms[nameForm].elements["comentario"].focus();
		return false;
	}
}


function FJSdesplegar(identificador){
// +----------------------------------------------------------------------------------------------+
// | Función que oculta/muestra el HTML contenido en el ID que se le pasa                         |
// +----------------------------------------------------------------------------------------------+
	if(document.getElementById(identificador).style.visibility=="visible")
	{
		document.getElementById(identificador).style.visibility = "hidden";	
		document.getElementById(identificador).style.display="none";
	}
	else
	{
		document.getElementById(identificador).style.visibility = "visible";
		document.getElementById(identificador).style.display="Inline";
	}
}



function autoRefresco()
{
	window.location = location.href;
}
//25/05/2010 13:07:12 setTimeout('autoRefresco()', eval(600 * 1000));
setTimeout('autoRefresco()', eval(900 * 1000));

