Advertisement
pixedelic

custom_4.0.0.php

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