as = {
	scroll: 0
};

as.init_index = function() {
	$('#scroll_left').click(function() {
		$('#scroll').scrollTo('-=225px', 500, {axis: 'x', onAfter: as.update_scroll});
		return false;
	});
	$('#scroll_right').click(function() {
		$('#scroll').scrollTo('+=225px', 500, {axis: 'x', onAfter: as.update_scroll});
		return false;
	});
	as.update_scroll();
	$(window).resize(function() {
		as.update_scroll();
		$('#scroll').get(0).scrollLeft = 0;
	});
}

as.update_scroll = function() {
	var so = $('#scroll').get(0);
	var s = so.scrollLeft;
	var w = $('#scroll_body').get(0).offsetWidth;
	var ww = so.offsetWidth;
	if (s > 0) $('#scroll_left').show();
	else $('#scroll_left').hide();
	if ((w - s) > ww) $('#scroll_right').show();
	else $('#scroll_right').hide();
}

as.init_slimbox = function() {
	var e = $("a[rel^='lightbox']");
	if (e.slimbox) e.slimbox({
		loop: true
	}, null, function(el) {
		return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
	});
}

as.init = function() {
	$('.menu li').hover(function() {
		$(this).find('table:first').show();
	}, function() {
		$(this).find('table').hide();
	});
}

as.init();
