function new_calendar (caldate){
	
	var MonthName=new Array();
		MonthName[0]="January";
		MonthName[1]="February";
		MonthName[2]="March";
		MonthName[3]="April";
		MonthName[4]="May";
		MonthName[5]="June";
		MonthName[6]="July";
		MonthName[7]="August";
		MonthName[8]="September";
		MonthName[9]="October";
		MonthName[10]="November";
		MonthName[11]="December";
		//end array
	
	var DayName=new Array();
		DayName[0]="Sun";
		DayName[1]="Mon";
		DayName[2]="Tue";
		DayName[3]="Wed";
		DayName[4]="Thu";
		DayName[5]="Fri";
		DayName[6]="Sat";
		//end array
		
	var event_month=new Array("0","0","1","1","1","4");
	var event_day=new Array("19","20","3","4","23","15");
	
	var message=new Array();
		message[0]="Manitoba Safety Council";
		message[1]="Manitoba Safety Council";
		message[2]="Manitoba Construction Conference";
		message[3]="Manitoba Construction Conference";
		message[4]="AMM Conference";
		message[5]="City of Winnipeg Expo";
		
	var Calendar_Day=new Date(caldate);
	var ThisDay=Calendar_Day.getDate();
	var ThisMonth=Calendar_Day.getMonth();
	var ThisYear=Calendar_Day.getFullYear();
	
	new_window= window.open ("","mywindow","menubar=0,resizable=1,width=605,height=550"); 
	new_window.document.write('<html><head><title>'+MonthName[ThisMonth]+' Calendar</title><script src="scripts/newCalendar.js"></script><link href="CSS/page.css" rel="stylesheet" type="text/css"></head>');
	new_window.document.write('<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
	
	new_window.document.write('<table id="calendar">');
	new_window.document.write('<tr>');
	new_window.document.write('<th id="calendar_head" colspan="7">'+MonthName[ThisMonth]+' '+ThisYear+'</th>');
	new_window.document.write('</tr>');
	
	new_window.document.write('<tr>');
	for (var cnt=0; cnt<DayName.length; cnt++){
		new_window.document.write('<th class="calendar_weekdays">'+DayName[cnt]+'</th>');
	}//end for loop
	new_window.document.write('</tr>');
	
	Calendar_Day.setDate(1);
	var week_day=Calendar_Day.getDay();
	
	new_window.document.write('<tr>');
	for (var num=0; num<week_day; num++){
		new_window.document.write('<td></td>');
	}//end for loop
			
	var cellcount=1;
	var day=1;
	var special=true;	
	
	while (cellcount==day){
		
		if (week_day==0){
			new_window.document.write('<tr>');
		}//end if
				
        if (week_day<=6){
			new_window.document.write('<td class="calendar_dates">'+day);
				for (i=0; i<31; i++){
					if (day==event_day[i]&&ThisMonth==event_month[i]){
						//new_window.document.write('<br><a href="javascript:new_popup('+i+')">'+message[i]+'</a><br>');
					}
				}	
				if (week_day==4&&day>=1&&day<8){
					new_window.document.write('<br><font size="2" color="black">*CB4UD Meeting*</font>');
				}
			new_window.document.write('</td>');
		}//end if-else
		if (week_day==6){
			new_window.document.write('</tr>');
		}//end if
		
		cellcount++;
		Calendar_Day.setDate(cellcount);
		week_day=Calendar_Day.getDay();
		day=Calendar_Day.getDate();
				
	}//end while loop
	
	new_window.document.write('</tr></table>');

}//end function

function new_popup(i){

	var popup_message=new Array();
		popup_message[0]="popups/calendar/01_19_20.htm";
		popup_message[1]="popups/calendar/01_19_20.htm";
		popup_message[2]="popups/calendar/02_03_04.htm";
		popup_message[3]="popups/calendar/02_03_04.htm";
		popup_message[4]="popups/calendar/02_23.htm";
		popup_message[5]="popups/calendar/05_15.htm";
				
	popup=window.open(popup_message[i],"mywindow2","menubar=0,resizable=1,width=450,height=250"); 	

	
		
}





