//<!--
function postCommentBox(e,newsID)
{
	if (IE)
	{
		coordX = event.clientX + document.body.scrollLeft;
		coordY = event.clientY + document.body.scrollTop;
	}
	else
	{
		coordX = e.pageX;
		coordY = e.pageY;
	}

	var t = document.getElementById('newsAjaxBox').style;
	t.left = coordX-50+"px";
	t.top = coordY+15+"px";
	t.visibility = 'visible';

	document.getElementById('newsAjaxBox').innerHTML = "<div "+
		"class=\"newsCommentBox\"><span class=\"error\">[Please Wait...]</span></div>";
	xmlHttp = new GetXmlHttpObject();
	url = "/includes/ajax/news/newscommentbox.asp?newsID="+newsID+"&sid="+Math.random();
	xmlHttp.onreadystatechange = function(){xmlHttpResponse('newsAjaxBox',''+
		'','newsAjaxBox');};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

var commentUser;
var commentText;

function postNewsComment(newsID)
{
	commentUser = escape(document.getElementById('newNewsUser').value);
	commentText = escape(document.getElementById('newNewsComment').value);
	if (commentText.length > 30)
	{
		document.getElementById('newsAjaxBox').innerHTML = "<div "+
			"class=\"newsCommentBox\"><span class=\"error\">[Posting Comment...]</span></div>";
		xmlHttp = new GetXmlHttpObject();
		url = "/includes/ajax/news/postnewscomment.asp?newsID="+newsID+"&sid="+Math.random();
		xmlHttp.onreadystatechange = function(){xmlHttpResponse('newsAjaxBox',''+
			'','newsAjaxBox');}; 
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send("newNewsUser="+commentUser+"&newNewsComment="+commentText);
	}
	else
	{
		document.getElementById('messageDisplayBox').innerHTML = "<span "+
			"class=\"error\">You must enter at least 30 characters</span>";
	}
}

function viewComments(e,newsID)
{
	if (IE)
	{
		coordX = event.clientX + document.body.scrollLeft;
		coordY = event.clientY + document.body.scrollTop;
	}
	else
	{
		coordX = e.pageX;
		coordY = e.pageY;
	}

	var t = document.getElementById('newsAjaxBox').style;
	t.left = coordX+0+"px";
	t.top = coordY+15+"px";
	t.visibility = 'visible';

	document.getElementById('newsAjaxBox').innerHTML = "<div "+
		"class=\"newsCommentBox\"><span class=\"error\">[Loading Comment(s)...]</span></div>";
	xmlHttp = new GetXmlHttpObject();
	url = "/includes/ajax/news/fullnewscomments.asp?newsID="+newsID+"&sid="+Math.random();
	xmlHttp.onreadystatechange = function(){xmlHttpResponse('newsAjaxBox',''+
		'','newsAjaxBox');}; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function clearNewsBox()
{
     document.getElementById('newsAjaxBox').style.visibility = 'hidden';
}

var mailEmail;

function setMailingEmail()
{
	mailEmail = escape(document.getElementById('mailingEmail').value);

	document.getElementById('messageDisplayBox').innerHTML = "<span "+
		"class=\"error\">[Updating mailing list...]</span>";
	xmlHttp = new GetXmlHttpObject();
	url = "/includes/ajax/news/setmailingemail.asp?mailAddress="+mailEmail+"&sid="+Math.random();
	xmlHttp.onreadystatechange = function(){xmlHttpResponse('messageDisplayBox',''+
		'','messageDisplayBox');}; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
//-->