$(document).ready(function(){

    //When user move mouse over menu
	$('#watch').live('mousemove', function(e){

	    var div = $('#watch'),
             ul = $('#watch img');

	    var divHeight = div.height();

	    //Remove scrollbars (non-JS compatibility)
	    //div.css({overflow: 'hidden'});

	    var lastLi = $('#watch img');

      //As images are loaded ul width increases,
      //so we recalculate it each time
      var ulHeight = lastLi[0].offsetTop + lastLi.outerHeight();

      var top = (e.pageY - div.offset().top) * (ulHeight-divHeight) / divHeight;
		
      div.scrollTop(top);
    });

	$("#watch").live("mouseout", function(e) {
		$(this).animate({scrollTop : ($('#watch > img').height()-$('#watch').height())/2},'slow');
	});

//	$("#watch img").live("load", function(e) {
		$("#watch").animate({scrollTop : ($('#watch > img').height()-$('#watch').height())/2},'slow');
//	});

	$('#topmenu ul li ul li a').mouseover(function () {
		var bgpic = $(this).attr("href");
		bgpic = 'url("/images/watches/ul' + bgpic.substring(1,5) + '.jpg") right center #141414';
		$('#topmenu ul').css("background",bgpic)
	});

});

