<!--
function menu(a){	
	$("#"+a ).css({'color':'#fff','background':'url(Content/images/'+a+'_on.png) no-repeat'});
}
function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 3000 );
});


var nos=new Array();
for(var i=0; i<4; i++){
	nos[i] = 0;	
}




function nosotros(a){
	nos[a] = 1;
	if(a<2){
		 $("#menuNosotros a:eq("+a+")").animate({
			left: '59px'
		  }, 100);	
	}
	else{
		$("#menuNosotros a:eq("+a+")").animate({
			left: '850px'
		  }, 100);		
	}
}

function campamentos(a){
	$("#"+a ).css({'background':'url(Content/images/'+a+'_on.png) no-repeat'});	
}

function padres(a){
	$("#"+a ).css({'color':'#895b3b'});	
}

var faq;
var faqOld;

$(window).load(function(){
	$.preloadCssImages(); 
}); 
$(document).ready(function(){
   
   $('#ulfaq a').click(function() {
	  	var orden =  $('#ulfaq a').index(this);	
		faqOld = faq;
		faq = orden;
		if(faqOld!=undefined&&faqOld!=faq){
			 $("#ulfaq  .q:eq("+faqOld+") ul").slideUp("fast");
		}
		$("#ulfaq  .q:eq("+faq+") ul").slideDown("fast");
	});
   
	$("#menuNosotros a").hover(
	  function () {
		var orden =  $("#menuNosotros a").index(this);	
		if(nos[orden]==0){
			if(orden<2){
				 $("#menuNosotros a:eq("+orden+")").animate({
					left: '59px'
				  }, 100);	
			}
			else{
				$("#menuNosotros a:eq("+orden+")").animate({
					left: '850px'
				  }, 100);		
			}
		}
	  },
	  function () {
		var orden =  $("#menuNosotros a").index(this);	
		if(nos[orden]==0){
			if(orden<2){
				 $("#menuNosotros a:eq("+orden+")").animate({
					left: '69px'
				  }, 100);	
			}
			else{
				$("#menuNosotros a:eq("+orden+")").animate({
					left: '840px'
				  }, 100);		
			}
		}
	  }
	);
	
	 
 $("#actividades_1Int a").click(function (){
		var orden = $("#actividades_1Int a").index(this);	
		var orden2 =orden+1;
		var laH = $(".actividades_ContMov").height();
		laH = laH+30;
		laH = laH*orden;
		var laY = 0-laH;
		$('.actividades_ContMov').css({ 'overflow-y':'hidden'});
		$("#contAct").animate({
			top: laY
		  }, 300, function(){
				$('.actividades_ContMov').css({ 'overflow-y':'auto'});
			  });
   });
		
}); 

function abrir(a,e,b,c,d){
	if(document.all){var ventanaW=document.body.clientWidth;}
	else{var ventanaW=window.innerWidth}
	if(document.all){var ventanaH=document.body.clientHeight+150;}
	else{var ventanaH=window.innerHeight}
	var w = ventanaW/2;
	w = w-(b/2);
	var h = ventanaH/2;
	h = h-(c/2);
	window.open(a, e, 'width='+b+', height='+c+', top='+h+',left='+w+', scrollbars='+d+', location=0');
}

function ventana(a){
	$('.datoslegales').fadeIn("slow");
	$('.datoslegales .legalesInt').load(a);

};

function cerrar(a){
	$('.datoslegales').fadeOut("slow");

};

//function isDate(string)
//{ //string estará en formato dd/mm/yyyy (dí­as < 31 y meses < 12)
//  regExp=/^(([0-2]d|[3][0-1])/([0]d|[1][0-2])/[2][0]d{2})$|^(([0-2]d|[3][0-1])/([0]d|[1][0-2])/[2][0]d{2}s([0-1]d|[2][0-3]):[0-5]d:[0-5]d)$/;
//  if(!regExp.test(string)) return false;
//  else return true;
//};

var mask = /\d{2}\/\d{2}\/\d{4}/;
//dd/mm/aaaa;
function validarFecha(input){
var input = String(input); //input argument may be a string
if(!mask.test(input) || input.length != 10)return false; //not valid argument;
var date = input.split('/');

//var date = new Date(date[2], Number(date[1]) - 1, date[0]);
return validar(Number(date[0]),Number(date[1]),date[2]);

} 


function validar(Dia,Mes,Ano)
{

//var elMes = parseInt(mes);

//if ((elMes<1) || (parseInt(dia)<1) || (parseInt(anio)<1))
//return false;
//if(elMes>12)
//return false;
//// MES FEBRERO
//if(elMes == 2){
//if(esBisiesto(anio)){
//if(parseInt(dia) > 29){
//return false;
//}
//else
//return true;
//}
//else{
//if(parseInt(dia) > 28){
//return false;
//}
//else
//return true;
//}
//}
////RESTO DE MESES

//if(elMes== 4 || elMes==6 || elMes==9 || elMes==11){
//if(parseInt(dia) > 30){
//return false;
//}
//}
//return true;

  
    if (isNaN(Ano) || Ano.length<4 || parseFloat(Ano)<1900){              
         return false  ;
     }  
     
     if (isNaN(Mes) || parseFloat(Mes)<1 || parseFloat(Mes)>12){  
         
         return false  ;
     }  
     
     if (isNaN(Dia) || parseInt(Dia, 10)<1 || parseInt(Dia, 10)>31){  
          
         return false ; 
     }  
     if (Mes==4 || Mes==6 || Mes==9 || Mes==11 || Mes==2) {  
         if ((Mes==2 && Dia > 28) || Dia>30) {  
             
             return false  ;
         }  
     }  
return true;
}
function validarInscripcion(formu) {
    var texto = '';
    if (formu.nombre.value == '')
        texto += "- El campo nombre es obligatorio.\n";
    if (formu.fecha_nacimiento.value == '')   
        texto+="- El campo fecha de nacimiento es obligatorio.\n";
    else {
        if (!validarFecha(formu.fecha_nacimiento.value))
         texto+="- El campo fecha de nacimiento no tiene un formato correcto. Ejemplo: 02/02/2000.\n"
    }   
    if (formu.edad.value=='')
        texto+="- El campo edad es obligatorio.\n";
    else if (isNaN(formu.edad.value)){
     texto += "- La edad tiene que ser un valor entero.\n";
    }
    if (formu.curso_escolar.value=='')
        texto+="- El campo curso escolar es obligatorio.\n";
    if (formu.domicilio.value=='')
        texto+="- El campo domicilio es obligatorio.\n";   
    if (formu.ciudad.value=='')
        texto+="- El campo ciudad es obligatorio.\n";  
    if (formu.provincia.value=='')
        texto+="- El campo provincia es obligatorio.\n";   
    if (formu.cp.value=='')
        texto+="- El campo codigo postal es obligatorio.\n";   
    else if (isNaN(formu.cp.value)){ 
        texto += "- El codigo postal tiene que ser un valor entero.\n";       
    }
     if (formu.mail_acampado.value == '')
        texto += "- El campo email del acampado es obligatorio.\n";
    else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formu.mail_acampado.value))) {
        texto += "- Formato de email del acampado incorrecto.\n";
    }
    /*if (formu.num_socio.value=='')
        texto+="- El campo numero de socio es obligatorio.\n";*/
    if (formu.email_padre.value != '')
       { 
       if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formu.email_padre.value))) 
          texto += "- Formato de email del padre incorrecto.\n";
     }       
    if (formu.email_madre.value != '')
       { 
       if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formu.email_madre.value))) 
          texto += "- Formato de email de la madre incorrecto.\n";
     }            
//    if (formu.uxTelefono.value == '')
//        texto += "- El campo telefono es obligatorio.\n";
//    if (formu.uxComentarios.value == '')
//        texto += "- El campo comentario es obligatorio.\n";
//    if (!formu.uxChkAcepto.checked)
//        texto += "- Debe aceptar la pol\u00EDtica de privacidad.\n";
    if (texto != '') {
        alert(texto);
        return false;
    }
    return true;
};

//-->
