gDays = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
gMonths = new Array("January","February","March","April","May","June","July","August","September","October","November","December");


gCurDate = new Date();

months = new Array();
days = new Array();
months[1] ="jan.gif";
months[2] ="feb.gif";
months[3] ="mar.gif";
months[4] ="apr.gif";
months[5] ="may.gif";
months[6] ="jun.gif";
months[7] ="jul.gif";
months[8] ="aug.gif";
months[9] ="sep.gif";
months[10] ="oct.gif";
months[11] ="nov.gif";
months[12] ="dec.gif";
days[1] ="1st.gif";
days[2] ="2nd.gif";
days[3] ="3rd.gif";
days[4] ="4th.gif";
days[5] ="5th.gif";
days[6] ="6th.gif";
days[7] ="7th.gif";
days[8] ="8th.gif";
days[9] ="9th.gif";
days[10] ="10th.gif";
days[11] ="11th.gif";
days[12] ="12th.gif";
days[13] ="13th.gif";
days[14] ="14th.gif";
days[15] ="15th.gif";
days[16] ="16th.gif";
days[17] ="17th.gif";
days[18] ="18th.gif";
days[19] ="19th.gif";
days[20] ="20th.gif";
days[21] ="21st.gif";
days[22] ="22nd.gif";
days[23] ="23rd.gif";
days[24] ="24th.gif";
days[25] ="25th.gif";
days[26] ="26th.gif";
days[27] ="27th.gif";
days[28] ="28th.gif";
days[29] ="29th.gif";
days[30] ="30th.gif";
days[31] ="31st.gif";

// **********************************************************************************************************************
//
function MyPrintDate()
{
	document.write('<img src="common/datecalendar/' + months[gCurDate.getMonth()+1] + '"/ >'); // month
	document.write('<br />');
	document.write('<img src="common/datecalendar/' + days[gCurDate.getDate()] + '"/ >'); // day
}


// **********************************************************************************************************************
//
function MyDisplayDateTime()
{
	var mydate = new Date();
	var year = mydate.getYear();
	if (year < 2000)
	{
		if (document.all)
			year = "19" + year;
		else
			year += 1900;
	}
	var day = mydate.getDay();
	var month = mydate.getMonth();
	var daym = mydate.getDate();
	if (daym < 10)
		daym = "0" + daym;
	var hours = mydate.getHours();
	var minutes = mydate.getMinutes();
	var dn = "AM";
	if (hours >= 12)
	{
		dn = "PM";
		hours = hours - 12;
	}
	if (hours == 0)
		hours = 12;
	if (minutes <= 9)
		minutes = "0" + minutes;

	document.writeln("<font size=\"-1\"><b>&nbsp;",
							gDays[day], " ",daym, " ", gMonths[month], " ", year, " ", hours, ":", minutes, " ", dn, "</b></font><br />");
}

// **********************************************************************************************************************
// MyOpenWindow
//
function MyOpenWindow(inWindowTitle, inPicFileName, inTextualDescription)
{
	now = new Date();

	theWindow = open("", "", "width=670,height=615,resizable=1,scrollbars=1");

	// If user didn't specify a window title, default to "Picture"
	if (inWindowTitle == "")
		windowTitle = "Picture";
	else
		windowTitle = inWindowTitle;

	// Open new document
	theWindow.document.open();

	// Text of the new document
	// Replace your " with ' or \" or your document.writeln statements will fail
	theWindow.document.writeln("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
	theWindow.document.writeln("<html><head>");
	theWindow.document.writeln("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
	theWindow.document.writeln("<link href=\"../../../css/styles.css\" rel=\"stylesheet\" media=\"screen\">");
	theWindow.document.writeln("<title>" + windowTitle + "</title></head><body bgcolor=\"cornflowerBlue\">");
	theWindow.document.writeln("<center>");
	theWindow.document.writeln("<img src=\"" + inPicFileName + "\" />");
	theWindow.document.writeln("<br />");
	theWindow.document.writeln(inTextualDescription);
	theWindow.document.writeln("<br />");
	theWindow.document.writeln("<form>");
	theWindow.document.writeln("<input type=\"button\" value=\"Close Window\" onClick=\"window.close()\">");
	theWindow.document.writeln("</form>");
	theWindow.document.writeln("</center></body></html>");

	// Close the document (this doesn't close the window, however)
	theWindow.document.close();
}

