
// determines the page a user is on to highlight the correct tab
function navLocation()
{
	var here = location.pathname;
	var extension = here.indexOf(".") - 1;
	var filename = here.lastIndexOf("/");
	var strLen = extension - filename;
	var loc = here.substr(filename + 1, strLen);
	
	switch(loc)
	{
		case "index":
		case "":
			menuItem = document.getElementById("menu01");
			menuLink = menuItem.firstChild;
			menuLink.id = "here";
			var navBar = document.getElementById("navBar");
			navBar.style.marginTop = "0";
			break;
		case "features":
			menuItem = document.getElementById("menu02");
			menuLink = menuItem.firstChild;
			menuLink.id = "here";
			break;
		case "compare_notebooks":
			menuItem = document.getElementById("menu03");
			menuLink = menuItem.firstChild;
			menuLink.id = "here";
			break;
		case "compare_desktops":
			menuItem = document.getElementById("menu03");
			menuLink = menuItem.firstChild;
			menuLink.id = "here";
			break;			
	}
	
}

// open new/dw function
function openWin(url, width, height, scrollable, resizeable)
{
	var win;
	var windowName;
	var params;
	windowName  = "buttons";
	params = "toolbar=0,";
	params += "location=0,";
	params += "directories=0,";
	params += "status=0,";
	params += "menubar=0,";
	params += "scrollbars=" + scrollable + ",";
	params += "resizable=" + resizeable + ",";
	params += "top=50,";
	params += "left=50,";
	params += "width="+width+",";
	params += "height="+height;
	win = window.open(url, windowName, params);
}

// functions used to create dynamic links
function analink(a,tags)
{
	a.href += ((a.href.indexOf('?')>0)?"&":"?") + tags;
}
function dynLink(a,tags)
{
	a.href += ((a.href.indexOf('?')>0)?"&":"?") + tags;
}