function setPage(pageType, options)
{
	switch(pageType)
	{
		case 0: // Dashboard
			break;
		case 1: // Featured
			
			break;
	}
}
function setVisiblePath(path)
{
	if(!preloadComplete)
		return;
	if(!path)
		path = window.location.pathname + window.location.search;
	if(path.length == 0)
		return;
	if(path.substring(0, 1) != "/")
		return;
	switch(true)
	{
		case (path.indexOf("/header.asp") == 0):
		case (path.indexOf("/folders.asp") == 0):
		case (path.indexOf("/footer.asp") == 0):
			return;
		case (path.indexOf("/dashboard.asp") == 0):
			selectTab(-1);
			break;
		case (
			(path.indexOf("/listarticles.asp") == 0)
			&&
			(path.indexOf("featured=1") > -1)
		):
			selectTab(0);
			break;
		case (
			(path.indexOf("/listarticles.asp") == 0)
			&&
			(path.indexOf("recent=1") > -1)
		):
			selectTab(1);
			break;
		case (path.indexOf("/search.asp") == 0):
			selectTab(2);
			break;
		case (path.indexOf("/article2.asp") == 0):
		case (path.indexOf("/article.asp") == 0):
			selectTab(-1);
			break;
		case (path.indexOf("/signup/") == 0):
			selectTab(3);
			break;
	}
	var newPath = top.location.pathname + top.location.search + "#" + path;
	var currentPath = top.location.href.replace(top.location.protocol + "//" + top.location.hostname, "");
	if(newPath == currentPath)
		return;
	if(!$.browser.webkit)
		top.location.hash = path;
}
var timeoutID = null;
function trySelectTab(index)
{
	if(timeoutID != null)
		clearTimeout(timeoutID);
	var headerFrame = this.frames["header"];
	if(headerFrame != null || headerFrame.window != null || !headerFrame.window.selectTab)
		return headerFrame.window.selectTab(index);
	timeoutID = setTimeout(trySelectTab, 100, index)
	return false;
}
function selectTab(index)
{
	if(index < -1)
		index = -1;
	var $topNav = $("DIV#topNav");
	return trySelectTab(index);
}
var preloadComplete = false;
if($)
{
	$(document).ready(function()
	{
		var currentHash = window.location.hash;
		if(currentHash == "#")
			currentHash = "";
		if(currentHash.length > 0 && currentHash.substring(0, 1) == "#")
			currentHash = currentHash.substring(1);
		if(currentHash.length > 0)
			preloadCompleteStub(currentHash);
		else
			preloadComplete = true;
	});
}
function preloadCompleteStub(newLocation)
{
	if(this.frames == undefined)
	{
		setTimeout(preloadCompleteStub, 100, newLocation);
		return;
	}
	this.frames["mainContent"].window.location.replace(newLocation);
	preloadComplete = true;
}
