// multi_bucket
//List the default titles from each bucket from top to bottom.
var selectedTitles = new (Array)('0');
var numTitles = new (Array)('2');

function switchVisible(showId, hideId, active_link, inactive_link) {
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(hideId).style.display = "none";
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(showId).style.display = "block";
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(active_link).style.color = "#444";
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(inactive_link).style.color = "#666";
}

function clickMulti(bucketNum, titleNum) {
	//If this title is not already selected
	if (titleNum !=  _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0)) {
		var idNewTitle = 'multibucket' + bucketNum + '_' + titleNum;
		var idNewContent = 'content' + bucketNum + '_' + titleNum;
		var idOldTitle = 'multibucket' + bucketNum + '_' +  _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0);
		var idOldContent = 'content' + bucketNum + '_' +  _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0);
		//Hide the old content and display the new
		 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldContent).style.display = "none";
		 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewContent).style.display = "block";
		//If this is the top title
		if (titleNum == 0) {
			//Set the new title to the over state
			 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewTitle).style, 'backgroundImage', '=', ( "url(/images/bucket_title.gif)"));
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewTitle).style.backgroundColor = "#ccc9c3";
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewTitle).style.margin = "0 0 0 0";
			//If the old title was not the bottom title
			if ( _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0) !=  _proxy_jslib_handle(numTitles, (bucketNum), 0, 0) - 1) {
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.backgroundColor = "#e6e3da";
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.margin = "0 1px 1px 1px";
			}
			//Else the old title was the bottom title
			else {
				 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style, 'backgroundImage', '=', ( "url(/images/bucket_title_bot_off.gif)"));
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.backgroundColor = "#e6e3da";
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.margin = "0 0 0 0";
			}
		}
		//If this is not the bottom title
		else if (titleNum !=  _proxy_jslib_handle(numTitles, (bucketNum), 0, 0) - 1) {
			//Set the new title to the over state
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewTitle).style.backgroundColor = "#ccc9c3";
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewTitle).style.margin = "0 1px 0 1px";
			//If the old title is the top title
			if ( _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0) == 0) {
				 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style, 'backgroundImage', '=', ( "url(/images/bucket_title_off.gif)"));
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.backgroundColor = "#e6e3da";
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.margin = "0 0 1px 0";
			}
			//If the old title was not the bottom title
			else if ( _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0) !=  _proxy_jslib_handle(numTitles, (bucketNum), 0, 0) - 1) {
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.backgroundColor = "#e6e3da";
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.margin = "0 1px 1px 1px";
			}
			//Else the old title was the bottom title
			else {
				 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style, 'backgroundImage', '=', ( "url(/images/bucket_title_bot_off.gif)"));
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.backgroundColor = "#e6e3da";
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.margin = "0 0 0 0";
			}
		}
		//Else this is the bottom title
		else {
			//Set the new title to the over state
			 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewTitle).style, 'backgroundImage', '=', ( "none"));
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewTitle).style.backgroundColor = "#ccc9c3";
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idNewTitle).style.margin = "0 1px 0 1px";
			//If the old title is the top title
			if ( _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0) == 0) {
				 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style, 'backgroundImage', '=', ( "url(/images/bucket_title_off.gif)"));
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.backgroundColor = "#e6e3da";
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.margin = "0 0 1px 0";
			}
			//Else the old title was not the bottom title
			else {
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.backgroundColor = "#e6e3da";
				 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idOldTitle).style.margin = "0 1px 1px 1px";
			}
		}
	}
	 _proxy_jslib_assign('', selectedTitles, (bucketNum), '=', ( titleNum));
}

function overMulti(bucketNum, titleNum) {
	//If this title is not already selected
	if (titleNum !=  _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0)) {
		var id = 'multibucket' + bucketNum + '_' + titleNum;
		//If this is the top title
		if (titleNum == 0) {
			 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style, 'backgroundImage', '=', ( "url(/images/bucket_title_on.gif)"));
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style.backgroundColor = "#d7d5ce";
		}
		//If this is not the bottom title
		else if (titleNum !=  _proxy_jslib_handle(numTitles, (bucketNum), 0, 0) - 1) {
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style.backgroundColor = "#d7d5ce";
		}
		//Else this is the bottom title
		else {
			 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style, 'backgroundImage', '=', ( "url(/images/bucket_title_bot_on.gif)"));
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style.backgroundColor = "#d7d5ce";
		}
	}
}

function offMulti(bucketNum, titleNum) {
	//If this title is not already selected
	if (titleNum !=  _proxy_jslib_handle(selectedTitles, (bucketNum), 0, 0)) {
		var id = 'multibucket' + bucketNum + '_' + titleNum;
		if (titleNum == 0) {
			 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style, 'backgroundImage', '=', ( "url(/images/bucket_title_off.gif)"));
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style.backgroundColor = "#e6e3da";
		}
		//If this is not the bottom title
		else if (titleNum !=  _proxy_jslib_handle(numTitles, (bucketNum), 0, 0) - 1) {
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style.backgroundColor = "#e6e3da";
		}
		//Else if this is the bottom title
		else {
			 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style, 'backgroundImage', '=', ( "url(/images/bucket_title_bot_off.gif)"));
			 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id).style.backgroundColor = "#e6e3da";
		}
	}
}

function displayArchiveByYear(year) {
   $(curYear).style.display = 'none';
   $( _proxy_jslib_handle(year, 'value', '', 0, 0)).style.display = 'block';
   curYear =  _proxy_jslib_handle(year, 'value', '', 0, 0);
}
 ;
_proxy_jslib_flush_write_buffers() ;