var encServerName = 'archive.elca.org';var enc_dynamic = 1;
var enc_option = 4;
var enc_border = 1;
var enc_DisplayHeadline = 5;
var enc_TotalHeadlines = 25;
var enc_bgcolor = '#FFFFFF';
var enc_themecolor = '#FFCF00';
var enc_themecolorover = '#F8F098';
var enc_themetextcolor = '#000000';
var enc_link = '#0000CC';
var enc_visited = '#663366';
var enc_hover = '#FF9020';
var Headline = new Array();
var URL = new Array();
var NumRecs = 25;
var cntr = 0;
Headline[cntr] = 'Jackson-Skelton Elected LWF Treasurer, Vice President LWF North America';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4598';
cntr = cntr + 1;
Headline[cntr] = 'ELCA Presiding Bishop Calls for Immigration Reform in Letter to Obama';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4597';
cntr = cntr + 1;
Headline[cntr] = 'ELCA Members Elected to Lutheran World Federation&#39;s Council';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4596';
cntr = cntr + 1;
Headline[cntr] = 'ELCA Members, Bishops Moved to Ensure Children Don&#39;t Go Hungry';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4595';
cntr = cntr + 1;
Headline[cntr] = 'Munib Younan Elected President of Lutheran World Federation';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4594';
cntr = cntr + 1;
Headline[cntr] = 'Lutherans Take Historic Step in Asking for Forgiveness from Mennonites';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4593';
cntr = cntr + 1;
Headline[cntr] = 'Lutheran World Federation President Pleads for Unity Despite Differences';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4592';
cntr = cntr + 1;
Headline[cntr] = 'Hollywood Movie &#39;Get Low&#39; Features ELCA Pastor&#39;s Extended Family';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4591';
cntr = cntr + 1;
Headline[cntr] = 'Lutheran World Federation President Says Ecumenical Commitment to Continue';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4590';
cntr = cntr + 1;
Headline[cntr] = 'Lutheran World Federation Meets In &#39;Confident Hope,&#39; Says President';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4589';
cntr = cntr + 1;
Headline[cntr] = 'ELCA Sierra Pacific Synod to Receive Seven Pastors by &#39;Rite of Reception&#39;';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4588';
cntr = cntr + 1;
Headline[cntr] = 'Lutheran World Federation Assembly Focused on Alleviating Hunger';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4587';
cntr = cntr + 1;
Headline[cntr] = 'Robert Vogel Appointed Interim President at Texas Lutheran University';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4586';
cntr = cntr + 1;
Headline[cntr] = 'LCMS Convention Requests &#39;Thorough Response&#39; to ELCA Social Statement';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4585';
cntr = cntr + 1;
Headline[cntr] = 'Lutherans Remind New Orleanians that &#39;They are not Forgotten&#39;';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4584';
cntr = cntr + 1;
Headline[cntr] = 'ELCA, United Methodist Church Embark on New Relationship';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4583';
cntr = cntr + 1;
Headline[cntr] = 'LCMS Convention Votes to Continue Cooperative Work with ELCA';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4582';
cntr = cntr + 1;
Headline[cntr] = 'Lutherans to Meet in Germany July 20-27 for LWF Eleventh Assembly';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4581';
cntr = cntr + 1;
Headline[cntr] = 'Marj Leegard, Lutheran Woman Today Columnist, Dies';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4580';
cntr = cntr + 1;
Headline[cntr] = 'ELCA&#39;s Dana College Suspends Operations';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4579';
cntr = cntr + 1;
Headline[cntr] = 'LCMS Convention Responds to 2009 ELCA Human Sexuality Decisions';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4578';
cntr = cntr + 1;
Headline[cntr] = 'ELCA Presiding Bishop Offers Best Wishes to New LCMS President-Elect';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4577';
cntr = cntr + 1;
Headline[cntr] = 'ELCA Presiding Bishop Says Time for Immigration Reform is Now';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4576';
cntr = cntr + 1;
Headline[cntr] = 'Three ELCA Members Perish in Oklahoma Plane Crash';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4574';
cntr = cntr + 1;
Headline[cntr] = 'Juan Cobrda, Former Bishop of ELCA Slovak Zion Synod, Dies';
URL[cntr] = 'http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx?a=4573';
cntr = cntr + 1;
NumRecs = enc_TotalHeadlines;
var enc_height = '180';
var enc_width = '354';
var enc_DisplayHeadline = 5;
var enc_headerimage = 'encElcaGlobe.gif';
document.write("<script language=JavaScript1.2 TYPE=text/javascript src='http://" + encServerName + "/scriptlib/co/Feeds/Feed_Log/ecfLog.asp?HostName=" + location.href + "&encFeedID=1'></script>");//This page relies on variables created and set in encNews.asp

//History:
//
//10/11/2001  tloza - Changed paging so that only IE 5.0 or > instead of 4.0
//                    because we received an email about it not working in 4.0.
//
//05/14/2002  Chris Albrecht - Allowed for logging of server names which pull the content feed.
//				               Also, allowed for user to customize the content feed.
//
//07/22/2004  PMendez - removed the log script "/scriptlib/co/Feeds/Feed_Log/ecfLog.asp", already being executed at  "/scriptlib/CO/ELCA_News/encNews.asp"
//

//Style sheet that defines attributes of the buttons, links, and the last arrow
document.write("<STYLE>");
document.write(".Button{font-family: Tahoma, Times New Roman, Arial;font-weight:bold;background-color:'" + enc_themecolor + "'; color: " + enc_themetextcolor + "; font-size: 8pt; position: relative; width: 60}");
document.write(".Arrow{position: relative; top: -3}"); //Moves last arrow up 3 pixels to be even with text

//for IE, you can write a.classname.link or a.link.classname
//but BE CAREFUL-to work in Netscape, you need to say
//a.classname:link
document.write("a.encHeaderLink:link {color: " + enc_themetextcolor + "; text-decoration: none;}");
document.write("a.encHeaderLink:visited {color: " + enc_themetextcolor + "; text-decoration: none;}");
document.write("a.encHeaderLink:hover {color: " + enc_themetextcolor + "; text-decoration: none;}");

document.write("a.encLink:link {color: " + enc_link + "; text-decoration: none;}");
document.write("a.encLink:visited {color: " + enc_visited + "; text-decoration: none;}");
document.write("a.encLink:hover {color: " + enc_hover + "; text-decoration: none;}");

document.write("</STYLE>");

//Variable declarations
var enc_headcntr, enc_startcntr, enc_endcntr, enc_next, enc_previous;
var enc_option, enc_page, enc_imagepath;

//Initial variable settings
enc_startcntr = 0;
enc_endcntr = enc_startcntr + enc_DisplayHeadline;
enc_imagepath = "/scriptlib/images/";

//Determines if the browser supports paging
if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("MSIE 4") < 0 && navigator.appVersion.indexOf("Windows") >= 0)
{
	//Microsoft Internet Explorer version 5.0 and higher for Windows
	enc_page = 1; //turns paging on
}
else
{
	enc_page = 0; //turns paging off
}

//Determines if the table is dynamic (no whitespace)
if (enc_dynamic == 1)
{
	//Arbitrarily defined table height ensuring it will be small enough for text to 'break'
	//This ensures table will only be as big as it needs to be, creating the dynamic effect
	enc_height = 10;
}

//Image maps the ELCA header
document.write("<MAP NAME = 'enc_elcaheader'>");
document.write("<AREA HREF = 'http://www.elca.org' SHAPE = 'rect' COORDS = '0, 0, 25, 20' ALT = 'Go to the ELCA home page' onClick='NewWindow(this.href,640,450); return false;'>");
document.write("<AREA HREF='http://" + encServerName + "/news/' SHAPE = 'rect' COORDS = '26, 0, " + (enc_width + 1) + ", 20' ALT = 'ELCA News' onClick='NewWindow(this.href,640,450); return false;'>");
document.write("</MAP>");                 

//Opens new window that is centered on the screen with the appropriate URL
//Parameters:  'mypage' is the name of the new window
//             'w' and 'h' are the width and height of the window
function NewWindow(mypage, w, h)
{
	var scroll = 'yes';
	myname = 'enc_NewWin';
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
	win = window.open(mypage, myname, winprops)
}

//Changes the background color of the button for mouseover effects
//Parameters:  'color' is the value of the new color, either hexidecimal or constant (ex. #000000 or black)
function Change(color)
{
	event.srcElement.style.backgroundColor=color;
}

//Returns which headline to display first
//Parameters:  'enc_startcntr' is an integer that indicates what record to start on
function GetStartRecord(enc_startcntr)
{
	if (enc_startcntr < 0)
	{
		enc_startcntr = 0;
	}
	else if (enc_startcntr >= NumRecs)
	{
		enc_startcntr = NumRecs - enc_DisplayHeadline;
	}

	return enc_startcntr;
}

//Returns which headline to display last
//Parameters:  'enc_endcntr' is an integer that indicates what record to end on
//             'enc_startcntr' is an integer that indicates what record to start on
function GetEndRecord(enc_endcntr, enc_startcntr)
{
	if (enc_startcntr + enc_DisplayHeadline > NumRecs)
	{
		enc_endcntr = NumRecs;
	}
	else
	{
		enc_endcntr = enc_startcntr + enc_DisplayHeadline;
	}

	return enc_endcntr;
}

//Returns the current page number
//Parameters:  'thispage' is the value of the current page
//             'enc_startcntr' is an integer that indicates what record to start on
function GetCurrentPage(thispage, enc_startcntr)
{
	var remainder, tempnum;	

	tempnum = (enc_startcntr + 1) / enc_DisplayHeadline;
	remainder = (enc_startcntr + 1) % enc_DisplayHeadline;
	thispage = ((enc_startcntr + 1) - remainder) / enc_DisplayHeadline;
		
	if (thispage < tempnum)
	{
		thispage = thispage + 1;
	}
		
	return thispage;
}

//Returns the last page number
//Parameters:  'lastpage' is the value of the last page
function GetLastPage(lastpage)
{
	var tempnum;	

	lastpage = parseInt(NumRecs / enc_DisplayHeadline);
	tempnum = NumRecs / enc_DisplayHeadline;
	if (lastpage != tempnum)
	{
		lastpage = lastpage + 1;
	}
	
	return lastpage;
}

//Displays the ELCA News Content Feed
function DisplayTable(enc_startcntr)
{
	
	var thispage, lastpage, tempHTML;	

	//Calls functions to retrieve data
	enc_startcntr = GetStartRecord(enc_startcntr);
	enc_endcntr = GetEndRecord(enc_endcntr, enc_startcntr);
	thispage = GetCurrentPage(thispage, enc_startcntr);
	lastpage = GetLastPage(lastpage);
			
	enc_next = enc_endcntr;
	if (enc_next == NumRecs)
	{
		enc_next = enc_startcntr;
	}
	enc_previous = enc_startcntr - enc_DisplayHeadline;
	
	//Stores HTML code in a variable string to be displayed later
	tempHTML =
	"<TABLE WIDTH= '" + enc_width + "' HEIGHT= '" + enc_height + "' BGCOLOR=" + enc_bgcolor + " BORDER='0' CELLPADDING='0' CELLSPACING='0'>" +
	"<TR VALIGN='Top'><TD COLSPAN='3'>" +
	"<TABLE WIDTH= '" + enc_width + "' HEIGHT= '" + (enc_height - 30) + "' BGCOLOR=" + enc_bgcolor + " BORDER=0 CELLPADDING=0 CELLSPACING=0>" +
	"<TR VALIGN=Top></TR><TD>" +
	"</TD>";
	"<TR VALIGN=Top><TD WIDTH= '" + enc_width + "'></TD></TR>";
	for (enc_headcntr = enc_startcntr; enc_headcntr < enc_endcntr; enc_headcntr = enc_headcntr + 1)
	{
		tempHTML = tempHTML + "<TR VALIGN='Top'>" +
		"<TD WIDTH='10' ALIGN='Right'><IMG SRC= 'http://" + encServerName + enc_imagepath + "encArrow.gif' WIDTH='7' HEIGHT='12'></TD><TD WIDTH='" + (enc_width - (enc_width-3)) + "'></TD>" +
		"<TD WIDTH= '" + enc_width + "'>" +
		"<FONT FACE = 'Tahoma, Times' SIZE=2><A HREF = " + URL[enc_headcntr] + " CLASS='encLink' onClick='NewWindow(this.href,640,450); return false;'>"+ Headline[enc_headcntr] + "</A></FONT><BR>" +
		"</TD></TR>";
	}
	tempHTML = tempHTML + "<TR VALIGN='Bottom'>" +
	"<TD WIDTH=10 ALIGN=Right><IMG SRC= 'http://" + encServerName + enc_imagepath + "encArrow.gif' CLASS='Arrow' WIDTH=7 HEIGHT=12></TD><TD WIDTH='" + (enc_width - (enc_width-3)) + "'></TD>" +
	"<TD WIDTH= '" + enc_width + "'>" +
	"<FONT FACE = 'Tahoma, Times' SIZE=2><B><A HREF='http://www.elca.org/Who-We-Are/Our-Three-Expressions/Churchwide-Organization/Communication-Services/News/Releases.aspx' CLASS='encLink' onClick='NewWindow(this.href,640,450); return false;'>More ELCA News</A></B></FONT><BR>" +
	"</TD></TR>" +
    "</TABLE>" +
	"</TD></TR>";

	//Allows for paging if browser supports it
	if (enc_page)
	{
		tempHTML = tempHTML + "<TR VALIGN=Bottom HEIGHT=100%>" +
		"<TD WIDTH=30% ALIGN=Left>" +
		"<BUTTON CLASS='Button' onClick='DisplayTable(enc_previous)' onMouseover=Change('" + enc_themecolorover + "'); onMouseout=Change('" + enc_themecolor + "');>Previous</BUTTON>" +
		"</TD>" +
		"<TD WIDTH=40% ALIGN=Center>" +
		"<FONT FACE = 'Tahoma, Times' COLOR='" + enc_link + "' SIZE=2>Page " + thispage + " of " + lastpage + "</FONT>" +
		"</TD>" +
		"<TD WIDTH=30% ALIGN=Right>" +
		"<BUTTON CLASS='Button' onClick='DisplayTable(enc_next)' onMouseover=Change('" + enc_themecolorover + "'); onMouseout=Change('" + enc_themecolor + "');>Next</BUTTON>" +
		"</TD></TR>";
	}
	tempHTML = tempHTML + "</TABLE>";
	
	//Displays final code to the screen
	if (enc_page)
	{
		document.getElementById('NewsTable').innerHTML = tempHTML;
	}
	else
	{
		document.write(tempHTML);
	}
}

//Displays initial table so it doesn't need to be re-loaded after paging
if (enc_option != 4)
{
	//Pre-made option selected.  Table displays header graphic.
	document.write("<TABLE WIDTH= '" + enc_width + "' HEIGHT= '" + enc_height + "' BGCOLOR='#FFFFFF' BORDER='1' CELLPADDING='0' CELLSPACING='0'>");
	document.write("<TR VALIGN='Top'><TD WIDTH= '" + enc_width + "'><IMG SRC= 'http://" + encServerName + enc_imagepath + enc_headerimage + "' HEIGHT='20' WIDTH='" + (enc_width) + "' BORDER=0 USEMAP='#enc_elcaheader'>");
	document.write("<DIV ID='NewsTable'></DIV>");
}
else
{
	//Custom option selected.  Table does not display header graphic
	document.write("<TABLE WIDTH= '" + enc_width + "' HEIGHT= '" + enc_height + "' BGCOLOR=" + enc_themecolor + " BORDER= '" + enc_border + "' CELLPADDING='0' CELLSPACING='0'><TR VALIGN='Top'><TD BGCOLOR=" + enc_themecolor + ">");
	document.write("<TABLE WIDTH= '" + enc_width + "' HEIGHT= '20' BGCOLOR='#FFFFFF' BORDER= '0' CELLPADDING='0' CELLSPACING='0' COLSPAN='2'>");
	document.write("<TR VALIGN='Top'><TD WIDTH = '25' BGCOLOR=" + enc_themecolor + "><A HREF='http://www.elca.org' ALT = 'Go to the ELCA home page' onClick='NewWindow(this.href,640,450); return false;' BORDER='1'>");
	document.write("<IMG SRC= 'http://" + encServerName + enc_imagepath + enc_headerimage + "' HEIGHT='20' WIDTH='25' BORDER=0></A></TD><TD ALIGN='Center' BGCOLOR=" + enc_themecolor + ">");
	document.write("<B><A HREF = 'http://" + encServerName + "/webfeeds/' CLASS='encHeaderLink' onClick='NewWindow(this.href,640,450); return false;'>ELCA NEWS</A></B></TD></TR></TABLE>");
	document.write("<DIV ID='NewsTable'></DIV>");
}

//Calls function to display the ELCA News Content Feed
DisplayTable(0);

//Finishes the initial table
document.write("</TD></TR></TABLE>");

//Retrieves the path of the server which is pulling the ELCA content feed and sends to the corresponding ASP page through the URL
//document.write("<script language='JavaScript1.2' TYPE='text/javascript' src='http://" + encServerName + "/scriptlib/co/encLog/encLog.asp?HostName="+location.href+"&encFeedID=1'></script>");
//document.write("<script language='JavaScript1.2' TYPE='text/javascript' src='http://" + encServerName + "/scriptlib/co/Feeds/Feed_Log/ecfLog.asp?HostName=" + location.href + "&encFeedID=1'></script>");
// The above links are executed within the file "/scriptlib/CO/ELCA_News/encNews.asp"