// JavaScript Document






//This function defines the parts of each article
function hr_article(title, subject, author, destination)
{
this.title=title;
this.subject=subject;
this.author=author;
this.destination=destination;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////





// THIS IS THE SECTION YOU EDIT!
//These are the titles, subjects, authors and urls of each article (in that order!)
//Make sure that you enter each of thsese pieces of information in double quotes, seperated by a comma. Like this: ("title","subject","author","url");
//The subject and author are case sensitive. Make sure to capitolize the first letter of each word, like this, "General HR"

var article= new Array();
article[0]= new hr_article("Do you have a real 'Pay-for-Performance' Compensation System, or do you Just Call it Pay-for-Performance?","Compensation and Benefits","Deborah Gallant","actualArticles/payforGallant.html");

article[1]= new hr_article("13 Tips for a Quick Fix or Real Change","HR Career Development","Pearl Ivey","actualArticles/thirteentipsIvey.html");

article[2]= new hr_article("Worksite Wellness Teams","Wellness and Workplace Health","Susan Olson","actualArticles/worksitewellnessOlson.html");

article[3]= new hr_article("Best Practices: An Interactive Approach to Progressive Discipline","Employee Relations","Nicole Morin-Scribner","actualArticles/interactiveScribner.html");

article[4]= new hr_article("On More Step: Maine Employers' Initiative to Support Higher Education","Workforce Development","Tim Sardano","actualArticles/onemoreSardano.html");

article[5]= new hr_article("Maine Apprenticeships: The Other Four-Year Degree","Workforce Development","Tim Sardano","actualArticles/maineapprenticeshipsSardano.html");

article[6]= new hr_article("Creating an Epic Safety Culture","Workers' Comp", "Clark Phinney","actualArticles/epicsafetyPhinney.html");

article[7]= new hr_article("Making 'Best Places to Work' Work for You","Recruitment and Retention","HRTimes","actualArticles/bestplacesHrtimes.html");

article[8]= new hr_article("Managing Health Care Benefit Expense in Today's Unprecedented Economic Times","Compensation and Benefits","Mercer","actualArticles/managinghealthMercer.html");

article[9]= new hr_article("Legal Update: 2009 SHRM Employment Law and Legislation Conference","Legislative and Legal","William Saufley","actualArticles/shrmemploymentSaufley.html");

article[10]= new hr_article("Are You Ready for an OFCCP Audit?","Legislative and Legal","Deborah Gallant","actualArticles/youreadyGallant.html");

article[11]= new hr_article("Change has Come to the Family & Medical Leave Act","Legislative and Legal","Matthey Tarasevich","actualArticles/changehascomeTarasevich.html");

article[12]= new hr_article("Effective Problem Solving: Avoiding the Activity Trap","Employee Relations","Rick Dacri","actualArticles/effectiveproblemDacri.html");

article[13]= new hr_article("How to Choose an Occupational Medicine Provider","Workers' Comp","Susan Olson","actualArticles/howchooseGwozdz.html");

article[14]= new hr_article("How Accurate are Your Job Descriptions","General HR","Jim Briggs","actualArticles/howaccurateBriggs.html");

article[15]= new hr_article("A Look at 'Uncomplicating Management'", "Employee Relations", "Kristine Avery", "actualArticles/alookavery.html");

article[16]= new hr_article("Maine's Apprenticeship Program 2008 Annual Report", "Workforce Development", "Maine Department of Labor", "actualArticles/mainesapprenticeshipFortman.html");

article[17]= new hr_article("Investing in Clear Workplace Communication", "Employee Relations", "Malvina Gregory", "actualArticles/InvestingInGregory.html");

article[18]= new hr_article("Manage Costs and Invest in Talent", "Recruitment and Retention", "April Clark", "actualArticles/managingcostsclark.html");

article[19]= new hr_article("Best Practices: Company Wellness With Sarah Conroy of B2B Well Consortium", "Best Practices", "HRTimes Staff", "actualArticles/bestpracticeshrtimes1.html");

article[20]= new hr_article("Managing is Hard: The Case for Supervisory Training", "Training and Development", "Rick Dacri", "actualArticles/managingisdacri.html");

article[21]= new hr_article("Smart Manager Blows It...Are You?", "Training and Development", "David Lee", "actualArticles/smartmanagerLee.html");

article[22]= new hr_article("Who Are the Customers of Human Resources?", "General HR", "Ken Moore", "actualArticles/whoareMoore.html");

article[23]= new hr_article("Financial Wellness: More Than a 401(k) Plan", "Compensation and Benefits", "Alison Hinson", "actualArticles/financialwellnessHinson.html");



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////






//Tells the pages to first list the articles that have been most recently added (reverses the array).
article.reverse();







//Writes the 12 newest articles to the page.

function put_all_articles()
{
	 var listed_articles="";
	 
	for (var i=0; i<11; i++)
	{
	listed_articles=document.write("<p class='articletitle'><a href='"+article[i].destination+"'onclick=\"window.open('"+article[i].destination+"'); return false;\" target='_blank'>"+article[i].title+"</a><br/>"+article[i].author+"</p></br>");
	}
	return listed_articles;
	}









///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////// This function calls the above functions and lists the articles according to subject, depending on what is selected in the subject drop down menu.  /////////////////////////////////////



function awesomesubjectsort() {

   document.getElementById('sortarticles').innerHTML="";
   var listed_articles="";
   
   for (var i in article)
	{
   if (article[i].subject==document.article_subject.subject_choose.options[document.article_subject.subject_choose.selectedIndex].text)
	{
		listed_articles=listed_articles+"<p class='articletitle'><a href='"+article[i].destination+"'onclick=\"window.open('"+article[i].destination+"');return false;\" target='_blank'>"+article[i].title+"</a><br/>"+article[i].author+"</p></br>";
	}
	
	if (document.article_subject.subject_choose.options[document.article_subject.subject_choose.selectedIndex].text=="All Articles")
	{
		
	listed_articles=listed_articles+"<p class='articletitle'><a href='"+article[i].destination+"'onclick=\"window.open('"+article[i].destination+"');return false;\" target='_blank'>"+article[i].title+"</a><br/>"+article[i].author+"</p></br>";
	
	}

}
	document.getElementById('sortarticles').innerHTML = listed_articles;
}





///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////// This function calls the above functions and lists the articles according to author depending on what is selected in the author drop down menu.  /////////////////////////////////////

	
	



function awesomeauthorsort() {

   document.getElementById('sortarticles').innerHTML="";
   var listed_articles="";
   
   for (var i in article)
	{
   if (article[i].author==document.article_author.author_choose.options[document.article_author.author_choose.selectedIndex].text)
	{
		listed_articles=listed_articles+"<p class='articletitle'><a href='"+article[i].destination+"'onclick=\"window.open('"+article[i].destination+"');return false;\" target='_blank'>"+article[i].title+"</a><br/>"+article[i].author+"</p></br>";
		
}
}
	document.getElementById('sortarticles').innerHTML = listed_articles;
}