
var headlines = new Array(
		['Success!','See some of the <a href="successes.html">CID\'s accomplishments</a>'],
		['CID News','Read our <a href="events.html">News & Views</a> newsletter and <a href="events.html">annual report</a>.'],
		['Our People','Meet <a href="staff.html">the people</a> of the CID.'],
		['More Info','<a href="about.html">What is the Cumberland CID</a>, and <a href="about.html">who benefits</a> from it?'],
		['Money','What is the <a href="funding.html">source of funding</a> for CID projects?'],
		['CID Projects','What <a href="projects.html">types of projects</a> does the CID work on? And <a href="projects.html">where are they</a>?']
	);

function getHeadlines(number) {
		var used_indexes = new Array();
		var headline_str = '';
		var num_headlines = headlines.length;
		for(var i=0; i<number; i++) {
			var rand = getUniqueIndex(num_headlines,used_indexes);
			used_indexes.push(rand);
			headline_str += '<h2>' + headlines[rand][0] + '</h2><p>' + headlines[rand][1] + '</p>';
		}
		return headline_str;
}

function getUniqueIndex(ceiling,used) {
	do {
		var rand_index = Math.floor(Math.random()*ceiling);
		var unique=true;
		for(var i=0; i<used.length; i++) {
			if(rand_index == used[i]) {
				unique=false;
			}
		}
	} while(!unique);
	
	return rand_index;
}