Advertisement
pixedelic

custom.2.9.2.php

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