window.onerror = function() { return false; }
window.defaultStatus ="";
// that sets the status bar to "" and disables error reporting.

var imgLocked = null;			// used to detect the state of a button when clicked
var imgPreviousLocked = null;
var allImagesLoaded = false;
var intMenuMax = 6;				//other functions need to know how many menu items there are
var intHomePage = 0;

function imageLoad()
// Used to precache images; also used for image rollovers
{

	imgSidelink1On = new Image(115,45);			imgSidelink1On.src="/images/sidelink_1_on.gif";	//bio
	imgSidelink2On = new Image(115,43);			imgSidelink2On.src="/images/sidelink_2_on.gif";	//resume
	imgSidelink3On = new Image(115,36);			imgSidelink3On.src="/images/sidelink_3_on.gif";	//web portfolio
	imgSidelink4On = new Image(115,41);			imgSidelink4On.src="/images/sidelink_4_on.gif";	//in print
	imgSidelink5On = new Image(115,38);			imgSidelink5On.src="/images/sidelink_5_on.gif";	//digital art
	imgSidelink6On = new Image(115,40);			imgSidelink6On.src="/images/sidelink_6_on.gif";	//photogtraphy
	
	imgSidelink1Off = new Image(115,45);		imgSidelink1Off.src="/images/sidelink_1_off.gif";	//bio
	imgSidelink2Off = new Image(115,43);		imgSidelink2Off.src="/images/sidelink_2_off.gif";	//resume
	imgSidelink3Off = new Image(115,36);		imgSidelink3Off.src="/images/sidelink_3_off.gif";	//web portfolio
	imgSidelink4Off = new Image(115,41);		imgSidelink4Off.src="/images/sidelink_4_off.gif";	//in print
	imgSidelink5Off = new Image(115,38);		imgSidelink5Off.src="/images/sidelink_5_off.gif";	//digital art
	imgSidelink6Off = new Image(115,40);		imgSidelink6Off.src="/images/sidelink_6_off.gif";	//photogtraphy
	
	
	imgBottomlink1On = new Image(75,31);		imgBottomlink1On.src="/images/bottomlink_home_on.gif";			//home
	imgBottomlink2On = new Image(86,31);		imgBottomlink2On.src="/images/bottomlink_contact_on.gif";		//contact
	imgBottomlink3On = new Image(89,31);		imgBottomlink3On.src="/images/bottomlink_signup_on.gif";			//sign up
	imgBottomlink4On = new Image(80,31);		imgBottomlink4On.src="/images/bottomlink_about_on.gif";			//about
	
	imgBottomlink1Off = new Image(75,31);		imgBottomlink1Off.src="/images/bottomlink_home_off.gif";			//home
	imgBottomlink2Off = new Image(86,31);		imgBottomlink2Off.src="/images/bottomlink_contact_off.gif";		//contact
	imgBottomlink3Off = new Image(89,31);		imgBottomlink3Off.src="/images/bottomlink_signup_off.gif";		//sign up
	imgBottomlink4Off = new Image(80,31);		imgBottomlink4Off.src="/images/bottomlink_about_off.gif";		//about
	
	imgEyeOn = new Image(146,148);				imgEyeOn.src="/images/eyelid_closed.gif";
	imgEyeHalf = new Image(145,148);			imgEyeHalf.src="/images/eyelid_halfclosed.gif";
	imgEyeOff = new Image(146,148);				imgEyeOff.src="/images/spacer.gif";
	

	return (allImagesLoaded = true);
}

function rollOver(imgID,imgName) 
{ 
	if (document.images) 
	{ 
		document.images[imgID].src = eval(imgName + '.src'); 
	} 
} 





function toggleMenu(imgName) 
{
	//Netscape cannot get the image source, so have to pass image declaration to funciton
	
//	var eSrc = window.event.srcElement;		//setup to get name of object
//	var eCurrentSrc = eSrc.id				//get the name of the object that triggered this function
	
	var eCurrentSrc = imgName;

	
	if(allImagesLoaded) //make sure all images are cached first
	{
		if(imgLocked != eCurrentSrc) //do not switch image if already on that section
		{
			if(document[eCurrentSrc].src == eval(eCurrentSrc + "On.src")) //if image is already on
			{
				document[eCurrentSrc].src = eval(eCurrentSrc + "Off.src"); //turn it off
			}
			else
			{
				document[eCurrentSrc].src = eval(eCurrentSrc + "On.src");	//turn it on
			}
		}
	}
}




function lockImage()
//locks the current menu button 
//this function can be called from another funtion that will forward user to link and unlock image
//need to toggle all other images back

//if Netscape has a problem with getting the current element, then may have to alter functions to have items specify "this.name" to the function directly for compatibility
//using the window.event.srcElement is much slicker and more compact.

{

	var eSrc = window.event.srcElement;
	var eCurrentSrc = eSrc.id;				//get the name of object that triggered this function
	
	if(allImagesLoaded)
	{
		imgLocked = eCurrentSrc;
		for(i=1; i<intMenuMax; i++)	//turn off all menu items
		{
			imageOff("imgSidelink" + i);
		}
		imageOn(eCurrentSrc);			//turn on only the locked menu item
	}

}



function imageOn(imgName)
{
	document[imgName].src = eval(imgName + "On.src");
}

function imageOff(imgName)
{
	document[imgName].src = eval(imgName + "Off.src");
}




function toggleDiv(strDiv)
{
	//var strArrowId = strDiv.replace("div","divArrow");
	
	
	if(document.all)
	{
		if(document.all(strDiv).style.display == "none")
		{
			document.all(strDiv).style.display = "";
		}
		else
		{
			document.all(strDiv).style.display = "none";
		}
	}
	else if(document.getElementById) //netscape compatible
	{
		var obj = document.getElementById(strDiv);
		
		if(obj.style.display == "none")
		{
			obj.style.display = "";
		}
		else
		{
			obj.style.display = "none";
		}
	}
}


function jumpto(link)
{
	document.location = link;
}





function openWindow(whatpage,windowname, nWidth, nHeight)
	{
	window.open (whatpage, windowname, "resizable=yes, width=" + nWidth + ", height=" + nHeight + ", scrollbars=yes, status=no, toolbar=no, menubar=no")
	//eval("top.window." + windowname + ".focus()")
	}



function openPhoto(whatpage, orientation)
	{
		if(orientation == "0") //vertical
		{
			window.open (whatpage, "winPhoto", "resizable=yes, width=400, height=500, scrollbars=yes, status=no, toolbar=no, menubar=no")
		}
		else //horizontal
		{
			window.open (whatpage, "winPhoto", "resizable=yes, width=500, height=400, scrollbars=yes, status=no, toolbar=no, menubar=no")
		}
	//eval("top.window." + windowname + ".focus()")
	}
