/*
** Project: Picky Noo
** Version: 3
** File:    PickyNoo.js
** Author:  NJW James
** Date:    13.01.2003
**	
** Copyright (c) NJW James 2003
*/
function onLoad()
{
	var aDayNames = new Array(
		"Sunday"  , "Monday", "Tuesday", "Wednesday",
		"Thursday", "Friday", "Saturday");

	var aMonthNames = new Array(
		"January", "February", "March"    , "April"  , "May"      , "June",
		"July"   , "August"  , "September", "October", "November" ,"December");
		
	var objDate = new Date();
	var sDay = aDayNames[objDate.getDay()];
	var sDate = objDate.getDate();

	var iDateLen = sDate.length;
	var sDateUnit = new String(sDate).substring((iDateLen - 1), iDateLen);

	var sDateSuffix;
	if (sDateUnit == "1")
		sDateSuffix = "st";
	else if (sDateUnit == "2")
		sDateSuffix = "nd";
	else if (sDateUnit == "3")
		sDateSuffix = "rd";
	else
		sDateSuffix = "th";

	sDate += sDateSuffix;
		
	var sMonth = aMonthNames[objDate.getMonth()];
	var sYear = objDate.getYear();

	tdDateTime.innerHTML =
		sDay + " " + sDate + " " + sMonth + ", " + sYear;
}

function openNewWindow (sURL)
{
	var sFeatures = "";
	sFeatures += "toolbar=yes,location=yes,status=yes";
	sFeatures += ",menubar=yes,scrollbars=yes,resizable=yes";
	sFeatures += ",width=800,height=450";
	window.open(sURL, "newwindow", sFeatures);
}

function getHitCounter (sCount)
{
	var sTag = "";
	sTag += "<img src=";
	sTag += '"http://www28.brinkster.com/kettlemouse/services/';
	sTag += "GetCounterImage.aspx?value=";
	sTag += sCount;
	sTag += '">';
	document.write(sTag);
}

function getMenu (sMenuCode)
{
	var sUrl = "getmenu.aspx?menu=" + sMenuCode;
	var oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	oXmlHttp.open("GET", sUrl, false);
	oXmlHttp.send();
	window.document.all.item("tdContentCell").innerHTML = oXmlHttp.responseText;
}

function openPopupWindow (sURL)
{
	var sFeatures = "";
	sFeatures += "toolbar=no,location=no,status=no";
	sFeatures += ",menubar=no,scrollbars=no,resizable=no";
	sFeatures += ",width=240,height=180";
	window.open(sURL, "popup", sFeatures);
}

function openFormWindow (sURL)
{
	var sFeatures = "";
	sFeatures += "toolbar=no,location=no,status=yes";
	sFeatures += ",menubar=no,scrollbars=yes,resizable=yes";
	sFeatures += ",width=640,height=450";
	window.open(sURL, "formwindow", sFeatures);
}

function openPdfWindow (sURL)
{
	var sFeatures = "";
	sFeatures += "toolbar=no,location=no,status=yes";
	sFeatures += ",menubar=no,scrollbars=yes,resizable=yes";
	sFeatures += ",width=880,height=660";
	window.open(sURL, "formwindow", sFeatures);
}

function setContent (sPage)
{
	var sUrl = sPage + ".aspx";
	var oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

	oXmlHttp.open("GET", sUrl, false);
	oXmlHttp.send();
	window.document.all.item("tdContentCell").innerHTML = oXmlHttp.responseText;
}

