//************************************************ 
//* Customizable region c file - this file can be 
//* modified to hold history logic and/or generate
//* a link to enable printer friendly versions of
//* the content.
//*
//* This region is the history list at the 
//* top of the topic content area.
//*
//* NOTE: DO NOT DELETE THIS FILE.
//*	  You may modify this file or you may
//*	  remove its functionality by deleting all
//*	  lines following the first line:
//*	  'document.write('<!--begin region_c-->');'
//*
//************************************************ 

// determine back color for table
document.writeln('<!--');
document.writeln('-->');

document.writeln("<!--begin region_c-->");
document.writeln('<form method="post" name="frmNavList" action="">');

document.writeln('<table border="0" width="100%">');
document.writeln('<tr>');
document.writeln('<td height="10">');
document.writeln('<select name="selNavList" onChange="navigatelist()" >');
document.writeln('<option value="">Go back to...</option>');

document.writeln('<!--');

	// event handler for selecting an item from the NavList
	function navigatelist()
	{
		var index = document.forms.frmNavList.selNavList.selectedIndex;
		document.location.href = document.forms.frmNavList.selNavList.options[index].value;

	}
	
	function getnavlistval(offset) 
	{
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1)
			endstr = document.cookie.length;
		return(unescape(document.cookie.substring(offset, endstr)));
	}
	
	function getnavlistarray() 
	{
		var arg = "HWNavList=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen) 
		{
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
				return(getnavlistval(j).split("!!"));
			i = document.cookie.indexOf(" ", i) + 1
			if (i == 0) break; 
		}
		return(null);
	}  
	
	// if needed, add the current document to the list
	function updatenavlist(list)
	{
		var index;			
		
		if ( hwRank > 2 )
			return false;
		
		// This is needed for the DocTitle/SecTitle 30/30 split.		var m_topicTitleNew;
		// This variable is needed for 3rd party content. 3rd party content will not have a hwSectionTitle.
		// We need to determine if the hwSectionTitle exists or not and go from there. 
		var hwSectionTitleNew = "";
		
		if(!window.hwSectionTitle){
			hwSectionTitleNew = "";
		}
		else {
			hwSectionTitleNew = hwSectionTitle;
		}
		
		if(hwSectionTitleNew.length < 1){
			m_topicTitleNew  = hwDocTitle.substring(0,30); // 30/30
		}
		else {
			m_topicTitleNew  = hwDocTitle.substring(0,30) + " (" + hwSectionTitleNew.substring(0,30) + ")"; // 30/30
		}		
		index = isinarray(m_topicTitleNew, list); // This is the new index, using the 30/30 split.
		
		if(index > -1)
			list = list.slice(0, index-1).concat(list.slice(index+1));
			
		if(hwSectionTitleNew.length < 1){
			list[list.length] = hwDocTitle.substring(0,30) + "$" + document.URL; // 30/30
		}
		else {
			list[list.length] = hwDocTitle.substring(0,30) + " (" + hwSectionTitleNew.substring(0,30) + ")$" + document.URL; // 30/30
		}
		return true;
		
	}
	
	function isinarray(val, arr)
	{
		for(i=0;i<arr.length-1;i++)
			if (arr[i].indexOf(val) > -1)
				return i;
		
		return -1;
	}
	
	function saveselnavlist(list) 
	{                                                          
		var value = "";
		
		for(i=0;i<list.length;i++){
			value += list[i] + "!!";
			}

		document.cookie = "HWNavList=" + escape(value) + ";" +
					  	  "path=/";
	}
	
	
	function buildnavigationselectmenu(){

		var search = "HWNavList=" 
		var navListArray;
		var cnt = 1;

		//if(document.forms["frmNavList"] != null) {

		navListArray = getnavlistarray();
		if(navListArray == null){
			navListArray = new Array();
		}		
		//document.forms.frmNavList.selNavList.options[cnt] = new Option("Navigation History", "")
		//document.forms.frmNavList.selNavList.options[cnt++].selected = true;

		for(i=navListArray.length-1; i>-1; i--) {
			if(navListArray[i].length > 0){
				var item = unescape( navListArray[i] );
				var fields = item.split("$");
				if(fields[0] != document.title){ // do not include the current document
					var docTitle = fields[0];
					if(docTitle.length > 60)
					docTitle = docTitle.substr(0, 60);
					document.writeln( '-->' );
					document.writeln('<option  value="' + fields[1] + '">' + docTitle + '</option>');
				//	document.forms.frmNavList.selNavList.options[cnt++] = new Option(docTitle, fields[1]);
					document.writeln( '<!--' );
				}
			}
		}
		if (updatenavlist(navListArray))
			saveselnavlist(navListArray);
	}//end buildnavigationselectmenu()
	
	
	buildnavigationselectmenu();
	
	
document.writeln('-->');
document.writeln('</select>');

document.writeln('</td>');

	// Build the Printer Friendly link if desired
	// Remove comment below to enable Printer Friendly link
	//buildWebPrintLink();

document.writeln('</tr>');
document.writeln('</table>');
document.writeln('</form>');
document.writeln("<!--end region_c-->");



	
