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('
').wrapInner('
'); } var theClass = jQuery('img',this).attr('class'); jQuery('img',this).removeClass(theClass); jQuery('.imgHentry',this).addClass(theClass); var a = jQuery('.linkIcon',this); var i = jQuery('img',this).css('display','block'); a.show().animate({'opacity':0},0); jQuery(this).hover(function(){ i.stop(true,false).animate({'opacity':0.2},300); a.stop(true,false).animate({'opacity':1},300); },function(){ i.stop(true,false).animate({'opacity':1},300); a.stop(true,false).animate({'opacity':0},300); }); }); }); /****************************************************** * * Ajax form * ******************************************************/ jQuery(document).ready(function() { jQuery('.contactForm').each(function () { var t = jQuery(this); var hT = t.height(); var wT = t.width(); jQuery('.success, .unsuccess', t).height(hT).width(wT); jQuery('input[type=checkbox]',t).after('
').hide(); jQuery('.off-on').each(function(){ if(!jQuery(this).prev('input[type=checkbox]').is(':checked')){ jQuery('.switcher',this).addClass('off'); } jQuery('.off-on').live('click',function(){ if(jQuery('.switcher',this).hasClass('off')){ jQuery(this).prev('input[type=checkbox]').attr('checked', true); jQuery('.switcher',this).fadeIn(200,function(){ jQuery(this).removeClass('off'); }); } else { jQuery(this).prev('input[type=checkbox]').attr('checked', false); jQuery('.switcher',this).fadeOut(200,function(){ jQuery(this).addClass('off'); }); } }); }); jQuery('input[type=radio]',t).after('
').hide().click(function(){ jQuery('input[type=radio]',t).each(function(){ if(jQuery(this).is(':checked')){ jQuery(this).next('.radio-fake').find('.radio-on').fadeIn(200,function(){ jQuery(this).removeClass('off'); }); } else { jQuery(this).next('.radio-fake').find('.radio-on').fadeOut(200,function(){ jQuery(this).addClass('off'); }); } }); }); jQuery('.radio-fake').each(function(){ if(!jQuery(this).prev('input[type=radio]').is(':checked')){ jQuery('.radio-on',this).addClass('off'); } jQuery('.radio-fake').live('click',function(){ jQuery(this).prev('input[type=radio]').click(); }); }); jQuery('input[type=submit]',t).click(function () { var data = 'captcha='+jQuery('input[name="captcha"]',t).val()+'&form='+t.attr('id'); var allRequired = []; var allFields = []; var allValues = []; jQuery('input[type="checkbox"]').each(function(){ if(!jQuery(this).is(':checked')){ jQuery(this).val(''); } else { jQuery(this).val('on'); } }) jQuery('input[type="radio"]').each(function(){ var pV = jQuery(this).attr('data-value'); if(!jQuery(this).is(':checked')){ jQuery(this).val(''); } else { jQuery(this).val(pV); } }) jQuery('.required', t).each(function() { allRequired.push(jQuery(this).val()); }); var req = 0; var tag; var name; jQuery.each(allRequired, function(key, value) { tag = jQuery('.required:eq('+key+')', t).attr('type'); if(tag!='radio'){ if(allRequired[key]==''){ jQuery('.required:eq('+key+')', t).css({'border-color':'#f00'}); req = 1; } else { jQuery('.required:eq('+key+')', t).css({'border-color':'#eee'}); } } else { name = jQuery('.required:eq('+key+')', t).attr('name'); var radioVal; jQuery('input[type=radio][name='+name+']', t).each(function(){ radioVal = jQuery('input[type=radio][name='+name+']:checked', t).val(); jQuery(this).val(radioVal); }); } }); jQuery('.off-on').each(function(){ if(jQuery(this).prev('input[type="checkbox"]').hasClass('required')){ if(!jQuery(this).prev('input[type="checkbox"]').is(':checked')){ jQuery(this).css({'border-color':'#f00'}); } else { jQuery(this).css({'border-color':'#ccc'}); } } }); jQuery('.radio-fake').each(function(){ name = jQuery('input[type=radio].required', t).attr('name'); if(jQuery('input[type=radio].required', t).val()==''){ jQuery('input[type=radio][name='+name+']',t).next('.radio-fake').css({'border-color':'#f00'}); } else { jQuery('input[type=radio][name='+name+']',t).next('.radio-fake').css({'border-color':'#ccc'}); } }); var emailReq = jQuery('.required.email',t).val(); var emailCheck = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if(!emailCheck.test(emailReq)) { jQuery('.required.email',t).css({'border-color':'#f00'}); req = 1; } jQuery('input').not('.email').bind('change keyup blur',function(){ if(jQuery(this).val()!=''){ jQuery(this).css({'border-color':'#eee'}); } }) jQuery('select').bind('change',function(){ if(jQuery(this).val()!=''){ jQuery(this).css({'border-color':'#eee'}); } }) jQuery('input.email').bind('keyup blur',function(){ if(!emailCheck.test(jQuery(this).val())) { jQuery(this).css({'border-color':'#eee'}); } }) jQuery('textarea').bind('keyup blur',function(){ if(jQuery(this).val()!=''){ jQuery(this).css({'border-color':'#eee'}); } }) if(req == 1){ return false; } jQuery('input, textarea, select', t).each(function() { allFields.push(jQuery(this).attr('data-name')); }); jQuery('input, textarea, select', t).each(function() { allValues.push(jQuery(this).val()); }); jQuery.each(allFields, function(key, value) { if(allFields[key]){ data = data+'&'+allFields[key] + '=value_'+key; } }); jQuery.each(allValues, function(key, value) { data = data.replace('value_'+key, allValues[key]); }); jQuery('.loading').show(); jQuery.ajax({ url: "http://www.agorachurrascaria.com/wp-content/themes/delight/scripts/mailer/mailer.php", type: "GET", data: data, cache: false, success: function (html) { if (html==1) { jQuery('form',t).animate({'opacity':'0'},500); jQuery('.success',t).fadeIn('500'); _gaq.push(['_trackPageview', '/sent-email-from-'+ t.attr('id')]); pageTracker = _gat._getTracker('/sent-email-from-'+ t.attr('id')); pageTracker._trackPageview(); } else if (html=='noCaptcha') { jQuery('input[name="captcha"]',t).css({'border-color':'#f00'}); jQuery('.recaptcha',t).click(); } else { jQuery('form',t).animate({'opacity':'0'},500); jQuery('.unsuccess',t).fadeIn('500'); } } }); return false; }); if(jQuery('#to',t).length!=0 && jQuery('#from',t).length!=0) { jQuery('#from',t).css({'width':'75%'}).after('
'); jQuery('#to',t).css({'width':'75%'}).after('
'); jQuery('#to',t).prev('label').prependTo(jQuery('#to',t).next(".wrapPeriod")); jQuery('#to',t).appendTo(jQuery('#to',t).next(".wrapPeriod")); jQuery('#from',t).prev('label').prependTo(jQuery('#from',t).next(".wrapPeriod")); jQuery('#from',t).appendTo(jQuery('#from',t).next(".wrapPeriod")); } }); }); jQuery(window).one('load',function(){ jQuery('aside .contactForm').each(function () { if(jQuery('.captchaCont', this).length!=0){ var cS = jQuery('.captchaCont img#cryptogram', this).width(); var rCs = jQuery('.recaptcha', this).width(); var dS = jQuery('.captchaCont', this).width(); jQuery('input[name="captcha"]', this).css('width',dS-(cS+rCs+12)); } }); jQuery('article .contactForm').each(function () { if(jQuery('.captchaCont', this).length!=0){ var cS = jQuery('.captchaCont img#cryptogram', this).width(); jQuery('input[name="captcha"]', this).css({'width':cS,'float':'left','margin':'3px 0 0 10px'}); } }); }); /****************************************************** * * Date picker * ******************************************************/ jQuery(function() { jQuery('.contactForm').each(function () { var t = jQuery(this); if(jQuery.isFunction(jQuery.fn.datepicker)){ var dates = jQuery( "#from, #to", t ).datepicker({ defaultDate: "+1w", changeMonth: false, numberOfMonths: 1, showOn: "both", buttonImage: "http://www.agorachurrascaria.com/wp-content/themes/delight/images/calendar.png", buttonImageOnly: true, onSelect: function( selectedDate ) { var option = this.id == "from" ? "minDate" : "maxDate", instance = jQuery( this ).data( "datepicker" ), date = jQuery.datepicker.parseDate( instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat, selectedDate, instance.settings ); dates.not( this ).datepicker( "option", option, date ); } }); } }); }); /****************************************************** * * Tooltip * ******************************************************/ jQuery(window).one('load',function(){ jQuery('a.pix_clue_credits').each(function(){ var t = jQuery(this); var api = jQuery(this).qtip('api'); t.qtip({ style: { tip: { corner: "bottomRight" }, classes: "ui-tooltip-youtube", height: 'auto' }, position: { target: "mouse", adjust: { mouse: false, y: -10 }, my: "bottom right", at: "bottom right" }, show: { delay: 500, solo: true }, content: jQuery('#pix_credits_pictures').html(), hide: { event: 'unfocus' }, events: { show: function(event, api) { jQuery('.ui-tooltip, .qtip').css({'width':150}); api.set('content.text', jQuery('#pix_credits_pictures').html()); } } }); }); }); jQuery(document).ready(function() { jQuery('.pix_after_tips').each(function(){ var t = jQuery(this); var i = jQuery('body .pix_after_tips').index(t); t.attr('id','pix_after_tips'+i); t.prevAll('a').attr('data-rel','#pix_after_tips'+i).attr('href','#pix_after_tips'+i); }); jQuery('a.pix_tips, .pix_share a').each(function(){ var t = jQuery(this); var w = t.attr('data-width'); if(w==''){ w = 280; } var h = t.attr('data-height'); if(h==''){ h = 'auto'; } t.qtip({ style: { tip: { corner: "bottomLeft" }, classes: "ui-tooltip-youtube", height: h }, position: { target: "mouse", adjust: { mouse: false, x: 10, y: -10 }, my: "bottom left", at: "bottom left" }, show: { delay: 500, solo: true }, content: t.attr('title'), events: { show: function(event, api) { jQuery('.ui-tooltip, .qtip').css({'width':w}); } } }); }); jQuery('a.pix_tips_TR').each(function(){ var t = jQuery(this); t.qtip({ style: { tip: { corner: "topRight" }, classes: "ui-tooltip-youtube" }, position: { target: "mouse", adjust: { mouse: false, x: 10, y: 10 }, my: "top right", at: "top right" }, show: { delay: 500, solo: true }, content: t.attr('title') }); }); jQuery('a.pix_tips_ajax').each(function(){ var t = jQuery(this); var w = t.attr('data-width'); if(w==''){ w = 280; } var h = t.attr('data-height'); if(h==''){ h = 'auto'; } t.qtip({ content: { text: 'Loading...', ajax: { url: t.attr('data-rel') } }, style: { tip: { corner: "bottomLeft" }, classes: "ui-tooltip-youtube", height: h }, position: { target: "mouse", adjust: { mouse: false, x: 10, y: -10 }, my: "bottom left", at: "bottom left" }, show: { delay: 500, solo: true }, hide: { event: 'unfocus' }, events: { show: function(event, api) { jQuery('.ui-tooltip, .qtip').css({'width':w}); } } }); }); }); /****************************************************** * * Wide Google map * ******************************************************/ jQuery(window).one('load',function(){ if(jQuery('#map_canvas').length !=0) { var map, mapEl = jQuery('#map_canvas'), lat = jQuery('#map_canvas').attr('data-coord1'), lng = jQuery('#map_canvas').attr('data-coord2'), pix_zoom = parseFloat(jQuery('#map_canvas').attr('data-zoom')), pix_type = jQuery('#map_canvas').attr('data-type'), pix_indications = jQuery('#map_canvas').attr('data-indications'), the_type; if (pix_type=='HYBRID'){ the_type = google.maps.MapTypeId.HYBRID; } else if (pix_type=='TERRAIN'){ the_type = google.maps.MapTypeId.TERRAIN; } else if (pix_type=='SATELLITE'){ the_type = google.maps.MapTypeId.SATELLITE; } else if (pix_type=='ROADMAP'){ the_type = google.maps.MapTypeId.ROADMAP; } var point = new google.maps.LatLng(lat,lng), mapOptions = { zoom : pix_zoom, center : point, mapTypeId : the_type, mapTypeControl : false, panControl : true, panControlOptions : { position : google.maps.ControlPosition.TOP_RIGHT }, zoomControl : true, zoomControlOptions : { style : google.maps.ZoomControlStyle.SMALL, position : google.maps.ControlPosition.TOP_RIGHT }, streetViewControl : true, streetViewControlOptions : { position : google.maps.ControlPosition.TOP_RIGHT } }; map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); map.setTilt(45); var coordInfoWindow = new google.maps.InfoWindow({maxWidth : 1024}), latlngStr = pix_indications; if(latlngStr!=''){ coordInfoWindow.setContent('
'+latlngStr+'
'); coordInfoWindow.setPosition(point); coordInfoWindow.open(map); } } }); jQuery(window).bind('resize load',function(){ if (jQuery.browser.msie) { var h = jQuery(window).height(); } else { var h = window.innerHeight; } var w = jQuery(window).width(); jQuery('#outer_canvas').width(w+14).height(h); jQuery('#map_canvas').width(w+14).height(h); }); /****************************************************** * * Refresh Cufon * ******************************************************/ jQuery(window).one('load',function() { Cufon.refresh(); }); /****************************************************** * * Wide flash * ******************************************************/ function thisMovie(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return window[movieName] } else { return document[movieName] } } function playVideo() { thisMovie("wide_flash").playVideo(); } function pauseVideo() { thisMovie("wide_flash").pauseVideo(); } function resumeVideo() { thisMovie("wide_flash").resumeVideo(); } function muteVideo() { thisMovie("wide_flash").muteVideo(); } function unMuteVideo() { thisMovie("wide_flash").unMuteVideo(); } function rePlayVideo() { if(jQuery('#pix_pause_slide').is(':visible')){ jQuery('#pix_pause_slide').hide(); } if(jQuery('#pix_resume_slide').is(':visible')){ jQuery('#pix_resume_slide').hide(); } if(!jQuery('#pix_play_slide').is(':visible')){ jQuery('#pix_play_slide').fadeIn(200); } } function showPause() { jQuery('#pix_pause_slide').show(); jQuery('#pix_resume_slide').hide(); jQuery('#pix_play_slide').hide(); } function showPlay() { jQuery('#pix_play_slide').show(); jQuery('#pix_pause_slide').hide(); jQuery('#pix_resume_slide').hide(); } jQuery(window).one('load',function(){ jQuery('#pix_play_slide').live('click',function(){ playVideo(); jQuery(this).fadeOut(100,function(){ jQuery('#pix_pause_slide').fadeIn(200); }); }); jQuery('#pix_pause_slide').live('click',function(){ pauseVideo(); jQuery(this).fadeOut(100,function(){ jQuery('#pix_resume_slide').fadeIn(200); }); }); jQuery('#pix_resume_slide').live('click',function(){ resumeVideo(); jQuery(this).fadeOut(100,function(){ jQuery('#pix_pause_slide').fadeIn(200); }); }); jQuery('#pix_mute_slide').live('click',function(){ muteVideo(); jQuery(this).fadeOut(100,function(){ jQuery('#pix_unmute_slide').fadeIn(200); }); }); jQuery('#pix_unmute_slide').live('click',function(){ unMuteVideo(); jQuery(this).fadeOut(100,function(){ jQuery('#pix_mute_slide').fadeIn(200); }); }); }); /****************************************************** * * Portfolio images * ******************************************************/ function portfolioImages(){ jQuery('.imgHentry').each(function(){ var t = jQuery(this); var i = jQuery('img',t); var a = jQuery('.linkIcon',t); a.show().find('a').animate({'opacity':0},0); jQuery('a',t).each(function(){ var ti; var ex; var ac; if(jQuery(this).attr('data-title')){ ti = ''+jQuery(this).attr('data-title')+'
'; } else { ti = ''; } if(jQuery(this).attr('data-excerpt')){ ex = jQuery(this).attr('data-excerpt')+'
'; } else { ex = ''; } if(jQuery(this).attr('data-action')){ ac = ''+jQuery(this).attr('data-action')+'
'; } else { ac = ''; } if(jQuery(this).attr('data-hide')!='hide'){ jQuery(this).qtip({ style: { tip: { corner: "bottomLeft" }, classes: "ui-tooltip-youtube" }, position: { target: "mouse", adjust: { mouse: false, x: 10, y: -10 }, my: "bottom left", at: "bottom left" }, show: { delay: 500, solo: true }, content: ti+ex+ac }); } }); t.hover(function(){ i.stop(true,false).animate({'opacity':0.2},300); a.find('a').stop(true,false).animate({'opacity':1},300); },function(){ i.stop(true,false).animate({'opacity':1},300); a.find('a').stop(true,false).animate({'opacity':0},300); }); }); } jQuery(function(){ portfolioImages(); }); /****************************************************** * * Filter tag * ******************************************************/ function filterTag() { if(jQuery('#filtering-nav').length!=0){ jQuery('#filtering-nav a').each(function(){ var t = jQuery(this); var dF = t.attr('data-filter'); var l = jQuery(dF).length; if(dF!='*'&&l==0){ t.hide(); } else { t.show(); } }); } } jQuery(function(){ filterTag(); }); /****************************************************** * * Portfolio layout * ******************************************************/ jQuery(function(){ var ha = 0; if(jQuery('aside').length!=0){ ha = jQuery('aside').height(); } if(jQuery('section.widepagePortfolio').length!=0){ var w = jQuery(window).width(); if(w > 1050){ w = jQuery(window).width()-300; } else { w = 1050 - 300; } jQuery('section.widepagePortfolio').css({'width':w,'float':'left','margin-left':'270px'}) jQuery(window).resize(function(){ w = jQuery(window).width(); if(w > 1050){ w = jQuery(window).width()-300; } else { w = 1050 - 300; } jQuery('section.widepagePortfolio').css({'width':w,'float':'left','margin-left':'270px'}) }); } if(jQuery('div.isoFilter').length!=0){ var speed = 400, the_mode, the_difference, wall; if(jQuery('section.widepagePortfolio').length!=0){ wall = jQuery('section div.isoFilter'); the_mode = 'masonry'; } else if(jQuery('section.pagePortfolio').length!=0) { wall = jQuery('article div.isoFilter'); the_mode = 'fitRows'; jQuery(window).one('load',function(){ the_difference = 100+(jQuery('article > div').height() - (jQuery('.isoFilter').height() + jQuery('#filtering-nav').height())); }); } wall.imagesLoaded( function(){ wall.isotope({ masonry : { columnWidth : '1' }, itemSelector : '.hentry', layoutMode : the_mode, animationEngine : 'jquery', animationOptions: { duration: 400, easing: 'linear', queue: false } }); }); var colorClass = '.all'; jQuery('#filtering-nav a').click(function(){ colorClass = '.' + jQuery(this).attr('data-filter'); var selector = jQuery(this).attr('data-filter'); wall.isotope({ filter: selector }); setTimeout(function(){ var newH = jQuery('.isoFilter').height(); if(jQuery('#filtering-nav').length!=0){ var fH = jQuery('#filtering-nav').height(); } else { var fH = 0; } if(jQuery('.pix_pagenavi').length!=0){ var bC = jQuery('.pix_pagenavi > ul').height(); } else { var bC = 0; } jQuery('article').css({'height':(newH+the_difference+fH)}); var hs = 0; if(jQuery('article').length!=0){ hs = jQuery('article').height()+(fH+bC); } articleAsideOpen(hs, ha); jQuery(window).resize(); }, speed); if ( !jQuery(this).hasClass('selected') ) { jQuery(this).parents('#filtering-nav').find('.selected').removeClass('selected'); jQuery(this).addClass('selected'); } return false; }); if(jQuery.isFunction(jQuery.fn.infinitescroll)) { wall.infinitescroll({ navSelector : 'a#page_nav:last', nextSelector : 'a#page_nav:last', itemSelector : '.hentry:not(.invis)', loadingImg : 'http://www.agorachurrascaria.com/wp-content/themes/delight/images/loader.gif', loadingText : 'Loading...', donetext : 'No more items to load', debug: false, errorCallback: function() { jQuery('#infscr-loading').animate({opacity: .8},2000).fadeOut('normal'); } }, function( newElements ) { wall.isotope( 'appended', jQuery( newElements ), function(){ setTimeout(function(){ var thisClass = jQuery('#filtering-nav a.selected').attr('data-filter'); if(thisClass!='*') { jQuery('#filtering-nav a[data-filter="'+thisClass+'"]').click(); } var newH = jQuery('.isoFilter').height(); filterTag(); if(jQuery('#filtering-nav').length!=0){ var fH = jQuery('#filtering-nav').height(); } else { var fH = 0; } jQuery('article').css({'height':(newH+the_difference+fH+50)}); var hs = 0; if(jQuery('article').length!=0){ hs = jQuery('article').height(); } articleAsideOpen(hs, ha); jQuery(window).resize(); portfolioImages(); }, speed+speed); jQuery("a[href$='.jpg']", newElements).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']", newElements).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']", newElements).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", newElements).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(window).unbind('.infscr'); jQuery('a#page_nav').click(function(){ jQuery(document).trigger('retrieve.infscr'); return false; }); jQuery(document).ajaxError(function(e,xhr,opt){ if (xhr.status == 404) { jQuery('a#page_nav').remove(); } }); } }); /****************************************************** * * Accordions * ******************************************************/ jQuery(function() { if(jQuery('.pix_accordion').length!=0){ jQuery( '.pix_accordion' ).each(function(){ var aA = parseFloat(jQuery(this).attr('data-active')); if(aA==0){ aA = 100000; } jQuery( this ).accordion({ autoHeight: false, navigation: false, collapsible: true, icons: false, header: 'a.header_accordion', change: function(event, ui) { jQuery('.ui-state-active .icons',this).html('_'); jQuery('.ui-state-default .icons',this).html('>'); jQuery('article, aside').css({'height':'auto'}); jQuery('article .entry-title:first, aside h3:first').unbind('click'); var hs = jQuery('article').height(); var ha = jQuery('aside').height(); articleAsideOpen(hs, ha); jQuery(window).resize(); Cufon.refresh(); }, create: function(event, ui) { jQuery('.ui-state-default .icons',this).html('>'); jQuery('.ui-state-active .icons',this).html('_'); jQuery(window).resize(); Cufon.refresh(); }, active: aA-1 }); }); } }); /****************************************************** * * Tabs * ******************************************************/ jQuery(window).one('load',function() { if(jQuery('.pix_tabs').length!=0){ jQuery( '.pix_tabs' ).each(function(){ var aA = parseFloat(jQuery(this).attr('data-active')); jQuery( this ).tabs({ icons: false, show: function(event, ui) { jQuery('article, aside').css({'height':'auto'}); jQuery('article .entry-title:first, aside h3:first').unbind('click'); var hs = jQuery('article').height(); var ha = jQuery('aside').height(); articleAsideOpen(hs, ha); jQuery(window).resize(); Cufon.refresh(); }, fx: { opacity: 'toggle' }, selected: aA-1 }); }); } }); /****************************************************** * * Columns IE7 workaround * ******************************************************/ jQuery(function() { if ((jQuery.browser.msie && jQuery.browser.version < 9) && jQuery('.pix_columns').length != 0) { var w = jQuery('article > div').width(); jQuery('.pix_columns .col_two').css({'width':Math.floor(w*0.47)}); jQuery('.pix_columns .col_two').not('.last_column').css({'margin-right':Math.floor(w*0.06)}); jQuery('.pix_columns .col_three').css({'width':Math.floor(w*0.32)}); jQuery('.pix_columns .col_three').not('.last_column').css({'margin-right':Math.floor(w*0.02)}); //jQuery('#post-22 .pix_columns .col_three').css({'width':Math.floor(w*0.37)}); //jQuery('#post-22 .pix_columns .col_three').not('.last_column').css({'margin-right':Math.floor(w*0.04)}); jQuery('.pix_columns .col_two_three').css({'width':Math.floor(w*0.65)}); jQuery('.pix_columns .col_two_three').not('.last_column').css({'margin-right':Math.floor(w*0.05)}); //jQuery('#post-22 .pix_columns .col_two_three').css({'width':Math.floor(w*0.59)}); //jQuery('#post-22 .pix_columns .col_two_three').not('.last_column').css({'margin-right':Math.floor(w*0.04)}); jQuery('.pix_columns .col_four').css({'width':Math.floor(w*0.23)}); jQuery('.pix_columns .col_four').not('.last_column').css({'margin-right':Math.floor(w*0.02)}); jQuery('.pix_columns .col_two_four').css({'width':Math.floor(w*0.48)}); jQuery('.pix_columns .col_two_four').not('.last_column').css({'margin-right':Math.floor(w*0.04)}); jQuery('.pix_columns .col_three_four').css({'width':Math.floor(w*0.74)}); jQuery('.pix_columns .col_three_four').not('.last_column').css({'margin-right':Math.floor(w*0.04)}); jQuery('.pix_columns .col_five').css({'width':Math.floor(w*0.18)}); jQuery('.pix_columns .col_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)}); jQuery('.pix_columns .col_two_five').css({'width':Math.floor(w*0.385)}); jQuery('.pix_columns .col_two_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)}); jQuery('.pix_columns .col_three_five').css({'width':Math.floor(w*0.59)}); jQuery('.pix_columns .col_three_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)}); } }); /****************************************************** * * Smoothscroll * ******************************************************/ jQuery(function(){ jQuery('a[href*=#]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = jQuery(this.hash); target = target.length && target || jQuery('[name=' + this.hash.slice(1) +']'); if (target.length) { var targetOffset = target.offset().top; jQuery('body') .animate({scrollTop: targetOffset}, 1000); jQuery('html') .animate({scrollTop: targetOffset}, 1000); return false; } } }); }); /****************************************************** * * Hover nav effect * ******************************************************/ jQuery(window).one('load',function(){ jQuery('nav > ul > li').has('ul').each(function(){ var w = parseFloat(jQuery(this).find('a:first').width()); var p = parseFloat(jQuery(this).find('a:first').css('padding-left').replace('px','')); //jQuery('a:first',this).after(' >'); }); jQuery('nav > ul > li li').has('ul').each(function(){ var w = parseFloat(jQuery(this).find('a:first').width()); var p = parseFloat(jQuery(this).find('a:first').css('padding-left').replace('px','')); //jQuery('a:first',this).after(' _'); }); jQuery('nav li li ul').addClass('third_level_menu'); //jQuery('nav > ul > li').css({'margin-left':0}); var hH = jQuery('header').height(); //jQuery('header').css({'top':'-'+hH+'px'}).css({'visibility':'visible','top':0}); var cI = jQuery('#socialtoggle').height(); jQuery('#socialtoggle').css({'top':'-'+cI+'px'}).css({'visibility':'visible','top':0}); var hF = 0; if(jQuery('footer').length!=0){ hF = jQuery('footer').height(); //jQuery('footer').css({'bottom':'-'+hH+'px'}).css({'visibility':'visible','bottom':0}); } if(jQuery('article').length!=0){ var aT = parseFloat(jQuery('article').css('top').replace('px','')); var aH = jQuery('article').height(); //jQuery('article').not('.open_toggle').css({'top':aT+aH+hF,'visibility':'visible','top':aT}); } if(jQuery('aside').length!=0){ var sT = parseFloat(jQuery('aside').css('top').replace('px','')); var sH = jQuery('aside').height(); //jQuery('aside').not('.open_toggle').css({'top':sT+sH+hF,'visibility':'visible','top':aT}); } }); jQuery(window).one('load',function(){ //jQuery('nav > ul > li').not(':has(ul)').each(function(){ // var a = jQuery(this).find('a:first'); //a.hoverIntent({ // over: function(){jQuery(this).stop(true,false).animate({'border-right-width':'5px','padding-right':'15px'},100);}, // out: function(){jQuery(this).stop(true,false).animate({'border-right-width':'0','padding-right':'20px'},100);}, // timeout: 250 //}); //}); jQuery('nav > ul > li').has('ul').each(function(){ var a = jQuery(this).find('a:first'); var sub = jQuery(this).find('.submenu:first'); //var w = 30+(a.width()); var w = a.width() + parseInt(a.css('padding-left')) + parseInt(a.css('padding-right')); var u = jQuery(this).find('ul:first'); var sto; //u.find('li').not(':first').before('
  • /
  • '); //jQuery('.third_level_menu .slash_li:first-child').remove(); var uW = u.width() + parseInt(u.css('padding-left')) + parseInt(u.css('padding-right')); u.each(function(){ jQuery(this).css({'left':'-'+((uW-w))+'px','width':uW+'px'}); }); jQuery('nav ul.third_level_menu').hide(); uW = 2; jQuery('> ul > li',this).each(function(){ var allLi = []; allLi.push(jQuery(this).width()); jQuery.each(allLi, function(key, value) { uW = uW + (allLi[key]); }); }); jQuery('> ul',this).css({'left':'-'+(uW)+'px','width':uW}); jQuery('nav ul.third_level_menu').show(); function seThide(){ //a.stop(true,false).animate({'padding-right':'20px'},100); sub.stop(true,false).animate({'opacity':1,'right':'12px'},100); u.stop(true,false).animate({'left':'-'+(uW)+'px'},200); } function seTout(){ sto = setTimeout(seThide,250); } jQuery(this).hoverIntent({ over: function(){ w = a.width() + parseInt(a.css('padding-left')) + parseInt(a.css('padding-right')); clearTimeout(sto); //a.stop(true,false).animate({'padding-right':'15px'},100); sub.stop(true,false).animate({'opacity':0,'right':0},100); u.stop(true,false).animate({'left':w},200); }, out: seTout, timeout: 650 }); }); jQuery('nav li').hover(function(){ jQuery(this).addClass('nav_li_hover'); },function(){ jQuery(this).removeClass('nav_li_hover'); }); jQuery('nav li li').has('ul').each(function(){ var ul = jQuery(this).find('ul:first'); var sub = jQuery(this).find('.submenu:first'); var ulW = 2; var sto; ul.find('> li').each(function(){ var allLi = []; allLi.push(jQuery(this).width()); jQuery.each(allLi, function(key, value) { ulW = ulW + (allLi[key]); }); }); var thisH = jQuery(this).height(); ul.width(0).height(thisH-7); function seThide(){ ul.css({'width':0,'margin-left':0}).hide(); sub.stop(true,false).animate({'top':'-2px','opacity':1},100); jQuery('nav li').removeClass('nav_hover'); jQuery('nav li').css({'z-index':'1'}); } function seTout(){ sto = setTimeout(seThide,650); } jQuery(this).hoverIntent({ over: function(){ clearTimeout(sto); jQuery('nav li li ul').hide(); var offset = jQuery(this).offset(); if(offset.left+ulW>1050){ ul.css({'left':0,'top':thisH}).show().stop(true,false).animate({'width':ulW,'margin-left':(1050-offset.left)-ulW},200); } else { ul.css({'left':10,'top':thisH}).show().stop(true,false).animate({'width':ulW},200); } ul.parent().parent().parent().addClass('nav_hover'); jQuery('nav li').not('.nav_hover').css({'z-index':'-1'}); sub.stop(true,false).animate({'top':'15px','opacity':0},100); }, out: seTout, timeout: 250 }); }); Cufon.refresh(); }); /****************************************************** * * Link with # * ******************************************************/ jQuery(function(){ jQuery('nav a').click(function(){ if(jQuery(this).attr('href')=='#'){ return false; } }); }); /****************************************************** * * Show thumbs & thmb scroller * ******************************************************/ function navGhide(){ jQuery('#navgallery_wrap').fadeOut(200,function(){ jQuery('#credits_blog, #pix_controls').fadeIn(400); }); } var sto; function seTout(){ sto = setTimeout(navGhide,1000); } function resizeThumbCont(){ //funzione per il resize del contenitore thumb var w = jQuery(window).width(); jQuery('#navgallery_wrap, #scroll_wrapper').width(w-40); // 20+20 margine laterale } jQuery(window).bind('load resize',function(){ resizeThumbCont(); }); jQuery(window).one('load',function(){ jQuery('#navgallery_wrap').hide(); if(jQuery('#pix_show_thumbs').length!=0){ jQuery('#pix_show_thumbs').click(function(){ jQuery('#credits_blog, #pix_controls').fadeOut(200,function(){ jQuery('#navgallery_wrap').fadeIn(400); }); }); jQuery('#navgallery_wrap').mouseout(function(){ seTout(); }).mouseover(function(){ clearTimeout(sto); }); } var wrapperW = (jQuery('.navgallery li').length)*(50+10+2); jQuery('.navgallery').width(wrapperW); var wrapW = jQuery('#navgallery_wrap').width(); if( wrapperW > wrapW ) { jQuery("#navgallery_wrap").thumbnailScroller({ scrollerType:"hoverPrecise", scrollerOrientation:"horizontal", scrollSpeed:2, scrollEasing:"easeOutCirc", scrollEasingAmount:250, acceleration:4, scrollSpeed:300, noScrollCenterSpace:10, autoScrolling:0, autoScrollingSpeed:2000, autoScrollingEasing:"easeInOutQuad", autoScrollingDelay:500 }); } else { jQuery('.navgallery').css({'margin-left' : (wrapW - wrapperW) }); } }); jQuery(window).one('load',function(){ jQuery('#plusone').hide(); }); jQuery(function(){ var hash = window.location.hash; if(typeof hash !== 'undefined' && hash !== false && hash !== ''){ if(!jQuery('article').hasClass('open_toggle')){ window.location.hash = ''; } } }); /******************************************* Script used to display current date. ********************************************/ function addToArray(ar, str) { var l; l = ar[0] + 1; ar[l] = str; ar[0] = l; } function makeArray() { array = new Object(); array[0] = 0; return array; } var dayNames = makeArray() addToArray(dayNames, " Sun"); addToArray(dayNames, " Mon"); addToArray(dayNames, " Tue"); addToArray(dayNames, " Wed"); addToArray(dayNames, " Thu"); addToArray(dayNames, " Fri"); addToArray(dayNames, " Sat"); function ShowDay() { var ryear = jQuery('select[name="ResYear"]').val(); ryear = jQuery('select[name="ResYear"]').val(); var rmonth = jQuery('select[name="ResMonth"]').val() - 1;// document.r.ResMonth.selectedIndex; var rdate = jQuery('select[name="ResDate"]').val(); //document.r.ResDate.selectedIndex + 1; var rnow = new Date(ryear,rmonth,rdate); var rday = rnow.getDay() + 1; jQuery('input[name="dayweek"]').val(dayNames[rday]); } function setDate() { // extract date from literal.. var now = new Date(); var closestTime = (now.getTime() + (30 * 60000)); //1/2 hour in advance... var nearest = new Date(closestTime); var nearmonth = nearest.getMonth(); var neardate = nearest.getDate(); var nearyear = nearest.getFullYear(); jQuery('select[name="ResMonth"]').val(nearmonth + 1); jQuery('select[name="ResDate"]').val(neardate); jQuery('select[name="ResYear"]').val(nearyear); //document.r.ResMonth.selectedIndex = nearmonth; //document.r.ResDate.selectedIndex = neardate - 1; //document.r.ResYear.selectedIndex = nearyear-2005; } jQuery(window).one('load',function(){ setDate(); ShowDay(); }); /****************************************************** * * hover states for social icons * ******************************************************/ //pix_opentable_icon jQuery(function() { jQuery("#social_bar .wrapIn .icon img") .mouseover(function() { var src = jQuery(this).attr("src").match(/[^\.]+/) + "_hover.gif"; jQuery(this).attr("src", src); }) .mouseout(function() { var src = jQuery(this).attr("src").replace("_hover", ""); jQuery(this).attr("src", src); }); }); function Debug(action, msg) { if (console.log) console.log("%s: %o", msg, action); }