Advertisement
pixedelic

custom.3.1.3.php

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