var ArticleArray = new Array();
var NumberArticles = 0;

function article (author, subject, title, date, pages, classification) {
	this.author = author;
	this.subject = subject;
	this.title = title;
	this.date = date;
	this.pages = pages;
	this.classification = classification;
}

function newArticle (a, s, t, d, p, c) {
	ArticleArray[NumberArticles++] = new article(a, s, t, d, p, c);
}

function compareAuthor(a,b){ if(a.author>b.author) {return 1;}	else {return -1;}}
function compareTitle(a,b){ if(a.title>b.title) {return 1;}	else {return -1;}}
function compareDate(a,b){ if(a.date>b.date) {return 1;}	else {return -1;}}
function comparePages(a,b){ if(a.pages>b.pages) {return 1;}	else {return -1;}}

function sortArticles ( field ){
	if(field=="author") ArticleArray.sort(compareAuthor);
	if(field=="title") ArticleArray.sort(compareTitle);
	if(field=="date") ArticleArray.sort(compareDate);
	if(field=="pages") ArticleArray.sort(comparePages);
}

newArticle("Fredericks, Sarah",	"history", "A Brief History of Science and Religion in the West", "05-04-16", "4", "feature");
newArticle("Murphy, George L.", "evolution", "Evolution: Cosmic and Biological", "05-04-16", "2", "feature");
newArticle("Symposium, Sunday Scientists", "special event", "Sunday Scientists! Symposium (Sept 17-19, 2004)", "05-04-21", "2", "news");
newArticle("Symposium, Sunday Scientists", "special event", "News Release: Sunday Scientists!", "05-04-20", "1", "feature");
newArticle("Powell, Kevin", "about Covalence", "What happened to Covalence?", "05-04-16", "1", "issue");
newArticle("Symposium, Sunday Scientists", "congregations", "What makes a congregation scientist/ science friendly?", "05-04-16", "2", "issue");
newArticle("Bucher, Gail", "about Covalence", "A note of thanks to George Koch", "05-04-16", "1", "issue");
newArticle("Jackelen, Antje", "religion and science", "Divine Action", "05-08-15", "9", "feature");
newArticle("Powell, Kevin", "about Covalence", "Our second online issue", "05-08-15", "1", "issue");
newArticle("Hanson, Ken", "religion and science", "Religion and Science 101", "05-08-15", "1", "news");
newArticle("Russell, Patrick", "book review", "Review of Evolution From Creation To New Creation", "05-08-15", "2", "book review");
newArticle("Anderson, Per", "religion and science", "Christian Responsibility and Uncertainty: The Question of Precaution", "06-03-15", "9", "feature");
newArticle("Murphy, George L.", "religion and science", "Couldn't God Get It Right?", "06-03-15", "2", "feature");
newArticle("Peters, Ted", "about Covalence", "Eight Models of Relating Science and Faith", "06-06-15", "1", "news");
newArticle("Foxe, David M.", "about Covalence", "The Inescapable Role of Place in Religious Dialogue", "06-06-15", "1", "news");
newArticle("Smith, Charles F.", "about Covalence", "The Cosmos in the Light of the Cross", "06-06-15", "1", "news");
newArticle("West, Andrew", "about Covalence", "A Theology of Land Management", "07-02-19", "1", "news");
newArticle("Klessig, Lowell", "about Covalence", "Was Creation One Big Temptation?", "07-02-19", "1", "news");
