<!-- Utilites -- © 2005 AraKaraath halfDragon / A Maus

// returns a string to the first full stop after N characters.
function showNChars(sContent, iChars)
	{ return sContent.substring(0, iChars+sContent.substring(iChars, sContent.length).indexOf(".")+1); }

// this function removes all the characters that XML doesn't like
function cleanForRSS(sUnclean)
	{
//	sUnclean = sUnclean.replace(/'/gi, "&apos;");
	sUnclean = sUnclean.replace(/"/gi, "&quot;");
	sUnclean = sUnclean.replace(/&/gi, "&amp;");
	sUnclean = sUnclean.replace(/</gi, "&amp;lt;");
	sUnclean = sUnclean.replace(/>/gi, "&amp;gt;");
	return sUnclean;
	}

// corrects the getYear function for Mozzilla based browsers
//function getYear(year)
//	{
//	if (year < 70) { return (2000 + year); }
//	if (year < 1900) { return (1900 + year); }
//	return year;
//	}

function getYear(year)
	{
	var y = year % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
	}

// this function removes all HTML tags from a string
function cleanOutHTML(sUnclean)
	{ return sUnclean.replace(/<[a-zA-Z_0-9\ \'\/\:\.\=\?\&]*>/gi, ""); }

// this function sorts the aNews database by the date attribute decsending
function sortByDate(a, b)
	{ return b.date - a.date; }

// this function sorts the aMedia database by its rating hightest to lowest
function sortByRating(a, b)
	{ return b.rating - a.rating; }

// this function sorts the aMedia database by game title
function sortByTitle(a, b)
	{ return a.title - b.title; }

// function sorts the aMedia database by the genre category
function sortByEndTitle(a, b)
	{ return a.endtitle - b.endtitle; }

// sidebar popup for headline file
function addSidePanel(sTitle, sURL) {

	if (window.sidebar && window.sidebar.addPanel) {
		window.sidebar.addPanel(sTitle, sURL, "");
	} else {
		var bBrowser = window.confirm("This feature only works with Netscape 6 and Mozilla-based browsers. Alternatively would you like to open it in a popup window?");
		if (bBrowser) {
			window.open(sURL, sTitle, "width=250,height=600,resizable=1,scrollbars=1,toolbar=0,location=0,directories=0,status=0,menubar=0");
			return false;
		}
	}
}

  // -->
