// JavaScript functions for Darkness and Light Index Galleries

var prevBwSepVal_i;

function initialise_index_gallery() {
//	lowResScreenRedirector();  NO LONGER NEEDED 16/10/06
	var selOption = document.index_options_form.bw_sepia_i.selectedIndex;
	prevBwSepVal_i = document.index_options_form.bw_sepia_i.options[selOption].text;
}

function index_gallery_quicklaunch() {
	// Process quicklaunch gallery choices from the index gallery pages
	var selLocOpt = document.gallery_quicklaunch_form.location.selectedIndex;
	var selSubjOpt = document.gallery_quicklaunch_form.subject.selectedIndex;
	if ( selLocOpt == 0 && selSubjOpt == 0 ) {
		// Both at their default "choose-location" values - complain
		alert( "Please choose a location or subject" );
	}
	else {
		document.gallery_quicklaunch_form.submit();
	}
}

function index_gallery_options_form() {
	// Process the submission of the options bar form on index gallery pages
	var selOption = document.index_options_form.bw_sepia_i.selectedIndex;
	var bwSepVal_i = document.index_options_form.bw_sepia_i.options[selOption].text;
	if ( bwSepVal_i == prevBwSepVal_i ) 
	{
		// Toning option not changed - something else has, so reset the pager
		document.index_options_form.pgi.value = 1;
	}
	document.index_options_form.submit();
}

