// JavaScript Document
var mImages=null;
startList = function()
{
	var lEl=document.getElementById("bg");
	if (lEl) {
		var lNames=lEl.src.split("/");
		if (lEl.title == "") {
			lEl.title=_doDecode(lNames[lNames.length-1]);
		}
	}

	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
  				}
  				node.onmouseout=function() {
  					this.className=this.className.replace(" over", "");
   				}
   			}
  		}
 	}
}
window.onload=startList;

function _doSw(pElem)
{
	var lEl=document.getElementById("bg");
	var lID=pElem.id;
	lID = parseInt(lID.substr(3));
	if (lEl && pElem && mImages && mImages[lID]) {
		lEl.src=mImages[lID].src;
		var lNames=pElem.src.split("/");

		lEl.title=_doDecode(lNames[lNames.length-1]);
	}
	window.status=pElem.src;
}

function _doDecode(pName)
{
	if (pName) {
		pName = decodeURIComponent(pName);
		pName = pName.substring(0,pName.length-4);
		return pName;
	}
	return "";
}
function openAbout()
{
	location.href=location.protocol + "//" + location.host + "/index.cgi?go=about";
}

function openCV()
{
	location.href=location.protocol + "//" + location.host + "/index.cgi?go=bio";
}

function openContact()
{
	location.href=location.protocol + "//" + location.host + "/index.cgi?go=contact";
}

function openPhotos(pType)
{
	location.href=location.protocol + "//" + location.host + "/index.cgi?go=" + pType;
}


function _doImgLoad( pList )
{
	if (document.images) {
		mImages = new Object();
		var lArr = new Array();
		lArr=pList.split(/~/);
		for (i=0; i<lArr.length; i++) {
			mImages[i]=new Image();
			mImages[i].src = lArr[i];
		}
	}
}


