    $(document).ready(function() {
      //On Hover Over
      function hoverOn(){
        $(this).find(".submenu").stop().fadeTo(0, 1).show().animate({'marginTop':'0'}, '20'); //Find sub and fade it in
        $(this).addClass("hover");
      }
      //On Hover Out
      function hoverOff(){
        var h = $(this).find(".submenu").css('height');
        $(this).find(".submenu").stop().animate({'marginTop':'-'+h}, '20', function() { //Fade to 0 opactiy
    	    $(this).hide();  //after fading, hide it
      	});
      	$(this).removeClass("hover");
      }
      
      //Set custom configurations
      var config = {
        sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
        interval: 0, // number = milliseconds for onMouseOver polling interval
        over: hoverOn, // function = onMouseOver callback (REQUIRED)
        timeout: 0, // number = milliseconds delay before onMouseOut
        out: hoverOff // function = onMouseOut callback (REQUIRED)
      };
      
      $("ul#menu li .submenu").css({'opacity':'0'}).each(function() {
        var h = $(this).height();
        $(this).css({'marginTop':-h, 'height':h});
      }); //Fade sub nav to 0 opacity on default
      $("ul#menu li").hoverIntent(config); //Trigger Hover intent with custom configurations
    
      // On Hover Over
      function expOn() {
        var p = $(this).parent();
        var cur = $(".current", p);
        var target = $(this);
        $(target).addClass('current');
        $(target).siblings().stop(true).animate({width:'112px'}, {queue: false});
        $(target).stop(true).animate({width:'274px'}, {queue: false});
        $('ul', target).stop(true).animate({marginLeft:'12px',paddingLeft:'96px'}, {queue: false});
        $('ul', $(target).siblings()).stop(true).animate({marginLeft:'12px',paddingLeft:'122px'}, {queue: false});
        if( cur.length > 0 ) cur.not(target).removeClass('current');
      }
      // On Hover Out
      function expOff() {
        var p = $(this).parent();
        var cur = $(".current", p); 
        if ( cur.length > 0 && $(this).hasClass("current") ) {
          $('div ul', p).stop().animate({marginLeft:'32px',paddingLeft:'122px'}, {queue: false});
          $(cur).stop().animate({width:'154px'}, {queue: false});
          $(cur).siblings().stop().animate({width:'154px'}, {queue: false});
          $(cur).removeClass('current');
        }
      }
      
      // Set custom configurations
      var expCfg = {
           sensitivity: 4, // number = sensitivity threshold (must be 1 or higher)
           interval: 100, // number = milliseconds for onMouseOver polling interval
           over: expOn, // function = onMouseOver callback (REQUIRED)
           timeout: 200, // number = milliseconds delay before onMouseOut
           out: expOff // function = onMouseOut callback (REQUIRED)
      };
      
      $("#expandos div").hoverIntent(expCfg); //Trigger Hover intent with custom configurations

      var sc = jQuery.url.param('sourcecode');
      sc = jQuery.trim(sc);
      if ( sc ) {
        $("a[href]").each(function(){
					var h = $(this).html();
          var u = $(this).attr("href");
          var s = u.replace(/(\?|&)sourcecode\=(&|$)/,'$1'+'sourcecode='+sc+'$2');
          if ( u == s ) {
            var p = ( s.lastIndexOf("?") > 0 ) ? "&" : "?";
            s = s.replace(/([^#]+)(#.+)?/gi, '$1'+p+'sourcecode='+sc+'$2');
          }
          $(this).attr("href", s);
					$(this).html(h);
        });
      }

      var cpid = jQuery.url.param('cpid');
      cpid = jQuery.trim(cpid);
      if ( cpid ) {
        $("a[href]").each(function(){
					var h = $(this).html();
          var u = $(this).attr("href");
          var s = u.replace(/(\?|&)cpid\=(&|$)/,'$1'+'cpid='+cpid+'$2');
          if ( u == s ) {
            var p = ( s.lastIndexOf("?") > 0 ) ? "&" : "?";
            s = s.replace(/([^#]+)(#.+)?/gi, '$1'+p+'cpid='+cpid+'$2');
          }
          $(this).attr("href", s);
					$(this).html(h);
        });
      }

      $("#tnc a, .tnc a").click(function(event){
        event.preventDefault();
        if ( tncWin && ! tncWin.closed ) {
          tncWin.close();
          tncWin = window.open($(this).attr('href'), "tnc_window");
        }
        else {
          tncWin = window.open($(this).attr('href'), "tnc_window");
        }
      });

      $("ul.tabs li").click(function(e){
        var index = $("ul.tabs li").index(this);
        $("ul.tabs > li:eq("+index+")").addClass("active").siblings().removeClass("active");
        $("div.tab-box > div:eq("+index+")").show().siblings("div.tab-box > div").hide();
      });
      $("ul.tabs li:eq(0)").click();

    });

	if ( typeof(omn_rmaction) == "undefined" ) {
		omn_rmaction = function(a, b) { alert("Omniture Debug:\n" + a + "\n" + b); }
	}
