function prNewsFeed(news_title, news_description, news_date, news_link)
{
	this.title			= stripslashes(news_title);
	this.description	= news_description;
	this.pubdate		= news_date;
	this.publink		= news_link;
}

prNewsFeed.prototype.getTitle = function()
{
	return unescape(this.title);
}

prNewsFeed.prototype.getDescription = function()
{
	return unescape(this.description);
}

prNewsFeed.prototype.getDate = function()
{
	return unescape(this.pubdate);
}

prNewsFeed.prototype.getLink = function()
{
	return unescape(this.publink);
}

function initArray()
{
	if (initArray.arguments)
	{
		this.length = initArray.arguments[0];
	} else {
		this.length = 1;
	}
	
	for (var i = 0; i < this.length; i ++)
	{
		this[i] = "";
	}
}

function showList(newsArray)
{
	document.write("<ul>");
	for (var i=0; i < newsArray.length; i ++)
	{
		if(newsArray[i].getTitle)
		{
			document.write("<li>");
			document.write("<a title=\"" + newsArray[i].getTitle() + "\" href=\""+ newsArray[i].getLink() +  "\" target=\"" + target + "\">" + newsArray[i].getTitle() + "</a><br>");
			
			document.write(newsArray[i].getDescription());
			document.write(" " + newsArray[i].getDate() + "<br><br>");
						
			document.write("</li>");
		}
	}
	document.write("</ul>");
	document.write("<br><center>Feeds by <a href=\"http://www.emailwire.com\" target=\"" + target + "\">" + "<i>EmailWire.Com - Press Release Distribution Services.</i>" + "</a></center><br><br>");
}

function showTable(newsArray)
{
	document.write("<table>");
	for (var i=0; i < newsArray.length; i ++)
	{
		document.write("<tr>");
		document.write("<td>");
		document.write("<a title=\"" + newsArray[i].getTitle() + "\" href=\"" + newsArray[i].getLink() +  "\" target=\"" + target + "\">" + newsArray[i].getTitle() + "</a>");
		document.write("</td>");
		document.write("<tr>");

		document.write("<tr>");
		document.write("<td>");
		document.write(newsArray[i].getDescription());
		document.write(" (" + newsArray[i].getDate() + ")<br><br>");
		document.write("</td>");
		document.write("</tr>");
		
	}
	document.write("<tr>");
	document.write("<td>");
	document.write("<center>Feeds by <a href=\"http://www.emailwire.com\" target=\"" + target + "\">" + "<i>EmailWire.Com - Press Release Distribution Services.</i>" + "</a></center><br><br>");
	document.write("</td>");
	document.write("<tr>");
	document.write("</table>");
}

function showNews(newsArray, type)
{
	if (type == 1) {
		showList(newsArray);
	} else if (type == 2) {
		showTable(newsArray);
	} else {
		document.write("Please select the correct display type");
	}
}

function addslashes(str) {
str=str.replace(/\\/g,'\\\\');
str=str.replace(/\'/g,'\\\'');
str=str.replace(/\"/g,'\\"');
str=str.replace(/\0/g,'\\0');
return str;
}

function stripslashes(str) {
str=str.replace(/\\'/g,'\'');
str=str.replace(/\\"/g,'"');
str=str.replace(/\\0/g,'\0');
str=str.replace(/\\\\/g,'\\');
return str;
}

//--------------------------------- page
/*js_style = 1;
target = "_blank";
if (newsfeed){
	showNews(newsfeed, js_style);
} else {
	document.write("News feeds did not import correctly. Please contact the 24-7 pressrelease administrators");
}*/

