function netTrekkerLinkFunction(somePerm)
{
	var newLocation = GetNetTrekkerLinkInfo();
	var searchWord = document.getElementById("ntSearch").value;
	var mainSearchWord = GetNtSearchValue();
	var schoolType = GetNtSchoolType();
	var categoryType = "";
	var referenceType = "";
	
	switch(schoolType)
	{
		case "elementary":
			categoryType = "E0";
			referenceType = "_e";
		break;
		case "middle":
			categoryType = "M0";
			referenceType = "_m";
		break;
		case "high":
			categoryType = "X0";
			referenceType = "";
		break;
	}
	
	switch(somePerm)
	{
		case "general":
			if(searchWord == "")
			{
				if(mainSearchWord == "")
				{
					newLocation += "/subject/";
				}
				else
				{
					newLocation += "/results/?keyword=" + mainSearchWord + "&ctgry_id="+ categoryType;
				}
			}
			else
			{
				newLocation += "/results/?keyword=" + searchWord + "&ctgry_id="+ categoryType;
			}	
		break;
		case "timeline":
			if(searchWord == "")
			{
				newLocation += "/route.epl?timeline=1";
			}
			else
			{
				newLocation += "/results/?keyword=" + searchWord + "&ctgry_id="+ categoryType;
			}	
		break;
		case "famousPerson":
			if(searchWord == "")
			{
				newLocation += "/route.epl?search_person=1";
			}
			else
			{
				newLocation += "/famous/?keyword=" + searchWord + "&ctgry_id="+ categoryType;
			}
		break;
		case "imageSearch":
			if(searchWord == "")
			{
				newLocation += "/isearch/search.epl?search_image=1";
			}
			else
			{
				newLocation += "/isearch/?keyword=" + searchWord + "&ctgry_id="+ categoryType;
			}
		break;
		case "references":
			if(searchWord == "")
			{
				newLocation += "/subject/reference" + referenceType + ".epl";
			}
			else
			{
				newLocation += "/results/?keyword=" + searchWord + "&ctgty_id="+ categoryType;
			}
		break;
		case "teacherTools":
			if(searchWord == "")
			{
				newLocation += "/subject/?ctgry_id="+ categoryType;
			}
			else
			{
				newLocation += "/results/?keyword=" + searchWord + "&ctgry_id="+ categoryType;
			}
		break;
	}
	
	window.open(newLocation);
}