// JavaScript Document

	var inter1;
	var inter2;
	var theBg;
	var theContent;
	var ffOpacity = 0;
	var theImage;
	var loadingMsg;
	
function showImage(img)
{
	var top;
	!document.all ? top=window.pageYOffset : top=document.documentElement.scrollTop;
	inter1 = setInterval(fadeIn,1);
	theBg = document.getElementById("fadeBG");
	theContent = document.getElementById("fadeContent");
	theImage = document.getElementById("theImage");
	loadingMsg = document.getElementById("loadingMsg");	
	theBg.style.display = "block";
	theContent.style.display = "block";
	theContent.style.top = top + "px";
	
}
function hideImage()
{
	inter2 = setInterval(fadeOut,1);
}
function fadeIn()
{
	/* IF IE */
	if(document.all)
	{
		//document.title = theBg.filters.alpha.opacity;
		if(theBg.filters.alpha.opacity < 80)
		{			
			theBg.filters.alpha.opacity += 10;
			theContent.filters.alpha.opacity += 10;
		}
		else
		{
			clearInterval(inter1);
			theContent.filters.alpha.opacity = 100;
		}
	}
	else
	{
		
		//document.title = theContent.style.opacity + " " + theContent.style.opacity;
		if(theBg.style.opacity < .8)
		{			
			ffOpacity += .1;
			theContent.style.opacity = ffOpacity;
			theBg.style.opacity = ffOpacity;
			//alert(theContent.style.opacity);
			//alert(ffOpacity);
		}
		else
		{
			clearInterval(inter1);
			theContent.style.opacity = 1;
		}/**/
	}
	
}
function fadeOut()
{
	if(document.all)
	{
		//document.title = theBg.filters.alpha.opacity;
		if(theBg.filters.alpha.opacity > 0)
		{			
			theBg.filters.alpha.opacity -= 10;
			theContent.filters.alpha.opacity -= 10;
		}
		else
		{
			clearInterval(inter2);
			theContent.filters.alpha.opacity = 0;
			theBg.style.display = "none";
			theContent.style.display = "none";
			theImage.style.display = "none";
			loadingMsg.style.display = "block";
		}
	}
	else
	{
		//document.title = theBg.style.opacity;
		if(theBg.style.opacity > 0)
		{			
			theBg.style.opacity -= .1;
			theContent.style.opacity -= .1;
		}
		else
		{
			clearInterval(inter2);
			theContent.style.opacity = 0;
			ffOpacity = 0;
			theBg.style.display = "none";
			theContent.style.display = "none";
			theImage.style.display = "none";
			loadingMsg.style.display = "block";
		}
	}
}

function swapImg(img)
{
	theImage.innerHTML="<img src='" + img +"' onload=doneLoading()>";
}
function doneLoading()
{
	theImage.style.display = "block";
	loadingMsg.style.display = "none";
}