function Go(url)
{
	window.location.href = url;
}

function PreloadImage(imgFile)
{
	var imgToPreload = new Image();
	imgToPreload = imgFile;
}

function FlipTab(tabElem, OnOrOff)
{
	if (currentTab != tabElem.id)
	{
		if (OnOrOff == 1)
			tabElem.className = "mmhide_NavigationBarTab mmhide_SelectedTab";
		else
			tabElem.className = "mmhide_NavigationBarTab mmhide_UnselectedTab";
	}
}

function HighlightTab()
{
	cssClass = 'mmhide_NavigationBarTab mmhide_SelectedTab';

	if (typeof currentTab == 'undefined') currentTab = '';
	
	switch(currentTab)
	{
		case "home":
			document.getElementById(currentTab).className = cssClass;
			break;
		case "biography":
			document.getElementById(currentTab).className = cssClass;
			break;
		case "publications":
			document.getElementById(currentTab).className = cssClass;
			break;
		case "docs_photos":
			document.getElementById(currentTab).className = cssClass;
			break;
		case "contact":
			document.getElementById(currentTab).className = cssClass;
			break;
		default:
			break;
	}
}

function ParseURLCurrentFile(url)
{
	return url.substring(url.lastIndexOf('/') + 1).toLowerCase();
}

function ParseURLCurrentLanguage(url)
{
	currentFile = ParseURLCurrentFile(url);
	return currentFile.substr(currentFile.lastIndexOf('.') - 2, 2);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function DefaultPageSelector(cmbElem)
{
	hrefFile = ParseURLCurrentFile(window.location.href);
	hrefFileArr = hrefFile.split('?');
	hrefFile = hrefFileArr[0];

	cmbElemLength = cmbElem.options.length;

	i = 0;
	notFound = true;
	
	while (notFound && i < cmbElemLength)
	{
		if (cmbElem.options[i].value == hrefFile)
		{
			cmbElem.selectedIndex = i;
			notFound = false;
		}
		i++;
	}
}

function ChangePage(direction, indexStart, indexFinish)
{
	hrefFile = ParseURLCurrentFile(window.location.href);
	pageNum = hrefFile.substring(indexStart, indexFinish);
	pageNumInt = parseInt(pageNum, 10)
	
	if (direction == 'next')
		pageNumInt++;
	else
		pageNumInt--;
	
	if (pageNumInt < 10) pageNumInt = '0' + pageNumInt;
	
	url = hrefFile.replace(pageNum, pageNumInt);
	window.location.href = url;
}

function FlipGlowIcon(imgId, OnOrOff, PathExt) {

if (OnOrOff == 1)
		document.getElementById(imgId).src = PathExt + '../images/section_icon_border_134x134.gif';
	else
		document.getElementById(imgId).src = PathExt + '../images/section_icon_no_border_134x134.gif';
}

function ParseFilenameDate(filename) {
	return filename.substr(-14, 10);
}
