var sectionImageOff = "";		// should never be blank if working correctly
var sectionImageOn = "";		// should never be blank if working correctly

function initSectionSettings (sectionImage, sectionLink, defaultSection) {
	var docLocation = window.location.href;
	var sectionImageAlt = "";		// should never be blank
	var sectionTargetLink = "";		// should never be blank
	
	if (-1 == docLocation.indexOf('from=')) 
	{
		docLocation = defaultSection;
	}

	if(document.images)
	{
		switch(true)
		{
			case (-1 < docLocation.indexOf('from=Periodicals')):
				sectionImageOff = "images/PeriodicalsSectionButton.gif";
				sectionImageOn = "images/PeriodicalsSectionButton-over.gif";
				sectionImageAlt = "Periodicals and More";
				sectionTargetLink = "PeriodicalsAndMore.html";
				break;

			case (-1 < docLocation.indexOf('from=Books')):
				sectionImageOff = "images/BooksSectionButton.gif";
				sectionImageOn = "images/BooksSectionButton-over.gif";
				sectionImageAlt = "Books and More";
				sectionTargetLink = "BooksAndMore.html";
				break;

			case (-1 < docLocation.indexOf('from=ElectronicSources')):
				sectionImageOff = "images/ElectronicSourcesSectionButton.gif";
				sectionImageOn = "images/ElectronicSourcesSectionButton-over.gif";
				sectionImageAlt = "Electronic Sources";
				sectionTargetLink = "ElectronicSources.html";
				break;

			case (-1 < docLocation.indexOf('from=CourseResources')):
				sectionImageOff = "images/CourseResourcesSectionButton.gif";
				sectionImageOn = "images/CourseResourcesSectionButton-over.gif";
				sectionImageAlt = "Course Resources";
				sectionTargetLink = "CourseResources.html";
				break;

			case (-1 < docLocation.indexOf('from=AskUs')):
				sectionImageOff = "images/AskUsSectionButton.gif";
				sectionImageOn = "images/AskUsSectionButton-over.gif";
				sectionImageAlt = "Ask Us";
				sectionTargetLink = "AskUs.html";
				break;

			case (-1 < docLocation.indexOf('from=LibraryPolicies')):
				sectionImageOff = "images/PoliciesSectionButton.gif";
				sectionImageOn = "images/PoliciesSectionButton-over.gif";
				sectionImageAlt = "Library Policies";
				sectionTargetLink = "LibraryPolicies.html";
				break;

			case (-1 < docLocation.indexOf('from=Research')):
				sectionImageOff = "images/ResearchSectionButton.gif";
				sectionImageOn = "images/ResearchSectionButton-over.gif";
				sectionImageAlt = "Research and More";
				sectionTargetLink = "ResearchAndMore.html";
				break;

			default:
				break;
		}

		// set initial image, tool tip, and link target
		sectionImage.src = sectionImageOff;
		sectionImage.alt = sectionImageAlt;
		sectionLink.href = sectionTargetLink;
	}
}

