var current_frame;
var end_frame;
var shot_lis;
var description_lis;

function load_page(room) {
	portfolio_number = window.location.hash.length > 0 ? window.location.hash.charAt(1) : 1;
	new Ajax.Request('/'+room+'/ajax_find_shots/'+portfolio_number, {asynchronous:true, evalScripts:true})
}

function slide_show_init(selected_portfolio) {
	shot_lis = $$('.shot_img');
	shot_lis.invoke('hide');
	$$('.portfolio_img').invoke('removeClassName', 'selected');
	$('portfolio_img_' + (selected_portfolio - 1)).addClassName('selected');
	description_lis = $$('.description');
	description_lis.invoke('hide');
	current_frame = 0;
	end_frame = shot_lis.length - 1;
	// shot_lis[0].show();
	// description_lis[0].show();
	Effect.Appear(shot_lis[0]);
	Effect.Appear(description_lis[0]);
}

function fade_next_in() {
		Effect.Fade(shot_lis[current_frame]);
		Effect.Fade(description_lis[current_frame]);
		if (current_frame == end_frame) { current_frame = 0; } else { current_frame++; }
		Effect.Appear(shot_lis[current_frame]);
		Effect.Appear(description_lis[current_frame]);}

function fade_prev_in() {
		Effect.Fade(shot_lis[current_frame]);
		Effect.Fade(description_lis[current_frame]);
		if (current_frame == 0) { current_frame = end_frame; } else { current_frame--; }
		Effect.Appear(shot_lis[current_frame]);
		Effect.Appear(description_lis[current_frame]);
}

