Shadowbox.loadSkin('classic', '/shadowbox/skin');
Shadowbox.loadLanguage('en', '/shadowbox/lang');
Shadowbox.loadPlayer(['flv', 'html', 'img', 'swf'], '/shadowbox/player');

$(function() {
	var delay = 3;
	if($('#pieces')) {
	    delay = 30;
	}

	Shadowbox.init({
		continuous:true,
		handleOversize:'drag',
		slideshowDelay:delay,
		animSequence:'sync',
		counterType:'skip'
	});
	
	if($('#index').length > 0) {
		$('#cardMenu img').mouseenter(function() {
			var src = $(this).attr('src');
			$(this).attr('src', src.replace('.jpg', 'active.jpg'));
		}).mouseleave(function() {
			var src = $(this).attr('src');
			$(this).attr('src', src.replace('active.jpg', '.jpg'));
		});
	}
});

function deleteItem(object, item) {
	$('#' + object + item).parent().fadeOut(1000, function() {
		$(this).next().remove();
		$(this).remove();
	});
}

function more(from) {
	$('#more div').html('<img src="/img/loading.gif" alt="Loading..."/>');

	$.post('/more/' + from, {}, function(next) {
		$('#more').replaceWith(next);
	});
}
