function jumpToLink(a_obj)
{
	 var urlStr = document.location.search;  //document url parameters
//alert(urlStr);
	 var docLoc = a_obj.options[a_obj.selectedIndex].value;
	 if(docLoc !="not selected")
	 {
		var props = new Object();

	 	props.docLoc=docLoc;
	 	props.locSource="input";
	 	if(urlStr.indexOf("?")==0)	// remove the '?' from the parameters list
			urlStr = urlStr.substring(1,urlStr.length);
		if (urlStr != "")			// break url into parameters Array
		requestArr = urlStr.split('&');
		for (var i=0; i<requestArr.length; i++)
		{
			var prop = requestArr[i].split('=');

			// don't deal with empty params
			if (prop.length != 2)
				continue;
			//alert(prop[0]);
			if (prop[0] == "docId" || prop[0] == "showHits" || prop[0] == "queryId" || prop[0]== "doc")
				props[prop[0]] = unescape(prop[1]);
		}

		var tmpTitleIndx = document.getElementsByName("jumpLinkTitles");
		var tmp = 0;
		//alert (jumpLinkLastSelection);
		//alert(tmpTitleIndx[0].selectedIndex);
		//alert(tmpTitleIndx[1].selectedIndex);

		//Needed for the first entry.
		if (jumpLinkLastSelection == null)
			jumpLinkLastSelection = 0;

		if (tmpTitleIndx[0].selectedIndex != jumpLinkLastSelection){
			//alert("in one");
			tmp = tmpTitleIndx[0].selectedIndex;
			}
		else if (tmpTitleIndx[1].selectedIndex != jumpLinkLastSelection){
			//alert("====");
			tmp = tmpTitleIndx[1].selectedIndex;
			}
		//if (tmpTitleIndx != null)
			//alert(tmp);
			props.titleIndx = tmp;

		URLUtil.openLinkUnified("GetDocument.do", props);
	}
}


function drawJumpLinks(jumpLinks)
{
	var sOut = "";
	var sOut = "";
        var linkText = "";
        var linkStyle = "";
        var indention = "";
        var regSection = /^##/;
        var regSubSection = /^####/;
        var regDash = /^-/;
        var regEndDash = /-$/;

	if (jumpLinks.length == 0)
		return;
	document.write("<SELECT name='jumpLinkTitles' onChange=\"jumpToLink(this);\">\n <OPTION value=\"not selected\">"+Message.JumpLinkTag_SelectLocation);
	/*
	for (var i = 0; i < jumpLinks.length; )
	{
		sOut += "\n" + "<OPTION value=\""+jumpLinks[i]+"\">"+jumpLinks[i+1];
		i+=2;
	}
	*/
	// modified 01/31/06
	for (var i = 0; i < jumpLinks.length; )
	{
        linkText =  jumpLinks[i+1];
        if(linkText.search(regSubSection) != -1)
        {
            linkStyle = "SubSection";
            linkText = linkText.replace(regSubSection, "");
            linkText = linkText.replace(regDash, "");
            linkText = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + linkText;
        }
        else if(linkText.search(regSection) != -1)
        {
            linkStyle = "Section";
            linkText = linkText.replace(regSection, "");
            linkText = linkText.replace(regDash, "");
            linkText = "&nbsp;&nbsp;&nbsp;&nbsp;" + linkText;
        }
        else
        {
            linkStyle = "Chapter";
            indention = "";
        }
		sOut += "\n" + "<OPTION class=\"" + linkStyle + "\" value=\""+jumpLinks[i]+"\">"+ linkText;
		i+=2;
	}
	document.write(sOut + "\n</SELECT>")
}

