



		function supscript(x) {

			var supname;

			if ((2<x<21) || (22<x<31)) {

				supname = "<sup>th</sup>";
				return supname;
			}
			
			if (x==1 || x==21 || x==31) {
				
				supname = "<sup>st</sup>";
				return supname;
			}
			else {
		
				supname = "<sup>nd</sup>";
				return supname;
			}
							
		}


		// ***** How many days until the conference begins *******


			function daysleft(z) {
			
				var DaysToConference = new Date(z);
				var xtoday = new Date();

				if (DaysToConference.getTime() - xtoday.getTime() > 0) {
						
					y = Math.ceil((DaysToConference.getTime() - xtoday.getTime())/86400000);
	
					if (y>1) {

						return "[ This event begins in " + y + " days ]";
					}

					if (y == 1) {

						return "This event begins tomorrow!";
					}
				}
					
				else {
						return "[ Days to event will be determined when event dates are set. ]";	

				}
			}







		function EventsInfo(e_title,e_class,e_date,e_location,e_spknum,e_speakers,e_contact,e_webadd,e_year,e_month,e_sday,e_eday,e_start) {

			this.e_title = e_title;
			this.e_class = e_class;
			this.e_date = e_date;
			this.e_location = e_location;
			this.e_spknum = e_spknum;
			this.e_speakers = e_speakers;
			this.e_contact = e_contact;
			this.e_webadd = e_webadd;
			this.e_year = e_year;
			this.e_month = e_month;
			this.e_sday = e_sday;
			this.e_eday = e_eday;
			this.e_start = e_start;
	
		}


			var events = new Array(2);

		// *******  Template events[] = new EventsInfo("","","","","","","","","","","","","");


		// *******  Data Storage **********

		
		
		// ******* January (0) ****




		// ******* February (1) ****

			

		// ******* March (2) ****


		
			
		// ****** April (3) ****

			

		// ***** May (4) ****

			

		// ***** June (5) ****

			

		// **** July (6) ****

			events[0] = new EventsInfo("2011 Roswell UFO Festival","Ufo/Abduction","July 1-4, 2011","<br/>Roswell, New Mexico","0","Muliple Events in the city of Roswell","Roswell UFO Festival","http://www.ufofestivalroswell.com","2011","6","1","4","July 1, 2011");

			events[1] = new EventsInfo("MUFON Symposium 2011","Ufo/Abduction","July 29-31, 2011","<br/>Irvine, California","2","TBA","MUFON","http://www.mufon.com/events.html","2011","6","29","31","July 29, 2011");



			
		// ***** August (7) ****

			
		// ***** September (8) ****

			
		
		// ***** October (9) ****

			
		// ***** November (10) ****
			
			
			

		// ***** December (11) ****	

		





		// ***** Check For Current Conference ***********

			

				var today = new Date();
				Month = today.getMonth();
				Day = today.getDate();
				Year = today.getYear();

			 if (navigator.appName == "Netscape") {

				Year = Year + 1900;
			}
		
		// **** Begin Writing Page ***********

		
	
	document.write("<div id='backdrop'><br/><div id='titlealign'><img src='IMAGES/UpcomingEventsTitle1.gif'></div><br/><br/>");
	document.write("<h3>The latest Event was posted on : ");

		
		var info = new Date(document.lastModified);	
		theMonth = info.getMonth() + 1;
		theDate = info.getDate();
		theYear = info.getYear();
		if (navigator.appName == 'Netscape') {
			document.write(theMonth + '/' + theDate + '/' + (theYear+1900) );
		}
		else {
			document.write(theMonth + '/' + theDate + '/' + theYear);
		}
		

	document.write("<br/><br/><a class='linko' href='../Content.html'>MAIN PAGE</a><br/><hr width=69%></h3><br/>");

	document.write("<h2>Do you have an Event you would like to promote?<br/>Contact : <a href='EventsForm.php'>Events</a></h2><br/><br/>");
	
	

	document.write("<div><table align=center bgcolor=#7ee78a cellpadding=2 cellspacing=2 width=80%>");
	document.write("<tr><td>&nbsp</tr><tr><td>&nbsp</tr>");


			for (i=0; i<events.length; i++) {

			var eventinprogress = 0;

		//  Check all dates and make sure no expired Conferences are allowed to be seen.


			if (Year == events[i].e_year && (Month < events[i].e_month || ( Month == events[i].e_month && Day <= events[i].e_eday)) || Year < events[i].e_year) {
								

					document.write("<tr><td colspan=2 class='maintitle'>" + events[i].e_title + "</td>");
					document.write("<tr><td colspan=2 class='classtext'>Classification : " + events[i].e_class + "</td>");
			


		// Check to see if this day is the start of the conference. If it is then display a message saying so. If its a one day conference display a message saying so.

			
			if (Month == events[i].e_month && Day == events[i].e_sday && Year == events[i].e_year) {

				if (events[i].e_sday != events[i].e_eday) {

					document.write("<tr><td colspan=2 class='curdate'>Conference begins today and runs throught the " + events[i].e_eday + supscript(events[i].e_eday) + "</td>");
					eventinprogress = 1;
				}

				if (events[i].e_sday == events[i].e_eday) {
					document.write("<tr><td colspan=2 class='curdate'>This is a one day conference being held today.</td>");
					eventinprogress = 1;
				}
			}


		// Check to see if a conference is in progress.


			if ((Day > events[i].e_sday) && (Day < events[i].e_eday) && (Year == events[i].e_year) && (Month == events[i].e_month)) {

					document.write("<tr><td colspan=2 class='curdate'>Conference currently taking place...the final day is the " + events[i].e_eday + supscript(events[i].e_eday) + "</td>");
					eventinprogress = 1;
			}



		// Check to see if this is the final day of a conference.


			if ((Month == events[i].e_month) && (Day == events[i].e_eday) && (Year == events[i].e_year)) {

					document.write("<tr><td colspan=2 class='curdate'>This is the final day of the conference</td>");
					eventinprogress = 1;
			}

			

			document.write("<tr><td colspan=2 class='date'>" + events[i].e_date + "</td>");

			
		// Write this only if events hasn't started

			if (eventinprogress != 1) {

			document.write("<tr><td colspan=2 class='start'>" + daysleft(events[i].e_start) + "</td>");
	
			}

			
			document.write("<tr><td colspan=2 class='location'>" + events[i].e_location + "</td>");
				

			if (events[i].e_speakers != " ") {

				if (events[i].e_spknum == 1) {

					document.write("<tr><td colspan=2 class='subtitle1'>The speaker will be :</td>");
			
				}

				if (events[i].e_spknum > 1) {

					document.write("<tr><td colspan=2 class='subtitle1'>Speakers Include :</td>");

				}
					document.write("<tr><td colspan=2 class='speakers'>" + events[i].e_speakers + "</td>");
			}
			
			if (events[i].e_speakers == " ") {

				document.write("<tr><td colspan=2 class='subtitle1'>Speakers to be announced...</td>");

				}
						


			document.write("<tr><td colspan=2 class='moreinfo'>For additional information visit : &nbsp <a href='UpcomingEvents.html' target='Content' onClick=window.open('" + events[i].e_webadd + "','n','height=590,width=790,scrollbars,location,resizable')>" + events[i].e_contact + "</a></td>");

			document.write("<tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>");

			}

			}

	document.write("</table></div>");
	document.write("<br/><br/>");
	document.write("</div>");
	document.write("<br/><br/>");

				


