$(document).ready(function(){$(".js_hide").hide();$(".galeria .bloque3 a").click(function(){$.fancybox({padding:0,autoScale:false,transitionIn:"none",transitionOut:"none",title:this.title,width:680,height:495,href:this.href,type:"swf",swf:{wmode:"transparent",allowfullscreen:"true"}});return false});$(".pdf").fancybox({width:"85%",height:"85%",autoScale:false,transitionIn:"none",transitionOut:"none",type:"iframe"});$(".galeria .bloque2 a:first").addClass("activo");$(".galeria .bloque2 a").hover(function(e){$(this).addClass("hover")},
function(e){$(this).removeClass("hover")});$(".galeria .bloque2 a").click(function(e){e.preventDefault();var nom=$(this).attr("href");var indice=nom.indexOf(".avi");if(indice=="-1"){$(".galeria .bloque2 a").removeClass("activo");$(this).addClass("activo");var target=$(this).attr("href");var tipo=$(this).attr("type");var img=$(this).children("img").attr("rel");$(".galeria .bloque1 a").attr("href",target).attr("type",tipo);$(".galeria .bloque1 a img").attr("src",img)}});$(".galeria .galeria-grupo-ventana").height(85).css("overflow",
"hidden");$(".galeria .galeria-grupo-carro").each(function(){$(this).css("position","absolute").css("left",0);$(this).width(118*$(this).children("a").length)});$(".galeria .galeria-grupo-controles").show();$(".galeria .galeria-grupo-controles .siguientes").click(function(e){var carro=$(this).parent().siblings(".galeria-grupo-ventana:first").children();if(carro.width()+parseInt(carro.css("left"))>472)$(carro).animate({left:"-=472"},800)});$(".galeria .galeria-grupo-controles .anteriores").click(function(e){var carro=
$(this).parent().siblings(".galeria-grupo-ventana:first").children();if(parseInt(carro.css("left"))<0)$(carro).animate({left:"+=472"},800)});$(".galeria .bloque1 a").click(function(e){e.preventDefault();$.fancybox([{href:$(this).attr("href").replace(new RegExp("watch\\?v=","i"),"v/"),type:$(this).attr("type"),swf:{wmode:"transparent",allowfullscreen:"true"}}]);return false});$(".tabs").each(function(){$(this).children(".tabs-ul").children("li").removeClass("activo");$(this).children(".tabs-ul").children("li:first").addClass("activo");
$(this).find(".tab-titulo").hide();$(this).children(".tabs-content").hide();$(this).children(".tabs-content:first").show();$(this).children(".tabs-ul").children("li").children("a").click(function(e){e.preventDefault();$(this).parent().siblings("li").removeClass("activo");$(this).parent().addClass("activo");var target=$(this).attr("href");$(this).parent().parent().siblings(".tabs-content").hide();$(target).show()})});$(".destacados ul li a").mouseover(function(e){$(this).children(".titulo").css("text-decoration",
"underline");$(this).children(".flechaP").css("text-decoration","underline");$(this).children(".border").show()});$(".destacados ul li a").mouseout(function(e){$(this).children(".titulo").css("text-decoration","none");$(this).children(".flechaP").css("text-decoration","none");$(this).children(".border").hide()});$(".plegable .a-mostrar").removeClass("a-mostrar").addClass("a-ocultar");$(".plegable .plegable-contenido").show();$(".plegable .a-mostrar").live("click",function(e){e.preventDefault();$(this).blur();
$(this).parent().children(".plegable-contenido").slideDown();$(this).removeClass("a-mostrar").addClass("a-ocultar")});$(".plegable .a-ocultar").live("click",function(e){e.preventDefault();$(this).blur();$(this).parent().children(".plegable-contenido").slideUp();$(this).removeClass("a-ocultar").addClass("a-mostrar")});$(".plegable .a-ocultarMapa").removeClass("a-ocultarMapa").addClass("a-mostrarMapa");$(".plegable .plegable-contenido-mapa").hide();$(".plegable .a-ocultarMapa").live("click",function(e){e.preventDefault();
$(this).blur();$(this).parent().children(".plegable-contenido-mapa").slideUp();$(this).removeClass("a-ocultarMapa").addClass("a-mostrarMapa")});$(".plegable .a-mostrarMapa").live("click",function(e){e.preventDefault();$(this).blur();$(this).parent().children(".plegable-contenido-mapa").slideDown();$(this).removeClass("a-mostrarMapa").addClass("a-ocultarMapa")});$("#ocultarMapa").click(function(event){event.preventDefault();$("#idLinkMapa").show();$(".plegable .a-mostrarMapa").removeClass("a-mostrarMapa").addClass("a-ocultarMapa")});
$("select[id*=ddlComunidad]").change(function(event){event.preventDefault();if($("select[id*=ddlComunidad]").val()!="0")$("span[id*=SeleccionComunidad]").attr("style","display:none")});$(".plegable .titular-1b").css("cursor","pointer").live("click",function(e){e.preventDefault();$(this).blur();if($(this).parent().children(".plegable-contenido").is(":visible")){$(this).parent().children(".plegable-contenido").slideUp();$(this).siblings("a").removeClass("a-ocultar").addClass("a-mostrar")}else if($(this).parent().children(".plegable-contenido").is(":hidden")){$(this).parent().children(".plegable-contenido").slideDown();
$(this).siblings("a").removeClass("a-mostrar").addClass("a-ocultar")}else if($(this).parent().children(".plegable-contenido-mapa").is(":visible")){$(this).parent().children(".plegable-contenido-mapa").slideUp();$(this).siblings("a").removeClass("a-ocultarMapa").addClass("a-mostrarMapa")}else if($(this).parent().children(".plegable-contenido-mapa").is(":hidden")){$(this).parent().children(".plegable-contenido-mapa").slideDown();$(this).siblings("a").removeClass("a-mostrarMapa").addClass("a-ocultarMapa");
$("#IframeMapa").attr("src",document.getElementById(document.getElementById("HiddenMapa2").value).value)}});$(".plegable-pequeno .plegable-pequeno-contenido").hide();$(".plegable-pequeno .plegable-pequeno-titular").addClass("plegado").css("cursor","pointer").click(function(e){e.preventDefault();if($(this).siblings(".plegable-pequeno-contenido:first").is(":visible")){$(this).removeClass("desplegado").addClass("plegado");$(this).siblings(".plegable-pequeno-contenido:first").slideUp()}else{$(this).removeClass("plegado").addClass("desplegado");
$(this).parent().children(".plegable-pequeno-contenido").slideDown()}});$(".desplegar-todos").click(function(e){e.preventDefault();$(".plegable-pequeno-titular").removeClass("plegado").addClass("desplegado");$(".plegable-pequeno-contenido").slideDown()});$(".plegar-todos").click(function(e){e.preventDefault();$(".plegable-pequeno-titular").removeClass("desplegado").addClass("plegado");$(".plegable-pequeno-contenido").slideUp()});$("div.juridica").hide();$("#tipo_persona").change(function(){if($(this).val()==
"f"){$("div.fisica").show();$("div.juridica").hide()}else{$("div.fisica").hide();$("div.juridica").show()}});$("#menus #menu-sup ul li").mouseover(function(e){$(this).children("ul").show()}).mouseout(function(e){$(this).children("ul").hide()})});

