/* Portal Output Commands */
document.write("\<div id=\"smartbrief\"\>\<h4\>Industry News \<a target='_blank' href='"+SB_SIGNUP_URL+"'\>\<small\>(Powered by SmartBrief)\</small\>\</a\>\</h4\>");

//updated date
if(issue!=null && sections.length>0)
{
	document.write("\<h5\>"+issue.date+"\</h5\>");
}

//print sections/stories
if(issue!=null && sections.length>0)
{
	var j=0;
	var storyNo=0;
	while(j<sections.length)
	{
		stories = sections[j].stories;
		//print stories
		document.write("\<ul\>")
		var i = 0;
		while(i<stories.length && storyNo<SB_MAX_STORIES_PER_SECTION && storyNo<SB_MAX_STORIES_TOTAL)
		{
			storyNo++;
			document.write("\<li\>");
			var story_url = SB_LINK+"&copyid="+stories[i].copyid+"&issueid="+issue.id+"&style="+issue.style
			var linkHref = SB_SERVER + "/servlet/rdrc?u="+escape(story_url)+"&i="+issue.id+"&p="+SB_PORTAL_ID;
			document.write("\<a TARGET='_blank' class='"+SB_HEADLINE_CLASS+"' href='"+linkHref+"'\>"+stories[i].headline+"\</a\>");
			document.write("\</li\>");
			i++;
		}//end while (stories)
		j++;
		document.write("\</ul\>")
	} //end for(j< sections.length)
} //end if(sections.length>0)
else
{
	document.write("\<p class=\"unavailable\"\>This news feed is temporarily unavailable.\</p\>");
}

var xml_lmid = getCookie("xml_lmid");
if(xml_lmid!=null && xml_lmid!="" && xml_lmid!="null")
{
	if(SB_LOGOUT_LINK_TEXT!="")
	{
		//write the logout link
		document.write("\<p class=\"signup bottom\"\>");
		document.write("\<a class='"+SB_LINK_CLASS+"' target='_blank' href='"+SB_LOGOUT_URL+"'\>"+SB_LOGOUT_LINK_TEXT+"\</a\>");
		document.write("\</p\>");
	}
}
else
{
	if(SB_SIGNUP_LINK_TEXT!="")
	{
		//write the signup link
		document.write("\<p class=\"signup bottom\"\>");
		document.write("\<a class='"+SB_LINK_CLASS+"' target='_blank' href='"+SB_SIGNUP_URL+"'\>"+SB_SIGNUP_LINK_TEXT+"\</a\>");
		document.write("\</p\>");
	}
}

//write the current issue link
if(issue!=null && SB_ISSUE_LINK_TEXT!="")
{
	document.write("\<p class=\"bottom dot\"\>&bull;\</p\>\<p class=\"currentissue bottom\"\>");
	document.write("\<a class='"+SB_LINK_CLASS+"' target='_blank' href='"+SB_LINK+"&issueid="+issue.id+"'\>"+SB_ISSUE_LINK_TEXT+"\</a\>");
	document.write("\</p\>");
}
document.write("\</div\>");
