function altosVacios() { $.each($(".wmk_title,.wmk_edit_Layout_title,.wmk_edit_Layout"), function( index, value ) { if ($(this).text()=="" && !$(this).find("img").length ) { $(this).css("height","5px") $(this).css("padding","0px") $(this).css("margin","0px") } }); $.each($(".flex-videoMapa"), function( index, value ) { if ($(this).html()=="") $(this).css("height","5px") }); } $(window).ready(function(){ addHelperImg(); $("#slider").orbit({ animation: 'fade',fluid: true,timer:true,directionalNav: false }); $('#idiomaSelector').on('change', function(e) { var idne="http://www.hotelhoteles.com/index.php?lang="; if(window.location.hash!="#preview") { location.href=idne+this.value } else location.href=idne+this.value+"#preview" }); $('#refresh-captcha').on('click', function(e) { $('img#captcha').attr("src","js/jquerycaptcha/php/newCaptcha.php?rnd=" + Math.random()); }); if ($(".flex-videoMapa").length && is_touch_device() ) { $(".flex-videoMapa").prepend('
') } $("#wmk_contactForm").validate({ messages: { wmk_formEmail: { email: "" } }, errorPlacement: function(error, element) { if (element.attr("name") == "wmk_formAviso" ) { error.insertAfter("#title5"); } else { error.insertAfter(element); } }, submitHandler: function(form) { $('#wmk_sendResult').html(""); $.ajax({ type: "POST", url: "sendemail.php?c=qweqwqwe", data: $("#wmk_contactForm").serialize(), success: function (data, textStatus, xhr) { var obj = jQuery.parseJSON( data ); if (obj.error==0) $("#wmk_contactForm").find("input[type=text], textarea,input[type=email]").val(""); $('#wmk_sendResult').html(obj.texto); } }); //event.preventDefault(); } }); //cambio raiz novosites enlaces $("a").attr("href", function(i, href) { if( window.location.hostname === this.hostname ) { return href.replace("/sites/", "/"); } }); }) function is_touch_device() { try { document.createEvent("TouchEvent"); return true; } catch (e) { return false; } } function addHelperImg() { if ($(".wmk_edit_Layout_image").find("img").length) $(".wmk_edit_Layout_image").prepend("") if ($(".wmk_editable_image").not("#wmk_id_Logo").find("img").length) $(".wmk_editable_image").not("#wmk_id_Logo").prepend("") }