// JavaScript Document
/*imageViewer & imageViewer_smallscreen.htm functions
if (screen.availHeight < 700)
{
	window.location.replace("imageViewer_smallscreen.htm");
}*/
function hideImageLoadingImage()
{
	if (document.all)
	{
		document.all.imageLoadingAnimation.style.visibility = "hidden";
	}
}

function scrollThumbnailUp_onclick()
{
	var thumbnailFrame = window.frames["thumbnailFrame"];
	thumbnailFrame.scrollBy(0,-95);
}

function scrollThumbnailDown_onclick()
{
	var thumbnailFrame = window.frames["thumbnailFrame"];
	thumbnailFrame.scrollBy(0,95);
}

function loadNewMainImage(imgSrc)
{
	var mainImgFrame = window.frames["mainImageFrame"];
	if (document.all)
	{
		document.all.imageLoadingAnimation.style.visibility = "visible";
	}
	//mainImgFrame.resize(imgSrc);
	mainImgFrame.location.href = imgSrc;
	
}

/*CategoryIndex.htm functions*/
function OnMouseOverHeading(thisTag)
{
thisTag.style.textDecoration = 'underline';
thisTag.style.color = 'gold';
}
function OnMouseOutHeading(thisTag)
{
thisTag.style.textDecoration = 'none';
thisTag.style.color = 'darkorange';
}
function switchDisplay(tagId, branchImage)
{
	var tagToSwitch = getTagById(tagId);
	var imgToSwitch = getTagById(branchImage);
	if (tagToSwitch.style.display == " " || tagToSwitch.style.display == "none")
	{
		tagToSwitch.style.display = "block";
		imgToSwitch.src = "minus.gif";
		if (document.all)
		{
			tagToSwitch.scrollIntoView();
		}
	}
	else
	{
		tagToSwitch.style.display = "none";
		imgToSwitch.src = "plus.gif";
	}
}

function loadNewImageCategory(menuElementClicked, categoryURL)
{
	parent.loadNewCategoryThumbnails(categoryURL);
	if (typeof(previousMenuElementClicked) == "object")
	{
		previousMenuElementClicked.style.backgroundColor = "black";
	}
	
	previousMenuElementClicked = menuElementClicked;
	previousMenuElementClicked.style.backgroundColor = "gray";
}

function getTagById(tagId)
{
	var selectedTag;
	if (document.all)
	{
		selectedTag = document.all.item(tagId);
	}
	else
	{
		selectedTag = document.getElementById(tagId);
	}
	
	return selectedTag;
}

function loadNewCategoryThumbnails(categorySrc)
{
	var mainImgFrame = window.frames["thumbnailFrame"];
	mainImgFrame.location.href = categorySrc;
}

function resize(source)
{
	var imgElement = document.getElementById(source);
	alert(imgElement);
	imgElement.style.height = '240px';
}