function popupPage() {

	var page = "notice.htm";
	
	windowprops = "height=300,width=400,location=no,"
	+ "scrollbars=no,menubars=no,toolbars=no,resizable=yes";

	window.open(page, "hbjb_popup", windowprops);

}

function popup_until(yr,mon,day,hh,mm)
{
	// this function takes an expiry date as input and displays the popup notice
	// until that expiry date.  The message will NOT be displayed on the expiry day itself.
	
	mon = mon - 5; //Month is 0-11 in JavaScript
	var today=new Date()

	var expire=new Date(yr,mon,day,hh,mm,00)
	alert(expire);
	if (today.getTime()<=expire.getTime())
	popupPage();
}

function popup_between(start_yr,start_mon,start_day,start_hh,start_mm,end_yr,end_mon,end_day,end_hh,end_mm){
	// this function takes an expiry date as input and displays the popup notice
	// until that expiry date.  The message will NOT be displayed on the expiry day itself.
	
	start_mon = start_mon - 1; //Month is 0-11 in JavaScript
	end_mon = end_mon - 1;
	var today=new Date()

	var startDisplay=new Date(start_yr,start_mon,start_day,start_hh,start_mm,00)
	var expire=new Date(end_yr,end_mon,end_day,end_hh,end_mm,00)
	//alert(startDisplay);
	//alert(expire);
	//alert(today.getTime());
	//alert(expire.getTime());
	//alert(startDisplay.getTime());
	if ( (today.getTime()<=expire.getTime()) && (today.getTime()>=startDisplay.getTime()) ) {
		popupPage();
	}
}

// Instructions for this JavaScript:
// There are two ways to use this popup_function JavaScript.  You can simply post a notice
// with an expiry datetime (if you want to post something immediately), or you can post a 
// notice with a start time & expiry time in case you want to do future notices.
// 
// For the first behaviour, use the popup_until function which takes an expiry time only.
// For the second behaviour (start & end times) use the popup_between function.

// 20040904 - Corey - added new function to allow popup-between start time & end time. 
// Use the popup-between function rather than the popup-until function.

//popup_until(2004,09,03,13,30);

// remember to re-post this .js file after changing it!	
// popup_between(start_year,start_month,start_day,start_hour,start_minute,end_year,end_month,end_day,end_hour,end_minute)
popup_between(2005,11,14,04,00,2005,11,14,19,00);


