// JavaScript Document


	
	function overTD(td,color){td.bgColor=color;} 
	function outTD(td,color){td.style.cursor='default';td.bgColor=color;} 
	function clickTD(td){td.children.tags('A')[0].click();} 
	
	function CargarFoto(img, ancho, alto){
		derecha=(screen.width-ancho)/2;
		arriba=(screen.height-alto)/2;
		string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
		fin=window.open(img,"",string);
	}
 function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
		var MiVentana;
		if(window.screen)if(isCenter)if(isCenter=="true"){
			var myLeft = (screen.width-myWidth)/2;
			var myTop = (screen.height-myHeight)/2;
			
			features+=(features!='')?',':'';
			features+='scrollbars=1,left='+myLeft+',top='+myTop;
		}
		MiVentana=window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
		MiVentana.focus();
	}


function verFotoGaleria(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function esVacio(campo, mensaje)
{
	if(campo.value=='') 
	{
		alert(mensaje);
		campo.focus();
		return true;
	} 
	else
		return false;
}

function CheckMail(cadena) {
	var plant = /[^\w^@^\.^-]+/gi
	if (plant.test(cadena)) {
		 alert("La dirección de correo " + cadena + " contiene caracteres extraños.");
		 return false;
	} else {
		plant =/[a-zA-Z0-9_.](@{1})([\w\.-]+$)/i
		if (plant.test(cadena)) {
			return true;
		} else { 
			alert(cadena + " no es una dirección de correo válida.")
			return false;
		}
	} 
}

function BarraEstado() {
	var Texto = "Guerras Cantabras"; 
	var changeRate = 3000; // 1000 = 1 second
	var messageNumber = 0;

	window.status="GUERRAS CANTABRAS";
}

function FaltanDias()
	{
		var date = new Date("August 24, 2007");
		var description = " la VII Edicion de la fiesta Guerras Cantabras";
		var now = new Date();
		var diff = date.getTime() - now.getTime();
		var days = Math.floor(diff / (1000 * 60 * 60 * 24));
	
		if (days > 1) {
			document.write(days+1 + " dias para" + description);
		}
		else if (days == 1) {
			document.write("Solo dos dias para" + description);
		}
		else if (days == 0) {
			document.write("Mañana empiezan " + description);
		}
		else {
			document.write("¡¡¡ Ya estamos en " + description + "!!!");
		}
	}
	
	function Fecha() {
		var months=new Array(13);
		months[1]="Enero";
		months[2]="Febrero";
		months[3]="Marzo";
		months[4]="Abril";
		months[5]="Mayo";
		months[6]="Junio";
		months[7]="Julio";
		months[8]="Agosto";
		months[9]="Sept.";
		months[10]="Octubre";
		months[11]="Nov.";
		months[12]="Dic.";
	
		var time=new Date();
		var lmonth=months[time.getMonth() + 1];
		var date=time.getDate();
		var year=time.getYear();
	
		if (year < 2000)	year = year + 1900;
		document.write(date + " de " + lmonth + " de " + year);
	}
	
	function FechaCompleta(){
		dows = new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
		months = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
		now = new Date();
		dow = now.getDay();
		d = now.getDate();
		m = now.getMonth();
		h = now.getTime();
		y = now.getYear();
		document.write(dows[dow]+" "+d+" de "+months[m]+" de "+y);
	}
