var pageNav="project";
function loadPage() {
	enterPage(pageNav);
}
function enterPage(id) {
	var navDiv = document.getElementById(id);
	
	var parentId = navDiv.getAttribute("parentId");
	if(parentId !=null) {
		navDiv.className="subNavOn";
		parentNavDiv = document.getElementById(parentId) 
		parentNavDiv.className="navOn";
		changeTextColor(parentNavDiv,"#FFFFFF");
		changeTextColor(navDiv,"#FFFFFF");
		var subNavCounter=1;
		while(navDiv != null) {
		  navDiv.style.display="block";
			navDiv=document.getElementById(parentId+subNavCounter);
			subNavCounter++;
		}
  }else {	
		navDiv.className="navOn";
	}
}
function rollOver(id) {
	if(id != pageNav) {
		var navDiv= document.getElementById(id);
		
		if(navDiv.parentId != id) {
			navDiv.className='subNavOn';
		}else  {
			navDiv.className='navOn';
		}
	  changeTextColor(navDiv,'#FFFFFF');
	}
}
function changeTextColor (navDiv, color) {
		for(var i=0;i<navDiv.childNodes.length;i++) {
			if (navDiv.childNodes[i].nodeName=="A")
				navDiv.childNodes[i].style.color=color;
		}
}
function rollOut(id) {
	var navDiv= document.getElementById(id);
	var pageNavDiv = document.getElementById(pageNav);
	if(pageNavDiv !=null) {
		var pageNavParentId = pageNavDiv.parentId;
		
		if(id != pageNav && id != pageNavParentId) {
				if(navDiv.id != navDiv.parentId) {
					navDiv.className='subNavOff';
					changeTextColor(navDiv,'#198dc9');
				} else { 
					navDiv.className="navOff";
					changeTextColor(navDiv,'#4468AE');
				}
		}
	} else {
		navDiv.className="navOff";
		changeTextColor(navDiv,'#4468AE');
	}
}
function openWindow(hrefTag) {
	window.location="";
	window.open(hrefTag.href,"new","resizable");
}
var memberThatIsOpen = null;
function openMember(memberId) {
	if(memberThatIsOpen != null) {
		memberThatIsOpen.style.display = "none"
	}
	memberThatIsOpen = document.getElementById(memberId);
	memberThatIsOpen.style.display = "block";
}
var photoThatIsOpen = "photo1";
function openPhoto(direction) {
	var photoDiv;
	var photoId = photoThatIsOpen.substring(photoThatIsOpen.length-1,photoThatIsOpen.length);
	if(direction=="next")
		photoId=parseInt(photoId)+1;
	if(direction=="back")
		photoId=parseInt(photoId)-1;
	photoId = photoThatIsOpen.substring(0,photoThatIsOpen.length-1)+photoId;
  photoDiv = document.getElementById(photoId);
	if(photoDiv != null) {
		var oldPhotoDiv = document.getElementById(photoThatIsOpen);
		oldPhotoDiv.style.display="none";
		photoDiv.style.display = "block";
		photoThatIsOpen=photoId;
	}

	
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}