function handleSliderChange(e, ui) {
	var maxScroll = $("#scroll_content").attr("scrollHeight") - $("#scroll_content").height();
	$("#scroll_content").attr({scrollTop: maxScroll - ui.value * (maxScroll / 100) });
}

function handleSliderSlide(e, ui) {
	var maxScroll = $("#scroll_content").attr("scrollHeight") - $("#scroll_content").height();
	$("#scroll_content").attr({scrollTop: maxScroll - ui.value * (maxScroll / 100) });
}

function scroll(value) {
	if ($("#slider a.uplnk").data('scrolled')) {
		var maxScroll = $("#scroll_content").attr("scrollHeight") - $("#scroll_content").height();
		var scroll_to = $("#slider a.uplnk").data('scrolled') + value;
		
		// check if scroll is out of scroll area
		if (scroll_to < 1) { scroll_to = 1; }
		else if (scroll_to > maxScroll) {
			scroll_to = maxScroll;
		}
		
		//scroll to
		$("#slider a.uplnk").data('scrolled', scroll_to);
	} else {
	 	$("#slider a.uplnk").data('scrolled', value);
	}
	$("#scroll_content").attr({scrollTop: $("#slider a.uplnk").data('scrolled') });
	return false;
}


$(document).ready(function() {
	
	// hide details  
	$(".details").hide();  
	
	// attach full size button to images 
	$("img").fullsize();  
	
	// show details
	$('.more a').click(function() {
		$(this).parent().parent().find('.details').show('slow');
		$(this).parent().hide('slow');
		return false;
	});
	
	// hide details
	$('.close a').click(function() {
		$(this).parent().parent().hide('slow');
		$(this).parent().parent().parent().find('.more').show('slow');
		return false;
	});
	
	/*
	if ($("#scroll_content").attr("scrollHeight") <= $("#scroll_content").height()) {
	 	$("#slider").hide();
	}
	
 	$("#slider a.uplnk").click(function() scroll(-20));
 	$("#slider a.downlnk").click(function() scroll(20));
	$(".inter_body, .linksr").mousewheel(function (event, delta) {
		if (delta > 0) {
			scroll(-20);
		} else {
			scroll(20);
		}
	});
	*/
 	
}); 