
function submitsearch()
{
	top.location.href='/search.aspx?SearchTerm=' +document.getElementById("q").value;
}

function highlightLinks(obj) {
   var linkList = document.getElementById("primary").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {
      linkList[i].className = "";
   }
   obj.className = "current";
}

function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i<gy.length;i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}
}

function settab()
{

	if(location.pathname == "/default.aspx")
	{
		highlightLinks(document.getElementById("linkhome"));
	}
	else if(location.pathname == "/login.aspx")
	{
		highlightLinks(document.getElementById("linkhome"));
	}	
	else if(location.pathname == "/profile.aspx")
	{
		highlightLinks(document.getElementById("linkprofile"));
	}
	else if(location.pathname == "/t-gallery.aspx")
	{
		highlightLinks(document.getElementById("linkgallery"));
	}
	else if(location.pathname == "/t-portfolio.aspx")
	{
		highlightLinks(document.getElementById("linkportfolio"));
	}
	else if(location.pathname == "/t-resources.aspx")
	{
		highlightLinks(document.getElementById("linkresources"));
	}
	else if(location.pathname == "/t-about.aspx")
	{
		highlightLinks(document.getElementById("linkabout"));
	}
	else if(location.pathname.indexOf("/forums/") != -1)
	{
		highlightLinks(document.getElementById("linkforums"));
		if(location.pathname == "/forums/default.aspx" && querySt("f") == "14")
		{
			highlightLinks(document.getElementById("linkcontests"));
		}	
	}
	else
	{
		highlightLinks(document.getElementById("linkgallery"));
	}
}