/* Slideshow functions*/

function slideSwitch() {
    var $active = $('.slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('.slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('.slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 500, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 2000 );
});

$(function(){
	$(".case-img a").hover(function(){
		$(this).children("img").fadeOut();
	}, function(){
		$(this).children("img").fadeIn();
	})		
});

Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('.footer ul li');

$(document).ready(function(){
	
	$("body").addClass("hasJS");
	
		$(".sel-box:nth-child(4n)").addClass("last");
		$(".sel-box:nth-child(4n+1)").addClass("clearthis");
		
		$(".about-menu ul li:first-child").addClass("firstAbout");
		$(".about-menu ul li:last-child").addClass("lastAbout");
		
		$(".release-list li:first-child").addClass("firstRelease");
		$(".list-pag li:last-child").addClass("last");
		
		$(function () {

	        $('div.ticker marquee').marquee('pointer').mouseover(function () {
	            $(this).trigger('stop');
	        }).mouseout(function () {
	            $(this).trigger('start');
	        }).mousemove(function (event) {
	            if ($(this).data('drag') == true) {
	                this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
	            }
	        }).mousedown(function (event) {
	            $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
	        }).mouseup(function () {
	            $(this).data('drag', false);
	        });
	    });
	
});






