$(document).ready(function(){
	var slideOffset;
	jQuery.each(jQuery.browser, function(i, val) {
		if($.browser.msie || $.browser.mozilla)
			slideOffset = 11;
		else
			slideOffset = 14;
	});
	var panelHeight = $('.slides').height()-slideOffset;
	var sliderHeight = $('.slider').height();
	var numSlides = Math.ceil(sliderHeight/panelHeight);
	var currentPanel = 1;
		
	$('.slide-control-down').click(function() {
		if (currentPanel < numSlides) {
			$('.slider').animate({
				top: ("-=" + panelHeight + "px")
			});
			currentPanel++;
		}
	});
	
	$('.slide-control-up').click(function() {
		if (currentPanel > 1) {
			$('.slider').animate({
				top: ("+=" + panelHeight + "px")
			});
			currentPanel--;
		}
	});
	
	//pretty photo
	if (typeof $("a[class*='prettyPhoto']").prettyPhoto == 'function') {
		$("a[class*='prettyPhoto']").prettyPhoto({
			padding: 50,
			opacity: 0.35,
			showTitle: true,
			counter_separator_label: '/',
			theme: 'dark_square',
			modal: false
		});
	}
});
