$(document).ready(function () {        
        $('#content').mousedown(function (event) {
            $(this)
                .data('down', true)
                .data('x', event.clientX)
                .data('scrollLeft', this.scrollLeft);
                
            return false;
        }).mouseup(function (event) {
            $(this).data('down', false);
        }).mousemove(function (event) {
            if ($(this).data('down') == true) {
                this.scrollLeft = $(this).data('scrollLeft') + $(this).data('x') - event.clientX;
            }
        }).mousewheel(function (event, delta) {
            this.scrollLeft -= (delta * 30);
        }).css({
            'overflow' : 'hidden',
            'cursor' : '-moz-grab'
        });
    });
    
    $(window).mouseout(function (event) {
        if ($('#content').data('down')) {
            try {
                if (event.originalTarget.nodeName == 'BODY' || event.originalTarget.nodeName == 'HTML') {
                    $('#content').data('down', false);
                }                
            } catch (e) {}
        }
    });

$(document).ready(function(){	
$('#content').serialScroll({
		items:'li',
		prev:'#prev',
		next:'#next',
		duration:200,
		force:true,
		stop:true,
		lock:false,
		cycle:true, //don't pull back once you reach the end
		offset: -80
	});
});

$(document).ready(function () {        
        $('#home_wrap').mousedown(function (event) {
            $(this)
                .data('down', true)
                .data('x', event.clientX)
                .data('scrollLeft', this.scrollLeft);
                
            return false;
        }).mouseup(function (event) {
            $(this).data('down', false);
        }).mousemove(function (event) {
            if ($(this).data('down') == true) {
                this.scrollLeft = $(this).data('scrollLeft') + $(this).data('x') - event.clientX;
            }
        }).mousewheel(function (event, delta) {
            this.scrollLeft -= (delta * 30);
        }).css({
            'overflow' : 'hidden',
            'cursor' : '-moz-grab'
        });
    });
    
    $(window).mouseout(function (event) {
        if ($('#home_wrap').data('down')) {
            try {
                if (event.originalTarget.nodeName == 'BODY' || event.originalTarget.nodeName == 'HTML') {
                    $('#home_wrap').data('down', false);
                }                
            } catch (e) {}
        }
    });

$(document).ready(function(){	
$('#home_wrap').serialScroll({
		items:'li',
		prev:'#sprev',
		next:'#snext',
		duration:200,
		force:true,
		stop:true,
		lock:false,
		cycle:true, //don't pull back once you reach the end
		offset: -5
	});
});


