//WARNING: do not use double quotes anywhere in the headline or body text use &quot; instead.
//single quotes are ok. be sure to use single quotes on any embedded html attributes.


var itemsToShow = 3;
var troopNews = {

	items:	[
	
		 {headline:"Troop Calendar Updated", body:"Take a look at the calendar and note the upcoming events. You certainly don't want to miss anything."}
		,{headline:"Scout Accounts Updated", body:"All of the boys &quot;Scout Account&quot; balance were update as of November 12th. The update includes the results of our popcorn sales."}
		,{headline:"Massawepie Information", body:"As you probably already know Massawepie is a premier destination for scouts who want a little Adirondack adventure to spice up their summer vacation."}
		,{headline:"Klondike Derby Photos Added", body:"The Annual Klondike Derby event was held this year. For those of you who don't know the Klondike Derby is a competition pitting scout troops from around the district (council?) against each other in a test of Winter camping skills. Hope you can join us next winter. In the mean-time check out <a href='http://troop207.org/gallery/main.php'>these photos</a>."}

	]//end items array
	
};//end troop news declaration



function loadAbridgedNews()
{

	for (var entryIndex = 0; entryIndex < Math.min(itemsToShow, troopNews.items.length); entryIndex++) {

		var headline = "<h3>" + troopNews.items[entryIndex].headline + "</h3>";
		var story = "<p>" + troopNews.items[entryIndex].body + "</p>";
		$(headline + story).appendTo('div#abridged-news');
	}
	
	var moreNews = troopNews.items.length > itemsToShow;
	if(moreNews) {
		$("div#more-news").append("<a href='troopnews.html'>more news...</a>");
	}
}

function loadNews()
{
	for (var entryIndex = 0; entryIndex < troopNews.items.length; entryIndex++) {

		var headline = "<h3>" + troopNews.items[entryIndex].headline + "</h3>";
		var story = "<p>" + troopNews.items[entryIndex].body + "</p>";
		$(headline + story).appendTo('div#all-news');
	}	
}

