$(document).ready(function(){
	$('#image-container a').attr('rel', 'Gallery');
	$('#image-container a').attr('title', function() {
	  return $(this).find('img').attr('title');
	});
	$('#image-container a').colorbox({fade: 'none', width: '85%', height: '90%'});
});


function move_slider(dir, id, max){
	$('#image-container img').fadeOut('slow', function(){
		$('#image-container').css('margin-top', dir+'px');
		$('#image-container img').fadeIn('slow');
	});

	mark_selected(id, max);
	return false;
}


function mark_selected(id, max){
	for(var i=1; i<=max; i++){
		$('#go-img-'+i).removeClass('selected');
		$('#description-'+i).removeClass('selected');
	}
	$('#go-img-'+id).addClass('selected');
	$('#description-'+id).addClass('selected');
}


function show_hide_parts(id, max){
	for(var i=1; i<=max; i++){
		if(i!=id){
			$('.part-'+i).css('display', 'none');
			$('#go-part-'+i).removeClass('selected');
		} else {
			$('.part-'+i).css('display', 'block');
			$('#go-part-'+i).addClass('selected');
		}
	}
}