function onLogoEnter(e){
 var tip = jQuery('#ftooltip');
 var x_offset = e.target.offsetLeft+54;// + tag_element.offsetWidth/2 - 100;// result_box.offsetWidth/2;
 var y_offset = 0;
 //var y_offset = e.target.offsetTop + e.target.offsetHeight-12;// + tag_element.offsetHeight;
 tip.css('left', x_offset + 'px');
 tip.css('top' ,  y_offset + 'px'); 
 tip.animate({'opacity':'1', 'marginTop' : '15px'}, 400); 
 tip.css('display', 'block');                  
}

function onLogoLeave(e){
  var tip = jQuery('#ftooltip');
  tip.animate({'opacity' : 0, 'marginTop' : '0px'}, 400); 
}

//window.addEvent('domready', function() {  
jQuery(document).ready(function(){
   var top_logo = jQuery('#logo');
   top_logo.bind('mouseenter', onLogoEnter);
   top_logo.bind('mouseleave', onLogoLeave);
   var tip = jQuery('#ftooltip');
   tip.css("opacity", "0");
});

//window.addEvent('domready', function(){
jQuery(document).ready(function(){

  if(screen.width > 1024) 
    return;
 //$$('#page div.overflow').setStyles({});
  jQuery('#page').css({
    width:'1076px',
    padding:'0px',
    'margin-left':'-73px',
    overflow:'hidden'
  });

  jQuery('#page').css('min-width','1076px');

});

/* jQuery SmoothScroll */
function initSmoothScroll(hash_name){
  jQuery('a[href^=#'+ hash_name +']').click(function() {
   // duration in ms
   var duration = 500;
   // easing values: swing | linear
   var easing='swing';
   // make sure it's the same location      
   if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'') && location.hostname==this.hostname && this.hash.replace(/#/,''))
   {
      // get parameters
      var hash=this.hash;
      var target=jQuery(hash).offset().top;
      // animate to target and set the hash to the window.location after the animation
      jQuery("html:not(:animated),body:not(:animated)").animate({ scrollTop: target }, duration, easing, function() { location.hash=hash; });
      // cancel default click action
      return false;
   }

  });
 
}
