//function handles more efficient Swapping and restoring images
//params:
//	obj - top-level element containing image - will traverse to image element
//	imgId - optional, either image name or index - default is 0
//	newImgSrc - optional, new image src value.  If omitted tries to restore last image
// Ex)
//	SwapImageEx(this,'purpleBtn','Images/purpleButton2') - swaps the purpleBtn IMG elements image with "Images/purpleButton2"
//	SwapImageEx(this) - restores first IMG src to original value
function SwapImageEx(obj,imgId,newImgSrc) 
{
	var retval=0;
	if(typeof(obj) == "string")
		obj=GetElementFromPath(obj)

	if(!imgId)
		imgId=0

	if(obj && typeof(obj)=="object")
	{
		var imgs=obj.getElementsByTagName("IMG");
		var imgObj,lastImgSrc=null;

		if(imgs && imgs[imgId])
			imgObj=imgs[imgId]
		else if(obj.hasChildNodes())
		{
			for(var i=0;i<obj.childNodes.length;i++)
			{
				retval=SwapImageEx(obj.childNodes[i],imgId,newImgSrc);
				if(retval)
					break;
			}
		}

		if(!retval && imgObj)
		{
			if(newImgSrc)
			{
				if(imgObj.getAttribute("src")!=newImgSrc)
				{
					imgObj.lastImgSrc=imgObj.getAttribute("src");
					imgObj.setAttribute("src",newImgSrc);
				}
			}
			else if(imgObj.lastImgSrc)
			{
				imgObj.setAttribute("src",imgObj.lastImgSrc);
				imgObj.lastImgSrc=null;
			}		
				
			retval=1;
		}
	}

	return retval;
}


function WriteMenu()
{
    
	document.write("Home | <a href='blah.html'>State Championship Plaque</a> | <a href='blah.html'></a>");
}