jQuery.noConflict(); var preloadImgs = ['/wp-content/uploads/aboutus.png', '/wp-content/uploads/aboutus_active.png','/wp-content/uploads/ambiance.png', '/wp-content/uploads/ambiance_active.gif', '/wp-content/uploads/contact.png', '/wp-content/uploads/contact_active.gif', '/wp-content/uploads/home.png', '/wp-content/uploads/home_active.gif', '/wp-content/uploads/menu.png', '/wp-content/uploads/menu_active.gif', '/wp-content/uploads/reservations.png', '/wp-content/uploads/reservations_active.gif', '/wp-content/uploads/reviews.png', '/wp-content/uploads/reviews_active.gif']; //jQuery(function() { jQuery.preload(preloadImgs, { init: function (loaded, total) { //alert("Loaded: "+loaded+"/"+total); }, loaded_all: function (loaded, total) { //alert("Loaded " + total); } }); //}); google.load("webfont", "1"); /* jQuery(function() { WebFont.load({ google: { families: [ 'Cabin', 'FontSiteSansRoman', 'Raleway:100', 'AlternateGothicFSNo3', 'AlternateGothicFSNo2' ] } }); });*/ /****************************************************** * * Article toggle effect * ******************************************************/ function articleAsideOpen(hs, ha){ //################### Apre article e aside separatamente e ad altezze diverse var deviceAgent = navigator.userAgent.toLowerCase(); var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/); var fe = 0; if (jQuery('.entry-title').length!=0) { fe = parseFloat(jQuery('.entry-title').css('line-height').replace('px',''))+parseFloat(jQuery('.entry-title').css('padding-bottom').replace('px',''))+parseFloat(jQuery('.entry-title').css('padding-top').replace('px','')); //altezza del gap } //if (jQuery.browser.msie) { if(jQuery(window).height() > jQuery(document).height()){ //in questo modo anche con menu scrollabile ho l'altezza della section piena var h = jQuery(window).height(); } else { var h = jQuery(document).height(); } //} else { // if(window.innerHeight > jQuery(document).height()){ //in questo modo anche con menu scrollabile ho l'altezza della section piena // var h = window.innerHeight; // } else { // var h = jQuery(document).height(); // } //} //Debug("window height", h); var off = 0; var offs = jQuery('article').offset(); var he = parseFloat(jQuery('section').css('margin-top').replace('px','')); //Debug("sectionMargTop", he);//always 125 var foo = 0; var hh2 = jQuery('article').not('.always_open').find('.entry-title:first').css({'cursor':'pointer','position':'relative'}).append('^').height()+15+15; var lhh2 = jQuery('article .entry-title:first').css('line-height'); //mi serve per settare le altezze dei due titoli //jQuery('aside').not('.always_open').find('h3:first').css({'cursor':'pointer','position':'relative'}).append('^').height(); var secMarg = parseFloat(jQuery('section').css('margin-top')); Cufon.refresh(); if(hs > h-(he+foo)) { var hs2 = hs; //Debug("hs > h-(he+foo)", hs2); } else { var hs2 = h-(he+foo); //Debug("hs2", hs2); } jQuery('article.open_toggle').css({'height':hs2,'visibility':'visible'}); function layoutAfterResize(){ var off = 0; var offs = jQuery('article').offset(); //if (jQuery.browser.msie) { // h = jQuery(window).height(); //} else { //h = window.innerHeight; h= jQuery(window).height(); //} var scrolled = jQuery(window).scrollTop(); var innerContentHeight = jQuery('article').find('.page').height() + parseInt(jQuery('article').find('.page').css("padding-bottom")); if (innerContentHeight >= hs) hs = innerContentHeight; else hs = h - (he + foo); //Debug("innerContentHeight", innerContentHeight); Cufon.refresh(); if(hs >= h-(he+foo)){ jQuery('article.open_toggle').css({'height':hs}); } else { jQuery('article.open_toggle').css({'height':h-(he+foo)}); } if(jQuery('article').length!=0) { jQuery('article').not('.open_toggle').css({'left':offs.left,'top':(off.top-scrolled)-(hh2)}); } if(hs > h-(he+foo)) { hs2 = hs; } else { hs2 = h-(he+foo); } } jQuery(window).resize(function(){ layoutAfterResize(); }); var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/); if( !jQuery('article').hasClass('always_open')){ jQuery('article .entry-title:first').click(function(){ var t = jQuery(this).parents('article'); if (jQuery.browser.msie) { var h = jQuery(window).height(); } else { var h = window.innerHeight; } var ha = jQuery('aside').height(); var off; off = jQuery('footer').offset(); var scrolled = jQuery(window).scrollTop(); if(t.hasClass('open_toggle')){ /*if (agentID) { return false; }*/ t.animate({'margin-top':(off.top-scrolled)-(hh2+secMarg),'height':hh2},300,function(){ t.removeClass('open_toggle'); t.find('.toggle_arrow').text('^'); Cufon.refresh(); t.css({'left':offs.left,'top':(off.top-scrolled)-(hh2),'margin':'0','position':'fixed'}); }); //if(!jQuery('aside').hasClass('open_toggle')) { // jQuery('html,body').animate({scrollTop: 0}, 300 ); //} else { //jQuery('aside.open_toggle').animate({'height':ha2}, 300 ); jQuery('html,body').animate({scrollTop: 0}, 300 ); //} /*if (agentID) { jQuery('footer').css({'position':'fixed','margin-top':'0'}); }*/ } else { t.css({'margin-top':off.top-(hh2+secMarg),'position':'static','top':'0','left':'0'}); t.find('.toggle_arrow').text('_'); Cufon.refresh(); if(hs < ha+fe && jQuery('aside').hasClass('open_toggle')){ t.animate({'margin-top':'0','height':ha+fe},300,function(){t.addClass('open_toggle')}); } else if(hs > h-(he+foo)) { //jQuery('aside.open_toggle').animate({'height':hs-fe},300); t.animate({'margin-top':'0','height':hs},300,function(){t.addClass('open_toggle')}); } else { //jQuery('aside.open_toggle').animate({'height':hs},300); t.animate({'margin-top':'0','height':h-(he+foo)},300,function(){t.addClass('open_toggle')}); } /*if (agentID) { jQuery('footer').css({'position':'relative'}); }*/ } }),layoutAfterResize(); } var orPadB = jQuery('aside h3:first').css('padding-bottom'); var orPadT = jQuery('aside h3:first').css('padding-top'); var orPadAr = jQuery('aside h3:first .toggle_arrow').css('padding-top'); var orLh = jQuery('aside h3:first').css('line-height'); } jQuery(window).one('load',function(){ jQuery('article .entry-title:first, aside h3:first').unbind('click'); var hs = 0; if(jQuery('article').length!=0){ hs = jQuery('article').height(); } var ha = 0; if(jQuery('aside').length!=0){ ha = jQuery('aside').height(); } articleAsideOpen(hs, ha); Cufon.refresh(); }); jQuery(window).one('load',function(){ var deviceAgent = navigator.userAgent.toLowerCase(); var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/); /*if (agentID) { jQuery('aside h3:first').click(); jQuery('article .entry-title:first').click(); jQuery('footer').css({'position':'relative'}); jQuery('#body').css({'height':'auto'}); }*/ }); /****************************************************** * * Full page slideshow * ******************************************************/ jQuery(function(){ if(jQuery('.pix_slide').length){ jQuery('.pix_slide').pixwall({ pauseOnClick: false, prevNav: '#pixwall_prev', //true, false. It enables the previous and the next buttons, their IDs are #pixwall_prev and #pixwall_next nextNav: '#pixwall_next', //true, false. It enables the previous and the next buttons, their IDs are #pixwall_prev and #pixwall_next commands: '#pixwall_commands', //true, false. It enables stop and play buttons prevNav: '#pix_prev_slide', nextNav: '#pix_next_slide', fx: 'simpleFade', thumbs: '#navgallery_wrapper', portrait: false, time: 2500, transPeriod: 3000 }); } }); /****************************************************** * * Social_bar position and toggle * ******************************************************/ jQuery(window).one('load',function() { var wF = jQuery("#social_bar form").width(); var wI = jQuery("#social_bar div.icon").width(); //jQuery("#social_bar .wrapIn").css({'width':wF+wI+5}); var wS = jQuery("#socialtoggle").width(); var ciRight = parseInt(jQuery("#socialtoggle").css("right")); jQuery("#social_bar").css({'right':wS + ciRight ,'visibility':'visible'}); }); jQuery(function() { jQuery("#social_bar").each(function(){ var t = jQuery(this); var c = jQuery('.click.icons'); c.click(function(){ if(t.hasClass('open')){ //c.html('_'); c.html('f'); Cufon.refresh(); t.animate({'top':'-1000px'},800,function(){ t.removeClass('open'); //jQuery('#addressline').show(); }); } else { //c.html('^'); c.html('f'); Cufon.refresh(); t.animate({'top':'0px'},300,function(){ t.addClass('open'); //jQuery('#addressline').hide(); }); } }); }); }); /****************************************************** * * Colorbox * ******************************************************/ jQuery(window).one("load", function(){ jQuery("a[data-rel='iframe']").colorbox({iframe:true, innerWidth:650, innerHeight:488, rel:'nofollow' }); jQuery("a[href$='.jpg']").not('.noColorBox').each(function(){ var dataRel = jQuery(this).attr('data-rel'); var dataTitle = jQuery(this).attr('data-title'); jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('
'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } }); }); jQuery("a[href$='.png']").not('.noColorBox').each(function(){ var dataRel = jQuery(this).attr('data-rel'); var dataTitle = jQuery(this).attr('data-title'); jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend(''); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } }); }); jQuery("a[href$='.gif']").not('.noColorBox').each(function(){ var dataRel = jQuery(this).attr('data-rel'); var dataTitle = jQuery(this).attr('data-title'); jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend(''); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } }); }); jQuery("a.play-icon").not('.noColorBox').each(function(){ var dataRel = jQuery(this).attr('data-rel'); var dataTitle = jQuery(this).attr('data-title'); jQuery(this).colorbox({iframe:true, innerWidth:800, innerHeight:450, scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('#cboxTitle').text(''); } }); }); jQuery("a.play-icon[href*='selfid']").not('.noColorBox').each(function(){ var dataRel = jQuery(this).attr('data-rel'); var dataTitle = jQuery(this).attr('data-title'); jQuery(this).colorbox({iframe:true, innerWidth:800, innerHeight:450, scrolling:false, inline:true, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('#cboxTitle').text(''); } }); }); jQuery("a.colorbox").each(function(){ var dataRel = jQuery(this).attr('data-rel'); var dataTitle = jQuery(this).attr('data-title'); jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend(''); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } }); }); jQuery(".gallery-icon a[href$='.jpg'], .gallery-icon a[href$='.png'], .gallery-icon a[href$='.gif']").not('.noColorBox').each(function(){ var dataRel = 'slideshow'; var dataTitle = jQuery(this).attr('data-title'); jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend(''); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } }); }); }); /****************************************************** * * Slideshow shortcodes * ******************************************************/ jQuery(function(){ jQuery('.pix_cycle').each(function(){ var t = jQuery(this); var h = jQuery('.pix_slide_caption', t).height()+40; var time = t.attr('data-time'); var p = t.next('.pix_slider_prevnext').next('.pix_slider_nav'); var prevB = t.next('.pix_slider_prevnext').find('.pix_slider_prev'); var nextB = t.next('.pix_slider_prevnext').find('.pix_slider_next'); jQuery('.pix_slide_caption',t).css({'bottom':'-'+h+'px'}); jQuery(this).cycle({ after: onAfter, before: onBefore, cleartype: true, cleartypeNoBg: false, pager: p, pause: true, timeout: time, prev: prevB, next: nextB }); jQuery('.pix_slide_caption:first', t).animate({'bottom':'0'},250); function onBefore(currSlideElement, nextSlideElement, options, forwardFlag) { var h = jQuery('.pix_slide_caption', currSlideElement).height()+80; jQuery('.pix_slide_caption', currSlideElement).animate({'bottom':'-'+h+'px'},250); } function onAfter(currSlideElement, nextSlideElement, options, forwardFlag) { jQuery('.pix_slide_caption', nextSlideElement).animate({'bottom':'0'},250); } var wT = t.width(); var hT = t.height(); jQuery('.pix_slider',t).width(wT).height(hT); }); }); /****************************************************** * * Image overlay * ******************************************************/ jQuery(function(){ jQuery(".hentry a[href$='.jpg'], .hentry a[href$='.png'], .hentry a[href$='.gif']").each(function(){ var w = jQuery('img',this).width(), h = jQuery('img',this).height(); if(!jQuery('body').hasClass('tax-gallery') && !jQuery(this).parent().hasClass('linkIcon') && jQuery('img',this).length){ jQuery(this).append('