//This creates a news object.
function news(titleCol,width)
{
if(!titleCol) titleCol="C3C3B6"
if(!width) width="90%"
people=new Array();
numPeople=-1;

	this.person=function()//titl,da,mont,dat,yea,hou,minut,nam,emai,avata,tex //possible args but they're gay so no
	{
	numPeople++
	people[numPeople]=this; //link the person object into the outer news object

	//Important! Read the comments beside each expression, they explain what the passed in variables (see just above) are for:

	this.title=""		//The title of the news update
	this.day=""			//The day of the week, counting from 0 (ie. Tuesday is 2)
	this.month=""		//The month, counting from 0 (ie. March is 2)
	this.date=""		//The day of the month
	this.year=""		//The year
	this.hour=""		//The hour
	this.minute=""	//The minutes
	this.name=""		//The author's name
	this.email=""		//The author's address
	this.avatar=""	//The author's avatar
	this.text=""		//The meat of the update; the text. You probably don't want to be passing in data like this.

	this.setTitle=function(titl)
		{this.title=titl}

	this.setDTS=function(da,mont,dat,yea,hou,minut)
		{this.day=da
		this.month=mont
		this.date=dat
		this.year=yea
		this.hour=hou
		this.minute=minut}

	this.setName=function(nam)
		{this.name=nam}

	this.setEmail=function(emai)
		{this.email=emai}

	this.setAvatar=function(img)
		{this.avatar=img}

	//Overwrites the current text
	this.setText=function(tex)
		{this.text=tex}

	//Adds to the current text with proper indentation and <p> tags
	this.addParagraph=function(tex)
		{this.text+="<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+tex+"</p>"}

	this.write=function()
		{
		document.writeln("<table align=center border=0 width=95% cellpadding=0 cellspacing=0>")

		//Avatar:
		document.writeln("<tr><td valign=top width=80>")
		document.writeln("<img src="+this.avatar+" width=80 height=80>")
		document.writeln("</td>")

		document.writeln("<td width=5%><!-- Spacing --></td>")

		//Title:
		document.writeln("<td align=left>")
		document.writeln("<font color="+titleCol+"><h2>"+this.title+"</h2>")

		//Date/time
		document.write(intToDay(this.day)+ ", " +intToMonth(this.month)+ " the " +this.date+numSuffix(this.date)+ ", "+this.year+ " - " +addZeroes(this.hour,"0",2)+":"+addZeroes(this.minute,"0",2))
		if(this.day==day && this.month==month && this.date==date && this.year==year) document.writeln(" <font color="+link+"><i><b>NEW!</b></i></font>")

		//Email & Name
		document.writeln("<br>By: <a href=mailto:"+this.email+">"+this.name+"</a></font>") //author
		document.writeln("</td></tr>")

		//Text:
		document.writeln("<tr><td colspan=3 height=10><!-- Spacing --></td><tr><td colspan=3>")
		document.writeln("<font color="+text+">"+this.text+"</font>")
		document.writeln("</td></tr>")

		document.writeln("</table>")
		}
	} //end person object

	this.write=function()
		{
		document.write("<center><hr width="+width+" /><br /><h1><font color=#"+titleCol+"><u>News</u></font></h1><br /><p />")
		document.write("<table width="+width+" border=1 cellpadding=3 cellspacing=3><tr>")
		for(this.i=0; this.i<=numPeople; this.i++)
			{
			document.write("<td width=50% valign=top")
			if(this.i==numPeople) document.write(" colspan=2") //for the last one, widen it if it's an odd # (from 1) of people
			document.write(">&nbsp;")
			people[this.i].write()			
			document.write("&nbsp;</td>")
			if(this.i%2!=0) document.write("</tr>\n\n<tr>")
			}

		document.write("</tr></table></center>")
		}

} //end news object
