//*****************************************************************************//
//	Highlight image swaps
//	Author: Michael Turnwall, Gateway, Inc
//	Created: 08.30.2005
//	Description: Used to swap images on the m280 mini-site hightlights page
//					also contains a function to determine the page filename
//	Copyright 2005 Gateway, Inc. All rights reserved.
//*****************************************************************************//

// 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("http://www.gateway.com/");
	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 "software":
			menuItem = document.getElementById("menu03");
			menuLink = menuItem.firstChild;
			menuLink.id = "here";
			break;
		case "how_to":
			menuItem = document.getElementById("menu04");
			menuLink = menuItem.firstChild;
			menuLink.id = "here";
			break;
		case "accessories":
			menuItem = document.getElementById("menu05");
			menuLink = menuItem.firstChild;
			menuLink.id = "here";
			break;
		case "reviews":
			menuItem = document.getElementById("menu06");
			menuLink = menuItem.firstChild;
			menuLink.id = "here";
			break;
		case "get_the_edge":
			menuItem = document.getElementById("menu07");
			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;
}
