// JavaScript Document

/*jQuery(function(){					
	jQuery('ul#menu li').each(function () {											  	
		jQuery(this).hover(function(){
			jQuery(this).css({ backgroundImage: "url('/img/btnmenuon.jpg')" });
			jQuery('p',this).css({color: "#d44059"});
		},function(){
			jQuery(this).css({ backgroundImage: "url('/img/btnmenuback.jpg')" });
			jQuery('p',this).css({color: "#cecece"});
		});
	});
});
*/

jQuery(document).ready(function(){

	jQuery("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	jQuery("ul.topnav li span, ul.topnav li a").hover(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		jQuery(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
		jQuery(this).parent().find("a.link").css("background-color", "#372524");
		
		jQuery(this).parent().hover(function() {
		}, function(){
			jQuery(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
			jQuery(this).find("a.link").css("background", "none");
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			jQuery(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			jQuery(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	//RollOver imágenes Galeria
	jQuery(".galeriaHome img").hover(function() {
			jQuery(this).css("border-color", "#df559d");
	}).mouseout(function() {
			jQuery(this).css("border-color", "#302A20");
	});
	//RollOver imágenes Galeria Interior
	jQuery(".ulFotos img").hover(function() {
			jQuery(this).css("border-color", "#E757A3");
	}).mouseout(function() {
			jQuery(this).css("border-color", "#ACD8DE");
	});

});


function openDiv(codi) {
	//alert('codi:'+codi);
	jQuery("#"+codi).each(function () {
			if (jQuery(this).css("display")=="none") {
				jQuery(".close").slideUp("fast");
				jQuery(this).slideDown("slow");
			} else {
				jQuery(this).slideUp("slow");
			}
	});
	
}

function enviarform()
{
//alert ("Hello World");
	if (document.formulario.nombre.value==''){
		alert("Rellene el campo nombre");return false;
	}else if (document.formulario.apellidos.value==''){
		alert("Rellene el campo apellidos");return false;
	}else if (document.formulario.mail.value==''){
		alert("Rellene el campo E-Mail");return false;
	}else if (document.formulario.mensaje.value==''){
		alert("Rellente el campo Mensaje");return false;
	}else {

	//document.formulario.action = "form/"+archivo+".php";
	//alert ("submit");
	//document.form.action = "enviar.php";
	//document.form.submit();
		return true;
	}
}



