jQuery.easing.quart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};  
	
jQuery(function(){ 
    
   //Window 
   jQuery(window).load(function() {
       jQuery('#loading').fadeOut(500); 
       jQuery('#table_tp div').fadeIn(2000);
       //jQuery('.entry-content img').animate({opacity:"1"},1500); 
   }); 
      
   // hidden counter
   jQuery("#counter_div").click(function(){
       jQuery(this).fadeOut("slow");   
       jQuery(".counter").fadeIn("slow");
   });
   jQuery(".counter").click(function(){
       jQuery(this).fadeOut("slow");   
       jQuery("#counter_div").fadeIn("slow");
   });

   //Toureki toggle
   jQuery(".open_toureki").click(function(){
       jQuery(this).fadeOut("slow");
       jQuery(".close_toureki").fadeIn("slow");
 　　　 jQuery("#toureki").animate({height: "toggle", opacity: "toggle"},"slow");
       return false;
   });
   
   jQuery(".close_toureki").click(function(){
       jQuery(this).fadeOut("slow");
       jQuery(".open_toureki").fadeIn("slow");
 　　　jQuery("#toureki").animate({height: "toggle", opacity: "toggle"},"slow");
       return false;
   });
   
   // Cycle Plugin
   $('#slideshow').cycle({
    timeout: 8000,
    //delay:  3000, 
    speed:  1000 
   })

 　 // smooth scroller
   jQuery("a[href^=#]").click(function() {
	   var hash = this.hash;
	   if(!hash || hash == "#")
	   return false;
	   jQuery(jQuery.browser.safari ? 'body' : 'html').animate({scrollTop: jQuery(hash).offset().top}, 1000, "quart");
	   return false;
   });
   
});

// Create the tooltips only on document load
jQuery(document).ready(function() {
    jQuery('#img_holder a[href][title]').qtip({
  
    content: { text: false },
   position: { adjust: { x: -160, y: 4 } },
       show: { effect: { type: 'fade'}, delay: 240 },
       hide: { effect: { type: 'false'}, delay: 0 },
      style: {
               width: { max: 600},
               padding: 4,
               background: '#444',
               color: 'white',
               textAlign: 'left',
               border: { width: 3,radius: 3,color: '#444'}
             }
      });
    /*  
     jQuery('#news a[href][title]').qtip({
          position: { corner: { target: 'bottomleft', tooltip: 'topMiddle' }},
              show: { effect: { type: 'fade' } },
              hide: { effect: { type: 'false' } },
            style: {
               padding: 3,
               background: '#444',
               color: 'white',
               textAlign: 'center',
               border: { width: 3,radius: 3,color: '#444'}
                   }
     });
     */
});

    Shadowbox.init({
      animSequence: "wh",
      overlayOpacity: "0.6",
      overlayColor: "#000",
      counterType: "skip"
    });
