$(document).ready(function() {
	$("#slideshow").cycle({
		fx: "fade",
		timeout: 5000
	});
	$("#slideinfo").cycle({
        cleartypeNoBg: true,
		fx: "fade",
		timeout: 5000
	});

	var target = ".MenuUl li";
	var hoverClass = "MenuHover";

	$(target).each(function() {
		$(this).hover(
			function() {
				$(this).addClass(hoverClass);
				status = $(this).find("a").attr("href");
			},
			function() {
				$(this).removeClass(hoverClass);
				status = "";
			}
		);
		$(this).click(function(){
			location = $(this).find("a").attr("href");
		});
		$(this).css("cursor", "pointer");
	});

	$(function(){
		var div = $("div.WorksPlace"),
			ul = $("ul.AllWorks"),
			ulPadding = 15;
		var divWidth = div.width();
		div.css({overflow: "hidden"});
		var lastLi = ul.find("li:last-child");
		div.mousemove(function(e){
		var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;
		var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
		div.scrollLeft(left);
		});
	});

	$("a[class='jq']").colorbox();
    
    $(".Download").hover(
        function() {
            $(".Download").addClass("DownloadHover");
            status = $(".Download").find("a").attr("href");
        },
        function() {
            $(".Download").removeClass("DownloadHover");
            status = "";
        }
    );
    $(".Download").click(function(){
        location = $(".Download").find("a").attr("href");
    });
    $(".Download").css("cursor", "pointer");
	
});
