function selectNavItem(page) {
	
	if (!page || page == null) {
		// get the page url
		var url = document.location.href;
		
		// pull out the page name
		var pieces = url.split('/');
		var page = pieces[pieces.length - 1];
		var section = page.split('.');
		var page = section[0];
	}
	
	// special case for R & D section because the page name is 'research'
	if (page == "research") { page = "r \&amp; d"; };
	
	// get all the list items in the main nav
	var nav = document.getElementById("nav");
	var lis = nav.getElementsByTagName("li");
	
	// select current nav link
	for (var i = 0; i < lis.length; i++) {
		
		var li = lis[i];
		var liText = li.innerHTML;

//window.alert("||" + liText.toLowerCase() + "||" + page + "||")

//		if (liText.toLowerCase() == page) {
		if (liText.toLowerCase().indexOf(page,0) > -1) {
			//li.style.backgroundImage = 'url(images/nav-selected-bg.png)';
			//li.style.backgroundRepeat = 'repeat-x';

			li.style.fontWeight = "bold";
			//li.style.fontSize = "8pt";
			//li.style.letterSpacing = ".5px";
			li.style.fontVariant = "small-caps";
			li.style.color = "#FFF";
			li.style.letterSpacing = ".5px";
		}
	}
	
}

function goTo(li,page) {
	// go to page
	document.location = page +".php";
	
	/*// get nav list items
	var nav = document.getElementById("nav");
	var lis = nav.getElementsByTagName("li");
	
	// select current nav link and deselect others
	for (var i = 0; i < lis.length; i++) {
		var li = lis[i];
		var liText = li.innerHTML;
		//window.alert(liText);
		if (liText.toLowerCase() == page) {
			li.style.className = "selected";
		}
		else {
			li.style.className = "";
		}
	}*/
	

}


/**
 * nHighlight(li)
 *
 * Used in header main navigation.  On mouseover on a list item, shows the
 * hover background. 
 * 
 * Use with nUnhighlight(li) on mouseout.
 *
 * @param li	list item object next to which bullet should be shown
 */
function nHighlight(li) {
	
	var bg = li.style.backgroundImage;

	// check the background image of the list item. if not selected, highlight. else, do nothing.
	if (bg.indexOf("selected",0) == -1) {
		//li.style.backgroundImage = "url(images/nav-hover-bg.png)";
		//li.style.backgroundRepeat = "repeat-x";	
		
		//li.style.backgroundColor = "black";
	}
}

/**
 * nUnhighlight(li)
 *
 * Used in header main navigation.  On mouseout on a list item, removes the
 * hover background.
 * 
 * Use with nHighlight(li) on mouseover.
 *
 * @param li	list item object next to which bullet should be hidden
 */
function nUnhighlight(li) {
	
	var bg = li.style.backgroundImage;
	
	// check the background image of the list item. if not selected, highlight. else, do nothing.
	if (bg.indexOf("selected",0) == -1) {
		//li.style.backgroundImage = "";
		//li.style.backgroundRepeat = "";
		
		//li.style.backgroundColor = "";
	}
	
	
}


/**
 * sbHighlight(li)
 *
 * Used in sidebar navigation.  On mouseover on a list item, shows the
 * green bullet.  If list item is current selection, do nothing.
 *
 * list item structure as follows:
 *
 *    <li onmouseover="highlight(this)" onmouseout="unhighlight(this)">
 *       <img src="images/bullet-blue.png" alt="blue bullet" />
 *       <span>History</span>
 *    </li>
 * 
 * Use with sbUnhighlight(li) on mouseout.
 *
 * @param li	list item object next to which bullet should be shown
 */
function sbHighlight(li) {
	
	// structure is static. just take the first img element.
	var img = li.getElementsByTagName("img")[0];

	// check the image src. if gray, highlight. else, do nothing.
	if (img.src.indexOf("bullet-gray",0) > -1) {
		img.src = "images/bullet-green.png";	
	}
	
}

/**
 * sbUnhighlight(li)
 *
 * Used in sidebar navigation.  On mouseout on a list item, hides the
 * green bullet.  If list item is current selection, do nothing.
 *
 * list item structure as follows:
 *
 *    <li onmouseover="highlight(this)" onmouseout="unhighlight(this)">
 *       <img src="images/bullet-green.png" alt="blue bullet" />
 *       <span>History</span>
 *    </li>
 * 
 * Use with sbHighlight(li) on mouseover.
 *
 * @param li	list item object next to which bullet should be hidden
 */
function sbUnhighlight(li) {
	
	// structure is static. just take the first img element.
	var img = li.getElementsByTagName("img")[0];

	// check the image src. if green, change bullet to gray. else, do nothing.
	if (img.src.indexOf("bullet-green",0) > -1) {
		img.src = "images/bullet-gray.png";	
	}
}

/**
 * lsbHighlight(li)
 *
 * Used in sidebar navigation.  On mouseover on a list item, shows the
 * green bullet.  If list item is current selection, do nothing.
 *
 * list item structure as follows:
 *
 *    <li onmouseover="lsbHighlight(this)" onmouseout="lsbUnhighlight(this)">
 *       <img src="images/bullet-blue.png" alt="blue bullet" />
 *       <span>History</span>
 *    </li>
 * 
 * Use with lsbUnhighlight(li) on mouseout.
 *
 * @param li	list item object next to which bullet should be shown
 */
function lsbHighlight(li) {
	
	// structure is static. just take the first img element.
	var img = li.getElementsByTagName("img")[0];

	// check the image src. if gray, highlight. else, do nothing.
	if (img.src.indexOf("bullet-ltgray",0) > -1) {
		img.src = "images/bullet-green.png";	
	}
	
}

/**
 * lsbUnhighlight(li)
 *
 * Used in sidebar navigation.  On mouseout on a list item, hides the
 * green bullet.  If list item is current selection, do nothing.
 *
 * list item structure as follows:
 *
 *    <li onmouseover="lsbHighlight(this)" onmouseout="lsbUnhighlight(this)">
 *       <img src="images/bullet-green.png" alt="blue bullet" />
 *       <span>History</span>
 *    </li>
 * 
 * Use with lsbHighlight(li) on mouseover.
 *
 * @param li	list item object next to which bullet should be hidden
 */
function lsbUnhighlight(li) {
	
	// structure is static. just take the first img element.
	var img = li.getElementsByTagName("img")[0];

	// check the image src. if green, change bullet to gray. else, do nothing.
	if (img.src.indexOf("bullet-green",0) > -1) {
		img.src = "images/bullet-ltgray.png";	
	}
}

function lsbSelect(li,name) {
	var ul = li.parentNode;	
	var lis = ul.getElementsByTagName('li');
	
	// deselect all
	for (var i = 0; i < lis.length; i++) {
		var cLi = lis[i];
		
		var img = cLi.getElementsByTagName("img")[0];
		img.src = "images/bullet-ltgray.png";
	}
	
	// select current
	var img = li.getElementsByTagName("img")[0];
	img.src = "images/bullet-blue.png";
	
	selectBio(name);
}

function selectBio(name) {
	var bios = ['pallabi','marc','jai','anil','paul'];
	
	
	if (name == "onload") {
		var url = document.location.href;	
		var pieces = url.split("#");
		name = pieces[pieces.length - 1];
	
	}
	
	// hide all
	for (var i = 0; i < bios.length; i++) {
		
		var bio = document.getElementById(bios[i]);	
		bio.style.display = "none";
	
		if (bios[i] == name) {
			bio.style.display = "block";	
		}
	}

}



