
$(function () {
  $('#main_nav li')
    .removeClass('glow')
    
    .find('a')
    
    .append('<div class="glow" />').each(function () {
      
      var $span = $('> div.glow', this).css('opacity', 0);
      
      $(this).hover(function () {
        
        $span.stop().fadeTo(500, 1);
      }, function () {
        
        $span.stop().fadeTo(1000, 0);
      });
    });
});


$(function () {
  $('#home_quips div.quip a.no_js')
    .removeClass('no_js')
    
    .prepend('<span class="glow" />').each(function () {
      
      var $span = $('> span.glow', this).css('opacity', 0);
      
      $(this).hover(function () {
        
        $span.stop().fadeTo(900, 1);
      }, function () {
        
        $span.stop().fadeTo(1500, 0);
      });
    });
});


/*
Flying Scroll
*/
$(document).ready( function(){
	$("#body_right").css({"position":"relative"}).animate({"top": "-30px"}, 2000);
});

/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * written by Alen Grakalic (http://cssglobe.com)
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 *<<<<< BEWARE: >>>>>>>  this script is heavily modified from Alen's original
 */
 
this.tooltip = function(){	
	 if ($.browser.msie && $.browser.version < 7) return;
		xOffset = 10;
		yOffset = -260;		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.fadeIn(400)
			.css({"display":"block"})
			.css({"position":"absolute"})
			.css("top:",(e.pageY - xOffset) + "px")
			.css("left:",(e.pageX + yOffset) + "px");
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

// starting the script on page load
$(document).ready(function(){
	tooltip();
});

//networks jumping icons
$(function () {
	var navDuration = 300;
      var navJumpHeight = ".6em";

      $('.icons li').hover(function() {
          $(this).animate({ marginTop : "-="+navJumpHeight }, navDuration);            
      }, function() {
          $(this).animate({ marginTop : "0" }, navDuration);
      });
});	

$(function () {
  $('#get_in_touch div.contact_info')
    .removeClass('no_js')
    
    .append('<span class="glow" />').each(function () {
      
      var $span = $('> span.glow', this).css('opacity', 0);
      
      $(this).hover(function () {
        
        $span.stop().fadeTo(900, 1);
      }, function () {
        
        $span.stop().fadeTo(1500, 0);
      });
    });
});
