//	cNewsAlert Javascript - Copyright (C) 2009-2010 Charles A Upsdell, All Rights Reserved; www.upsdell.com


// CLASSES & METHODS

cNewsAlert.prototype.$name = 'cNewsAlert';

function cNewsAlert ( y1, m1, d1, y2, m2, d2, title, text, ymin, mmin, ymax, mmax  )
{
this.nYear = ( y1 === undefined ) ? 2000 : y1;
this.sMonth = ( m1 === undefined ) ? 'January' : m1;
this.nDay = ( d1 === undefined ) ? 1 : d1;
this.nYearEnd = ( y2 === undefined ) ? 2000 : y2;
this.sMonthEnd = ( m2 === undefined ) ? 'December' : m2;
this.nDayEnd = ( d2 === undefined ) ? 31 : d2;
this.sTitle = ( title === undefined ) ? '' : title;
this.sText = ( text === undefined ) ? '' : text;
this.ymin = ( ymin === undefined ) ? kal.period[0] : ymin;
this.mmin = ( mmin === undefined ) ? kal.period[1] : mmin;
this.ymax = ( ymax === undefined ) ? kal.period[2] : ymax;
this.mmax = ( mmax === undefined ) ? kal.period[3] : mmax;
this.sHeader = '';
this.id_year = 'alert_year';
this.id_month = 'alert_month';
this.id_day = 'alert_day';
this.id_day_notice = 'alert_day_notice';
this.id_year_end = 'alert_year_end';
this.id_month_end = 'alert_month_end';
this.id_day_end = 'alert_day_end';
this.id_day_end_notice = 'alert_day_end_notice';
this.id_title = 'alert_title';
this.id_text = 'alert_text';
this.id_header = 'alert_header';
}

cNewsAlert.prototype.addNews = function ()
{
cal.M( this.sMonth, this.nYear );
cal.E( this.nDay, 'N!', [ this.sTitle, this.sText, this.sMonthEnd + ' ' + this.nDayEnd + ' ' + this.nYearEnd ] );
}

cNewsAlert.prototype.getDump = function ()
{
var rv = '';
for ( var property in this )
  {
	if ( typeof(this[property]) == 'function' )
		continue;
	rv += property + '="' + this[property] + '", ';
  }
return rv;
}


