// JavaScript Document

// Takes a string and a delimiter and returns an array of strings split on the delimiter.
function explode(strString, strDelim) {
	
	// Ouput array stores split string; i indexes the output array;
	var OutputArray = new Array();
	var i = 0;
	var count = 0;
	var pos = strString.indexOf(strDelim);
	
	while (pos != -1) {
		OutputArray[i] = strString.substring(count, pos);
		count = pos + 1;
		i = i + 1;
		pos = strString.indexOf(strDelim, pos + 1);
	}
	OutputArray[i] = strString.substring(count);
	
	return(OutputArray);
}

	function TabBrowser() {
		
		var SelTab;
		
		if (location.search == "") {
			SelTab = "browse";
		} else {
			var Temp = explode(location.search, "=");
			var Temp2 = explode(Temp[1], "&");
			SelTab = Temp2[0];
		}

			if (document.getElementById) {
				var SelTab = document.getElementById(SelTab);
				if (SelTab == null || SelTab == "") {
					SelTab = document.getElementById("browse");
					SelTab.className = "selected";
				} else {
					SelTab.className = "selected";
				}
			}
	
	}
