function list_cal_dates( datesText, datesCode, titles, infos, NumOfEntriesPerPage, pageNum, YearMonth, thisMonth)
{
	
	var cal_list = '';
	
	// { this will need to be in both .js files, the other one to calculate links
	var count_entries_for_this_month = 0;
	var num_of_pages_for_this_month = 0;
	var array_of_indexs_for_this_month = new Array();
	
	//calculate the number of pages required for this YearMonth
	if(thisMonth == 1)
	{
		for(var j=0;j< NumOfEntriesPerPage;j++)
		{
			array_of_indexs_for_this_month[count_entries_for_this_month]=j;
			count_entries_for_this_month++;
		}
	}
	else{
		for(var j=0;j<(datesText.length);j++)
		{
			if((YearMonth)==datesCode[j].slice(0,6))
			{
				array_of_indexs_for_this_month[count_entries_for_this_month]=j;
				count_entries_for_this_month++;
			}
		}
	}
		
	//divide - remainder
	num_of_pages_for_this_month = ((count_entries_for_this_month/NumOfEntriesPerPage)-(count_entries_for_this_month%NumOfEntriesPerPage));
	//if remainder is > 0 add one page
	if((count_entries_for_this_month%NumOfEntriesPerPage)>0)
	{num_of_pages_for_this_month++;}
	// { this will need to be in both .js files, the other one to calculate links}
	
	
	
	//cycle through only the entries for this list
	for(var j=(NumOfEntriesPerPage*pageNum);j<((NumOfEntriesPerPage*pageNum)+NumOfEntriesPerPage);j++)
		{
			//be sure entry exists
			var g=array_of_indexs_for_this_month[j];
			
			//change style of 1st date
			var first = "";
			if(j==0)
			{var first = "1";}
			
			if(datesCode[g])
			{
				cal_list+='<li id="'+datesCode[g]+'"><span id="cal_dates'+first+'">'+datesText[g]+'</span><br /><span id="cal_title">'+titles[g]+' </span><span class="more_button collIco"><a href="javascript:void(0)">more</a></span><div class="panel" style="display:none;" >'+infos[g]+'&nbsp; </div></li>';
			}
		}
	
	
	return cal_list;
}


