function NoDisponible () {
	alert("La función solicitada no está aun disponible!");
	return false;
}

function AbrirVentana(URL,SB,ANCHO,ALTO,IZDA,ARRIBA) 
{ // <--- Designed By Miguel M.( webmiguel(a)gmail.com ) - www.ski-cams.com
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" + SB + ",location=0,statusbar=0,menubar=0,resizable=0,width=" + ANCHO + ",height=" + ALTO + ",left = " + IZDA + ",top = " + ARRIBA + "');");
}

function ActivarFormulario(inputFather,inputSoon) {		
	var FatherSelected=inputFather[inputFather.selectedIndex].value;

	if (FatherSelected > 0) {
		inputSoon.disabled = false;
	} else {
		inputSoon.disabled = true;			
	}
}

function Borrar_Contenido(campo,texto) {
		if(campo.value == texto)
		{
				campo.value = '';
		}
}

function Buscador () {
	Borrar_Contenido(document.buscador.fecha,'dd/mm/aaaa');
	if(document.buscador.fecha.value.length < 6 && document.buscador.ciudad.value.length < 2 && document.buscador.local.value.length < 2 )
	{
		if(document.buscador.fecha.value.length == 0 ) {
			document.buscador.fecha.value = 'dd/mm/aaaa'; }
		alert("Debe introducir al menos un criterio correcto para la búsqueda.");
		return false;
	}
	else
		document.buscador.submit();
}

function CodigoPrivado () {
	if(document.privadas.codigotexto.value.length < 10)
	{
		alert("Debe introducir un código de acceso correcto.");
		document.privadas.codigotexto.focus();
	}
	else
		document.privadas.submit();
}

//Funcion para validar un email
function ValidarEmail(valor) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
		return true;
	} 
	else {
		return false;
	}
}

function UserLogin() {
	if(document.loginform.userfromlogin.value.length < 2)
	{
		alert("Debe introducir su usuario.");
		document.loginform.userfromlogin.focus();
	}
	else if(document.loginform.passwdfromlogin.value.length < 4)
	{
		alert("Debe introducir su contraseña.");
		document.loginform.passwdfromlogin.focus();
	}
	else
		document.loginform.submit();
}

var BANN_contador1 = 0;
var BANN_tiempo1 = 0;
var BANN_tempor1 = null;
function BANNERS_automat1(BANN_imag,BANN_enlace)
{
	BANN_tiempo1 = parseInt(BANN_tiempos1[BANN_contador1]);
	BANN_tempor1 = setTimeout("BANNERS_pasar1('" + BANN_imag + "','" + BANN_enlace + "')", BANN_tiempo1)
}
function BANNERS_pasar1(BANN_imag,BANN_enlace)
{
	BANNERS_cambio1(1,BANN_imag,BANN_enlace);
	if (BANN_contador1 < BANN_lista1.length-1)
		BANN_tempor1 = setTimeout("BANNERS_pasar1('" + BANN_imag + "','" + BANN_enlace + "')", BANN_tiempo1)
	else
	{
		BANN_contador1=-1;
		BANN_tempor1 = setTimeout("BANNERS_pasar1('" + BANN_imag + "','" + BANN_enlace + "')", BANN_tiempo1)
	}
}
function BANNERS_cambio1(BANN_sen,BANN_imag,BANN_enlace)
{
	var BANN_imagen1 = document.getElementById(BANN_imag);
	var BANN_enlace1 = document.getElementById(BANN_enlace);
	BANN_contador1+= BANN_sen;
	BANN_tiempo1 = parseInt(BANN_tiempos1[BANN_contador1]);
	if (BANN_contador1 ==BANN_lista1.length)
		BANN_contador1 = 0;
	else if (BANN_contador1 < 0) 
		BANN_contador1 = 0;
	BANN_imagen1.src = BANN_lista1[BANN_contador1];
	BANN_enlace1.href = BANN_enlaces1[BANN_contador1];
}

var BANN_contador2 = 0;
var BANN_tiempo2 = 0;
var BANN_tempor2 = null;
function BANNERS_automat2(BANN_imag,BANN_enlace)
{
	BANN_tiempo2 = parseInt(BANN_tiempos2[BANN_contador2]);
	BANN_tempor2 = setTimeout("BANNERS_pasar2('" + BANN_imag + "','" + BANN_enlace + "')", BANN_tiempo2)
}
function BANNERS_pasar2(BANN_imag,BANN_enlace)
{
	BANNERS_cambio2(1,BANN_imag,BANN_enlace);
	if (BANN_contador2 < BANN_lista2.length-1)
		BANN_tempor2 = setTimeout("BANNERS_pasar2('" + BANN_imag + "','" + BANN_enlace + "')", BANN_tiempo2)
	else
	{
		BANN_contador2=-1;
		BANN_tempor2 = setTimeout("BANNERS_pasar2('" + BANN_imag + "','" + BANN_enlace + "')", BANN_tiempo2)
	}
}
function BANNERS_cambio2(BANN_sen,BANN_imag,BANN_enlace)
{
	var BANN_imagen2 = document.getElementById(BANN_imag);
	var BANN_enlace2 = document.getElementById(BANN_enlace);
	BANN_contador2+= BANN_sen;
	BANN_tiempo2 = parseInt(BANN_tiempos2[BANN_contador2]);
	if (BANN_contador2 ==BANN_lista2.length)
		BANN_contador2 = 0;
	else if (BANN_contador2 < 0) 
		BANN_contador2 = 0;
	BANN_imagen2.src = BANN_lista2[BANN_contador2];
	BANN_enlace2.href = BANN_enlaces2[BANN_contador2];
}


