Advertisement
pixedelic

custom.php

Aug 31st, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 86.36 KB | None | 0 0
  1. <?php require_once( '../../../../wp-load.php' ); ?>
  2. jQuery.noConflict();
  3.  
  4. <?php if(get_pix_option('pix_google_prevent')!='0') { ?>
  5. google.load("webfont", "1");
  6.  
  7. <?php $fonts = array(
  8.     get_pix_option('pix_typo_general'),
  9.     get_pix_option('pix_typo_general_own'),
  10.     get_pix_option('pix_typo_buttons'),
  11.     get_pix_option('pix_typo_buttons_own'),
  12.     get_pix_option('pix_typo_h1'),
  13.     get_pix_option('pix_typo_h1_own'),
  14.     get_pix_option('pix_typo_h2'),
  15.     get_pix_option('pix_typo_h2_own'),
  16.     get_pix_option('pix_typo_h3'),
  17.     get_pix_option('pix_typo_h3_own'),
  18.     get_pix_option('pix_typo_h4'),
  19.     get_pix_option('pix_typo_h4_own'),
  20.     get_pix_option('pix_typo_h5'),
  21.     get_pix_option('pix_typo_h5_own'),
  22.     get_pix_option('pix_typo_h6'),
  23.     get_pix_option('pix_typo_h6_own'),
  24.     get_pix_option('pix_typo_sitetitle'),
  25.     get_pix_option('pix_typo_sitetitle_own'),
  26.     get_pix_option('pix_typo_sitedescription'),
  27.     get_pix_option('pix_typo_sitedescription_own'),
  28.     get_pix_option('pix_typo_firstlevellink'),
  29.     get_pix_option('pix_typo_firstlevellink_own'),
  30.     get_pix_option('pix_typo_secondlevellink'),
  31.     get_pix_option('pix_typo_secondlevellink_own'),
  32.     get_pix_option('pix_typo_thirdlevellink'),
  33.     get_pix_option('pix_typo_thirdlevellink_own'),
  34.     get_pix_option('pix_typo_logobottom'),
  35.     get_pix_option('pix_typo_logobottom_own'),
  36. );
  37. $fonts=array_unique($fonts);
  38. foreach ($fonts as $key => $value) {
  39.     if($value!=''){
  40.         if($key==0){
  41.             $font .= '\''.$value.'\'';
  42.         } else {
  43.             $font .= ', \''.$value.'\'';
  44.         }
  45.     }
  46. } ?>
  47.  
  48. jQuery(function() {
  49.     WebFont.load({
  50.         google: {
  51.             families: [ <?php echo $font; ?> ]
  52.         }
  53.     });
  54. });
  55.  
  56. <?php } ?>
  57.  
  58. /******************************************************
  59. *
  60. *   Article toggle effect
  61. *
  62. ******************************************************/
  63. function articleAsideOpen(hs, ha){     //################### Apre article e aside separatamente e ad altezze diverse
  64.     var deviceAgent = navigator.userAgent.toLowerCase();
  65.     var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
  66.  
  67.     var fe;
  68.     if (jQuery('.entry-title').length!=0) {
  69.         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
  70.     }
  71.     if (jQuery.browser.msie) {
  72.         if(jQuery(window).height()>jQuery(document).height()){      //in questo modo anche con menu scrollabile ho l'altezza della section piena
  73.             var h = jQuery(window).height();
  74.         } else {
  75.             var h = jQuery(document).height();
  76.         }
  77.     } else {
  78.         if(window.innerHeight>jQuery(document).height()){       //in questo modo anche con menu scrollabile ho l'altezza della section piena
  79.             var h = window.innerHeight;
  80.         } else {
  81.             var h = jQuery(document).height();
  82.         }
  83.     }
  84.     var off;
  85.     off = jQuery('footer').offset();
  86.     var offs = jQuery('article').offset();
  87.     var offa;
  88.     offa = jQuery('aside').offset();
  89.     var he = parseFloat(jQuery('section').css('margin-top').replace('px',''));
  90.     var foo = jQuery('footer').height();
  91.     var hh2 = jQuery('article').not('.always_open').find('.entry-title:first').css({'cursor':'pointer','position':'relative'}).append('<span class="toggle_arrow icons">^</span>').height()+15+15;
  92.     var lhh2 = jQuery('article .entry-title:first').css('line-height');    //mi serve per settare le altezze dei due titoli
  93.     var hh3 = jQuery('aside').not('.always_open').find('h3:first').css({'cursor':'pointer','position':'relative'}).append('<span class="toggle_arrow icons">^</span>').height()+15+15;
  94.     jQuery('aside').find('h3:first').addClass('first');
  95.     var ph3 = jQuery('aside').find('h3:first').css('padding-top');
  96.     jQuery('aside .toggle_arrow').css('padding-top',ph3);
  97.     var secMarg = parseFloat(jQuery('section').css('margin-top'));
  98.  
  99.    
  100.     var h2ln = Math.round(parseFloat(jQuery('article .entry-title:first').height()) / parseFloat(jQuery('article .entry-title:first').css('line-height')));    //numero di righe del titolo della article
  101.     var h3ln = Math.round(parseFloat(jQuery('aside h3:first').height()) / parseFloat(jQuery('aside h3:first').css('line-height')));    //numero di righe del titolo della aside
  102.    
  103.     if(h2ln == h3ln && (fe==0 || !jQuery('aside').hasClass('open_toggle') ) ) {    //se i numeri di righe sono uguali etc.
  104.         jQuery('aside h3:first').css({'line-height':lhh2});    //setto le altezze uguali
  105.         hh3 = hh2;    //setto le altezze uguali
  106.     }
  107.     if(jQuery('article').length!=0){
  108.         jQuery('article').not('.open_toggle').height(hh2).css({'left':offs.left,'top':off.top-(hh2),'position':'fixed'});
  109.     }
  110.     if(jQuery('aside').length!=0){
  111.         jQuery('aside').not('.open_toggle').height(hh3).css({'left':offa.left,'top':off.top-(hh3),'position':'fixed'});
  112.     }
  113.     jQuery('.open_toggle').find('.toggle_arrow').text('_');
  114.     Cufon.refresh();
  115.     if(hs>h-(he+foo)) {
  116.          var hs2 = hs;
  117.     } else {
  118.         var hs2 = h-(he+foo);
  119.     }
  120.     if(ha>h-(he+foo+fe)) {
  121.         var ha2 = ha;
  122.     } else {
  123.         var ha2 = h-(he+foo+fe);
  124.     }
  125.     if(ha+fe>hs) {
  126.         jQuery('article.open_toggle').css({'height':ha2+fe,'visibility':'visible'});
  127.         jQuery('aside.open_toggle').css({'margin-top':fe,'height':ha2,'visibility':'visible'});
  128.     } else {
  129.         jQuery('article.open_toggle').css({'height':hs2,'visibility':'visible'});
  130.         jQuery('aside.open_toggle').css({'margin-top':fe,'height':hs2-fe,'visibility':'visible'});
  131.     }
  132.  
  133.    
  134.     function layoutAfterResize(){
  135.         //var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
  136.         //if (!agentID) {
  137.             var off;
  138.             off = jQuery('footer').offset();
  139.             var offs = jQuery('article').offset();
  140.             var offa = jQuery('aside').offset();
  141.             if (jQuery.browser.msie) {
  142.                 h = jQuery(window).height;
  143.             } else {
  144.                 h = window.innerHeight;
  145.             }
  146.             var scrolled = jQuery(window).scrollTop();
  147.             if(ha+fe<hs){
  148.                if(hs>h-(he+foo)){
  149.                     jQuery('article.open_toggle').css({'height':hs});
  150.                     if(jQuery('article').hasClass('open_toggle')){
  151.                         jQuery('aside.open_toggle').css({'height':hs-fe});
  152.                     } else {
  153.                         if(ha+fe<h-(he+foo)){
  154.                             jQuery('aside.open_toggle').css({'height':h-(he+foo+fe)});
  155.                         }
  156.                     }
  157.                 } else {
  158.                     jQuery('article.open_toggle').css({'height':h-(he+foo)});
  159.                     jQuery('aside.open_toggle').css({'height':h-(he+foo+fe)});
  160.                 }
  161.             } else {
  162.                 if(ha+fe>h-(he+foo)){
  163.                     if(jQuery('aside').hasClass('open_toggle')){
  164.                         jQuery('article.open_toggle').css({'height':ha+fe});
  165.                     } else {
  166.                         if(hs<h-(he+foo)){
  167.                             jQuery('article.open_toggle').css({'height':h-(he+foo)});
  168.                         }
  169.                     }
  170.                     jQuery('aside.open_toggle').css({'height':ha});
  171.                 } else {
  172.                     jQuery('article.open_toggle').css({'height':h-(he+foo)});
  173.                     jQuery('aside.open_toggle').css({'height':h-(he+foo+fe)});
  174.                 }
  175.             }
  176.             if(jQuery('article').length!=0) {
  177.                 jQuery('article').not('.open_toggle').css({'left':offs.left,'top':(off.top-scrolled)-(hh2)});
  178.             }
  179.             if(jQuery('aside').length!=0) {
  180.                 jQuery('aside').not('.open_toggle').css({'left':offa.left,'top':(off.top-scrolled)-(hh3)});
  181.             }
  182.            if(hs>h-(he+foo)) {
  183.                 hs2 = hs;
  184.             } else {
  185.                 hs2 = h-(he+foo);
  186.             }
  187.             if(ha>h-(he+foo)) {
  188.                 ha2 = ha;
  189.             } else {
  190.                 ha2 = h-(he+foo+fe);
  191.             }
  192.         //}
  193.      } 
  194.      
  195.     jQuery(window).resize(function(){
  196.         layoutAfterResize();
  197.     });
  198.  
  199.     var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
  200.    
  201.      if( !jQuery('article').hasClass('always_open')){
  202.          jQuery('article .entry-title:first').click(function(){
  203.             var t = jQuery(this).parents('article');
  204.             if (jQuery.browser.msie) {
  205.                 var h = jQuery(window).height();
  206.             } else {
  207.                 var h = window.innerHeight;
  208.             }
  209.             var ha = jQuery('aside').height();
  210.             var off;
  211.             off = jQuery('footer').offset();
  212.             var scrolled = jQuery(window).scrollTop();
  213.             if(t.hasClass('open_toggle')){
  214.                 /*if (agentID) {
  215.                     return false;
  216.                 }*/
  217.                 t.animate({'margin-top':(off.top-scrolled)-(hh2+secMarg),'height':hh2},300,function(){
  218.                     t.removeClass('open_toggle');
  219.                     t.find('.toggle_arrow').text('^');
  220.                     Cufon.refresh();
  221.                     t.css({'left':offs.left,'top':(off.top-scrolled)-(hh2),'margin':'0','position':'fixed'});
  222.                 });
  223.                 if(!jQuery('aside').hasClass('open_toggle')) {
  224.                     jQuery('html,body').animate({scrollTop: 0}, 300 );
  225.                 } else {
  226.                         jQuery('aside.open_toggle').animate({'height':ha2}, 300 );
  227.                         jQuery('html,body').animate({scrollTop: 0}, 300 );
  228.                 }
  229.                 /*if (agentID) {
  230.                     jQuery('footer').css({'position':'fixed','margin-top':'0'});
  231.                 }*/
  232.             } else {
  233.                 t.css({'margin-top':off.top-(hh2+secMarg),'position':'static','top':'0','left':'0'});
  234.                 t.find('.toggle_arrow').text('_');
  235.                 Cufon.refresh();
  236.                 if(hs<ha+fe&&jQuery('aside').hasClass('open_toggle')){
  237.                     t.animate({'margin-top':'0','height':ha+fe},300,function(){t.addClass('open_toggle')});
  238.                 } else if(hs>h-(he+foo)) {
  239.                     jQuery('aside.open_toggle').animate({'height':hs-fe},300);
  240.                     t.animate({'margin-top':'0','height':hs},300,function(){t.addClass('open_toggle')});
  241.                 } else {
  242.                     //jQuery('aside.open_toggle').animate({'height':hs},300);
  243.                     t.animate({'margin-top':'0','height':h-(he+foo)},300,function(){t.addClass('open_toggle')});
  244.                 }
  245.                 /*if (agentID) {
  246.                     jQuery('footer').css({'position':'relative'});
  247.                 }*/
  248.             }
  249.         }),layoutAfterResize();
  250.     }
  251.    
  252.    
  253.     var orPadB = jQuery('aside h3:first').css('padding-bottom');
  254.     var orPadT = jQuery('aside h3:first').css('padding-top');
  255.     var orPadAr = jQuery('aside h3:first .toggle_arrow').css('padding-top');
  256.     var orLh = jQuery('aside h3:first').css('line-height');
  257.  
  258.  
  259.     jQuery('aside').not('.open_toggle').find('h3:first').each(function(){
  260.         var dif = jQuery('.entry-title').height()-jQuery(this).height();
  261.         var marg = parseFloat(jQuery(this).css('padding-bottom').replace('px',''));
  262.         jQuery(this).css({'padding-bottom':(marg+dif),'padding-top':'20px'});
  263.         jQuery('.toggle_arrow',this).css({'padding-top':'20px'});
  264.    });
  265.  
  266.  
  267.      if( !jQuery('aside').hasClass('always_open')){
  268.         jQuery('aside h3:first').click(function(){
  269.             var t = jQuery(this).parents('aside');
  270.             if (jQuery.browser.msie) {
  271.                 var h = jQuery(window).height();
  272.             } else {
  273.                 var h = window.innerHeight;
  274.             }
  275.             var hs = jQuery('article').height();
  276.             var off;
  277.             off = jQuery('footer').offset();
  278.             var scrolled = jQuery(window).scrollTop();
  279.             if(t.hasClass('open_toggle')){
  280.                 /*if (agentID) {
  281.                     return false;
  282.                 }*/
  283.                 var dif = jQuery('.entry-title').height()-jQuery(this).height();
  284.                 var marg = parseFloat(jQuery(this).css('padding-bottom').replace('px',''));
  285.                 jQuery(this).animate({'padding-bottom':(marg+dif),'padding-top':'20px'});
  286.                 jQuery('.toggle_arrow',this).animate({'padding-top':'20px'});
  287.                 if(h2ln == h3ln) {    //se i numeri di righe sono uguali etc.
  288.                     jQuery('aside h3:first').css({'line-height':lhh2});    //setto le altezze uguali
  289.                     hh3 = hh2;    //setto le altezze uguali
  290.                 }
  291.                 t.animate({'margin-top':(off.top-scrolled)-(hh3+secMarg),'height':hh3},300,function(){
  292.                     t.removeClass('open_toggle');
  293.                     t.find('.toggle_arrow').text('^');
  294.                     Cufon.refresh();
  295.                     t.css({'left':offa.left,'top':(off.top-scrolled)-(hh3),'margin':'0','position':'fixed'});
  296.                 });
  297.                 if(!jQuery('article').hasClass('open_toggle')) {
  298.                     jQuery('html,body').animate({scrollTop: 0}, 300 );
  299.                 } else {
  300.                     jQuery('article.open_toggle').animate({'height':hs2}, 300 );
  301.                     jQuery('html,body').animate({scrollTop: 0}, 300 );
  302.                 }
  303.             } else {
  304.                 jQuery(this).animate({'padding-bottom':orPadB,'padding-top':orPadT});
  305.                 jQuery('.toggle_arrow',this).animate({'padding-top':orPadAr});
  306.                 jQuery('aside h3:first').css({'line-height':orLh});
  307.                 t.css({'margin-top':off.top-(hh2+secMarg),'position':'static','top':'0','left':'0'});
  308.                 t.find('.toggle_arrow').text('_');
  309.                 Cufon.refresh();
  310.                 if(ha<hs-fe&&jQuery('article').hasClass('open_toggle')){
  311.                     t.animate({'margin-top':fe,'height':hs-fe},300,function(){t.addClass('open_toggle')});
  312.                 } else if(ha>h-(he+foo)) {
  313.                     jQuery('article.open_toggle').animate({'height':ha+fe},300);
  314.                     t.animate({'margin-top':fe,'height':ha},300,function(){t.addClass('open_toggle')});
  315.                 } else {
  316.                     //jQuery('article.open_toggle').animate({'height':ha+fe},300);
  317.                     t.animate({'margin-top':fe,'height':h-(he+foo)},300,function(){t.addClass('open_toggle')});
  318.                 }
  319.             }
  320.         }),layoutAfterResize();
  321.     }
  322. }
  323. jQuery(window).one('load',function(){
  324.     jQuery('article .entry-title:first, aside h3:first').unbind('click');
  325.     var hs = 0;
  326.     if(jQuery('article').length!=0){
  327.         hs = jQuery('article').height();
  328.     }    
  329.     var ha = 0;
  330.     if(jQuery('aside').length!=0){
  331.         ha = jQuery('aside').height();
  332.     }    
  333.    articleAsideOpen(hs, ha);
  334.     Cufon.refresh();
  335. });
  336. jQuery(window).one('load',function(){
  337.     var deviceAgent = navigator.userAgent.toLowerCase();
  338.     var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
  339.     /*if (agentID) {
  340.         jQuery('aside h3:first').click();
  341.         jQuery('article .entry-title:first').click();
  342.         jQuery('footer').css({'position':'relative'});
  343.         jQuery('#body').css({'height':'auto'});
  344.     }*/
  345. });
  346. /******************************************************
  347. *
  348. *   Full page slideshow
  349. *
  350. ******************************************************/
  351. jQuery.fn.espresslide = function(opts) {
  352.    
  353.     var defaults = {
  354.         navElem         : null,
  355.         navCont         : 'li',
  356.         controlsCont    : null,
  357.         prev            : null,
  358.         next            : null,
  359.         play            : null,
  360.         pause           : null,
  361.         thumbs          : false,
  362.         credits         : null,
  363.         time            : <?php echo get_pix_option('pix_slideshow_speed'); ?>,    //lunghezza della transizione
  364.         fadeperiod      : <?php echo get_pix_option('pix_slideshow_fade'); ?>,    //lunghezza della transizione
  365.         crop            : <?php if(get_pix_option('pix_slideshow_adapt')!='' && get_pix_option('pix_slideshow_adapt')!='0') { echo get_pix_option('pix_slideshow_adapt'); } else { echo 'false'; } ?>
  366.     };
  367.    
  368.    
  369.     var opts = jQuery.extend({}, defaults, opts);
  370.    
  371.     if (jQuery.browser.msie) {
  372.         var h = jQuery(window).height();
  373.     } else {
  374.         var h = window.innerHeight;
  375.     }
  376.     var w = jQuery(window).width();    //larghezza della pagina
  377.    
  378.     var elem = this;    //elemento trigger
  379.    
  380. if(elem.length!=0){
  381.     jQuery('body').prepend(elem);
  382.    
  383.     var allSrc = new Array();    //creo l'array vuoto
  384.     var amountSlide = elem.find('a').length;    //il numero di immagine della slideshow
  385.    
  386.     elem.find('a').each(function() {    //lo riempio con gli 'a' contenuti nell'elemento selezionato
  387.         allSrc.push(jQuery(this));
  388.     });
  389.     var nav;
  390.     jQuery(opts.navElem).parents('#navgallery_wrap').hide();
  391.     jQuery(opts.controlsCont).hide();
  392.     jQuery(opts.credits).hide();
  393.  
  394.     jQuery.each(allSrc, function(index, value) {
  395.         if(opts.thumbs==true){
  396.             jQuery(opts.navElem).append('<'+opts.navCont+' id="espress'+opts.navCont+'_'+index+'" class="espress'+opts.navCont+'" style="overflow:hidden; position:relative"><img src="'+allSrc[index].attr('data-thumb')+'"></li>');
  397.         } else {
  398.             jQuery(opts.navElem).append('<'+opts.navCont+' id="espress'+opts.navCont+'_'+index+'" class="espress'+opts.navCont+'">'+(index+1)+'</li>');
  399.         }
  400.         jQuery('.espress'+opts.navCont).hover(function(){
  401.             jQuery(this).addClass('espresshover');
  402.         },function(){
  403.             jQuery(this).removeClass('espresshover');
  404.         });
  405.     });
  406.         jQuery('.espress'+opts.navCont).click(function(){
  407.             if(!jQuery(opts.navElem).hasClass('espressliding')){
  408.                 var idNum = parseFloat(jQuery(this).attr('id').replace('espress'+opts.navCont+'_',''));
  409.                 var vis = parseFloat(jQuery('.espr_block:visible').attr('id').replace('espr_block_',''));    //la variabile è il numero del div partendo da 0
  410.                 if(idNum!=vis){
  411.                     clearInterval(set);
  412.                     nextSlide(idNum+1);
  413.                 }
  414.             }
  415.         });
  416.  
  417.         jQuery(opts.prev).click(function(){
  418.             if(!jQuery(opts.navElem).hasClass('espressliding')){
  419.                 var idNum = parseFloat(jQuery('.espresscurrent').attr('id').replace('espress'+opts.navCont+'_',''));
  420.                 var lastNum = parseFloat(jQuery('.espress'+opts.navCont+':last').attr('id').replace('espress'+opts.navCont+'_',''));
  421.                 if(idNum!=0){
  422.                     clearInterval(set);
  423.                     nextSlide(idNum);
  424.                 } else {
  425.                     clearInterval(set);
  426.                     nextSlide(lastNum+1);
  427.                }
  428.             }
  429.         });
  430.  
  431.         jQuery(opts.next).click(function(){
  432.             if(!jQuery(opts.navElem).hasClass('espressliding')){
  433.                 var idNum = parseFloat(jQuery('.espresscurrent').attr('id').replace('espress'+opts.navCont+'_',''));
  434.                 var lastNum = parseFloat(jQuery('.espress'+opts.navCont+':last').attr('id').replace('espress'+opts.navCont+'_',''));
  435.                 if(idNum==lastNum){
  436.                     clearInterval(set);
  437.                     nextSlide(1);
  438.                 } else {
  439.                     clearInterval(set);
  440.                     nextSlide(idNum+2);
  441.                }
  442.             }
  443.         });
  444.  
  445.         jQuery(opts.play).hide();
  446.         jQuery(opts.play).click(function(){
  447.             if(!jQuery(opts.navElem).hasClass('espressliding')){
  448.                 nextSlide();
  449.                 jQuery(this).fadeOut(100,function(){
  450.                     jQuery(opts.pause).fadeIn(200);
  451.                 });
  452.             }
  453.         });
  454.  
  455.         jQuery(opts.pause).click(function(){
  456.             if(!jQuery(opts.navElem).hasClass('espressliding')){
  457.                 clearInterval(set);
  458.                 jQuery(this).fadeOut(100,function(){
  459.                     jQuery(opts.play).fadeIn(200);
  460.                 });
  461.             }
  462.         });
  463.        
  464.         jQuery(document).bind('cbox_open', function(){
  465.             if(jQuery('.pix_slide a').length!=1){
  466.                 clearInterval(set);
  467.             }
  468.         });
  469.  
  470.         jQuery(document).bind('cbox_closed', function(){
  471.             if(jQuery('.pix_slide a').length!=1){
  472.                 nextSlide();
  473.             }
  474.         });
  475.  
  476.     setTimeout(function() { nextSlide(); }, 600);    //faccio partire l'effetto
  477.     jQuery(window).one('load',function(){
  478.         //jQuery(opts.navElem).parent().fadeIn('slow');
  479.         jQuery(opts.controlsCont).fadeIn('slow');
  480.         jQuery(opts.credits).fadeIn('slow');
  481.         //jQuery('#scrollCommands').animate({'opacity':1},600);
  482.     });
  483.     if(amountSlide>1){
  484.         var set = setInterval(function() { nextSlide(); }, opts.time);    //faccio partire l'effetto
  485.     }
  486.    
  487. }
  488.  
  489.  
  490.  
  491.  
  492.     var lTh = amountSlide*(50+10+2); //larghezza immagine, margine e bordo
  493.     jQuery(opts.navElem).width(lTh);
  494.    
  495.  
  496. /*************************** FUNZIONE la larghezza del CONTENITORE THUMB ***************************/
  497.  
  498.     function resizeThumbCont(){    //funzione per il resize del contenitore thumb
  499.         if(opts.navElem!=null){
  500.             if(amountSlide > 1) {
  501.                 jQuery('#navgallery_wrap, #scroll_wrapper').width(w-40); // 20+20 margine laterale
  502.             }
  503.         }
  504.     }
  505.    
  506.     resizeThumbCont();
  507.    
  508.     jQuery(window).bind('load resize',function(){
  509.         resizeThumbCont();
  510.     });
  511.  
  512.  
  513.  
  514. /*************************** FUNZIONE nextSlide() ***************************/
  515.  
  516.     function nextSlide(nav){    //funzione per il fading delle immagini
  517.         if(jQuery('.espr_block:visible').length!=0){    //se ho creato almeno un div con un'immagine
  518.             var vis = parseFloat(jQuery('.espr_block:visible').attr('id').replace('espr_block_',''));    //la variabile è il numero del div partendo da 0
  519.         } else {
  520.             var vis = 'undefined';
  521.         }
  522.         if(nav>0){    //se siamo all'ultimo div o se ancora non ho creato nessun div
  523.             var i = nav-1;
  524.         } else if (vis == amountSlide-1 || vis=='undefined') {
  525.             var i = 0;
  526.         } else {    //altrimenti l'indice è l'id corrent più uno, quindi il div successivo
  527.             var i = vis+1;
  528.         }
  529.         if(jQuery('#espr_block_'+i).length==0){    //se ancora non esiste il div con quell'id
  530.             var newImg = new Image();
  531.             var img_src = allSrc[i].attr('href');
  532.             newImg.src = img_src;
  533.             jQuery(newImg).attr('data-content',allSrc[i].attr('data-content'));
  534.  
  535.             elem.append('<div class="espr_block" id="espr_block_'+i+'"></div>');    //creo il div
  536.             jQuery('#espr_block_'+i).append(jQuery(newImg));    //e gli appendo l'immagine
  537.         }
  538.         jQuery('#espr_block_'+i).css({    //imposto i css per i contenitori di immagini
  539.             'display':'none',
  540.             'height':h,
  541.             'left':0,
  542.             'overflow':'hidden',
  543.             'position':'absolute',
  544.             'top':0,
  545.             'width':w<?php if(!detectMobile()){ ?>+20<?php } ?>,
  546.             'z-index':'-1'
  547.         });
  548.         var img2 = jQuery('#espr_block_'+i).find('img');    //cerco l'immagine all'interno del div corrente
  549.         jQuery(opts.navElem).addClass('espressliding');
  550.        
  551.         if(img2.parents('.espr_block').hasClass('espr_loaded')){    //se l'immagine è già stata caricata
  552.             jQuery('#espr_block_'+(vis)).css({'z-index':'-2'});    //il div visibile viene portato a z-index 1, quindi sotto
  553.             jQuery('#espr_block_'+i).fadeIn(opts.fadeperiod,function(){    //imposto il timeout che mi fa apparire il div successivo
  554.                 if(jQuery('.espr_block').length!=0){    //se esiste almeno un div, quindi la slide non parte ora per la prima volta
  555.                     jQuery('#espr_block_'+(vis)).css({'display':'none'});    //nascondo il div corrente
  556.                 }
  557.                 clearInterval(set);
  558.                 jQuery(opts.navElem).removeClass('espressliding');
  559.                 set = setInterval(function() { nextSlide(); }, opts.time);    //faccio ripartire l'effetto
  560.             });    //chiudo il timeout
  561.  
  562.         } else {
  563.        
  564.             img2.one('load',function(){    //la prima volta che carica l'immagine all'interno del div
  565.                 jQuery('#espr_block_'+i).css({    //imposto i css per i contenitori di immagini solo per IE perché altrimenti non becca la grandezza delle immagini
  566.                     'display':'block',
  567.                     'visibility':'hidden'
  568.                 });
  569.                 var hI = img2.height()-20;
  570.                 var wI = img2.width()-20;
  571.             if(opts.crop==true){
  572.                 if(hI>wI){
  573.                     var r = h / hI;
  574.                     var d = (Math.abs(w - (wI*r)))*0.5;
  575.                     img2.css({
  576.                         'height' : h,
  577.                         'margin-left' : d+'px',
  578.                         'margin-top' : '0',
  579.                         'position' : 'absolute',
  580.                         'width' : wI*r
  581.                     });
  582.                 } else {
  583.                     if((wI/hI)<(w/h)) {
  584.                         var r = w / wI;
  585.                         var d = (Math.abs(h - (hI*r)))*0.5;
  586.                         img2.css({
  587.                             'height' : hI*r,
  588.                             'margin-left' : '0',
  589.                             'margin-top' : '-'+d+'px',
  590.                             'position' : 'absolute',
  591.                             'width' : w
  592.                         });
  593.                     }
  594.                     else {
  595.                         var r = h / hI;
  596.                         var d = (Math.abs(w - (wI*r)))*0.5;
  597.                         img2.css({
  598.                             'height' : h,
  599.                             'margin-left' : '-'+d+'px',
  600.                             'margin-top' : '0',
  601.                             'position' : 'absolute',
  602.                             'width' : wI*r
  603.                         });
  604.                     }
  605.                 }
  606.             } else {
  607.                 if((wI/hI)<(w/h)) {
  608.                     var r = w / wI;
  609.                     var d = (Math.abs(h - (hI*r)))*0.5;
  610.                     img2.css({
  611.                         'height' : hI*r,
  612.                         'margin-left' : '0',
  613.                         'margin-top' : '-'+d+'px',
  614.                         'position' : 'absolute',
  615.                         'width' : w
  616.                     });
  617.                 }
  618.                 else {
  619.                     var r = h / hI;
  620.                     var d = (Math.abs(w - (wI*r)))*0.5;
  621.                     img2.css({
  622.                         'height' : h,
  623.                         'margin-left' : '-'+d+'px',
  624.                         'margin-top' : '0',
  625.                         'position' : 'absolute',
  626.                         'width' : wI*r
  627.                     });
  628.                 }
  629.             }
  630.                 jQuery('#espr_block_'+i).css({    //imposto i css per i contenitori di immagini solo per IE perché altrimenti non becca la grandezza delle immagini
  631.                     'display':'none',
  632.                     'visibility':'visible'
  633.                 });
  634.                 jQuery('#espr_block_'+(vis)).css({'z-index':'-2'});    //il div visibile viene portato a z-index 1, quindi sotto
  635.                 jQuery('#espr_block_'+i).fadeIn(opts.fadeperiod,function(){    //imposto il timeout che mi fa apparire il div successivo
  636.                     if(jQuery('.espr_block').length!=0){    //se esiste almeno un div, quindi la slide non parte ora per la prima volta
  637.                         jQuery('#espr_block_'+(vis)).css({'display':'none'});    //nascondo il div corrente
  638.                     }
  639.                     if(amountSlide>1){
  640.                         clearInterval(set);
  641.                         jQuery(opts.navElem).removeClass('espressliding');
  642.                         set = setInterval(function() { nextSlide(); }, opts.time);    //faccio ripartire l'effetto
  643.                     }
  644.                 }).addClass('espr_loaded');    //chiudo il timeout
  645.             });
  646.         }
  647.             var the_content = jQuery('img, #espr_block_'+i).attr('data-content');
  648.             jQuery(opts.credits).html(img2.attr('data-content'));
  649.             jQuery('.espress'+opts.navCont).removeClass('espresscurrent');
  650.             jQuery('#espress'+opts.navCont+'_'+i).addClass('espresscurrent');
  651.            
  652.            
  653.    
  654.             //scrollThumb();
  655.             resizeThumbCont();
  656.            
  657.             jQuery(opts.play).fadeOut(100,function(){
  658.                 jQuery(opts.pause).fadeIn(200);
  659.             });
  660.  
  661.     }
  662.  
  663.  
  664.  
  665.  
  666. /*************************** FUNZIONE per il RESIZE ***************************/
  667.  
  668.     jQuery(window).bind('load resize',function(){
  669.         if (jQuery.browser.msie) {
  670.             h = jQuery(window).height();
  671.         } else {
  672.             h = window.innerHeight;
  673.         }
  674.         w = jQuery(window).width()<?php if(!detectMobile()){ ?>+20<?php } ?>;    //larghezza della pagina
  675.         jQuery('.espr_block, .pix_overlay_pattern').css({    //imposto i css per i contenitori di immagini
  676.             'height':h,
  677.             'width':w
  678.         });
  679.         jQuery('.espr_block').find('img').each(function(){
  680.             var img2 = jQuery(this);
  681.             var hI = img2.height();
  682.             var wI = img2.width();
  683.             if(opts.crop==true){
  684.                 if(hI>wI){
  685.                     var r = h / hI;
  686.                     var d = (Math.abs(w - (wI*r)))*0.5;
  687.                     img2.css({
  688.                         'height' : h,
  689.                         'margin-left' : d+'px',
  690.                         'margin-top' : '0',
  691.                         'position' : 'absolute',
  692.                         'width' : wI*r
  693.                     });
  694.                 } else {
  695.                     if((wI/hI)<(w/h)) {
  696.                         var r = w / wI;
  697.                         var d = (Math.abs(h - (hI*r)))*0.5;
  698.                         img2.css({
  699.                             'height' : hI*r,
  700.                             'margin-left' : '0',
  701.                             'margin-top' : '-'+d+'px',
  702.                             'position' : 'absolute',
  703.                             'width' : w
  704.                         });
  705.                     }
  706.                     else {
  707.                         var r = h / hI;
  708.                         var d = (Math.abs(w - (wI*r)))*0.5;
  709.                         img2.css({
  710.                             'height' : h,
  711.                             'margin-left' : '-'+d+'px',
  712.                             'margin-top' : '0',
  713.                             'position' : 'absolute',
  714.                             'width' : wI*r
  715.                         });
  716.                     }
  717.                 }
  718.             } else {
  719.                 if((wI/hI)<(w/h)) {
  720.                     var r = w / wI;
  721.                     var d = (Math.abs(h - (hI*r)))*0.5;
  722.                     img2.css({
  723.                         'height' : hI*r,
  724.                         'margin-left' : '0',
  725.                         'margin-top' : '-'+d+'px',
  726.                         'position' : 'absolute',
  727.                         'width' : w
  728.                     });
  729.                 }
  730.                 else {
  731.                     var r = h / hI;
  732.                     var d = (Math.abs(w - (wI*r)))*0.5;
  733.                     img2.css({
  734.                         'height' : h,
  735.                         'margin-left' : '-'+d+'px',
  736.                         'margin-top' : '0',
  737.                         'position' : 'absolute',
  738.                         'width' : wI*r
  739.                     });
  740.                 }
  741.             }
  742.         });
  743.        
  744.        
  745.     });
  746.  
  747.  
  748.  
  749. }
  750.  
  751.  
  752. jQuery(function(){
  753.     if(jQuery('.pix_slide').length!=0){
  754.         jQuery('.pix_slide').espresslide({
  755.             navElem : '.navgallery',
  756.             prev : '#pix_prev_slide',
  757.             next : '#pix_next_slide',
  758.             play : '#pix_play_slide',
  759.             pause : '#pix_pause_slide',
  760.             controlsCont: '#pix_controls',
  761.             credits: '#pix_credits_pictures',
  762.             thumbs : true
  763.         });
  764.     }
  765. });
  766.  
  767. /******************************************************
  768. *
  769. *   Social_bar position and toggle
  770. *
  771. ******************************************************/
  772. jQuery(window).one('load',function() {
  773.     var wF = jQuery("#social_bar form").width();
  774.     var wI = jQuery("#social_bar div.icon").width();
  775.     //jQuery("#social_bar .wrapIn").css({'width':wF+wI+5});
  776.     var wS = jQuery("#social_bar").width();
  777.     jQuery("#social_bar").css({'left':1050-(wS+35),'visibility':'visible'});
  778. });
  779. jQuery(function() {
  780.     jQuery("#social_bar").each(function(){
  781.         var t = jQuery(this);
  782.         var c = jQuery('.click.icons');
  783.         c.click(function(){
  784.             if(t.hasClass('open')){
  785.                 c.html('_');
  786.                 Cufon.refresh();
  787.                 t.animate({'margin-top':'0'},300,function(){
  788.                     t.removeClass('open');
  789.                 });
  790.             } else {
  791.                 c.html('^');
  792.                 Cufon.refresh();
  793.                 t.animate({'margin-top':'50px'},300,function(){
  794.                     t.addClass('open');
  795.                 });
  796.             }
  797.         });
  798.     });
  799. });
  800.  
  801. /******************************************************
  802. *
  803. *   Colorbox
  804. *
  805. ******************************************************/
  806. jQuery(window).one("load", function(){
  807.     jQuery("a[data-rel='iframe']").colorbox({iframe:true, innerWidth:650, innerHeight:488, rel:'nofollow' });
  808. <?php if (get_pix_option('pix_checkcolorbox')=='show') { ?>
  809.     jQuery("a[href$='.jpg']").not('.noColorBox').each(function(){
  810.         var dataRel = jQuery(this).attr('data-rel');
  811.         var dataTitle = jQuery(this).attr('data-title');
  812.         jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } });
  813.     });
  814.     jQuery("a[href$='.png']").not('.noColorBox').each(function(){
  815.         var dataRel = jQuery(this).attr('data-rel');
  816.         var dataTitle = jQuery(this).attr('data-title');
  817.         jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } });
  818.     });
  819.     jQuery("a[href$='.gif']").not('.noColorBox').each(function(){
  820.         var dataRel = jQuery(this).attr('data-rel');
  821.         var dataTitle = jQuery(this).attr('data-title');
  822.         jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } });
  823.     });
  824.     jQuery("a.play-icon").not('.noColorBox').each(function(){
  825.         var dataRel = jQuery(this).attr('data-rel');
  826.         var dataTitle = jQuery(this).attr('data-title');
  827.         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(''); } });
  828.     });
  829.     jQuery("a.play-icon[href*='selfid']").not('.noColorBox').each(function(){
  830.         var dataRel = jQuery(this).attr('data-rel');
  831.         var dataTitle = jQuery(this).attr('data-title');
  832.         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(''); } });
  833.     });
  834. <?php } ?>
  835.     jQuery("a.colorbox").each(function(){
  836.         var dataRel = jQuery(this).attr('data-rel');
  837.         var dataTitle = jQuery(this).attr('data-title');
  838.         jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } });
  839.     });
  840.     jQuery(".gallery-icon a[href$='.jpg'], .gallery-icon a[href$='.png'], .gallery-icon a[href$='.gif']").not('.noColorBox').each(function(){
  841.         var dataRel = 'slideshow';
  842.         var dataTitle = jQuery(this).attr('data-title');
  843.        jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } });
  844.     });
  845. });
  846.  
  847. /******************************************************
  848. *
  849. *   Slideshow shortcodes
  850. *
  851. ******************************************************/
  852. jQuery(function(){
  853.     jQuery('.pix_cycle').each(function(){
  854.         var t = jQuery(this);
  855.         var h = jQuery('.pix_slide_caption', t).height()+40;
  856.         var time = t.attr('data-time');
  857.         var p = t.next('.pix_slider_nav');
  858.         jQuery('.pix_slide_caption',t).css({'bottom':'-'+h+'px'});
  859.         jQuery(this).cycle({
  860.             after: onAfter,
  861.             before: onBefore,
  862.             cleartype: true,
  863.             cleartypeNoBg: false,
  864.             pager: p,
  865.             pause: true,
  866.             timeout: time
  867.         });
  868.         jQuery('.pix_slide_caption:first', t).animate({'bottom':'0'},250);
  869.  
  870.     function onBefore(currSlideElement, nextSlideElement, options, forwardFlag) {
  871.         var h = jQuery('.pix_slide_caption', currSlideElement).height()+80;
  872.         jQuery('.pix_slide_caption', currSlideElement).animate({'bottom':'-'+h+'px'},250);
  873.     }
  874.     function onAfter(currSlideElement, nextSlideElement, options, forwardFlag) {
  875.         jQuery('.pix_slide_caption', nextSlideElement).animate({'bottom':'0'},250);
  876.     }
  877.         var wT = t.width();
  878.         var hT = t.height();
  879.         jQuery('.pix_slider',t).width(wT).height(hT);
  880.     });
  881.    
  882. });
  883.  
  884. /******************************************************
  885. *
  886. *   Image overlay
  887. *
  888. ******************************************************/
  889. jQuery(function(){
  890.     jQuery(".hentry a[href$='.jpg'], .hentry a[href$='.png'], .hentry a[href$='.gif']").each(function(){
  891.         var w = jQuery('img',this).width(),
  892.             h = jQuery('img',this).height();
  893.            
  894.         if(!jQuery('body').hasClass('tax-gallery') && !jQuery(this).parent().hasClass('linkIcon') && jQuery('img',this).length){
  895.             jQuery(this).append('<div class="linkIcon enlarge-icon" style="width:'+w+'px; height:'+h+'px">').wrapInner('<div class="imgHentry" />');
  896.         }
  897.         var theClass = jQuery('img',this).attr('class');
  898.         jQuery('img',this).removeClass(theClass);
  899.         jQuery('.imgHentry',this).addClass(theClass);
  900.        
  901.         var a = jQuery('.linkIcon',this);
  902.         var i = jQuery('img',this).css('display','block');
  903.  
  904.         a.show().animate({'opacity':0},0);
  905.        
  906.         jQuery(this).hover(function(){
  907.             i.stop(true,false).animate({'opacity':0.2},300);
  908.             a.stop(true,false).animate({'opacity':1},300);
  909.         },function(){
  910.             i.stop(true,false).animate({'opacity':1},300);
  911.             a.stop(true,false).animate({'opacity':0},300);
  912.         });
  913.  
  914.     });
  915. });
  916.  
  917. /******************************************************
  918. *
  919. *   Ajax form
  920. *
  921. ******************************************************/
  922. jQuery(document).ready(function() {
  923.  
  924.  
  925.     jQuery('.contactForm').each(function () {        
  926.         var t = jQuery(this);
  927.         var hT = t.height();
  928.         var wT = t.width();
  929.         jQuery('.success, .unsuccess', t).height(hT).width(wT);
  930.        
  931.        
  932.         jQuery('input[type=checkbox]',t).after('<div class="off-on"><div class="switcher"></div></div>').hide();
  933.         jQuery('.off-on').each(function(){
  934.             if(!jQuery(this).prev('input[type=checkbox]').is(':checked')){
  935.                 jQuery('.switcher',this).addClass('off');
  936.             }
  937.             jQuery('.off-on').live('click',function(){
  938.                 if(jQuery('.switcher',this).hasClass('off')){
  939.                     jQuery(this).prev('input[type=checkbox]').attr('checked', true);
  940.                     jQuery('.switcher',this).fadeIn(200,function(){
  941.                         jQuery(this).removeClass('off');
  942.                     });
  943.                 } else {
  944.                     jQuery(this).prev('input[type=checkbox]').attr('checked', false);
  945.                     jQuery('.switcher',this).fadeOut(200,function(){
  946.                         jQuery(this).addClass('off');
  947.                     });
  948.                 }
  949.             });
  950.         });
  951.  
  952.         jQuery('input[type=radio]',t).after('<div class="radio-fake"><div class="radio-on"></div></div>').hide().click(function(){
  953.             jQuery('input[type=radio]',t).each(function(){
  954.                 if(jQuery(this).is(':checked')){
  955.                     jQuery(this).next('.radio-fake').find('.radio-on').fadeIn(200,function(){
  956.                         jQuery(this).removeClass('off');
  957.                     });
  958.                 } else {
  959.                     jQuery(this).next('.radio-fake').find('.radio-on').fadeOut(200,function(){
  960.                         jQuery(this).addClass('off');
  961.                     });
  962.                 }
  963.             });
  964.         });
  965.         jQuery('.radio-fake').each(function(){
  966.             if(!jQuery(this).prev('input[type=radio]').is(':checked')){
  967.                 jQuery('.radio-on',this).addClass('off');
  968.             }
  969.             jQuery('.radio-fake').live('click',function(){
  970.                 jQuery(this).prev('input[type=radio]').click();
  971.             });
  972.         });
  973.  
  974.        
  975.         jQuery('input[type=submit]',t).click(function () {
  976.            
  977.             var data = 'captcha='+jQuery('input[name="captcha"]',t).val()+'&form='+t.attr('id');
  978.             var allRequired = [];
  979.             var allFields = [];
  980.             var allValues = [];
  981.             jQuery('input[type="checkbox"]').each(function(){
  982.                 if(!jQuery(this).is(':checked')){
  983.                     jQuery(this).val('');
  984.                 } else {
  985.                     jQuery(this).val('on');
  986.                 }
  987.             })
  988.             jQuery('input[type="radio"]').each(function(){
  989.                 var pV = jQuery(this).attr('data-value');
  990.                 if(!jQuery(this).is(':checked')){
  991.                     jQuery(this).val('');
  992.                 } else {
  993.                     jQuery(this).val(pV);
  994.                 }
  995.             })
  996.             jQuery('.required', t).each(function() {
  997.                 allRequired.push(jQuery(this).val());
  998.             });
  999.             var req = 0;
  1000.             var tag;
  1001.             var name;
  1002.             jQuery.each(allRequired, function(key, value) {
  1003.                 tag = jQuery('.required:eq('+key+')', t).attr('type');
  1004.                 if(tag!='radio'){
  1005.                     if(allRequired[key]==''){
  1006.                         jQuery('.required:eq('+key+')', t).css({'border-color':'#f00'});
  1007.                         req = 1;
  1008.                     } else {
  1009.                         jQuery('.required:eq('+key+')', t).css({'border-color':'#eee'});
  1010.                     }
  1011.                 } else {
  1012.                     name = jQuery('.required:eq('+key+')', t).attr('name');
  1013.                     var radioVal;
  1014.                     jQuery('input[type=radio][name='+name+']', t).each(function(){
  1015.                         radioVal = jQuery('input[type=radio][name='+name+']:checked', t).val();
  1016.                         jQuery(this).val(radioVal);
  1017.                     });                    
  1018.                 }
  1019.             });
  1020.             jQuery('.off-on').each(function(){
  1021.                 if(jQuery(this).prev('input[type="checkbox"]').hasClass('required')){
  1022.                     if(!jQuery(this).prev('input[type="checkbox"]').is(':checked')){
  1023.                         jQuery(this).css({'border-color':'#f00'});
  1024.                     } else {
  1025.                         jQuery(this).css({'border-color':'#ccc'});
  1026.                     }
  1027.                  }  
  1028.             });
  1029.             jQuery('.radio-fake').each(function(){
  1030.                 name = jQuery('input[type=radio].required', t).attr('name');
  1031.                 if(jQuery('input[type=radio].required', t).val()==''){
  1032.                     jQuery('input[type=radio][name='+name+']',t).next('.radio-fake').css({'border-color':'#f00'});
  1033.                 } else {
  1034.                     jQuery('input[type=radio][name='+name+']',t).next('.radio-fake').css({'border-color':'#ccc'});
  1035.                 }
  1036.             });
  1037.             var emailReq = jQuery('.required.email',t).val();
  1038.             var emailCheck = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
  1039.             if(!emailCheck.test(emailReq)) {
  1040.                 jQuery('.required.email',t).css({'border-color':'#f00'});
  1041.                 req = 1;
  1042.             }
  1043.             jQuery('input').not('.email').bind('change keyup blur',function(){
  1044.                 if(jQuery(this).val()!=''){
  1045.                     jQuery(this).css({'border-color':'#eee'});
  1046.                 }
  1047.             })
  1048.             jQuery('select').bind('change',function(){
  1049.                 if(jQuery(this).val()!=''){
  1050.                     jQuery(this).css({'border-color':'#eee'});
  1051.                 }
  1052.             })
  1053.             jQuery('input.email').bind('keyup blur',function(){
  1054.                 if(!emailCheck.test(jQuery(this).val())) {
  1055.                     jQuery(this).css({'border-color':'#eee'});
  1056.                 }
  1057.             })
  1058.             jQuery('textarea').bind('keyup blur',function(){
  1059.                 if(jQuery(this).val()!=''){
  1060.                     jQuery(this).css({'border-color':'#eee'});
  1061.                 }
  1062.             })
  1063.             if(req == 1){
  1064.                 return false;
  1065.             }
  1066.  
  1067.             jQuery('input, textarea, select', t).each(function() {
  1068.                 allFields.push(jQuery(this).attr('data-name'));
  1069.             });
  1070.             jQuery('input, textarea, select', t).each(function() {
  1071.                 allValues.push(jQuery(this).val());
  1072.             });
  1073.             jQuery.each(allFields, function(key, value) {
  1074.                 if(allFields[key]){
  1075.                         data = data+'&'+allFields[key] + '=value_'+key;
  1076.                 }
  1077.             });
  1078.             jQuery.each(allValues, function(key, value) {
  1079.                 data = data.replace('value_'+key, allValues[key]);
  1080.             });
  1081.             jQuery('.loading').show();
  1082.              
  1083.             jQuery.ajax({
  1084.                 url: "<?php echo get_bloginfo('stylesheet_directory'); ?>/scripts/mailer/mailer.php",
  1085.                 type: "GET",
  1086.                 data: data,    
  1087.                 cache: false,
  1088.                 success: function (html) {
  1089.                     if (html==1) {                  
  1090.                         jQuery('form',t).animate({'opacity':'0'},500);                
  1091.                         jQuery('.success',t).fadeIn('500');
  1092.                         _gaq.push(['_trackPageview', '/sent-email-from-'+ t.attr('id')]);
  1093.                         pageTracker = _gat._getTracker('/sent-email-from-'+ t.attr('id'));
  1094.                         pageTracker._trackPageview();
  1095.                     } else if (html=='noCaptcha') {
  1096.                         jQuery('input[name="captcha"]',t).css({'border-color':'#f00'});
  1097.                         jQuery('.recaptcha',t).click();
  1098.                     } else {
  1099.                         jQuery('form',t).animate({'opacity':'0'},500);                
  1100.                         jQuery('.unsuccess',t).fadeIn('500');
  1101.                     }
  1102.                 }      
  1103.             });
  1104.            
  1105.             return false;
  1106.         });
  1107.        
  1108.         if(jQuery('#to',t).length!=0 && jQuery('#from',t).length!=0) {
  1109.             jQuery('#from',t).css({'width':'75%'}).after('<div class="wrapPeriod" style="float:left; width:49%; clear: left" />');
  1110.             jQuery('#to',t).css({'width':'75%'}).after('<div class="wrapPeriod" style="float:right; width:49%;" />');
  1111.             jQuery('#to',t).prev('label').prependTo(jQuery('#to',t).next(".wrapPeriod"));
  1112.             jQuery('#to',t).appendTo(jQuery('#to',t).next(".wrapPeriod"));
  1113.             jQuery('#from',t).prev('label').prependTo(jQuery('#from',t).next(".wrapPeriod"));
  1114.             jQuery('#from',t).appendTo(jQuery('#from',t).next(".wrapPeriod"));
  1115.         }
  1116.     });
  1117. });
  1118.  
  1119. jQuery(window).one('load',function(){
  1120.     jQuery('aside .contactForm').each(function () {        
  1121.         if(jQuery('.captchaCont', this).length!=0){
  1122.             var cS = jQuery('.captchaCont img#cryptogram', this).width();
  1123.             var rCs = jQuery('.recaptcha', this).width();
  1124.             var dS = jQuery('.captchaCont', this).width();
  1125.             jQuery('input[name="captcha"]', this).css('width',dS-(cS+rCs+12));
  1126.         }
  1127.     });
  1128.     jQuery('article .contactForm').each(function () {        
  1129.         if(jQuery('.captchaCont', this).length!=0){
  1130.             var cS = jQuery('.captchaCont img#cryptogram', this).width();
  1131.             jQuery('input[name="captcha"]', this).css({'width':cS,'float':'left','margin':'3px 0 0 10px'});
  1132.         }
  1133.     });
  1134. });
  1135.        
  1136.  
  1137.  
  1138. /******************************************************
  1139. *
  1140. *   Date picker
  1141. *
  1142. ******************************************************/
  1143. jQuery(function() {
  1144.     jQuery('.contactForm').each(function () {
  1145.         var t = jQuery(this);      
  1146.         var dates = jQuery( "#from, #to", t ).datepicker({
  1147.             defaultDate: "+1w",
  1148.             changeMonth: false,
  1149.             numberOfMonths: 1,
  1150.             showOn: "both",
  1151.             buttonImage: "<?php echo get_bloginfo('stylesheet_directory'); ?>/images/calendar.png",
  1152.             buttonImageOnly: true,
  1153.             onSelect: function( selectedDate ) {
  1154.                 var option = this.id == "from" ? "minDate" : "maxDate",
  1155.                     instance = jQuery( this ).data( "datepicker" ),
  1156.                     date = jQuery.datepicker.parseDate(
  1157.                         instance.settings.dateFormat ||
  1158.                         jQuery.datepicker._defaults.dateFormat,
  1159.                         selectedDate, instance.settings );
  1160.                 dates.not( this ).datepicker( "option", option, date );
  1161.             }
  1162.         });
  1163.     });
  1164. });
  1165.  
  1166.  
  1167. <?php
  1168.     $file = TEMPLATEPATH.'/language/datePicker/jquery.ui.datepicker-'.WPLANG.'.php';
  1169.     $file2 = get_stylesheet_directory_uri().'/language/datePicker/jquery.ui.datepicker-'.WPLANG.'.php';
  1170.     if (file_exists($file)) { ?>
  1171.     jQuery(function() {
  1172.         jQuery.getScript( ['<?php echo $file2; ?>'] );     
  1173.     });
  1174.     <?php }
  1175. ?>
  1176.        
  1177.  
  1178.  
  1179. /******************************************************
  1180. *
  1181. *   Tooltip
  1182. *
  1183. ******************************************************/
  1184. jQuery(document).ready(function() {
  1185.     jQuery('.pix_after_tips').each(function(){
  1186.         var t = jQuery(this);
  1187.         var i = jQuery('body .pix_after_tips').index(t);
  1188.         t.attr('id','pix_after_tips'+i);
  1189.         t.prevAll('a').attr('data-rel','#pix_after_tips'+i).attr('href','#pix_after_tips'+i);
  1190.     });
  1191.  
  1192.     jQuery('a.pix_tips, .pix_share a').each(function(){
  1193.         var t = jQuery(this);
  1194.         var w = t.attr('data-width');
  1195.         if(w==''){
  1196.             w = 280;
  1197.         }
  1198.         var h = t.attr('data-height');
  1199.         if(h==''){
  1200.             h = 'auto';
  1201.         }
  1202.         t.qtip({
  1203.             style: {
  1204.                 tip: {
  1205.                     corner: "bottomLeft"
  1206.                 },
  1207.                 classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>",
  1208.                 height: h
  1209.             },
  1210.             position: {
  1211.                 target: "mouse",
  1212.                 adjust: {
  1213.                     mouse: false,
  1214.                     x: 10,
  1215.                     y: -10
  1216.                 },
  1217.                 my: "bottom left",
  1218.                 at: "bottom left"
  1219.             },
  1220.             show: {
  1221.                 delay: 500,
  1222.                 solo: true
  1223.             },
  1224.             content: t.attr('title'),
  1225.             events: {
  1226.               show: function(event, api) {
  1227.                 jQuery('.ui-tooltip, .qtip').css({'width':w});
  1228.               }
  1229.            }
  1230.         });
  1231.     });
  1232.     jQuery('a.pix_tips_TR').each(function(){
  1233.         var t = jQuery(this);
  1234.         t.qtip({
  1235.             style: {
  1236.                 tip: {
  1237.                     corner: "topRight"
  1238.                 },
  1239.                 classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>"
  1240.             },
  1241.             position: {
  1242.                 target: "mouse",
  1243.                 adjust: {
  1244.                     mouse: false,
  1245.                     x: 10,
  1246.                     y: 10
  1247.                 },
  1248.                 my: "top right",
  1249.                 at: "top right"
  1250.             },
  1251.             show: {
  1252.                 delay: 500,
  1253.                 solo: true
  1254.             },
  1255.             content: t.attr('title')
  1256.         });
  1257.     });
  1258.     jQuery('a.pix_tips_ajax').each(function(){
  1259.         var t = jQuery(this);
  1260.         var w = t.attr('data-width');
  1261.         if(w==''){
  1262.             w = 280;
  1263.         }
  1264.         var h = t.attr('data-height');
  1265.         if(h==''){
  1266.             h = 'auto';
  1267.         }
  1268.         t.qtip({
  1269.             content: {
  1270.                 text: '<img class="throbber" src="<?php echo get_bloginfo('stylesheet_directory'); ?>/images/ajax-loader.gif" alt="<?php _e('Loading...','delight'); ?>">',
  1271.                 ajax: {
  1272.                    url: t.attr('data-rel')
  1273.                 }
  1274.             },
  1275.             style: {
  1276.                 tip: {
  1277.                     corner: "bottomLeft"
  1278.                 },
  1279.                 classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>",
  1280.                 height: h
  1281.             },
  1282.             position: {
  1283.                 target: "mouse",
  1284.                 adjust: {
  1285.                     mouse: false,
  1286.                     x: 10,
  1287.                     y: -10
  1288.                 },
  1289.                 my: "bottom left",
  1290.                 at: "bottom left"
  1291.             },
  1292.             show: {
  1293.                 delay: 500,
  1294.                 solo: true
  1295.             },
  1296.             hide: {
  1297.                 event: 'unfocus'
  1298.             },
  1299.             events: {
  1300.               show: function(event, api) {
  1301.                 jQuery('.ui-tooltip, .qtip').css({'width':w});
  1302.               }
  1303.            }
  1304.         });
  1305.     });
  1306.     jQuery('a.pix_clue_credits').each(function(){
  1307.         var t = jQuery(this);
  1308.         var api = jQuery(this).qtip('api');
  1309.         t.qtip({
  1310.             style: {
  1311.                 tip: {
  1312.                     corner: "bottomRight"
  1313.                 },
  1314.                 classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>",
  1315.                 height: 'auto'
  1316.             },
  1317.             position: {
  1318.                 target: "mouse",
  1319.                 adjust: {
  1320.                     mouse: false,
  1321.                     y: -10
  1322.                 },
  1323.                 my: "bottom right",
  1324.                 at: "bottom right"
  1325.             },
  1326.             show: {
  1327.                 delay: 500,
  1328.                 solo: true
  1329.             },
  1330.             content: jQuery('#pix_credits_pictures').html(),
  1331.             events: {
  1332.                 show: function(event, api) {
  1333.                     api.set('content.text', jQuery('#pix_credits_pictures').html());
  1334.                 }
  1335.             },
  1336.             hide: {
  1337.                 event: 'unfocus'
  1338.             },
  1339.             events: {
  1340.               show: function(event, api) {
  1341.                 jQuery('.ui-tooltip, .qtip').css({'width':150});
  1342.               }
  1343.             }
  1344.         });
  1345.     });
  1346. });
  1347.        
  1348.  
  1349.  
  1350. /******************************************************
  1351. *
  1352. *   Wide Google map
  1353. *
  1354. ******************************************************/
  1355. jQuery(window).one('load',function(){
  1356.         if(jQuery('#map_canvas').length !=0) {
  1357.             var map,
  1358.                 mapEl       = jQuery('#map_canvas'),
  1359.                 lat         = jQuery('#map_canvas').attr('data-coord1'),
  1360.                 lng         = jQuery('#map_canvas').attr('data-coord2'),
  1361.                 pix_zoom    = parseFloat(jQuery('#map_canvas').attr('data-zoom')),
  1362.                 pix_type    = jQuery('#map_canvas').attr('data-type'),
  1363.                 pix_indications = jQuery('#map_canvas').attr('data-indications'),
  1364.                 the_type;
  1365.                
  1366.                 if (pix_type=='HYBRID'){
  1367.                     the_type = google.maps.MapTypeId.HYBRID;
  1368.                 } else if (pix_type=='TERRAIN'){
  1369.                     the_type = google.maps.MapTypeId.TERRAIN;
  1370.                 } else if (pix_type=='SATELLITE'){
  1371.                     the_type = google.maps.MapTypeId.SATELLITE;
  1372.                 } else if (pix_type=='ROADMAP'){
  1373.                     the_type = google.maps.MapTypeId.ROADMAP;
  1374.                 }
  1375.                
  1376.                
  1377.                    
  1378.                    
  1379.                 var point       = new google.maps.LatLng(lat,lng),
  1380.                         mapOptions  = {
  1381.                             zoom                        : pix_zoom,
  1382.                             center                      : point,
  1383.                             mapTypeId                   : the_type,
  1384.                             mapTypeControl              : false,
  1385.                             panControl                  : true,
  1386.                             panControlOptions           : {
  1387.                                 position    : google.maps.ControlPosition.TOP_RIGHT
  1388.                             },
  1389.                             zoomControl                 : true,
  1390.                             zoomControlOptions          : {
  1391.                                 style       : google.maps.ZoomControlStyle.SMALL,
  1392.                                 position    : google.maps.ControlPosition.TOP_RIGHT
  1393.                             },
  1394.                             streetViewControl           : true,
  1395.                             streetViewControlOptions    : {
  1396.                                 position    : google.maps.ControlPosition.TOP_RIGHT
  1397.                             }
  1398.                         };
  1399.                    
  1400.                     map             = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
  1401.                     map.setTilt(45);
  1402.                    
  1403.                    
  1404.                     var coordInfoWindow = new google.maps.InfoWindow({maxWidth : 10}),  
  1405.                         latlngStr       = pix_indications;
  1406.                    
  1407.                     if(latlngStr!=''){
  1408.                         coordInfoWindow.setContent('<div class="iwstyle">'+latlngStr+'<div>');    
  1409.                         coordInfoWindow.setPosition(point);    
  1410.                         coordInfoWindow.open(map);
  1411.                     }
  1412.                 }
  1413.                    
  1414. });
  1415. jQuery(window).bind('resize load',function(){
  1416.     if (jQuery.browser.msie) {
  1417.         var h = jQuery(window).height();
  1418.     } else {
  1419.         var h = window.innerHeight;
  1420.     }
  1421.     var w = jQuery(window).width();
  1422.     jQuery('#outer_canvas').width(w+14).height(h);
  1423.     jQuery('#map_canvas').width(w+14).height(h);
  1424. });
  1425.  
  1426.  
  1427.        
  1428.  
  1429.  
  1430. /******************************************************
  1431. *
  1432. *   Refresh Cufon
  1433. *
  1434. ******************************************************/
  1435. jQuery(window).one('load',function() {
  1436.     Cufon.refresh();
  1437. });
  1438.  
  1439.        
  1440.  
  1441.  
  1442. /******************************************************
  1443. *
  1444. *   Wide flash
  1445. *
  1446. ******************************************************/
  1447. function thisMovie(movieName) {
  1448.     if (navigator.appName.indexOf("Microsoft") != -1) {
  1449.         return window[movieName]
  1450.     }
  1451.     else {
  1452.         return document[movieName]
  1453.     }
  1454. }
  1455.  
  1456. function playVideo() {
  1457.     thisMovie("wide_flash").playVideo();
  1458. }
  1459. function pauseVideo() {
  1460.     thisMovie("wide_flash").pauseVideo();
  1461. }
  1462. function resumeVideo() {
  1463.     thisMovie("wide_flash").resumeVideo();
  1464. }
  1465. function muteVideo() {
  1466.     thisMovie("wide_flash").muteVideo();
  1467. }
  1468. function unMuteVideo() {
  1469.     thisMovie("wide_flash").unMuteVideo();
  1470. }
  1471. function rePlayVideo() {
  1472.     if(jQuery('#pix_pause_slide').is(':visible')){
  1473.         jQuery('#pix_pause_slide').hide();
  1474.     }
  1475.     if(jQuery('#pix_resume_slide').is(':visible')){
  1476.         jQuery('#pix_resume_slide').hide();
  1477.     }
  1478.     if(!jQuery('#pix_play_slide').is(':visible')){
  1479.         jQuery('#pix_play_slide').fadeIn(200);
  1480.     }
  1481. }
  1482. function showPause() {
  1483.     jQuery('#pix_pause_slide').show();
  1484.     jQuery('#pix_resume_slide').hide();
  1485.     jQuery('#pix_play_slide').hide();
  1486. }
  1487. function showPlay() {
  1488.     jQuery('#pix_play_slide').show();
  1489.     jQuery('#pix_pause_slide').hide();
  1490.     jQuery('#pix_resume_slide').hide();
  1491. }
  1492.  
  1493. jQuery(window).one('load',function(){
  1494.     jQuery('#pix_play_slide').live('click',function(){
  1495.         playVideo();
  1496.         jQuery(this).fadeOut(100,function(){
  1497.             jQuery('#pix_pause_slide').fadeIn(200);
  1498.         });
  1499.     });
  1500.  
  1501.     jQuery('#pix_pause_slide').live('click',function(){
  1502.         pauseVideo();
  1503.         jQuery(this).fadeOut(100,function(){
  1504.             jQuery('#pix_resume_slide').fadeIn(200);
  1505.         });
  1506.     });
  1507.  
  1508.     jQuery('#pix_resume_slide').live('click',function(){
  1509.         resumeVideo();
  1510.         jQuery(this).fadeOut(100,function(){
  1511.             jQuery('#pix_pause_slide').fadeIn(200);
  1512.         });
  1513.     });
  1514.  
  1515.     jQuery('#pix_mute_slide').live('click',function(){
  1516.         muteVideo();
  1517.         jQuery(this).fadeOut(100,function(){
  1518.             jQuery('#pix_unmute_slide').fadeIn(200);
  1519.         });
  1520.     });
  1521.  
  1522.     jQuery('#pix_unmute_slide').live('click',function(){
  1523.         unMuteVideo();
  1524.         jQuery(this).fadeOut(100,function(){
  1525.             jQuery('#pix_mute_slide').fadeIn(200);
  1526.         });
  1527.     });
  1528. });
  1529.        
  1530.  
  1531.  
  1532. /******************************************************
  1533. *
  1534. *   Portfolio images
  1535. *
  1536. ******************************************************/
  1537. function portfolioImages(){
  1538.     jQuery('.imgHentry').each(function(){
  1539.         var t = jQuery(this);
  1540.         var i = jQuery('img',t);
  1541.         var a = jQuery('.linkIcon',t);
  1542.         a.show().animate({'opacity':0},0);
  1543.        
  1544.         jQuery('a',t).each(function(){
  1545.             var ti;
  1546.             var ex;
  1547.             var ac;
  1548.             if(jQuery(this).attr('data-title')){
  1549.                 ti = '<strong style="font-size:1.2em">'+jQuery(this).attr('data-title')+'</strong><br>';
  1550.             } else {
  1551.                 ti = '';
  1552.             }
  1553.             if(jQuery(this).attr('data-excerpt')){
  1554.                 ex = jQuery(this).attr('data-excerpt')+'<br>';
  1555.             } else {
  1556.                 ex = '';
  1557.             }
  1558.             if(jQuery(this).attr('data-action')){
  1559.                 ac = '<strong>'+jQuery(this).attr('data-action')+'</strong><br>';
  1560.             } else {
  1561.                 ac = '';
  1562.             }
  1563. <?php if(!detectMobile()){ ?>
  1564.             if(jQuery(this).attr('data-hide')!='hide'){
  1565.                 jQuery(this).qtip({
  1566.                     style: {
  1567.                         tip: {
  1568.                             corner: "bottomLeft"
  1569.                         },
  1570.                         classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>"
  1571.                     },
  1572.                     position: {
  1573.                         target: "mouse",
  1574.                         adjust: {
  1575.                             mouse: false,
  1576.                             x: 10,
  1577.                             y: -10
  1578.                         },
  1579.                         my: "bottom left",
  1580.                         at: "bottom left"
  1581.                     },
  1582.                     show: {
  1583.                         delay: 500,
  1584.                         solo: true
  1585.                     },
  1586.                     content: ti+ex+ac
  1587.                 });
  1588.             }
  1589. <?php } ?>        
  1590.         });
  1591.         t.hover(function(){
  1592.             i.stop(true,false).animate({'opacity':0.2},300);
  1593.             a.stop(true,false).animate({'opacity':1},300);
  1594.         },function(){
  1595.             i.stop(true,false).animate({'opacity':1},300);
  1596.             a.stop(true,false).animate({'opacity':0},300);
  1597.         });
  1598.     });
  1599.  
  1600. }
  1601. jQuery(function(){
  1602.     portfolioImages();
  1603. });
  1604.  
  1605.        
  1606.  
  1607.  
  1608. /******************************************************
  1609. *
  1610. *   Filter tag
  1611. *
  1612. ******************************************************/
  1613. function filterTag() {
  1614.     if(jQuery('#filtering-nav').length!=0){
  1615.         jQuery('#filtering-nav a').each(function(){
  1616.             var t = jQuery(this);
  1617.             var dF = t.attr('data-filter');
  1618.             var l = jQuery(dF).length;
  1619.             if(dF!='*'&&l==0){
  1620.                 t.hide();
  1621.             } else {
  1622.                 t.show();
  1623.             }
  1624.         });
  1625.     }
  1626.  
  1627. }
  1628. jQuery(function(){
  1629.     filterTag();
  1630. });        
  1631.  
  1632.  
  1633. /******************************************************
  1634. *
  1635. *   Portfolio layout
  1636. *
  1637. ******************************************************/
  1638. jQuery(function(){
  1639.  
  1640.  
  1641.     var ha = 0;
  1642.     if(jQuery('aside').length!=0){
  1643.         ha = jQuery('aside').height();
  1644.     }    
  1645.  
  1646.     if(jQuery('section.widepagePortfolio').length!=0){
  1647.         var w = jQuery(window).width();
  1648.         if(w > 1050){
  1649.             w = jQuery(window).width()-300;
  1650.         } else {
  1651.             w = 1050 - 300;
  1652.         }
  1653.         jQuery('section.widepagePortfolio').css({'width':w,'float':'left','margin-left':'270px'})
  1654.        
  1655.         jQuery(window).resize(function(){
  1656.             w = jQuery(window).width();
  1657.             if(w > 1050){
  1658.                 w = jQuery(window).width()-300;
  1659.             } else {
  1660.                 w = 1050 - 300;
  1661.             }
  1662.             jQuery('section.widepagePortfolio').css({'width':w,'float':'left','margin-left':'270px'})
  1663.         });
  1664.     }
  1665.        
  1666.        
  1667.     if(jQuery('div.isoFilter').length!=0){
  1668.         var
  1669.             speed = 400,
  1670.             the_mode,
  1671.             the_difference,
  1672.             wall;
  1673.         if(jQuery('section.widepagePortfolio').length!=0){
  1674.              wall = jQuery('section div.isoFilter');
  1675.              the_mode = 'masonry';
  1676.         } else if(jQuery('section.pagePortfolio').length!=0) {
  1677.              wall = jQuery('article div.isoFilter');
  1678.              the_mode = 'fitRows';
  1679.             jQuery(window).one('load',function(){
  1680.                  the_difference = 100+(jQuery('article > div').height() - (jQuery('.isoFilter').height() + jQuery('#filtering-nav').height()));
  1681.             });
  1682.         }
  1683.        
  1684.            
  1685.  
  1686.         wall.imagesLoaded( function(){
  1687.             wall.isotope({
  1688.                 masonry : {
  1689.                     columnWidth : '1'
  1690.                 },
  1691.                 itemSelector : '.hentry',
  1692.                 layoutMode : the_mode,
  1693.                 animationEngine : 'jquery',
  1694.                 animationOptions: {
  1695.                  duration: 400,
  1696.                  easing: 'linear',
  1697.                  queue: false
  1698.                }
  1699.             });
  1700.         });
  1701.        
  1702.         var colorClass = '.all';
  1703.    
  1704.         jQuery('#filtering-nav a').click(function(){
  1705.             colorClass = '.' + jQuery(this).attr('data-filter');
  1706.             var selector = jQuery(this).attr('data-filter');
  1707.             wall.isotope({ filter: selector });
  1708.             setTimeout(function(){
  1709.                 var newH = jQuery('.isoFilter').height();
  1710.                 if(jQuery('#filtering-nav').length!=0){
  1711.                     var fH = jQuery('#filtering-nav').height();
  1712.                 } else {
  1713.                     var fH = 0;
  1714.                 }
  1715.                 if(jQuery('.pix_pagenavi').length!=0){
  1716.                     var bC = jQuery('.pix_pagenavi > ul').height();
  1717.                 } else {
  1718.                     var bC = 0;
  1719.                 }
  1720.                 jQuery('article').css({'height':(newH+the_difference+fH)});
  1721.                 var hs = 0;
  1722.                 if(jQuery('article').length!=0){
  1723.                     hs = jQuery('article').height()+(fH+bC);
  1724.                 }  
  1725.                 articleAsideOpen(hs, ha);
  1726.                 jQuery(window).resize();
  1727.             }, speed);
  1728.             if ( !jQuery(this).hasClass('selected') ) {
  1729.                 jQuery(this).parents('#filtering-nav').find('.selected').removeClass('selected');
  1730.                 jQuery(this).addClass('selected');
  1731.             }
  1732.             return false;
  1733.         });
  1734.                
  1735.         wall.infinitescroll({
  1736.             navSelector  : 'a#page_nav:last',
  1737.             nextSelector : 'a#page_nav:last',
  1738.             itemSelector : '.hentry:not(.invis)',
  1739.             loadingImg : '<?php echo get_bloginfo('stylesheet_directory'); ?>/images/loader.gif',
  1740.             loadingText : '<?php _e('Loading...','delight'); ?>',
  1741.             donetext  : '<?php _e('No more items to load','delight'); ?>',
  1742.             debug: false,
  1743.             errorCallback: function() {
  1744.                 jQuery('#infscr-loading').animate({opacity: .8},2000).fadeOut('normal');
  1745.             }
  1746.         },
  1747.             function( newElements ) {
  1748.                 wall.isotope( 'appended', jQuery( newElements ),
  1749.                     function(){
  1750.                         setTimeout(function(){
  1751.                             var thisClass = jQuery('#filtering-nav a.selected').attr('data-filter');
  1752.                             if(thisClass!='*') {
  1753.                                 jQuery('#filtering-nav a[data-filter="'+thisClass+'"]').click();
  1754.                             }
  1755.                             var newH = jQuery('.isoFilter').height();
  1756.                             filterTag();
  1757.                             if(jQuery('#filtering-nav').length!=0){
  1758.                                 var fH = jQuery('#filtering-nav').height();
  1759.                             } else {
  1760.                                 var fH = 0;
  1761.                             }
  1762.                             jQuery('article').css({'height':(newH+the_difference+fH+50)});
  1763.                             var hs = 0;
  1764.                             if(jQuery('article').length!=0){
  1765.                                 hs = jQuery('article').height();
  1766.                             }  
  1767.                             articleAsideOpen(hs, ha);
  1768.                             jQuery(window).resize();
  1769.                             portfolioImages();
  1770.  
  1771.                         }, speed+speed);
  1772.  
  1773.                         jQuery("a[href$='.jpg']", newElements).not('.noColorBox').each(function(){
  1774.                             var dataRel = jQuery(this).attr('data-rel');
  1775.                             var dataTitle = jQuery(this).attr('data-title');
  1776.                             jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } });
  1777.                         });
  1778.                         jQuery("a[href$='.png']", newElements).not('.noColorBox').each(function(){
  1779.                             var dataRel = jQuery(this).attr('data-rel');
  1780.                             var dataTitle = jQuery(this).attr('data-title');
  1781.                             jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } });
  1782.                         });
  1783.                         jQuery("a[href$='.gif']", newElements).not('.noColorBox').each(function(){
  1784.                             var dataRel = jQuery(this).attr('data-rel');
  1785.                             var dataTitle = jQuery(this).attr('data-title');
  1786.                             jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').text(dataTitle); }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); } });
  1787.                         });
  1788.                         jQuery("a.play-icon", newElements).not('.noColorBox').each(function(){
  1789.                             var dataRel = jQuery(this).attr('data-rel');
  1790.                             var dataTitle = jQuery(this).attr('data-title');
  1791.                            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(''); } });
  1792.                         });
  1793.                     }
  1794.                 );
  1795.             }
  1796.         );
  1797.        
  1798.        
  1799.         jQuery(window).unbind('.infscr');
  1800.        
  1801.         jQuery('a#page_nav').click(function(){
  1802.            
  1803.             jQuery(document).trigger('retrieve.infscr');            
  1804.            
  1805.             return false;
  1806.    
  1807.         });
  1808.         jQuery(document).ajaxError(function(e,xhr,opt){
  1809.             if (xhr.status == 404) {
  1810.                 jQuery('a#page_nav').remove();
  1811.             }
  1812.         });
  1813.  
  1814.     }    
  1815. });
  1816.  
  1817. /******************************************************
  1818. *
  1819. *   Accordions
  1820. *
  1821. ******************************************************/
  1822. jQuery(function() {
  1823.     if(jQuery('.pix_accordion').length!=0){
  1824.         jQuery( '.pix_accordion' ).each(function(){
  1825.             var aA = parseFloat(jQuery(this).attr('data-active'));
  1826.             if(aA==0){
  1827.                 aA = 100000;
  1828.             }
  1829.             jQuery( this ).accordion({
  1830.                 autoHeight: false,
  1831.                 navigation: false,
  1832.                 collapsible: true,
  1833.                 icons: false,
  1834.                 header: 'a.header_accordion',
  1835.                 change: function(event, ui) {
  1836.                     jQuery('.ui-state-active .icons',this).html('_');
  1837.                     jQuery('.ui-state-default .icons',this).html('&gt;');
  1838.                     jQuery('article, aside').css({'height':'auto'});
  1839.                     jQuery('article .entry-title:first, aside h3:first').unbind('click');
  1840.                     var hs = jQuery('article').height();
  1841.                     var ha = jQuery('aside').height();
  1842.                     articleAsideOpen(hs, ha);
  1843.                     jQuery(window).resize();
  1844.                     Cufon.refresh();
  1845.                 },
  1846.                 create: function(event, ui) {
  1847.                     jQuery('.ui-state-default .icons',this).html('&gt;');
  1848.                     jQuery('.ui-state-active .icons',this).html('_');
  1849.                     jQuery(window).resize();
  1850.                     Cufon.refresh();
  1851.                 },
  1852.                 active: aA-1
  1853.             });
  1854.         });
  1855.     }
  1856. });
  1857.  
  1858. /******************************************************
  1859. *
  1860. *   Tabs
  1861. *
  1862. ******************************************************/
  1863. jQuery(window).one('load',function() {
  1864.     if(jQuery('.pix_tabs').length!=0){
  1865.         jQuery( '.pix_tabs' ).each(function(){
  1866.             var aA = parseFloat(jQuery(this).attr('data-active'));
  1867.             jQuery( this ).tabs({
  1868.                 icons: false,
  1869.                 show: function(event, ui) {
  1870.                     jQuery('article, aside').css({'height':'auto'});
  1871.                     jQuery('article .entry-title:first, aside h3:first').unbind('click');
  1872.                     var hs = jQuery('article').height();
  1873.                     var ha = jQuery('aside').height();
  1874.                     articleAsideOpen(hs, ha);
  1875.                     jQuery(window).resize();
  1876.                     Cufon.refresh();
  1877.                 },
  1878.                 fx: { opacity: 'toggle' },
  1879.                 selected: aA-1
  1880.             });
  1881.         });
  1882.     }
  1883.    
  1884. });
  1885.  
  1886. /******************************************************
  1887. *
  1888. *   Columns IE7 workaround
  1889. *
  1890. ******************************************************/
  1891. jQuery(function() {
  1892.     if ((jQuery.browser.msie && jQuery.browser.version < 9) && jQuery('.pix_columns').length != 0) {
  1893.    
  1894.         var w = jQuery('article > div').width();
  1895.        
  1896.         jQuery('.pix_columns .col_two').css({'width':Math.floor(w*0.47)});
  1897.         jQuery('.pix_columns .col_two').not('.last_column').css({'margin-right':Math.floor(w*0.06)});
  1898.        
  1899.         jQuery('.pix_columns .col_three').css({'width':Math.floor(w*0.30)});
  1900.         jQuery('.pix_columns .col_three').not('.last_column').css({'margin-right':Math.floor(w*0.05)});
  1901.        
  1902.         jQuery('.pix_columns .col_two_three').css({'width':Math.floor(w*0.65)});
  1903.         jQuery('.pix_columns .col_two_three').not('.last_column').css({'margin-right':Math.floor(w*0.05)});
  1904.        
  1905.         jQuery('.pix_columns .col_four').css({'width':Math.floor(w*0.22)});
  1906.         jQuery('.pix_columns .col_four').not('.last_column').css({'margin-right':Math.floor(w*0.04)});
  1907.        
  1908.         jQuery('.pix_columns .col_two_four').css({'width':Math.floor(w*0.48)});
  1909.         jQuery('.pix_columns .col_two_four').not('.last_column').css({'margin-right':Math.floor(w*0.04)});
  1910.        
  1911.         jQuery('.pix_columns .col_three_four').css({'width':Math.floor(w*0.74)});
  1912.         jQuery('.pix_columns .col_three_four').not('.last_column').css({'margin-right':Math.floor(w*0.04)});
  1913.        
  1914.         jQuery('.pix_columns .col_five').css({'width':Math.floor(w*0.18)});
  1915.         jQuery('.pix_columns .col_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)});
  1916.        
  1917.         jQuery('.pix_columns .col_two_five').css({'width':Math.floor(w*0.385)});
  1918.         jQuery('.pix_columns .col_two_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)});
  1919.        
  1920.         jQuery('.pix_columns .col_three_five').css({'width':Math.floor(w*0.59)});
  1921.         jQuery('.pix_columns .col_three_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)});
  1922.        
  1923.     }
  1924.    
  1925. });
  1926.  
  1927. /******************************************************
  1928. *
  1929. *   Smoothscroll
  1930. *
  1931. ******************************************************/
  1932. jQuery(function(){
  1933.     jQuery('a[href*=#]').click(function() {
  1934.         if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
  1935.         && location.hostname == this.hostname) {
  1936.             var target = jQuery(this.hash);
  1937.             target = target.length && target
  1938.             || jQuery('[name=' + this.hash.slice(1) +']');
  1939.             if (target.length) {
  1940.                 var targetOffset = target.offset().top;
  1941.                 jQuery('html,body')
  1942.                 .animate({scrollTop: targetOffset}, 1000);
  1943.                 return false;
  1944.             }
  1945.         }
  1946.     });
  1947. });
  1948. /******************************************************
  1949. *
  1950. *   Hover nav effect
  1951. *
  1952. ******************************************************/
  1953. jQuery(window).one('load',function(){
  1954.     jQuery('nav > ul > li').has('ul').each(function(){
  1955.         var w = parseFloat(jQuery(this).find('a:first').width());
  1956.         var p = parseFloat(jQuery(this).find('a:first').css('padding-left').replace('px',''));
  1957.         jQuery('a:first',this).after('&nbsp;<span class="submenu">&gt;</span>');
  1958.     });
  1959.     jQuery('nav > ul > li li').has('ul').each(function(){
  1960.         var w = parseFloat(jQuery(this).find('a:first').width());
  1961.         var p = parseFloat(jQuery(this).find('a:first').css('padding-left').replace('px',''));
  1962.         jQuery('a:first',this).after('&nbsp;<span class="submenu">_</span>');
  1963.     });
  1964.     jQuery('nav li li ul').addClass('third_level_menu');
  1965.  
  1966.     var le = jQuery('nav > ul > li').length;
  1967.     jQuery('nav > ul > li').each(function(){
  1968.         var Mw = jQuery(this).width();
  1969.         jQuery(this).css({'margin-left':'-'+(Mw+100)+'px'})
  1970.     });
  1971.     var i = 0;
  1972.     <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1973.         jQuery('nav > ul > li').css({'margin-left':0});
  1974.     <?php } else { ?>
  1975.     while(i < le){
  1976.         jQuery('nav > ul > li').eq(i).delay((i*100)+500).animate({'margin-left':0},1000,'easeOutQuint');
  1977.         i++;
  1978.     }
  1979.     <?php } ?>
  1980.     var hH = jQuery('header').height();
  1981.     <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1982.     jQuery('header').css({'top':'-'+hH+'px'}).css({'visibility':'visible','top':0});
  1983.     <?php } else { ?>
  1984.     jQuery('header').css({'top':'-'+hH+'px'}).css({'visibility':'visible'}).animate({'top':0},1000);
  1985.     <?php } ?>
  1986.     <?php if(get_pix_option('pix_social_bar')!='hidden') { ?>
  1987.         <?php if(get_pix_option('pix_social_bar')!='closed') { ?>
  1988.         var sH = jQuery('#social_bar').height();
  1989.             <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1990.         jQuery('#social_bar').not('.open').css({'margin-top':'-'+sH+'px'}).css({'visibility':'visible','margin-top':0});
  1991.         jQuery('#social_bar.open').css({'visibility':'visible','margin-top':50});
  1992.             <?php } else { ?>
  1993.         jQuery('#social_bar').not('.open').css({'margin-top':'-'+sH+'px'}).css({'visibility':'visible'}).animate({'margin-top':0},1000);
  1994.         jQuery('#social_bar.open').css({'margin-top':'-'+sH+'px'}).css({'visibility':'visible'}).animate({'margin-top':50},1000);
  1995.             <?php } ?>
  1996.         <?php } ?>
  1997.         var cI = jQuery('.click.icons').height();
  1998.             <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1999.         jQuery('.click.icons').css({'top':'-'+cI+'px'}).css({'visibility':'visible','top':0});
  2000.             <?php } else { ?>
  2001.         jQuery('.click.icons').css({'top':'-'+cI+'px'}).css({'visibility':'visible'}).animate({'top':0},1000);
  2002.             <?php } ?>
  2003.     <?php } ?>
  2004.     var hF = 0;
  2005.     if(jQuery('footer').length!=0){
  2006.         hF = jQuery('footer').height();
  2007.     <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  2008.         jQuery('footer').css({'bottom':'-'+hH+'px'}).css({'visibility':'visible','bottom':0});
  2009.     <?php } else { ?>
  2010.         jQuery('footer').css({'bottom':'-'+hH+'px'}).css({'visibility':'visible'}).animate({'bottom':0},500);
  2011.     <?php } ?>
  2012.     }
  2013.     if(jQuery('article').length!=0){
  2014.         var aT = parseFloat(jQuery('article').css('top').replace('px',''));
  2015.         var aH = jQuery('article').height();
  2016.     <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  2017.         jQuery('article').not('.open_toggle').css({'top':aT+aH+hF,'visibility':'visible','top':aT});
  2018.     <?php } else { ?>
  2019.         jQuery('article').not('.open_toggle').css({'top':aT+aH+hF,'visibility':'visible'}).delay(250).animate({'top':aT},1000);
  2020.     <?php } ?>
  2021.     }
  2022.     if(jQuery('aside').length!=0){
  2023.         var sT = parseFloat(jQuery('aside').css('top').replace('px',''));
  2024.         var sH = jQuery('aside').height();
  2025.     <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  2026.         jQuery('aside').not('.open_toggle').css({'top':sT+sH+hF,'visibility':'visible','top':aT});
  2027.     <?php } else { ?>
  2028.         jQuery('aside').not('.open_toggle').css({'top':sT+sH+hF,'visibility':'visible'}).delay(250).animate({'top':aT},1000);
  2029.     <?php } ?>
  2030.     }
  2031. });
  2032. jQuery(window).one('load',function(){
  2033.     jQuery('nav > ul > li').not(':has(ul)').each(function(){
  2034.         var a = jQuery(this).find('a:first');
  2035.         a.hoverIntent({
  2036.             over: function(){jQuery(this).stop(true,false).animate({'border-right-width':'5px','padding-right':'15px'},100);},
  2037.             out: function(){jQuery(this).stop(true,false).animate({'border-right-width':'0','padding-right':'20px'},100);},
  2038.             timeout: 250
  2039.         });
  2040.     });
  2041.     jQuery('nav > ul > li').has('ul').each(function(){
  2042.         var a = jQuery(this).find('a:first');
  2043.         var sub = jQuery(this).find('.submenu:first');
  2044.         var w = 30+(a.width());
  2045.         var u = jQuery(this).find('ul:first');
  2046.         var sto;
  2047.         u.find('li').not(':first').before('<li class="slash_li">/</li>');
  2048.         jQuery('.third_level_menu .slash_li:first-child').remove();
  2049.         var uW = u.width();
  2050.         u.each(function(){
  2051.             jQuery(this).css({'left':'-'+(30+(uW-w))+'px','width':uW+'px'});
  2052.         });
  2053.             jQuery('nav ul.third_level_menu').hide();
  2054.             uW = 2;
  2055.             jQuery('> ul > li',this).each(function(){
  2056.                 var allLi = [];
  2057.                 allLi.push(jQuery(this).width());
  2058.                 jQuery.each(allLi, function(key, value) {
  2059.                     uW = uW + (allLi[key]);
  2060.                 });
  2061.             });
  2062.             jQuery('> ul',this).css({'left':'-'+(30+uW)+'px','width':uW});
  2063.             jQuery('nav ul.third_level_menu').show();
  2064.  
  2065.         function seThide(){
  2066.             a.stop(true,false).animate({'padding-right':'20px'},100);
  2067.             sub.stop(true,false).animate({'opacity':1,'right':'12px'},100);
  2068.             u.stop(true,false).animate({'left':'-'+(uW+30)+'px'},200);
  2069.         }
  2070.         function seTout(){
  2071.             sto = setTimeout(seThide,250);
  2072.         }
  2073.         jQuery(this).hoverIntent({
  2074.             over: function(){
  2075.                 w = 30+(a.width());
  2076.                 clearTimeout(sto);
  2077.                 a.stop(true,false).animate({'padding-right':'15px'},100);
  2078.                 sub.stop(true,false).animate({'opacity':0,'right':0},100);
  2079.                 u.stop(true,false).animate({'left':w-5},200);
  2080.             },
  2081.             out: seTout,
  2082.             timeout: 250
  2083.         });
  2084.     });
  2085.     jQuery('nav li').hover(function(){
  2086.         jQuery(this).addClass('nav_li_hover');
  2087.     },function(){
  2088.         jQuery(this).removeClass('nav_li_hover');
  2089.     });
  2090.     jQuery('nav li li').has('ul').each(function(){
  2091.         var ul = jQuery(this).find('ul:first');
  2092.         var sub = jQuery(this).find('.submenu:first');
  2093.         var ulW = 2;
  2094.         var sto;
  2095.         ul.find('> li').each(function(){
  2096.             var allLi = [];
  2097.             allLi.push(jQuery(this).width());
  2098.             jQuery.each(allLi, function(key, value) {
  2099.                 ulW = ulW + (allLi[key]);
  2100.             });
  2101.         });
  2102.         var thisH = jQuery(this).height();
  2103.         ul.width(0).height(thisH-7);
  2104.  
  2105.         function seThide(){
  2106.             ul.css({'width':0,'margin-left':0}).hide();
  2107.             sub.stop(true,false).animate({'top':'-2px','opacity':1},100);
  2108.             jQuery('nav li').removeClass('nav_hover');
  2109.             jQuery('nav li').css({'z-index':'1'});
  2110.         }
  2111.         function seTout(){
  2112.             sto = setTimeout(seThide,250);
  2113.         }
  2114.         jQuery(this).hoverIntent({
  2115.             over: function(){
  2116.                 clearTimeout(sto);
  2117.                 jQuery('nav li li ul').hide();
  2118.                 var offset = jQuery(this).offset();
  2119.                 if(offset.left+ulW>1050){
  2120.                     ul.css({'left':0,'top':thisH}).show().stop(true,false).animate({'width':ulW,'margin-left':(1050-offset.left)-ulW},200);
  2121.                 } else {
  2122.                     ul.css({'left':10,'top':thisH}).show().stop(true,false).animate({'width':ulW},200);
  2123.                 }
  2124.                 ul.parent().parent().parent().addClass('nav_hover');
  2125.                 jQuery('nav li').not('.nav_hover').css({'z-index':'-1'});
  2126.                 sub.stop(true,false).animate({'top':'15px','opacity':0},100);
  2127.             },
  2128.             out: seTout,
  2129.             timeout: 250
  2130.         });
  2131.     });
  2132.     Cufon.refresh();
  2133.  
  2134. });
  2135.  
  2136. /******************************************************
  2137. *
  2138. *   Link with #
  2139. *
  2140. ******************************************************/
  2141. jQuery(function(){
  2142.     jQuery('nav a').click(function(){
  2143.         if(jQuery(this).attr('href')=='#'){
  2144.             return false;
  2145.         }
  2146.     });
  2147. });
  2148.  
  2149. /******************************************************
  2150. *
  2151. *   Show thumbs & thmb scroller
  2152. *
  2153. ******************************************************/
  2154. function navGhide(){
  2155.     jQuery('#navgallery_wrap').fadeOut(200,function(){
  2156.         jQuery('#credits_blog, #pix_controls').fadeIn(400);
  2157.     });
  2158. }
  2159. var sto;
  2160. function seTout(){
  2161.     sto = setTimeout(navGhide,1000);
  2162. }
  2163.  
  2164. jQuery(window).one('load',function(){
  2165.     if(jQuery('#pix_show_thumbs').length!=0){
  2166.         jQuery('#pix_show_thumbs').click(function(){
  2167.             jQuery('#credits_blog, #pix_controls').fadeOut(200,function(){
  2168.                 jQuery('#navgallery_wrap').fadeIn(400);
  2169.             });
  2170.         });
  2171.         jQuery('#navgallery_wrap').mouseout(function(){
  2172.             seTout();
  2173.         }).mouseover(function(){
  2174.             clearTimeout(sto);
  2175.         });
  2176.     }
  2177.    
  2178.    
  2179.     var wrapperW = jQuery('.navgallery').width();
  2180.     var wrapW = jQuery('#navgallery_wrap').width();
  2181.        
  2182.    
  2183.     if( wrapperW > wrapW ) {
  2184.         jQuery("#navgallery_wrap").thumbnailScroller({
  2185.             scrollerType:"hoverPrecise",
  2186.             scrollerOrientation:"horizontal",
  2187.             scrollSpeed:2,
  2188.             scrollEasing:"easeOutCirc",
  2189.             scrollEasingAmount:250,
  2190.             acceleration:4,
  2191.             scrollSpeed:300,
  2192.             noScrollCenterSpace:10,
  2193.             autoScrolling:0,
  2194.             autoScrollingSpeed:2000,
  2195.             autoScrollingEasing:"easeInOutQuad",
  2196.             autoScrollingDelay:500
  2197.         });
  2198.     } else {
  2199.         jQuery('.navgallery').css({'margin-left' : (wrapW - wrapperW) });
  2200.     }
  2201. });
  2202.  
  2203.  
  2204. <?php   if (detectMobile()) { ?>
  2205. jQuery(window).one('load',function(){
  2206.     setTimeout(function(){
  2207.     jQuery('*[data-height="100"]').each(function(){
  2208.         var t = jQuery(this);
  2209.         jQuery(window).bind('scroll load resize',function(){
  2210.             var h = parseFloat(window.innerHeight);
  2211.             t.css({'height':h+'px'});
  2212.         });
  2213.     });
  2214.     jQuery('*[data-position="fixed"]').each(function(){
  2215.         var t = jQuery(this);
  2216.         t.css({'position':'absolute'});
  2217.         var top = jQuery(this).attr('data-top');
  2218.         var bottom = jQuery(this).attr('data-bottom');
  2219.         var hT = parseFloat(t.height());
  2220.         jQuery(window).bind('scroll load resize',function(){
  2221.             var sumScroll = parseFloat(jQuery('html').scrollTop())+parseFloat(jQuery('body').scrollTop());
  2222.             var h = parseFloat(window.innerHeight);
  2223.             if(top!='not'){
  2224.                 t.css({'top':(sumScroll+parseFloat(top))+'px'});
  2225.             } else {
  2226.                 t.css({'top':((sumScroll+h)-(parseFloat(bottom)+hT))+'px','bottom':''});
  2227.             }
  2228.         });
  2229.     });
  2230.     },2);
  2231. });
  2232. <?php } ?>
  2233.  
  2234. jQuery(window).one('load',function(){
  2235.     jQuery('#plusone').hide();
  2236. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement