//
//  There are two "DefineEvent" functions...one for this "upcoming events" display on the home page,
//  and one for the full "Events.HTML" calendar. 
//
function DefineEvent(evDate,evTime,evTitle,evDesc,evContact,evLink,evLinkType,evImage,evWidth,evHeight) {
var strDate = evDate.toString();
evYYYY = strDate.substr(0,4);
evMM = strDate.substr(4,2);
evDD = strDate.substr(6,2);
	var Qot = "'"
// The number of days to look ahead
   evNumDays = 7

// get current year
var d = new Date();
var x_curr_year = d.getFullYear();

// Make month relative to zero
   evMM = (evMM * 1) - 1;

// But make the display month a real month value
   var evDisplayMonth = evMM + 1;
   curr_month = evDisplayMonth;

// Convert day to a number (from a string)
   evDD = evDD * 1;

// A local, numeric, and current julian day...
   var xjulian = (julian * 1);


// The event's julian day...
   evJulian = julianMM[evMM] + evDD;

// The difference (in days) between today and event's day
   upcomingdays = evJulian - xjulian;

if (evYYYY < x_curr_year)
    {upcomingdays = -1}
	
   

if (upcomingdays >= 0) 
   {
   if (upcomingdays <= evNumDays) 
      {
       if (prev_month != curr_month)
          {
	  document.write('<span class="BodySmall"><font COLOR="#FF6600"><b>' + month_name[evDisplayMonth] + '</b></FONT></span><br>');         
           }
 evTitleBackSlash = evTitle.replace(/'/g,"\\'");
 evDescBackSlash =   evDesc.replace(/'/g,"\\'");   	   

	tmp = "";
	tmp = '<A HREF="javascript:ViewEvent(' + Qot + evDate + Qot;
        tmp = tmp + ',' + Qot + evTime + Qot; 
        tmp = tmp + ',' + Qot + evTitleBackSlash + Qot;
        tmp = tmp + ',' + Qot + evDescBackSlash + Qot;
        tmp = tmp + ',' + Qot + evContact + Qot;
        tmp = tmp + ',' + Qot + evLink + Qot;
        tmp = tmp + ',' + Qot + evLinkType + Qot;
        tmp = tmp + ',' + Qot + evImage + Qot;
        tmp = tmp + ',' + evWidth + ',' + evHeight;
        tmp = tmp + ')">' 

document.write('<span class="BodyCaption LinkOff">' + tmp + '<b>' + evDD + '</b>-'  + evTitle + '</a></span><br>');
        prev_month = curr_month;
      }
   }
                               
//END OF FUNCTION
}