// JavaScript Document

// This sets the image we will restore things to to the file of our choosing
// this relies on the fact that MM_SwapImage will not set oSrc if it is already set
function SetSwapImage(stImgName, stImgFile) {
	var x;
	if ((x=MM_findObj(stImgName))!=null)
	   {
		   x.oSrc = stImgFile;
	   }
	   
}

function RestoreImage(stImgName, stImgFile, wind) {
	SetSwapImage(stImgName, stImgFile);
	setTimeout("ChangeImage('"+stImgName+"', '"+stImgFile+"')", 3500);
}

function ChangeImage(stImgName, stImgFile) {
	var x;
	if ((x = MM_findObj(stImgName)) != null) {
		if (!FInSwapImageList(x)) {
			x.src = stImgFile;
		}
	}
}

function FInSwapImageList(objFind) {
 	var i,x,a=document.MM_sr; 
	if (a == null) return false;
   	for(i=0; a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		if (x == objFind) {
			return true;
		}
	
	return false;
}

function AddBackground() {
	var elem;
	var elemBody;
	
	elem = document.getElementById("screencss");
	if (elem != null) {
		if (elem.getAttribute("href") != "phe-print.css") {
			elemBody = document.body;
			elemBody.style.backgroundImage = "url(i/background-interior.gif)";
			elemBody.style.backgroundRepeat = "repeat-x";
		}
	}
}

function setStyleSheetState(id,enabled) 
{
	var sheet = document.getElementById(id);
	if(sheet)
		sheet.disabled = (!enabled);
}

