$(document).ready(function(){
    $("#header li").hover(
        function(){ $("ul",this).show(); },
		function(){ $("ul",this).css("display","none"); }
	);    
	$("#productList ul li:nth-child(2),#productList ul li:nth-child(3),#productList ul li:nth-child(4),#productList ul li:nth-child(5),#productList ul li:nth-child(6),#productList ul li:nth-child(7),#productList ul li:nth-child(8),#productList ul li:nth-child(9),#productList ul li:nth-child(10)").before("<span><img src='/img/common/list-separate.gif' alt='' /></span>");
	$("#linkTree li:nth-child(2),#linkTree li:nth-child(3),#linkTree li:nth-child(4),#linkTree li:nth-child(5)").before("<span><img src='/img/common/list-tree.gif' alt='' /></span>");
	$("table tr:nth-child(even)").addClass("evenTr");	
	$("#main dd:last-child").addClass("lastDd");
	$("#main ul li:last-child").addClass("lastLi");
	$("#main h2:gt(0)").addClass("mt_35");
});

$(document).ready( function() {
  $("#sideLeft li a").each( function() {
    var url = document.URL.split("#");

    if ( this == url[0] || this + "index.html" == url[0]) {
      $(this).parent().addClass("onPage");
    }
  });
});

$(function () { // run this code on page load (AKA DOM load)
/* set variables locally for increased performance */
var scroll_timer;
var displayed = false;
var $message = $('#message');
var $window = $(window);
var top = $(document.body).children(0).position().top;

/* react to scroll event on window */
$window.scroll(function () {
window.clearTimeout(scroll_timer);
scroll_timer = window.setTimeout(function () { // use a timer for performance
if($window.scrollTop() <= top) // hide if at the top of the page
{
displayed = false;
$message.fadeOut(500);
}
else if(displayed == false) // show if scrolling down
{
displayed = true;
$message.stop(true, true).fadeIn(500).click(function () { $message.fadeOut(500); });
}
}, 100);
});
$('#top-link').click(function(e) {
e.preventDefault();
$.scrollTo(0,300);
});
});