google.load("jquery","1");if(typeof(percorso_dati)!="undefined"){google.load("maps","2")}google.setOnLoadCallback(function(){jQuery.rollover||(function(p){p.fn.rollover=function(r){r=jQuery.extend({suffixFrom:"_off.",suffixTo:"_on."},r);var q=document.createElement("img");return this.each(function(){var s=this.src;var t=this.src.replace(r.suffixFrom,r.suffixTo);q.src=t;p(this).hover(function(){this.src=t},function(){this.src=s})})}})(jQuery);var n=window.IEPNGFix||{};n.tileBG=function(v,H,E){var T=this.data[v.uniqueID],q=Math.max(v.clientWidth,v.scrollWidth),w=Math.max(v.clientHeight,v.scrollHeight),A=v.currentStyle.backgroundPositionX,z=v.currentStyle.backgroundPositionY,F=v.currentStyle.backgroundRepeat;if(!T.tiles){T.tiles={elm:v,src:"",cache:[],img:new Image(),old:{}}}var P=T.tiles,K=P.img.width,r=P.img.height;if(H){if(!E&&H!=P.src){P.img.onload=function(){this.onload=null;n.tileBG(v,H,1)};return P.img.src=H}}else{if(P.src){E=1}K=r=0}P.src=H;if(!E&&q==P.old.w&&w==P.old.h&&A==P.old.x&&z==P.old.y&&F==P.old.r){return}var t={top:"0%",left:"0%",center:"50%",bottom:"100%",right:"100%"},C,B,p;C=t[A]||A;B=t[z]||z;if(p=C.match(/(\d+)%/)){C=Math.round((q-K)*(parseInt(p[1])/100))}if(p=B.match(/(\d+)%/)){B=Math.round((w-r)*(parseInt(p[1])/100))}C=parseInt(C);B=parseInt(B);var R={repeat:1,"repeat-x":1}[F],O={repeat:1,"repeat-y":1}[F];if(R){C%=K;if(C>0){C-=K}}if(O){B%=r;if(B>0){B-=r}}this.hook.enabled=0;if(!({relative:1,absolute:1}[v.currentStyle.position])){v.style.position="relative"}var u=0,D,N=R?q:C+0.1,I,L=O?w:B+0.1,M,G,Q;if(K&&r){for(D=C;D<N;D+=K){for(I=B;I<L;I+=r){Q=0;if(!P.cache[u]){P.cache[u]=document.createElement("div");Q=1}var J=Math.max(0,D+K>q?q-D:K),S=Math.max(0,I+r>w?w-I:r);M=P.cache[u];G=M.style;G.behavior="none";G.left=(D-parseInt(v.currentStyle.paddingLeft))+"px";G.top=I+"px";G.width=J+"px";G.height=S+"px";G.clip="rect("+(I<0?0-I:0)+"px,"+J+"px,"+S+"px,"+(D<0?0-D:0)+"px)";G.display="block";if(Q){G.position="absolute";G.zIndex=-999;if(v.firstChild){v.insertBefore(M,v.firstChild)}else{v.appendChild(M)}}this.fix(M,H,0);u++}}}while(u<P.cache.length){this.fix(P.cache[u],"",0);P.cache[u++].style.display="none"}this.hook.enabled=1;P.old={w:q,h:w,x:A,y:z,r:F}};n.update=function(){for(var q in n.data){var p=n.data[q].tiles;if(p&&p.elm&&p.src){n.tileBG(p.elm,p.src)}}};n.update.timer=0;if(window.attachEvent&&!window.opera){window.attachEvent("onresize",function(){clearTimeout(n.update.timer);n.update.timer=setTimeout(n.update,100)})}(function(p){p.prettyPhoto={version:"2.5.6"};p.fn.prettyPhoto=function(J){J=jQuery.extend({animationSpeed:"normal",opacity:0.8,showTitle:true,allowresize:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"light_rounded",hideflash:false,wmode:"opaque",autoplay:true,modal:false,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details clearfix"><a class="pp_close" href="#">Close</a><p class="pp_description"></p><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0/0</p><a href="#" class="pp_arrow_next">Next</a></div></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay"></div><div class="ppt"></div>',image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline clearfix">{content}</div>'},J);if(p.browser.msie&&parseInt(p.browser.version)==6){J.theme="light_square"}if(p(".pp_overlay").size()==0){K()}var t=true,x=false,I,D,O,r,B,C,H,L,v=p(window).height(),N=p(window).width(),s=0,G=u();p(window).scroll(function(){G=u();y();F()});p(window).resize(function(){y();F()});p(document).keydown(function(P){if(D.is(":visible")){switch(P.keyCode){case 37:p.prettyPhoto.changePage("previous");break;case 39:p.prettyPhoto.changePage("next");break;case 27:if(!J.modal){p.prettyPhoto.close()}break}}});p(this).each(function(){p(this).bind("click",function(){_self=this;theRel=p(this).attr("rel");galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);var P=new Array(),R=new Array(),Q=new Array();if(theGallery){p("a[rel*="+theGallery+"]").each(function(S){if(p(this)[0]===p(_self)[0]){s=S}P.push(p(this).attr("href"));R.push(p(this).find("img").attr("alt"));Q.push(p(this).attr("title"))})}else{P=p(this).attr("href");R=(p(this).find("img").attr("alt"))?p(this).find("img").attr("alt"):"";Q=(p(this).attr("title"))?p(this).attr("title"):""}p.prettyPhoto.open(P,R,Q);return false})});p.prettyPhoto.open=function(R,Q,P){if(p.browser.msie&&p.browser.version==6){p("select").css("visibility","hidden")}if(J.hideflash){p("object,embed").css("visibility","hidden")}images=p.makeArray(R);titles=p.makeArray(Q);descriptions=p.makeArray(P);image_set=(p(images).size()>0)?true:false;w(p(images).size());p(".pp_loaderIcon").show();r.show().fadeTo(J.animationSpeed,J.opacity);D.find(".currentTextHolder").text((s+1)+J.counter_separator_label+p(images).size());if(descriptions[s]){D.find(".pp_description").show().html(unescape(descriptions[s]))}else{D.find(".pp_description").hide().text("")}if(titles[s]&&J.showTitle){hasTitle=true;O.html(unescape(titles[s]))}else{hasTitle=false}movie_width=(parseFloat(q("width",images[s])))?q("width",images[s]):J.default_width.toString();movie_height=(parseFloat(q("height",images[s])))?q("height",images[s]):J.default_height.toString();if(movie_width.indexOf("%")!=-1||movie_height.indexOf("%")!=-1){movie_height=parseFloat((p(window).height()*parseFloat(movie_height)/100)-100);movie_width=parseFloat((p(window).width()*parseFloat(movie_width)/100)-100);x=true}D.fadeIn(function(){imgPreloader="";switch(M(images[s])){case"image":imgPreloader=new Image();nextImage=new Image();if(image_set&&s>p(images).size()){nextImage.src=images[s+1]}prevImage=new Image();if(image_set&&images[s-1]){prevImage.src=images[s-1]}D.find("#pp_full_res")[0].innerHTML=J.image_markup;D.find("#fullResImage").attr("src",images[s]);imgPreloader.onload=function(){I=z(imgPreloader.width,imgPreloader.height);_showContent()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");p.prettyPhoto.close()};imgPreloader.src=images[s];break;case"youtube":I=z(movie_width,movie_height);movie="http://www.youtube.com/v/"+q("v",images[s]);if(J.autoplay){movie+="&autoplay=1"}toInject=J.flash_markup.replace(/{width}/g,I.width).replace(/{height}/g,I.height).replace(/{wmode}/g,J.wmode).replace(/{path}/g,movie);break;case"vimeo":I=z(movie_width,movie_height);movie_id=images[s];movie="http://vimeo.com/moogaloop.swf?clip_id="+movie_id.replace("http://vimeo.com/","");if(J.autoplay){movie+="&autoplay=1"}toInject=J.flash_markup.replace(/{width}/g,I.width).replace(/{height}/g,I.height).replace(/{wmode}/g,J.wmode).replace(/{path}/g,movie);break;case"quicktime":I=z(movie_width,movie_height);I.height+=15;I.contentHeight+=15;I.containerHeight+=15;toInject=J.quicktime_markup.replace(/{width}/g,I.width).replace(/{height}/g,I.height).replace(/{wmode}/g,J.wmode).replace(/{path}/g,images[s]).replace(/{autoplay}/g,J.autoplay);break;case"flash":I=z(movie_width,movie_height);flash_vars=images[s];flash_vars=flash_vars.substring(images[s].indexOf("flashvars")+10,images[s].length);filename=images[s];filename=filename.substring(0,filename.indexOf("?"));toInject=J.flash_markup.replace(/{width}/g,I.width).replace(/{height}/g,I.height).replace(/{wmode}/g,J.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":I=z(movie_width,movie_height);frame_url=images[s];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=J.iframe_markup.replace(/{width}/g,I.width).replace(/{height}/g,I.height).replace(/{path}/g,frame_url);break;case"inline":myClone=p(images[s]).clone().css({width:J.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo(p("body"));I=z(p(myClone).width(),p(myClone).height());p(myClone).remove();toInject=J.inline_markup.replace(/{content}/g,p(images[s]).html());break}if(!imgPreloader){D.find("#pp_full_res")[0].innerHTML=toInject;_showContent()}})};p.prettyPhoto.changePage=function(P){if(P=="previous"){s--;if(s<0){s=0;return}}else{if(p(".pp_arrow_next").is(".disabled")){return}s++}if(!t){t=true}A(function(){p.prettyPhoto.open(images,titles,descriptions)});p("a.pp_expand,a.pp_contract").fadeOut(J.animationSpeed)};p.prettyPhoto.close=function(){D.find("object,embed").css("visibility","hidden");p("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(J.animationSpeed);r.fadeOut(J.animationSpeed,function(){p("#pp_full_res").html("");D.attr("style","").find("div:not(.pp_hoverContainer)").attr("style","");y();if(p.browser.msie&&p.browser.version==6){p("select").css("visibility","visible")}if(J.hideflash){p("object,embed").css("visibility","visible")}s=0;J.callback()});t=true};_showContent=function(){p(".pp_loaderIcon").hide();projectedTop=G.scrollTop+((v/2)-(I.containerHeight/2));if(projectedTop<0){projectedTop=0+O.height()}D.find(".pp_content").animate({height:I.contentHeight},J.animationSpeed);D.animate({top:projectedTop,left:(N/2)-(I.containerWidth/2),width:I.containerWidth},J.animationSpeed,function(){D.find(".pp_hoverContainer,#fullResImage").height(I.height).width(I.width);D.find(".pp_fade").fadeIn(J.animationSpeed);if(image_set&&M(images[s])=="image"){D.find(".pp_hoverContainer").show()}else{D.find(".pp_hoverContainer").hide()}if(J.showTitle&&hasTitle){O.css({top:D.offset().top-25,left:D.offset().left+20,display:"none"});O.fadeIn(J.animationSpeed)}if(I.resized){p("a.pp_expand,a.pp_contract").fadeIn(J.animationSpeed)}J.changepicturecallback()})};function A(P){D.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");D.find(".pp_fade").fadeOut(J.animationSpeed,function(){p(".pp_loaderIcon").show();if(P){P()}});O.fadeOut(J.animationSpeed)}function w(P){if(s==P-1){D.find("a.pp_next").css("visibility","hidden");D.find("a.pp_arrow_next").addClass("disabled").unbind("click")}else{D.find("a.pp_next").css("visibility","visible");D.find("a.pp_arrow_next.disabled").removeClass("disabled").bind("click",function(){p.prettyPhoto.changePage("next");return false})}if(s==0){D.find("a.pp_previous").css("visibility","hidden");D.find("a.pp_arrow_previous").addClass("disabled").unbind("click")}else{D.find("a.pp_previous").css("visibility","visible");D.find("a.pp_arrow_previous.disabled").removeClass("disabled").bind("click",function(){p.prettyPhoto.changePage("previous");return false})}if(P>1){p(".pp_nav").show()}else{p(".pp_nav").hide()}}function z(Q,P){hasBeenResized=false;E(Q,P);imageWidth=Q;imageHeight=P;if(((L>N)||(H>v))&&t&&J.allowresize&&!x){hasBeenResized=true;notFitting=true;while(notFitting){if((L>N)){imageWidth=(N-200);imageHeight=(P/Q)*imageWidth}else{if((H>v)){imageHeight=(v-200);imageWidth=(Q/P)*imageHeight}else{notFitting=false}}H=imageHeight;L=imageWidth}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(H),containerWidth:Math.floor(L)+40,contentHeight:Math.floor(B),contentWidth:Math.floor(C),resized:hasBeenResized}}function E(Q,P){Q=parseFloat(Q);P=parseFloat(P);$pp_details=D.find(".pp_details");$pp_details.width(Q);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().appendTo(p("body")).css({position:"absolute",top:-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if(p.browser.msie&&p.browser.version==7){detailsHeight+=8}$pp_details.remove();B=P+detailsHeight;C=Q;H=B+O.height()+D.find(".pp_top").height()+D.find(".pp_bottom").height();L=Q}function M(P){if(P.match(/youtube\.com\/watch/i)){return"youtube"}else{if(P.match(/vimeo\.com/i)){return"vimeo"}else{if(P.indexOf(".mov")!=-1){return"quicktime"}else{if(P.indexOf(".swf")!=-1){return"flash"}else{if(P.indexOf("iframe")!=-1){return"iframe"}else{if(P.substr(0,1)=="#"){return"inline"}else{return"image"}}}}}}}function y(){if(t){titleHeight=O.height();contentHeight=D.height();contentwidth=D.width();projectedTop=(v/2)+G.scrollTop-((contentHeight+titleHeight)/2);D.css({top:projectedTop,left:(N/2)+G.scrollLeft-(contentwidth/2)});O.css({top:projectedTop-titleHeight,left:(N/2)+G.scrollLeft-(contentwidth/2)+20})}}function u(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else{if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else{if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}}}function F(){v=p(window).height();N=p(window).width();r.css({height:p(document).height()})}function K(){p("body").append(J.markup);D=p(".pp_pic_holder");O=p(".ppt");r=p("div.pp_overlay");D.attr("class","pp_pic_holder "+J.theme);r.css({opacity:0,height:p(document).height()}).bind("click",function(){if(!J.modal){p.prettyPhoto.close()}});p("a.pp_close").bind("click",function(){p.prettyPhoto.close();return false});p("a.pp_expand").bind("click",function(){$this=p(this);if($this.hasClass("pp_expand")){$this.removeClass("pp_expand").addClass("pp_contract");t=false}else{$this.removeClass("pp_contract").addClass("pp_expand");t=true}A(function(){p.prettyPhoto.open(images,titles,descriptions)});D.find(".pp_fade").fadeOut(J.animationSpeed);return false});D.find(".pp_previous, .pp_arrow_previous").bind("click",function(){p.prettyPhoto.changePage("previous");return false});D.find(".pp_next, .pp_arrow_next").bind("click",function(){p.prettyPhoto.changePage("next");return false})}y()};function q(t,s){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var r="[\\?&]"+t+"=([^&#]*)";var v=new RegExp(r);var u=v.exec(s);if(u==null){return""}else{return u[1]}}})(jQuery);$(".rollover").rollover();$("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:"slow",padding:10,opacity:0.7,showTitle:false,theme:"facebook"});if(typeof(google.maps)!="undefined"){function j(){if(d.getStatus().code==G_GEO_UNKNOWN_ADDRESS){alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: "+d.getStatus().code)}else{if(d.getStatus().code==G_GEO_SERVER_ERROR){alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: "+d.getStatus().code)}else{if(d.getStatus().code==G_GEO_MISSING_QUERY){alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: "+d.getStatus().code)}else{if(d.getStatus().code==G_GEO_BAD_KEY){alert("The given key is either invalid or does not match the domain for which it was given.\n Error code: "+d.getStatus().code)}else{if(d.getStatus().code==G_GEO_BAD_REQUEST){alert("A directions request could not be successfully parsed.\n Error code: "+d.getStatus().code)}else{alert("An unknown error occurred.")}}}}}}function h(){var p=d.getMarker(o).getIcon();p.image=m.image;p.iconSize=m.iconSize;p.iconAnchor=m.iconAnchor;var q=d.getMarker(g).getIcon();q.image="http://maps.google.com/mapfiles/kml/pal3/icon31.png";q.iconSize=new GSize(32,32);q.iconAnchor=new GPoint(16,32)}function f(q){if(typeof(k)!="object"){k=new GMap2(document.getElementById("percorso_mappa"));d=new GDirections(k,document.getElementById("percorso_testuale"));k.addControl(new GSmallMapControl());k.addControl(new GMapTypeControl());GEvent.addListener(d,"load",h);GEvent.addListener(d,"error",j)}if(typeof(q)=="object"){q=q.value;var p=document.forms[0].elements.scelta;for(i=0;i<p.length;i++){p[i].checked=false}}var r=q;var s=percorso_dati.struttura;o=1;g=0;d.load("from: "+r+" to: "+s,{locale:percorso_dati.locale})}var k;var d;var o;var g;var m;m=new google.maps.Icon();m.image="http://www."+percorso_dati.dominio+"/img/puntatore_mappa.gif";m.iconSize=new GSize(percorso_dati.icon_width,percorso_dati.icon_height);m.iconAnchor=new GPoint(20,percorso_dati.icon_height);var l=percorso_dati.Lat;var c=percorso_dati.Lon;var b=new GMap2(document.getElementById("percorso_mappa"));var a=new GLatLng(l,c);b.setCenter(a,percorso_dati.zoom);b.addControl(new GSmallMapControl());b.addControl(new GMapTypeControl());var e=new GMarker(new GLatLng(l,c),m);b.addOverlay(e);$("#percorsi").submit(function(){f($("#indirizzo").val());return false});$('input[name="scelta"]').click(function(){f($(this).val())})}});var gaJsHost=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");document.write(unescape("%3Cscript src='"+gaJsHost+"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));try{var pageTracker=_gat._getTracker("UA-8322875-1");pageTracker._setDomainName(".miramarehotel.org");pageTracker._trackPageview()}catch(err){};