	
	function tabBox(tabToShow, totalTabs){
		// start by hiding any displayed tab content and unselecting all tabs
		for (var i = 1; i <= totalTabs; i ++){
			var tmpTab = "tab" + i;
			var tmpContent = "tabContent" + i;
			document.getElementById(tmpTab).className = "";
			document.getElementById(tmpContent).style.display = "none";
		}
		//display the selected tab and contents
		tmpTab = "tab" + tabToShow;
		tmpContent = "tabContent" + tabToShow;
		document.getElementById(tmpTab).className = "selected";
		document.getElementById(tmpTab).blur();
		document.getElementById(tmpContent).style.display = "block";
	}

	function tabBoxV2(tabToShow){
		// this version is used on Samples and sets a client cookie to remember the last tab selected.
		// additionally, each calling page has an array of tab labels
		
		// create an instance of the Date object
		var now = new Date();
		now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
		
		// remember their choice	
		setCookie("selection", tabs[tabToShow], now)
		// hide any displayed tab content and unselecting all tabs
		tabClear();
		
		//display the selected tab
		tabShow();
	}
	
	function tabBoxV3(tabPrefix, tabToShow, totalTabs){
		// start by hiding any displayed tab content and unselecting all tabs
		for (var i = 1; i <= totalTabs; i ++){
			var tmpTab = tabPrefix + i;
			var tmpContent = tabPrefix + "Content" + i;
			document.getElementById(tmpTab).className = "";
			document.getElementById(tmpContent).style.display = "none";
		}
		//display the selected tab and contents
		tmpTab = tabPrefix + tabToShow;
		tmpContent = tabPrefix + "Content" + tabToShow;
		document.getElementById(tmpTab).className = "selected";
		document.getElementById(tmpTab).blur();
		document.getElementById(tmpContent).style.display = "block";
	}
	
	
	function tabClear(){
		for (var i = 1; i < tabs.length; i ++){
			var tmpTab = "tab" + i;
			var tmpContent = "tabContent" + i;
			document.getElementById(tmpTab).className = "";
			document.getElementById(tmpContent).style.display = "none";
		}
	}
		
	function tabShow(){
		// check for a saved tab selection
		var selection = getCookie("selection");
		if(selection){
			for (var i = 1; i < tabs.length; i ++){
				if(selection == tabs[i]){
					tmpTab = "tab" + i;
					tmpContent = "tabContent" + i;
				}
			}
		}else{
			tmpTab = "tab1"
			tmpContent = "tabContent1"
		}
		
		//display the selected tab and contents
		document.getElementById(tmpTab).className = "selected";
		document.getElementById(tmpContent).style.display = "block";
	}

	function hideResults(resultSet){
		document.getElementById(resultSet).style.display = "none";
	}
	
	function setCookie(name, value, expires) {
    document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? " " : "; expires=" + expires.toGMTString());
	}
	
	function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
      begin = dc.indexOf(prefix);
      if (begin != 0) return null;
    } else
      begin += 2;
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
      end = dc.length;
    return unescape(dc.substring(begin + prefix.length, end));
  }
  
	function deleteCookie(name, path, domain) {
    if (getCookie(name)) {
      document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
  }	
  
	function tableStriper(){
	 	// get only the tables contained within the maincontent section
	 	var tsDiv = document.getElementById("mainContent");
	 	
	 	if(!tsDiv)return;
	 	
	 	var tsTables = tsDiv.getElementsByTagName("table");
	 	
	 	// for each of the tables, get the tr tags
	 	for(var i = 0; i < tsTables.length; i++){
	 		var tsTrs = tsTables[i].getElementsByTagName("tr")
	 		// based on the row index, apply the appropriate style:
	 		// row 0 = header, so no special row class
	 		// row 1 has the drop shadow below the header row
	 		// even rows are shaded
	 		for(var e = 0; e < tsTrs.length; e++){
	 			if(e == 1) var theClass = "shadow";
	 			else if (e % 2)  var theClass = "odd";
	 			else var theClass = "even";
	 			tsTrs.item(e).className = theClass;
	 		}
	 	}
	 }
  