/*** Evitamos conflictos con Mootools ***/
var j = jQuery.noConflict();

/****************************************/

j(document).ready(function()
{
	//Text d'exemple formulari
	j('.clearme').example(function() {
	  return j(this).attr('title');
	});
	
		j('#textArea').example(function() {
	  return j(this).attr('title');
	});

/*	j('#textArea').example('Expl�quenos brevemente su proyecto ...', {
	  className: 'textarea'
	});*/
	
	  // ******* Demanar presupost  **********//
	  
   j("input:radio[name=para]").click(function(){
   		var valor=j("input[@name=para]:checked").val();
		
		switch (valor) {
			case "obra":
				j('#tipoObra').addClass('mostrarBloc');					
				break;
			case "otros":
				j('#tipoObra').removeClass('mostrarBloc');
				j('#tipoNueva').removeClass('mostrarBloc');
				j('#tipoReforma').removeClass('mostrarBloc');
				j('#tipoComercial').removeClass('mostrarBloc');
				break;				
		}
	});
   
   		
		j("input:radio[name=tipos]").click(function(){
		var tipo=j("input[name=tipos]:checked").val();
		
		switch (tipo) {
                    case "reforma":
                            j('#tipoReforma').addClass('mostrarBloc');
                            j('#tipoNueva').removeClass('mostrarBloc');
                            j('#tipoComercial').removeClass('mostrarBloc');
                            break;
                    case "nueva":
                            j('#tipoNueva').addClass('mostrarBloc');
                            j('#tipoReforma').removeClass('mostrarBloc');
                            j('#tipoComercial').removeClass('mostrarBloc');
                            break;
		    case "local":
                            j('#tipoComercial').addClass('mostrarBloc');
                            j('#tipoReforma').removeClass('mostrarBloc');
                            j('#tipoNueva').removeClass('mostrarBloc');
                            break;
		}
	});
		
   

	// validate signup form on keyup and submit
	j("#commentForm").validate({
		rules: {
			realname: {
				required: true,
				minlength: 2
			},
			email: {
				required: true,
				email: true
			},
			comentaris: {
				required: true,
				minlength: 10
			},
			para:
			{
				required:true,
				minlength:1
			},
			telf:
			{
				required:true,
				digits:true
			}/*,
			lq:
			{
				required:true,
				minlength:1
			},
			obrnu:
			{
				required:true,
				minlength:1
			}*/
		},
		messages: {
			realname: {
				required: "Por favor, introduzca su nombre",
				minlength: "Su nombre debe contener al menos 2 caracteres"
			},
						
			email: "Por favor, introduzca un email v&aacute;lido",
			
			telf: "Por favor, introuduzca un tel&eacute;fono v&aacute;lido",
			
			comentaris: {
				required: "Por favor, introduzca un comentario",
				minlength: "15 caracteres como m&iacute;nimo"
			}
			
		}
	});

	// LIGHTBOX
	j(function() {
		j('#uniNazaret a').lightBox({fixedNavigation:true});
		j('#refValen a').lightBox({fixedNavigation:true});		
		j('#restaurantes a').lightBox({fixedNavigation:true});		
		j('#refLoft a').lightBox({fixedNavigation:true});
		j('#refEstimat a').lightBox({fixedNavigation:true});
		j('#refBanoPatacona a').lightBox({fixedNavigation:true});
		j('#refCocinaMalvarrosa a').lightBox({fixedNavigation:true});
		j('#refCocinaPatacona a').lightBox({fixedNavigation:true});
		j('#refPolleria a').lightBox({fixedNavigation:true});
		j('#refViviendaPatacona a').lightBox({fixedNavigation:true});
		j('#refViviendaUni a').lightBox({fixedNavigation:true});
		j('#varios a').lightBox({fixedNavigation:true});
		j('#EjemVivienda a').lightBox({fixedNavigation:true});	
		j('#EjemCocina a').lightBox({fixedNavigation:true});
        j('#EjemActuales a').lightBox({fixedNavigation:true});
        j('#estimat3d a').lightBox({fixedNavigation:true});
	});
	
	// SUBMENU DE PROYECTOS
	j("#itemuniNazaret").click(function () {
		j("#EjemCocina").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#varios").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow");j("#refCocinaMalvarrosa").hide("slow");j("#refCocinaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow"); j("#uniNazaret").show("slow"); 
		j("#itemrefValen").removeClass("active");j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemPolleria").removeClass("active");j("#itemvarios").removeClass("active");("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
		j("#itemuniNazaret").addClass("active");
    });
	
	j("#itemrefValen").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow");j("#restaurantes").hide("slow"); j("#refLoft").hide("slow");j("#varios").hide("slow");j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow");j("#refCocinaMalvarrosa").hide("slow");j("#refCocinaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow"); j("#refValen").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemvarios").removeClass("active");("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemrefValen").addClass("active");
    });

 	j("#itemrest").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#refLoft").hide("slow");j("#varios").hide("slow");j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow");j("#refCocinaMalvarrosa").hide("slow");j("#refCocinaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow"); j("#restaurantes").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrefLoft").removeClass("active");j("#itemvarios").removeClass("active");("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemrest").addClass("active");
	});

	j("#itemrefLoft").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow");j("#varios").hide("slow");j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow");j("#refCocinaMalvarrosa").hide("slow");j("#refCocinaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow"); j("#refLoft").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemvarios").removeClass("active");("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemrefLoft").addClass("active");
	});
	
		j("#itemrefEst").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow");j("#varios").hide("slow");j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow"); j("#refLoft").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow");j("#refCocinaMalvarrosa").hide("slow");j("#refCocinaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow"); j("#refEstimat").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemvarios").removeClass("active");("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemrefEst").addClass("active");
	});
		
	j("#itemrefBanoPata").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#refValen").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refCocinaMalvarrosa").hide("slow"); j("#varios").hide("slow");j("#refCocinaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow"); j("#refBanoPatacona").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemvarios").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemrefBanoPata").addClass("active");
	});

	j("#itemrefCocinaMalva").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#refValen").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow"); j("#varios").hide("slow");j("#refCocinaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow"); j("#refCocinaMalvarrosa").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemvarios").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemrefCocinaMalva").addClass("active");
	});
	
	j("#itemrefCocinaPata").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#refValen").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow");j("#refPolleria").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow"); j("#varios").hide("slow");j("#refCocinaMalvarrosa").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow"); j("#refCocinaPatacona").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemvarios").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemrefCocinaPata").addClass("active");
	});
	
	j("#itemPolleria").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#refValen").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow");j("#refPolleria").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow"); j("#varios").hide("slow");j("#refCocinaMalvarrosa").hide("slow"); j("#refCocinaPatacona").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow");j("#refPolleria").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemvarios").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemrefCocinaPata").addClass("active");
	});
	
	j("#itemViviendaPata").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#refValen").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow");j("#refPolleria").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow"); j("#varios").hide("slow");j("#refCocinaMalvarrosa").hide("slow"); j("#refCocinaPatacona").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaUni").hide("slow");j("#refViviendaPatacona").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemvarios").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemViviendaPata").addClass("active");
	});
	
	j("#itemViviendaUni").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#refValen").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow");j("#refPolleria").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refBanoPatacona").hide("slow"); j("#varios").hide("slow");j("#refCocinaMalvarrosa").hide("slow"); j("#refCocinaPatacona").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaUni").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemvarios").removeClass("active");j("#itemrefBanoPata").removeClass("active");j("#itemrefCocinaMalva").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemrefCocinaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");j("#itemViviendaPata").removeClass("active");
            j("#itemViviendaUni").addClass("active");
	});

	j("#itemvarios").click(function () {
            j("#EjemCocina").hide("slow");j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#refValen").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#refCocinaMalvarrosa").hide("slow");j("#refBanoPatacona").hide("slow");j("#refCocinaPatacona").hide("slow");j("#refPolleria").hide("slow");j("#refViviendaPatacona").hide("slow");j("#refViviendaUni").hide("slow");j("#varios").show("slow");
            j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemEjvivienda").removeClass("active");j("#itemCocina").removeClass("active");j("#itemrefEst").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemrPolleria").removeClass("active");j("#itemViviendaPata").removeClass("active");j("#itemViviendaUni").removeClass("active");
            j("#itemvarios").addClass("active");
	});
	
		// SUBMENU DE PROYECTOS EN 3D
		
	j("#itemEsti3d").click(function () {
            j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#varios").hide("slow"); j("#uniNazaret").hide("slow");j("#EjemCocina").hide("slow"); j("#EjemActuales").hide("slow");j("#EjemVivienda").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").show("slow");
            j("#itemrefValen").removeClass("active");j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemvarios").removeClass("active");j("#itemuniNazaret").removeClass("active");j("#itemCocina").removeClass("active");j("#itemActuales").removeClass("active"); j("#itemEjvivienda").removeClass("active");
            j("#itemEsti3d").addClass("active");
    });
			
	j("#itemEjvivienda").click(function () {
            j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#varios").hide("slow"); j("#uniNazaret").hide("slow");j("#EjemCocina").hide("slow"); j("#EjemActuales").hide("slow"); j("#estimat3d").hide("slow");j("#refEstimat").hide("slow"); j("#EjemVivienda").show("slow");
            j("#itemrefValen").removeClass("active");j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemvarios").removeClass("active");j("#itemuniNazaret").removeClass("active");j("#itemCocina").removeClass("active");j("#itemActuales").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemrefEst").removeClass("active");
            j("#itemEjvivienda").addClass("active");
    });
	
	j("#itemCocina").click(function () {
            j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow");j("#varios").hide("slow"); j("#uniNazaret").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemActuales").hide("slow");j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow");j("#EjemCocina").show("slow");
            j("#itemrefValen").removeClass("active");j("#itemrest").removeClass("active");j("#itemrefLoft").removeClass("active");j("#itemvarios").removeClass("active");j("#itemuniNazaret").removeClass("active"); j("#itemEjvivienda").removeClass("active");j("#itemActuales").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemrefEst").removeClass("active");
            j("#itemCocina").addClass("active");
    });

    j("#itemActuales").click(function () {
       
        j("#uniNazaret").hide("slow"); j("#refValen").hide("slow"); j("#restaurantes").hide("slow"); j("#refLoft").hide("slow"); j("#varios").hide("slow"); j("#EjemVivienda").hide("slow"); j("#EjemCocina").hide("slow"); j("#refEstimat").hide("slow"); j("#estimat3d").hide("slow"); j("#EjemActuales").show("slow");
        j("#itemuniNazaret").removeClass("active"); j("#itemrefValen").removeClass("active"); j("#itemrest").removeClass("active"); j("#itemrefLoft").removeClass("active"); j("#itemvarios").removeClass("active"); j("#itemEjvivienda").removeClass("active"); j("#itemCocina").removeClass("active");j("#itemEsti3d").removeClass("active");j("#itemrefEst").removeClass("active");
        j("#itemActuales").addClass("active");
    });


});

