


<!--

var selectCount = 0;
var honorExpandJs = true;

function goSubmit(action, orgId, topicId, isPreview, start, terms, sectionId, dateId, docId, sortParm, isSearch, dashboard, isShowChart){
	if (action.indexOf("&") >= 0) {
		args = action.split("&");
		document.frmSubmit.Action.value = args[0];
		terms = args[1].split("=");
		document.frmSubmit.terms.value=terms[1];
	}else {
		document.frmSubmit.Action.value = action;
	}
	if(action == "UserDisplayFullDocument"){
		document.frmSubmit.target = "_self";
	}
	document.frmSubmit.orgId.value = orgId;
	document.frmSubmit.topicId.value = topicId;
	document.frmSubmit.isPreview.value = isPreview;
	document.frmSubmit.start.value = start;
	document.frmSubmit.terms.value = terms;
	document.frmSubmit.sectionId.value = sectionId;
	document.frmSubmit.dateId.value = dateId;
	document.frmSubmit.docId.value = docId;
	document.frmSubmit.sort.value = sortParm;
	
	// No dashboard or isShortChart args may be passed to goSubmit() when the call to it is created by EndUserCiteList.xsl 
	// in those cases where the XSL doesn't find a header for either a short or a long cite format

	try {
		if (dashboard == null || typeof dashboard == 'undefined') {
	   		dashboard = "";
		}
			
		if (isShowChart == null || typeof isShowChart == 'undefined') {
	   		isShowChart = "";
		}
		
		document.frmSubmit.dashboard.value = dashboard;
		document.frmSubmit.showChart.value = isShowChart;
	} catch (e) {
		// ignore error
	}
	
	try{
		document.frmSubmit.checkedItems.value = getCheckedItems();
	}catch(e){
		//must not be a checked items display...ignore & go on.
	}
	document.frmSubmit.selDocCount.value=document.frmSubmit.checkedItems.value.split(",").length;
	if (isSearch !=null && isSearch != "" && isSearch != "undefined"){
		issearch = isSearch.split("=");
		document.frmSubmit.isSearch.value=issearch[1];
	}
	document.frmSubmit.submit();
}

function getCheckedItems(){
	dml=document.frmTab;
	return getCheckedItemsAll(dml);
}

function getCheckedItemsAll(dml){

	len = dml.elements.length; 
	dms=document.frmSubmit;
	var i=0;
	checkedVals = new String("," + dms.checkedItems.value);
	if (checkedVals.length > 1) {
		checkedVals += ",";
	}
	for(i=0; i<len; i++) {   
		if (dml.elements[i].name=="docItem") {
			if (dml.elements[i].checked) {
				
				if (checkedVals.indexOf("," + dml.elements[i].value + ",") == -1) {
					checkedVals += dml.elements[i].value + ",";
				}
			}else{
				
				if (checkedVals.indexOf(dml.elements[i].value + ",") > 0) {
					var tmpArray = checkedVals.split(dml.elements[i].value + ",");
					checkedVals = tmpArray[0] + tmpArray[1];
				}
			}			
		}
	}
	checkedVals = checkedVals.slice(1,-1);
	return checkedVals;
}

function jumpToCite(jumpNum){
	dml=document.getElementById('frmTab');
	var popuplinks = dml.getElementsByTagName("a");
	leftVal = 0;
	topVal = 0;
	for(i=0; i<popuplinks.length; i++) {   
			if(i == jumpNum){
				leftVal = popuplinks[i].scrollLeft;
				topVal = popuplinks[i].scrollTop;
				obj = popuplinks[i];
				while (obj = obj.offsetParent) 
				{
					leftVal += obj.offsetLeft;
					topVal += obj.offsetTop;
				}
				i = popuplinks.length;
		}
	}
	window.scrollTo(leftVal, topVal);	
}

function preCheckBoxes(){
	dml=document.getElementById('frmTab');
	preCheckBoxesAll(dml);
}

function preCheckBoxesAll(dml){
	len = dml.elements.length; 
	dms=document.frmSubmit;
	var i=0;
	var checkedVals = dms.checkedItems.value;
	if(checkedVals != ""){
		var tmpArray = checkedVals.split(",")
		selectCount = tmpArray.length;
		checkedVals = "," + checkedVals;
	}
	checkedVals = checkedVals + ",";
	for(i=0; i<len; i++) {   
		if (dml.elements[i].name=="docItem") {
			if (checkedVals.indexOf(dml.elements[i].id) >= 0) {
				dml.elements[i].checked = true;
				obj = document.getElementById("doc"+dml.elements[i].id);
				abs = document.getElementById("abs"+dml.elements[i].id);
				cite = document.getElementById("cite"+dml.elements[i].id);
				if (obj != null) obj.style.fontSize="14px";
				if (abs != null) abs.style.fontWeight="bold";
				if (cite != null) cite.style.fontWeight="bold";			
			}		
		}
	}
}
function docSelectionStateChange(selectBox){
	updateStyle(selectBox);
	val = selectBox.value;
	var command = 'add';
	if(!selectBox.checked){
		command = 'remove';
	}
	var str = '';
	str += 'Action=StateChange';
	str += '&topicId=' + val.substring(0,val.indexOf("-"));
	str += '&docId=' + val.substring(val.indexOf("-")+1);
	str += '&orgId=' + document.frmSubmit.orgId.value;
	str += '&stateType=DocDelivery';
	str += '&stateCommand=' + command;
	doAjax('EndUser', 'handleEmptyAjaxResponse', str);
}


function doAjax(strURL, strResultFunc, strSubmit){
	if (window.XMLHttpRequest) {
		xmlHttpReq = new XMLHttpRequest();
	} else if (window.ActiveXObject){
		xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}	
	
	xmlHttpReq.open('POST', strURL, true);
    xmlHttpReq.setRequestHeader('Content-Type', 
	     'application/x-www-form-urlencoded');
    xmlHttpReq.onreadystatechange = function() {
            if ((xmlHttpReq.readyState == 4) && (strResultFunc != null) && (xmlHttpReq.responseText != null) && (xmlHttpReq.responseText != "")) {                            
                    eval(strResultFunc + '(xmlHttpReq.responseText);');
            }
    }
    
    xmlHttpReq.send(strSubmit);			
}
	
function handleEmptyAjaxResponse(resp){
	//resp is empty ("") on a successfull call
	if (resp != null && resp != "") {
		alert(resp);
	}
}

function updateStyle(selectBox){

	obj = document.getElementById("doc"+selectBox.id);
	abs = document.getElementById("abs"+selectBox.id);
	cite = document.getElementById("cite"+selectBox.id);
	if(selectBox.checked){
//		if (obj != null) obj.style.fontSize="14px";
		if (abs != null) abs.style.fontWeight="bold";
		if (cite != null) cite.style.fontWeight="bold";
	}else{
//		if (obj != null) obj.style.fontSize="12px";
		if (abs != null) abs.style.fontWeight="normal";	
		if (cite != null) cite.style.fontWeight="normal";		
	}
	
}


function previewDocList(dateControl, sectionControl) {

	var dateText    = " for " + dateControl[dateControl.selectedIndex].innerHTML;
	var sectionText = "";
	
	if (sectionControl != undefined) {
		sectionText = " to "  + sectionControl[sectionControl.selectedIndex].innerHTML;
	}
	
	alert("This would update the document list to show all documents published" + sectionText + dateText + ".");
}

function previewLink(message, date){
	alert("This would open the " + message + " page. \nLink is now visited.");
}

function previewPage(message){
	alert("This would display the page with documents in range " + message + ". \nLink is now visited.");
}

function launchHelp(helpFile, showFrame, orgId) {
	launchFQUserHelp("", helpFile, showFrame, orgId);
}

function launchUserHelp(helpFile, showFrame, orgId) {
	launchFQUserHelp("", helpFile, showFrame, orgId);
}

function openUserPref(lnk){
	window.location.href=lnk + "&urlRedirect=" + escape(window.location.href);
}

function launchFQUserHelp(baseUrl, helpFile, showFrame, orgId) {
	var center = 1;

	args=getHelpArgs(800,600,center,0);

	if ((parseInt(navigator.appVersion) >= 4 ) && (center))
	{
		if(window.formhelp && !window.formhelp.closed)
		{
			formhelp.close();
		}
	}
	
	var helpUrl = "";
	
	if (baseUrl != "") {
		helpUrl = baseUrl + "/";
	}
			
	helpUrl = helpUrl + "EndUser?Action=HelpDisplay&helpFile=" + helpFile + "&orgId=" + orgId; 

	formhelp=window.open(helpUrl, "LNPHelp", args);
}

function getHelpArgs(width,height,center,menu)
{
	xposition=0; yposition=0;

	if ((parseInt(navigator.appVersion) >= 4 ) && (center))
	{
		if (center==1)
		{
			xposition = (screen.width - width) / 2;
			yposition = (screen.height - height) / 2;
		}
	}
	if (navigator.appName == 'Netscape')
	{
		width = width + 25;
		height = height + 25;
	}
	args="width="+width+",height="+height+",toolbar="+menu+",menubar="+menu+",screenx="+ xposition+",screeny="+yposition+",left="+xposition+",top="+yposition+",resizable=1,scrollbars=1,";
	return args;
}

function checkSearch() {
	if (document.frmMain.terms.value == "") {
		alert("Please enter a search parameter!");
		return false;
	} else {
		return true;
	}
}

function goAction(act) {
	document.frmMain.Action.value = act;
	document.frmMain.target = "_top";
	document.frmMain.submit();
}

function showSwoosh(val) {
	//document.getElementById("hover" + val).style.display = ""; 
	temp = "document.hover.hover" + val + ".style.display = \"\";";
	eval(temp);
}
function hideSwoosh(val) {
	//document.getElementById("hover" + val).style.display = "none";
	temp = "document.hover.hover" + val + ".style.display = \"none\";";
	eval(temp);
}
function showDisclaimer(user, rss, editor){
	var disclaimerText = "";
	if(user || rss){
		disclaimerText = disclaimerText + userDocDisclaimer();
	}
	if(editor){
		if(user || rss){
			disclaimerText = disclaimerText + "\n\n";
		}
		disclaimerText = disclaimerText + userContentDisclaimer();
	}
	alert(unescape(disclaimerText));
}
function userDocDisclaimer(){
	return "This document and any links, illustrations, comments or other information included in or accompanying it are independently provided by your firm through either independent creation or based upon independent relationships between your firm and third party sources other than LexisNexis%AE. LexisNexis%AE has not created, supplied, reviewed or endorsed this document and accompanying information.";
}
function userContentDisclaimer(){
	return "Any added material (\"Editorial Content\"), including related links, illustrations, comments and other information, is added at your firm's risk. LexisNexis%AE does not ensure the security or confidentiality of Editorial Content.  Your firm assumes all risks related to the Editorial Content, including risk of loss and breach of confidentiality.";
}
function WM_toggle(id){
	idPlus = id + "_plus";
	idMinus = id + "_minus";
  if (document.getElementById){
	if(document.getElementById(id).style.display == 'none'){
      document.getElementById(id).style.display = 'block';
	document.getElementById(idPlus).style.display = 'none';
	document.getElementById(idMinus).style.display = 'block';
    } else {
      document.getElementById(id).style.display = 'none';
	document.getElementById(idPlus).style.display = 'block';
	document.getElementById(idMinus).style.display = 'none';
	collapseAllDOM(id);
    }
  } else if (document.all){
    if(document.all(id).style.display == 'none'){
      document.all(id).style.display = '';
	document.all(idPlus).style.display = 'none';
	document.all(idMinus).style.display = '';
    } else {
      document.all(id).style.display = 'none';
	document.all(idPlus).style.display = '';
	document.all(idMinus).style.display = 'none';
	collapseAll(id);
   }
  } else {
	alert('this browser is not supported');
  }
}
function collapseAllDOM(id){

	try{
		var oTest = document.getElementsByName(id);
		var testArray = oTest[0].getElementsByTagName("DIV");
	}catch (a){
		try{
			var oTest = document.getElementsByName(id);
			var testArray = oTest[0].all.tags("DIV");
		}catch (b){
			var testArray = document.getElementsByTagName("*");
		}
	}

	for(i=0; i<testArray.length; i++){
		if(testArray[i].id != ""){
			if(testArray[i].id.substr(0, id.length) == id && testArray[i].id.length > id.length){
				if(testArray[i].id.slice(-4) != "plus" && testArray[i].id.slice(-5) != "minus" && testArray[i].id.slice(-6) != "anchor"){
					document.getElementById(testArray[i].id).style.display = 'none';
					document.getElementById(testArray[i].id + "_plus").style.display = 'block';
					document.getElementById(testArray[i].id + "_minus").style.display = 'none';
				}
			}
		}
	}
}

function collapseAll(id){
	var testArray = document.all;
	for(i=0; i<testArray.length; i++){
		if(testArray[i].id != ""){

			if(testArray[i].id.substr(0, id.length) == id && testArray[i].id.length > id.length){
				if(testArray[i].id.slice(-4) != "plus" && testArray[i].id.slice(-5) != "minus" && testArray[i].id.slice(-6) != "anchor"){
					document.all(testArray[i].id).style.display = 'none';
					document.all(testArray[i].id + "_plus").style.display = '';
					document.all(testArray[i].id + "_minus").style.display = 'none';
				}
			}
		}
	}
}
function getTopicList(orgId, topicId, isPreview, backgroundClass, expandFirstDate, useCookieToOverrideSettings) {
	getTopicList(orgId, "", topicId, isPreview, backgroundClass, expandFirstDate, useCookieToOverrideSettings);
}

function getTopicList(orgId, catId, topicId, isPreview, backgroundClass, expandFirstDate, useCookieToOverrideSettings) {
	
	// Use orgId from URL to determine if TopicList.TopicDateCookieName cookie indicates what topic
	// was expanded at the time the user clicked a link to access a cite list or a document;
	// if cookie specifies this, then expand this topic instead of the topic that was passed in
	// as an input argument
	// 
	var inCatList = false;
	var expandId = "";
	if(catId != ""){
		expandId = catId + "_";
		inCatList = true;
	}
	expandId += topicId;
	if (useCookieToOverrideSettings) {
	
		var recordStr = Common.GetCookieRecordAsString(TopicList.TopicDateCookieName, orgId);	
		if (recordStr.valueOf() != "") {
	
			var fields = recordStr.split(Common.CookieFieldSeparator);	
			// Don't override settings if displaying first topic in the list
			// since this is the topic the user saw when initially accessing the topic list
			// and want to ensure QUERY_STRING is the same as that initial time so that the 
			// cached version of this list is sent by the server instead of the server generating a new one
			//
			if ((fields.length >= 5) && (topicId != fields[1])) {				
				try{
					if(inCatList){
						if(fields[5] != ""){
							catId = fields[5];
							topicId = fields[1];
							expandId = fields[5] + '_' + fields[1];
						}
					}else if(fields[1] != ""){
						topicId = fields[1];
						expandId = fields[1];
					}
					backgroundClass = fields[4];
//					expandFirstDate = false;
				}catch (e){
//					WM_toggle(expandId);
				}
			}
		}
	}
	WM_toggle(expandId);
	var populated = document.getElementById(expandId).getAttribute("isPopulated");
	if (populated == null || populated != 'true') {
		var loaderUrl = "EndUser?Action=TopicGetDateHeadlineList&orgId=" + orgId + "&catId=" + catId + "&topicId=" + topicId + "&backgroundClass=" + backgroundClass;
		if (isPreview) {
			loaderUrl += "&isPreview=true";
		}
		if (expandFirstDate) {
			loaderUrl += "&expandFirstDate=true";
		}
		contentLoader.location.href = loaderUrl;
	}
}

function getDateTopicList(linkDate, orgId, topicInfoParam, isPreview, backgroundClass, expandFirstTopic) {
	getDateTopicList(linkDate, orgId, '', topicInfoParam, isPreview, backgroundClass, expandFirstTopic);
}

function getDateTopicList(linkDate, orgId, catId, topicInfoParam, isPreview, backgroundClass, expandFirstTopic) {
	var expandId = "";
	if(catId != ""){
		expandId = catId + "_";
	}
	expandId += linkDate;
	WM_toggle(expandId);
	
	var populated = document.getElementById(expandId).getAttribute("isPopulated");
	if (populated == null || populated != 'true') {
		var loaderUrl = "EndUser?Action=TopicListGetHeadlinesForDate&orgId=" + orgId + "&catId=" + catId + "&date=" + linkDate + "&" + topicInfoParam + "&backgroundClass=" + backgroundClass;
		if (isPreview) {
			loaderUrl += "&isPreview=true";
		}
		if (expandFirstTopic) {
			loaderUrl += "&expandFirstTopic=true";
		}
		contentLoader.location.href = loaderUrl;
	}
}

function invokeAnchorOnClick(orgId, dateAnchor, useCookieToOverrideSettings) {
	var onClickFunction;
	if (useCookieToOverrideSettings) {
	
		// Use orgId from URL to determine if TopicList.TopicDateCookieName cookie indicates what date
		// was expanded at the time the user clicked a link to access a cite list or a document;
		// if cookie specifies this, then expand this date instead of the date that was passed in
		// as an input argument
		//
		var recordStr = Common.GetCookieRecordAsString(TopicList.TopicDateCookieName, orgId);	
		if (recordStr.valueOf() != "") {
	
			var fields = recordStr.split(Common.CookieFieldSeparator);	
			// Don't override settings if displaying first date in the list
			// since this is the date the user saw when initially accessing the topic list
			// and want to ensure QUERY_STRING is the same as that initial time so that the 
			// cached version of this list is sent by the server instead of the server generating a new one
			//
			if ((fields.length >= 6) && (dateAnchor != fields[2]) && (fields[2] != '0')) {
				var newDateAnchor = "";
				if(fields[5] != "" && fields[5] != 'undefined'){
					var tempId = document.getElementById(fields[5]);
					if(tempId != null){
						newDateAnchor = fields[5] + '_';
					}
				}
				newDateAnchor += fields[2];
				if((dateAnchor.indexOf("_")>=0 && newDateAnchor.indexOf("_")>=0) ||
				   (dateAnchor.indexOf("_")==-1 && newDateAnchor.indexOf("_")==-1)){
					dateAnchor = newDateAnchor
				}

			}
		}
	}
	dateAnchor = dateAnchor + "_anchor";
	var dateAnchorElement = document.getElementById(dateAnchor);
	
	if(dateAnchorElement!=null){
		onClickFunction = dateAnchorElement.onclick;
		
		if (onClickFunction != undefined) {
			onClickFunction.call();
		}
	}
}

function expandDate(orgId, date, useCookieToOverrideSettings) {
	var onClickFunction;
	if (useCookieToOverrideSettings) {
	
		// Use orgId from URL to determine if TopicList.TopicDateCookieName cookie indicates what date
		// was expanded at the time the user clicked a link to access a cite list or a document;
		// if cookie specifies this, then expand this date instead of the date that was passed in
		// as an input argument
		//
		var recordStr = Common.GetCookieRecordAsString(TopicList.TopicDateCookieName, orgId);	
		if (recordStr.valueOf() != "") {
	
			var fields = recordStr.split(Common.CookieFieldSeparator);	
			// Don't override settings if displaying first date in the list
			// since this is the date the user saw when initially accessing the topic list
			// and want to ensure QUERY_STRING is the same as that initial time so that the 
			// cached version of this list is sent by the server instead of the server generating a new one
			//
			if ((fields.length >= 6) && (date != fields[2])) {
				if(fields[2] != '0'){
					date = "";
					if(fields[5] != "" && fields[5] != "undefined"){
						var testCat = document.getElementById(fields[5]);
						if(testCat != null){
							date = date + fields[5] + "_";
						}
					}
					date = date + fields[1] 
					if(fields[3] != "" && fields[3] != '0'){
						date = date + '_' + fields[3];
					}
					date = date + '_' + fields[2];
				}
			}
		}
	}
	WM_toggle(date);
}

function expandSection(orgId, section, useCookieToOverrideSettings) {
	var onClickFunction;
	if (useCookieToOverrideSettings) {
	
		// Use orgId from URL to determine if TopicList.TopicDateCookieName cookie indicates what date
		// was expanded at the time the user clicked a link to access a cite list or a document;
		// if cookie specifies this, then expand this date instead of the date that was passed in
		// as an input argument
		//
		var recordStr = Common.GetCookieRecordAsString(TopicList.TopicDateCookieName, orgId);	
		if (recordStr.valueOf() != "") {
	
			var fields = recordStr.split(Common.CookieFieldSeparator);	
			// Don't override settings if displaying first date in the list
			// since this is the date the user saw when initially accessing the topic list
			// and want to ensure QUERY_STRING is the same as that initial time so that the 
			// cached version of this list is sent by the server instead of the server generating a new one
			//
			if ((fields.length >= 6) && (section != fields[3])) {
				if(fields[3] != '0'){
					section = "";
					if(fields[5] != "" && fields[5] != "undefined"){
						var tempId = document.getElementById(fields[5]);
						if(tempId != null){	
							section += fields[5] + "_";
						}
					}
					section += fields[1] + '_' + fields[3];
				}
			}
		}
	}
	WM_toggle(section);
}

function expandDateTopic(orgId, expandId, useCookieToOverrideSettings) {
	if(!honorExpandJs){
		return;
	}
	honorExpandJs = false;
	var onClickFunction;
	if (useCookieToOverrideSettings) {
	
		// Use orgId from URL to determine if TopicList.TopicDateCookieName cookie indicates what date
		// was expanded at the time the user clicked a link to access a cite list or a document;
		// if cookie specifies this, then expand this date instead of the date that was passed in
		// as an input argument
		//
		var recordStr = Common.GetCookieRecordAsString(TopicList.TopicDateCookieName, orgId);	
		if (recordStr.valueOf() != "") {
			var fields = recordStr.split(Common.CookieFieldSeparator);	
			// Don't override settings if displaying first date in the list
			// since this is the date the user saw when initially accessing the topic list
			// and want to ensure QUERY_STRING is the same as that initial time so that the 
			// cached version of this list is sent by the server instead of the server generating a new one
			//
			if ((fields.length >= 6) && (expandId != fields[2])) {
				if(fields[2] != '0'){
					var newExpandId = "";
					if(fields[5] != "" && fields[5] != "undefined"){
						var testCat = document.getElementById(fields[5]);
						if(testCat != null){
							newExpandId += fields[5] + "_";
						}
					}
					newExpandId += fields[2] + '_' + fields[1];
					var testCat = document.getElementById(newExpandId);
					if(testCat != null){
						expandId = newExpandId;
					}
				}
			}
		}
	}
	WM_toggle(expandId);
}

function expandCategory(orgId, catId, useCookieToOverrideSettings) {
	var onClickFunction;
	if (useCookieToOverrideSettings) {
	
		// Use orgId from URL to determine if TopicList.TopicDateCookieName cookie indicates what date
		// was expanded at the time the user clicked a link to access a cite list or a document;
		// if cookie specifies this, then expand this date instead of the date that was passed in
		// as an input argument
		//
		var recordStr = Common.GetCookieRecordAsString(TopicList.TopicDateCookieName, orgId);	
		if (recordStr.valueOf() != "") {
	
			var fields = recordStr.split(Common.CookieFieldSeparator);	
			// Don't override settings if displaying first date in the list
			// since this is the date the user saw when initially accessing the topic list
			// and want to ensure QUERY_STRING is the same as that initial time so that the 
			// cached version of this list is sent by the server instead of the server generating a new one
			//
			if ((fields.length >= 6) && (catId != fields[5]) && fields[5] != "undefined" && fields[5] != "") {
				catId = fields[5];
			}
		}
	}
	WM_toggle(catId);
}

function copyContent(divName) {
	document.getElementById(divName).innerHTML = contentLoader.document.getElementById("theContent").innerHTML;
	document.getElementById(divName).setAttribute("isPopulated", "true");
}
function euPrintDld(cmd, isCurrDoc){		
		//alert(cmd + ": " + isCurrDoc);

		actionValue = "TextFileDownload";
		if (cmd == 'email') {
			delivery = "Email";
			actionValue = "EndUserEmailDelivery";
		}else if (cmd == "dld") delivery = "Download";
		else delivery = "Print";
		
		document.frmSubmit.checkedItems.value = getCheckedItems();
		//alert(document.frmSubmit.checkedItems.value);
		if (document.frmSubmit.checkedItems.value != "") {
			var ciArray = document.frmSubmit.checkedItems.value.split(",");
			document.frmSubmit.selDocCount.value=ciArray.length;
		}else {
			document.frmSubmit.selDocCount.value="0";
		}
		
			
			if (document.frmSubmit.checkedItems.value == "" && !isCurrDoc){
				alert("Not one document(s) selected. To " + delivery + ", you must select at leat one document.");
				return false;
			}
			
			url = "EndUser?Action=UserDisplayDeliveryOptions";
			url += "&inFullDoc="+isCurrDoc;
			url += "&docId="+document.frmSubmit.docId.value;
			url += "&deliveryType="+delivery;
			url += "&userType="+ 'EndUser';
			url +="&orgId=" + document.frmSubmit.orgId.value;
			if(document.frmSubmit.topicId)
				url +="&topicId=" + document.frmSubmit.topicId.value;
			sFeatures = "height=";				
			if (cmd == 'email'){
				sFeatures += "402px,";
			}else{
				sFeatures += "352px,";
			}
			sFeatures += "width=650px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=220,top=245";
			downloadWindow = window.open(url,'deliver', sFeatures);
		

		
	};
	
	function euPreviewPrintDld(deliveryMethod){
		alert("This would open the " + deliveryMethod + " options page");
	};




// begin Rating namespace


var Rating = {};

var setRating = false;

Rating.doRatingOver =
	function(x) {
		if (setRating == false) {
			switch (x) {
				case 1:
					document.getElementById('setRating').style.backgroundPosition = '-54px -89px';
					break;
				case 2:
					document.getElementById('setRating').style.backgroundPosition = '-42px -89px';
					break;
				case 3:
					document.getElementById('setRating').style.backgroundPosition = '-30px -89px';
					break;
				case 4:
					document.getElementById('setRating').style.backgroundPosition = '-17px -89px';
					break;
				case 5:
					document.getElementById('setRating').style.backgroundPosition = '0 -89px';
					break;
			}
		}
	};
	
Rating.doRatingOut =
	function(x) {
		if (setRating == false) {
			document.getElementById('setRating').style.backgroundPosition = '-65px -89px';
		}
	};
	
Rating.doRating =
	function(x) {
		setRating = true;
		switch (x) {
			case 1:
				document.getElementById('setRating').style.backgroundPosition = '-54px -89px';
				document.getElementById('ratetext').innerHTML = 'Selected Rating: 1';
				break;
			case 2:
				document.getElementById('setRating').style.backgroundPosition = '-42px -89px';
				document.getElementById('ratetext').innerHTML = 'Selected Rating: 2';
				break;
			case 3:
				document.getElementById('setRating').style.backgroundPosition = '-30px -89px';
				document.getElementById('ratetext').innerHTML = 'Selected Rating: 3';
				break;
			case 4:
				document.getElementById('setRating').style.backgroundPosition = '-17px -89px';
				document.getElementById('ratetext').innerHTML = 'Selected Rating: 4';
				break;
			case 5:
				document.getElementById('setRating').style.backgroundPosition = '0 -89px';
				document.getElementById('ratetext').innerHTML = 'Selected Rating: 5';
				break;
		}
	};

Rating.saveRating = 
 function(orgId, topicId) {
 	var docId = document.getElementById("docId").value;
 	var docNum = docId;
 	var rateText = document.getElementById('ratetext').innerHTML;
 	var pageRank = rateText.substring(rateText.length-1, rateText.length)
 	if(Rating.isNumeric(pageRank)){
	 } else {
		 alert("Please select a rating.");
		 return false;
	 }
	var str = '';
	str += 'Action=SubmitPageRanking';
	str += '&topicId=' + topicId;
	str += '&docId=' + docId;
	str += '&orgId=' + orgId;
	str += '&pageRank=' + pageRank;
	doAjax('EndUser', 'Rating.displayPageRankInfo', str);
 };

Rating.isNumeric = 
 function (expression) {
	var nums = "0123456789";
	if (expression.length==0)return(false);
	for (var n=0; n < expression.length; n++){
		if(nums.indexOf(expression.charAt(n))==-1)return(false);
	}
	return(true);
 };


Rating.displayPageRankInfo = 
 function (pageRankVar){
	if (pageRankVar != null && pageRankVar != "") {
		//pageRankVar = roundedAverage : averagePageRank : totalNumUsers (format)
		var pageRankInfo = pageRankVar.split(":");
		var roundedAvg = pageRankInfo[0];
		var avgPageRank = pageRankInfo[1];
		var numUsers = pageRankInfo[2];
		
		document.getElementById('ratingImg').src = "images/xx/rating" + roundedAvg + ".gif";
		document.getElementById('ratingImg').alt = avgPageRank;
		document.getElementById('ratingImg').title = avgPageRank;
		
		document.getElementById('numUsers').innerHTML = '(' + numUsers + ' Users)';
		
		var rateText = document.getElementById('ratetext').innerHTML;
 		var pageRank = rateText.substring(rateText.length-1, rateText.length)
	 	if(Rating.isNumeric(pageRank)){
			document.getElementById('ratetext').innerHTML += '<span id="rateTextSaved"> - Saved</span>';
		}
		
	}
 }; 


Rating.processPageRankInfo = 
 function (){
 	var pageRankVar=document.frmPageRank.pageRankInfo.value;
	if(pageRankVar!=null && pageRankVar.length>0){
		//pageRankVar = roundedAverage : averagePageRank : totalNumUsers (format)
		var pageRankInfo = pageRankVar.split(":");
		var roundedAvg = pageRankInfo[0];
		var avgPageRank = pageRankInfo[1];
		var numUsers = pageRankInfo[2];
		
		document.getElementById('ratingImg').src = "images/xx/rating" + roundedAvg + ".gif";
		document.getElementById('ratingImg').alt = avgPageRank;
		document.getElementById('ratingImg').title = avgPageRank;
		document.getElementById('numUsers').innerHTML = ' (' + numUsers + ' Users)';
	} else {
	}
 }; 

Rating.setPageRankInfoForCite = 
 function (){ 	
 	var pageRankVar=trim(document.frmCitePageRank.pageRankInfo.value);
	var numPageRankVars = pageRankVar.split(",");
	if(numPageRankVars!=null && numPageRankVars!="null" && numPageRankVars.length>1){
		var docRank = "";
		var pageRankInfo = "";
		var docId = "";
		var roundedAvg = "";
		var avgPageRank = "";
		var numUsers = "";
		var ratImg = "";
		var numUsrs = "";
		
		for(i=0;i<numPageRankVars.length;i++){
		
			docRank = trim(numPageRankVars[i]);
			if(docRank!=null && docRank!="null" && docRank.length>1){
				//docRank = docId | roundedAverage | averagePageRank | totalNumUsers (format)
				
				pageRankInfo = docRank.split("|");
				docId = pageRankInfo[0];
				roundedAvg = pageRankInfo[1];
				avgPageRank = pageRankInfo[2];
				numUsers = pageRankInfo[3];
				
				ratImg = docId + 'ratingImg';
				numUsrs = docId + 'numUsers';
	
				document.getElementById(ratImg).src = "images/xx/rating" + roundedAvg + ".gif";
				document.getElementById(ratImg).alt = avgPageRank;
				document.getElementById(ratImg).title = avgPageRank;
				document.getElementById(numUsrs).innerHTML = ' (' + numUsers + ' Users)';
			}
		}
	} else {
	}
 };
 
function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); };
// end Rating namespace

// begin Navigation namespace

var Navigation = {};
		
Navigation.SetCookies =
	function (orgId, topicId, dateId, sectionId, backgroundClass, catId) {
		TopicList.SetTopicDateCookie(orgId, topicId, dateId, sectionId, backgroundClass, catId);
		Newsstand.SetSectionDateCookie(topicId, dateId, sectionId);
	};

// end Navigation namespace





// begin Newsstand namespace
var Newsstand = {}; // create namespace

Newsstand.MaxDatesInList        = 0;     // value is set by Newsstand.InitializeForm()
Newsstand.MaxSeachNameSize      = 0;     // value is set by Newsstand.InitializeForm()
Newsstand.SearchNameDiv         = null;
Newsstand.SectionDateCookieName = "LnpSectionDateNewsstand";
Newsstand.TruncInd              = "...";

Newsstand.CreateArrowImg =
	function() {
		var arrowImg          = document.createElement("IMG");
		arrowImg.border       = "0";
		arrowImg.height       = "7";
		arrowImg.width        = "7";			
		arrowImg.style.margin = "5px";
		arrowImg.alt          = "";	
		arrowImg.style.verticalAlign = "middle";
		return arrowImg;
	}

Newsstand.HideSearchNameDiv =
	function () { 
		Common.HideObject( Newsstand.SearchNameDiv );
	};

Newsstand.InitializeControls = 
	function ( dateControl, sectionControl ) {

		var selectedDateId    = "0";
		var selectedSectionId = "0";
		
		if ((document.frmSubmit.filterByDateDefault.value == "first") &&
		    (dateIds.length > 1)) 
		{
			selectedDateId = dateIds[1];
		}
	
//		var topicId   = document.frmNewsstand.topicId.value;
		var topicId   = document.frmSubmit.topicId.value;
		var recordStr = Common.GetCookieRecordAsString(Newsstand.SectionDateCookieName, topicId);
		var fields    = recordStr.split(Common.CookieFieldSeparator);

		if (fields.length >= 3) {
			if (fields[1] != "") {
				selectedDateId = fields[1];
			}
			if (fields[2] != "") {
				selectedSectionId = fields[2];
			}
		}	

		Newsstand.InitializeSectionControl(sectionControl, selectedSectionId);
		Newsstand.InitializeDateControl(dateControl, selectedDateId, sectionControl);		
		
		// If "All" option (first option) is not selected, 
		// then need to re-populate Section control to only contain valid entries for item selected in Date control
		if (selectedDateId != 0) {
			Newsstand.RePopulateSectionControl(dateControl, sectionControl);
		}				
	};

Newsstand.InitializeDateControl =
	function ( dateControl, selectedDateId, sectionControl ) {
		var itemSelected = false;

		controlSize = dateControl.length;		
		for (i = controlSize - 1; i >= 0; i--) {
			dateControl.options[i] = null;
		}	

		sectionIdx        = sectionControl[sectionControl.selectedIndex].value;
		arrayPositionsStr = sectionDates[sectionIdx];
		arrayPositions    = arrayPositionsStr.split(",");	

		for (i = 0; i < arrayPositions.length && i <= Newsstand.MaxDatesInList; i++) {
	
			var pos  = arrayPositions[i];
			var name = dateNames[pos];
			
			if (i == Newsstand.MaxDatesInList) {
				name = name + " and before";
			}
				
			dateControl.options[i] = new Option(name, pos, false, false);					

			if (dateIds[pos] == selectedDateId) { 
				dateControl.options[i].selected = true;	
				itemSelected = true;
			}		
		}
	
		if (!itemSelected) { 
				
			// If date drop down contains an "MM/DD/YYYY and before" entry and 
			// selectedDateId is numerically equal to or less than this date,
			// then select "MM/DD/YYYY and before" entry;
			// otherwise select "All" entry (first item in list).
			//
			//   NOTE: Date values are in YYYYMMDD format

			if (dateControl.options.length > Newsstand.MaxDatesInList) {
			
				pos           = dateControl[Newsstand.MaxDatesInList].value;
				beforeAsStr   = dateIds[pos];
				beforeAsNum   = new Number(dateIds[pos]);
				selectedAsNum = new Number(selectedDateId);
				
				if (selectedAsNum.valueOf() <= beforeAsNum.valueOf()) {
					dateControl.options[Newsstand.MaxDatesInList].selected = true;
					itemSelected = true;
				}
			}
			
			if (!itemSelected) {
				dateControl.options[0].selected = true;
			}
		}		
	};
	
Newsstand.InitializeSectionControl =
	function ( sectionControl, selectedSectionId ) {
	
		var itemSelected = false;

		controlSize = sectionControl.length;		
		for (i = controlSize - 1; i >= 0; i--) {
			sectionControl.options[i] = null;
		}	

		for (i = 0; i < sectionIds.length; i++) {
		
			name = sectionNames[i];
 
			if (name.length > Newsstand.MaxSeachNameSize) {
				name = name.substr(0, Newsstand.MaxSeachNameSize) + Newsstand.TruncInd;
			}

			sectionControl.options[i] = new Option(name, i, false, false);
									
			if (!itemSelected) {
				if (sectionIds[i] == selectedSectionId) {
					sectionControl.options[i].selected = true;
					itemSelected = true;
				}
			}		
		}

		if (!itemSelected) { // select first item in date drop down assuming invalid/old section id in cookie
			sectionControl.options[0].selected = true;
		}	
	};

Newsstand.InitializeForm = 
	function ( dateControl, sectionControl ) {
	 	Newsstand.MaxSeachNameSize = document.frmTab.maxSeachNameSize.value;
	 	Newsstand.MaxDatesInList   = document.frmTab.maxDatesInList.value;
		Newsstand.InitializeControls(dateControl, sectionControl);		
		Newsstand.RetrieveDocs(dateControl, sectionControl);	
	};
		
Newsstand.LoadDocList =
	function (htmlText, previousHref, nextHref, numLinks, showPageNumbers) {
	
		tabIndex = 3;
		tabIndex = Newsstand.UpdateNextPrevLink("TopPrevNextLinksDiv",    previousHref, nextHref, tabIndex, numLinks, showPageNumbers);
		tabIndex = Newsstand.UpdateNextPrevLink("BottomPrevNextLinksDiv", previousHref, nextHref, tabIndex, numLinks, showPageNumbers);	
		parent.document.getElementById("DocumentListContent").innerHTML = htmlText;
		Newsstand.preCheckBoxes();
		Newsstand.ShowCiteList();	
			
	};	
		
Newsstand.ProcessChange = 
	function ( dateControl, sectionControl, updatedControl ) {		

		if (updatedControl == "dateIdSelect") {	
			Newsstand.RePopulateSectionControl(dateControl, sectionControl);
			document.frmSubmit.start.value = 1;	// retrieve documents starting with first one for this date				
		} else if (updatedControl == "sectionIdSelect") {						
			Newsstand.RePopulateDateControl(dateControl, sectionControl);						
		}
		
		dateIdx    = dateControl[dateControl.selectedIndex].value;
		sectionIdx = sectionControl[sectionControl.selectedIndex].value;

		Newsstand.SetSectionDateCookieUsingForm(dateIds[dateIdx], sectionIds[sectionIdx]);
		document.frmSubmit.checkedItems.value = getCheckedItems();
		Newsstand.RetrieveDocs(dateControl, sectionControl);	
	};

Newsstand.ProcessNextPrevLinkOLD = 
	function ( href ) {	
	
		Newsstand.ShowRetrieveMessage();
			
		window.frames['contentLoader'].location.href = href;								
	};
	
Newsstand.getCheckedItemsList = 
	function (){
		dml=document.frmTab;
		return getCheckedItemsAll(dml);
	};
	
Newsstand.preCheckBoxes = 
	function() {
		dml=document.frmTab;
		preCheckBoxesAll(dml);
	};
	
Newsstand.ProcessFirstPageLink = 
	function (action){
		var tempArray = action.split(",");

		document.frmSubmit.Action.value = tempArray[0];
		document.frmSubmit.orgId.value = tempArray[1];
		document.frmSubmit.topicId.value = tempArray[2];
		document.frmSubmit.isPreview.value = tempArray[3];
		document.frmSubmit.sectionId.value = tempArray[4];
		document.frmSubmit.dateId.value = tempArray[5];
		document.frmSubmit.start.value = 1;

		document.frmSubmit.checkedItems.value = Newsstand.getCheckedItemsList();

		Newsstand.ShowRetrieveMessage();

		document.frmSubmit.submit();
	};
	
Newsstand.ProcessLastPageLink = 
	function (action, start){
		var tempArray = action.split(",");

		document.frmSubmit.Action.value = tempArray[0];
		document.frmSubmit.orgId.value = tempArray[1];
		document.frmSubmit.topicId.value = tempArray[2];
		document.frmSubmit.isPreview.value = tempArray[3];
		document.frmSubmit.sectionId.value = tempArray[4];
		document.frmSubmit.dateId.value = tempArray[5];
		document.frmSubmit.start.value = start;

		document.frmSubmit.checkedItems.value = Newsstand.getCheckedItemsList();

		Newsstand.ShowRetrieveMessage();

		document.frmSubmit.submit();
	};
	
Newsstand.ProcessNextPrevLink = 
	function (action, orgId, topicId, isPreview, sectionId, dateId, start){
		var tempArray = action.split(",");

		document.frmSubmit.Action.value = tempArray[0];
		document.frmSubmit.orgId.value = tempArray[1];
		document.frmSubmit.topicId.value = tempArray[2];
		document.frmSubmit.isPreview.value = tempArray[3];
		document.frmSubmit.sectionId.value = tempArray[4];
		document.frmSubmit.dateId.value = tempArray[5];
		document.frmSubmit.start.value = tempArray[6];

		document.frmSubmit.checkedItems.value = Newsstand.getCheckedItemsList();

		Newsstand.ShowRetrieveMessage();

		document.frmSubmit.submit();
	};

Newsstand.ProcessNextPrevLink = 
	function (action){
		var tempArray = action.split(",");

		document.frmSubmit.Action.value = tempArray[0];
		document.frmSubmit.orgId.value = tempArray[1];
		document.frmSubmit.topicId.value = tempArray[2];
		document.frmSubmit.isPreview.value = tempArray[3];
		document.frmSubmit.sectionId.value = tempArray[4];
		document.frmSubmit.dateId.value = tempArray[5];
		document.frmSubmit.start.value = tempArray[6];

		document.frmSubmit.checkedItems.value = Newsstand.getCheckedItemsList();

		Newsstand.ShowRetrieveMessage();

		document.frmSubmit.submit();
	};

Newsstand.RePopulateDateControl = 
	function ( dateControl, sectionControl ) {

		currentPos        = dateControl[dateControl.selectedIndex].value;
		
		sectionIdx        = sectionControl[sectionControl.selectedIndex].value;
		arrayPositionsStr = sectionDates[sectionIdx];
		arrayPositions    = arrayPositionsStr.split(",");		
	
		controlSize = dateControl.length;		
		for (i = controlSize - 1; i >= 0; i--) {
			dateControl.options[i] = null;
		}	

		for (i = 0; i < arrayPositions.length && i <= Newsstand.MaxDatesInList; i++) {
		
			pos  = arrayPositions[i];
			name = dateNames[pos];;	

			if (i == Newsstand.MaxDatesInList) {
				name = name + " and before";
			}			

			dateControl.options[i] = new Option(name, pos, false, false);			
						
			if (pos == currentPos) {
				dateControl.options[i].selected = true;			
			}
		}	
	};

Newsstand.RePopulateSectionControl = 
	function ( dateControl, sectionControl ) {

		currentPos        = sectionControl[sectionControl.selectedIndex].value;

		dateIdx           = dateControl[dateControl.selectedIndex].value;
		arrayPositionsStr = dateSections[dateIdx];
		arrayPositions    = arrayPositionsStr.split(",");		

		controlSize = sectionControl.length;		
		for (i = controlSize - 1; i >= 0; i--) {
			sectionControl.options[i] = null;
		}

		for (i = 0; i < arrayPositions.length; i++) {
		
			pos  = arrayPositions[i];
			name = sectionNames[pos];
			
			if (name.length > Newsstand.MaxSeachNameSize) {
				name = name.substr(0, Newsstand.MaxSeachNameSize) + Newsstand.TruncInd;
			}
			 	
			sectionControl.options[i] = new Option(name, pos, false, false);
			 		 			
			if (pos == currentPos) {
				sectionControl.options[i].selected = true;
			}			
		}	
	};
			
Newsstand.RetrieveDocs = 
	function ( dateControl, sectionControl ) {	
		
		window.focus();	// remove focus from dropdown control
		
		Newsstand.ShowRetrieveMessage();	
			
		dateIdx    = dateControl[dateControl.selectedIndex].value;
		sectionIdx = sectionControl[sectionControl.selectedIndex].value;	

		// dateId needs to start with a minus sign for "MM/DD/YYYY and before" entry 
		// which is last entry (Newsstand.MaxDatesInList) in list
		// 
		var prefix = "";
		if (dateControl.selectedIndex == Newsstand.MaxDatesInList) {
			prefix = "-";
		}

//		document.frmNewsstand.dateId.value    = prefix + dateIds[dateIdx];
//		document.frmNewsstand.sectionId.value = sectionIds[sectionIdx];		
	
//		document.frmNewsstand.submit();		
					
		document.frmSubmit.dateId.value    = prefix + dateIds[dateIdx];
		document.frmSubmit.sectionId.value = sectionIds[sectionIdx];		
	
		document.frmSubmit.submit();
	};

Newsstand.SetSectionDateCookie =
	function (topicId, dateId, sectionId) {	
	
		if (topicId == "") {
			return;
		}
		
		var name    = Newsstand.SectionDateCookieName;
		var value   = Newsstand.SetSectionDateCookieValue(name, topicId, dateId, sectionId);	
		var domain  = Common.GetDomain(window.location);
		var path    = Common.CookiePath;
		var secure  = "";
		var expires = "";  // causes cookie to be session based / to expire when close browser

		Common.SetCookie(name, value, domain, path, secure, expires);		
	};

Newsstand.SetSectionDateCookieUsingForm =
	function (dateId, sectionId) {
//		var topicId = document.frmNewsstand.topicId.value;
		var topicId = document.frmSubmit.topicId.value;
		Newsstand.SetSectionDateCookie(topicId, dateId, sectionId);
	};
	
// Cookie format:
//
//   :topicId1,dateId1,sectionId1:topicId2,dateId2,sectionId2:...
//
Newsstand.SetSectionDateCookieValue =
	function (cookieName, topicId, dateId, sectionId) {	

					
		var newRecordStr = new String(topicId + Common.CookieFieldSeparator + 
		                              dateId  + Common.CookieFieldSeparator +
		                              sectionId);
		                              		
		return Common.SetCookieRecord(cookieName, topicId, newRecordStr);		                                
	};
		
Newsstand.ShowCiteList =
	function () {
		Common.HideObject("DocumentListRetrieveMsg");
		Common.ShowObject("DocumentListContent");				
	};

Newsstand.ShowRetrieveMessage =
	function () {
		Common.HideObject("DocumentListContent");	
		Common.ShowObject("DocumentListRetrieveMsg");			
	};
	
Newsstand.ShowSearchNameDiv =
	function ( sectionControl ) {
	
		if (!Newsstand.SearchNameDiv) {
			Newsstand.SearchNameDiv = document.createElement("Newsstand.SearchNameDiv");
			Newsstand.SearchNameDiv.id                    = "Newsstand.SearchNameDiv";
			Newsstand.SearchNameDiv.style.fontSize        = "7pt";
			Newsstand.SearchNameDiv.style.fontFamily      = "Verdana, Arial,Helvetica,Sans-Serif";
			Newsstand.SearchNameDiv.style.paddingLeft     = "2";
			Newsstand.SearchNameDiv.style.paddingRight    = "2";
			Newsstand.SearchNameDiv.style.paddingTop      = "2";
			Newsstand.SearchNameDiv.style.paddingBottom   = "2";
			Newsstand.SearchNameDiv.style.position        = "absolute";
			Newsstand.SearchNameDiv.style.backgroundColor = "#FFFFCC";
			Newsstand.SearchNameDiv.style.border          = "1px #000000 solid";
			document.body.appendChild(Newsstand.SearchNameDiv);
		}
	
		sectionIdx                               = sectionControl[sectionControl.selectedIndex].value;
		Newsstand.SearchNameDiv.innerHTML        = sectionNames[sectionIdx];

		
		var optLbl = sectionControl[sectionControl.selectedIndex].text;
		
		if ( optLbl.indexOf( Newsstand.TruncInd ) > -1 ) {
			Common.ShowObject( Newsstand.SearchNameDiv, "inline" );	
			Common.PositionDiv(sectionControl, Newsstand.SearchNameDiv);
		}
	};
		
Newsstand.UpdateNextPrevLink =
	function (divName, previousHref, nextHref, tabIndex, numLinks, showPageNumbers) {
		div = parent.document.getElementById(divName);
		
		if (div == undefined) {
			return tabIndex;
		}
			
		// Remove existing content
		for ( var n = div.childNodes.length - 1; n >= 0; n-- ) {
			div.removeChild( div.childNodes[n] );
		}

		if(showPageNumbers == undefined){
			showPageNumbers = 'false';
		}
					
		if ((previousHref != undefined) && (previousHref != ',') && (previousHref.length > 0)) {
			if(showPageNumbers == 'true'){
				var firstLink               = document.createElement("A");
				firstLink.href              = "javascript:parent.Newsstand.ProcessFirstPageLink('" + previousHref + "')";
				firstLink.name              = "First";
				firstLink.tabIndex          = tabIndex;
				firstLink.className         = "pageLinks";
				firstLink.style.marginRight = "8px";
				firstLink.alt="First Page";
				firstLink.title="First Page";
	
				var arrowImg = Newsstand.CreateArrowImg();
				arrowImg.src = "images/xx/but_first_v3.gif";
				arrowImg.style.marginRight = "0px";
				arrowImg.style.marginLeft = "0px";
				arrowImg.alt="First Page";
				arrowImg.title="First Page";
				
				firstLink.appendChild( arrowImg );

				div.appendChild( firstLink );
			}
			var previousLink               = document.createElement("A");
			previousLink.href              = "javascript:parent.Newsstand.ProcessNextPrevLink('" + previousHref + "')";
			previousLink.name              = "Previous";
			previousLink.tabIndex          = tabIndex;
			previousLink.className         = "pageLinks";
			previousLink.style.marginRight = "8px";

			
			
			var arrowImg = Newsstand.CreateArrowImg();
			//alternate arrow based on setting.
			if(showPageNumbers == 'true'){
				arrowImg.src = "images/xx/but_prev_v3.gif";
				arrowImg.marginRight = "0px";
				arrowImg.style.marginLeft = "0px";
				arrowImg.alt="Previous Page";
				arrowImg.title="Previous Page";
			}else{
				arrowImg.src = "images/xx/prev_arrow.gif";
			}
			
			previousLink.appendChild( arrowImg );
			if(showPageNumbers != 'true'){
				var linkLbl = document.createElement("SPAN");			
				linkLbl.innerHTML = "Previous";
				previousLink.appendChild( linkLbl );
			}else{
				previousLink.alt="Previous Page";
				previousLink.title="Previous Page";
			}

			
			tabIndex++;
			
			div.appendChild( previousLink );
		} 	

		/* BEGIN - Build NumLinks for navigation */
		var tempArray = numLinks.split(",");
	
		var frmSubmitAction = tempArray[0];
		var frmSubmitOrgId = tempArray[1];
		var frmSubmitTopicId = tempArray[2];
		var frmSubmitIsPreview = tempArray[3];
		var frmSubmitSectionId = tempArray[4];
		var frmSubmitDateId = tempArray[5];
	
		var startNum = Math.round(tempArray[6]);
		var totalCount = Math.round(tempArray[7]);
		var resultsPerPage = Math.round(tempArray[8]);
		totalNumPages = Math.round(totalCount/resultsPerPage);	
		if(totalCount - (totalNumPages * resultsPerPage) > 0){
			totalNumPages ++;
		}
		if(showPageNumbers == 'true'){
			var actionUrl = frmSubmitAction + "," + frmSubmitOrgId + "," + frmSubmitTopicId + "," + frmSubmitIsPreview + "," + frmSubmitSectionId + "," + frmSubmitDateId;
	
			
			numPages = 0;	
			numStr = "";
			linkNum = 0;
			range = "";
			if(totalNumPages>1){
				firstPage = 0; 
			
				if(totalNumPages>10){
					firstPage = Math.round((startNum-1)/resultsPerPage);
					if((firstPage+10)<totalNumPages && startNum==1){
						firstPage = 0;
						numPages = 10;
					} else if((firstPage+10)<totalNumPages && startNum!=1){
						numPages = firstPage + 10;
					} else if((firstPage+10)>=totalNumPages && startNum!=1){
						firstPage = totalNumPages - 10;
						numPages = totalNumPages;
					} else {
						numPages = 9;
					}
				} else {
					numPages = totalNumPages;
				}
	
				for(i=firstPage; i<numPages; i++){
					linkNum = Math.round((i*resultsPerPage) + 1);
					if ((linkNum + resultsPerPage) > totalCount) {
						range = linkNum + " - " + totalCount;
					} else {
						range = linkNum + " - " + Math.round(((i*resultsPerPage) + resultsPerPage));
					} 
					
					numLinkRef                 		= document.createElement("A");
					if(startNum==linkNum){
						numLinkRef.href 			= "javascript:void(0)";
					} else {
						numLinkRef.href             = "javascript:parent.Newsstand.ProcessNextPrevLink('" + actionUrl + "," + linkNum + "')";
					}
					numLinkRef.name              	= "Num" + linkNum;
					numLinkRef.title              	= range;
					numLinkRef.tabIndex          	= tabIndex;
					numLinkRef.className         	= "pageLinks";
					numLinkRef.style.marginLeft 	= "8px";
	
					var linkLbl = document.createElement("SPAN");			
					if(startNum==linkNum){
						linkLbl.innerHTML = "<b>" + (i+1) + "</b>";
					} else {
						linkLbl.innerHTML = (i+1);
					}
					
					tabIndex++;
				
					numLinkRef.appendChild( linkLbl );
					div.appendChild( numLinkRef );
	
					if((numLinkRef != undefined) && (numLinkRef != ',') && (numLinkRef != '') && (numLinkRef.length > 0)){
						div.appendChild( numLinkRef );
					}
				}
			}
		}
		
		/* END - Build NumLinks for navigation */
		if((startNum + resultsPerPage)<totalCount){
			if ((nextHref != undefined) && (nextHref != ',') && (nextHref.length > 0)) {
			
				/*if ((previousHref != undefined) && (previousHref.length > 0)) {		
					var separator       = document.createElement("SPAN");
					separator.innerHTML = "|";
					separator.className = "nsnavlabel nspipe";
					div.appendChild( separator );
				}*/
				
				var nextLink              = document.createElement("A");
				nextLink.href             = "javascript:parent.Newsstand.ProcessNextPrevLink('" + nextHref + "')";
				nextLink.name             = "Next";
				nextLink.tabIndex         = tabIndex;
				nextLink.className        = "pageLinks";
				nextLink.style.marginLeft = "8px";
				
													

				var arrowImg = Newsstand.CreateArrowImg();
				if(showPageNumbers == 'true'){
					arrowImg.src = "images/xx/but_next_v3.gif";
					arrowImg.marginRight = "0px";
					arrowImg.style.marginLeft = "0px";
					arrowImg.alt="Next Page";
					arrowImg.title="Next Page";
					nextLink.alt="Next Page";
					nextLink.title="Next Page";
				}else{
					var linkLbl = document.createElement("SPAN");
					linkLbl.innerHTML = "Next";
					nextLink.appendChild( linkLbl );
					arrowImg.src = "images/xx/next_arrow.gif";
				}
								
				nextLink.appendChild( arrowImg );
				div.appendChild( nextLink );
				
				if(showPageNumbers == 'true'){
					var lastLink               = document.createElement("A");
					lastLink.href              = "javascript:parent.Newsstand.ProcessLastPageLink('" + nextHref + "', '" + (Math.round((totalNumPages - 1) *resultsPerPage) + 1) + "')";
					lastLink.name              = "Last";
					lastLink.tabIndex          = tabIndex;
					lastLink.className         = "pageLinks";
					lastLink.style.marginRight = "8px";
					lastLink.alt="Last Page";
					lastLink.title="Last Page";
		
					var arrowImg = Newsstand.CreateArrowImg();
					arrowImg.src = "images/xx/but_last_v3.gif";
					arrowImg.style.marginRight = "0px";
					arrowImg.style.marginLeft = "0px";
					arrowImg.alt="Last Page";
					arrowImg.title="Last Page";
					
					lastLink.appendChild( arrowImg );
					div.appendChild( lastLink );
				}
										
				tabIndex++;			
			}
		}					
		return tabIndex;
	};					

// end Newsstand namespace




	
// begin TopicList namespace
var TopicList = {};	

TopicList.goTopicList = 
	function(orgId, isPreview, isDashboard, showChart){
		var recordStr = new String(Common.GetCookie("CiteListReturnCookie"));
		var action = "UserDisplayTopicList";
		var show = "";
		if(isDashboard){
			action = "DashboardUserDisplayTopics";
			//reset recordStr so cookie doesn't overwrite this setting
			recordStr = "";
			show = "&showChart=" + showChart;
		}
		var cat = "";
		var preview = "";
		if(isPreview){
			preview = "&isPreview=true"
		}
		if (recordStr.valueOf() != "") {
			var fields = recordStr.split(Common.CookieFieldSeparator);	
			if(fields[0] != ""){
				action = fields[0];
			}
			if (fields.length >= 2) {
				cat = "&catId=" + fields[1];
			}
		}
		var url = "/publisher/EndUser?Action=" + action + "&orgId=" + orgId + cat + show + preview;
		window.location.href = url;
	}

TopicList.SetCiteListReturnCookie =
	function (returnTo, catId) {	
		
		var name    = "CiteListReturnCookie";
		if(catId == ""){
			var value   = returnTo;	
		}else{
			var value   = returnTo + Common.CookieFieldSeparator + catId;
		}
		var domain  = Common.GetDomain(window.location);
		var path    = Common.CookiePath;
		var secure  = "";
		var expires = "";  // causes cookie to be session based / to expire when close browser

		Common.SetCookie(name, value, domain, path, secure, expires);		
	};

TopicList.TopicDateCookieName  = "LnpTopicDateTopicList";
			
TopicList.SetTopicDateCookie =
	function (orgId, topicId, dateId, sectionId, backgroundClass, catId) {	

		if (orgId == "") {
			return;
		}
		
		var name    = TopicList.TopicDateCookieName;
		var value   = TopicList.SetTopicDateCookieValue(name, orgId, topicId, dateId, sectionId, backgroundClass, catId);	
		var domain  = Common.GetDomain(window.location);
		var path    = Common.CookiePath;
		var secure  = "";
		var expires = "";  // causes cookie to be session based / to expire when close browser

		Common.SetCookie(name, value, domain, path, secure, expires);		
	};

// Cookie format:
//
//   :orgId1,topicId1,dateId1,sectionId1,backgroundClass1:orgId2,topicId2,dateId2,sectionId2,backgroundClass2:...
//
TopicList.SetTopicDateCookieValue =
	function (cookieName, orgId, topicId, dateId, sectionId, backgroundClass, catId) {	
		
		var newRecordStr = new String(orgId     + Common.CookieFieldSeparator + 
		                              topicId   + Common.CookieFieldSeparator +
		                              dateId    + Common.CookieFieldSeparator +
		                              sectionId + Common.CookieFieldSeparator +
		                              backgroundClass + Common.CookieFieldSeparator +
		                              catId);	
		                              	
		return Common.SetCookieRecord(cookieName, orgId, newRecordStr);		                                
	}
					
// end TopicList namespace
	
-->