﻿function goodmorning()
{
	var dtmDate = new Date();		
	var lngHours = dtmDate.getHours();
	var random = Math.random(); 
	var random2 = Math.random(); 
	if (random < 0.05) { document.write("¡Hola!"); } 
	else if (random > 0.95) { document.write("Dzień Dobry"); } 
	else
		{
		document.write("Good ");
		if (lngHours <= 11)
		{
			if (random < 0.1)
			{
				document.write("Moaning");
			}
			else
			{
				document.write("Morning");
				if (random < 0.5) { document.write(" ntc!"); }
				else if (random < 0.6) { document.write(" near the coast!"); } 
			}
		}
		else if (lngHours >= 12 && lngHours <= 17)
		{
			if (random < 0.7)
			{
				document.write("Afternoon");
			}
			else
			{
				document.write("Day");
			}
		}
		else
		{
			if (random < 0.9)
			{
				document.write("Evening");
			}
			else
			{
				if (random2 < 0.5)
				{
					document.write("Heavens!");
				}
				else
				{
					document.write("Golly Ms Molly!");
				}
			}
		}
	}
}

function ntcdate()
{
	<!-- This script and many more are available free online at -->
	<!-- The JavaScript Source!! http://javascript.internet.com -->
	var months=new Array(13);
	months[1]="January";
	months[2]="February";
	months[3]="March";
	months[4]="April";
	months[5]="May";
	months[6]="June";
	months[7]="July";
	months[8]="August";
	months[9]="September";
	months[10]="October";
	months[11]="November";
	months[12]="December";
	var time=new Date();
	var lmonth=months[time.getMonth() + 1];
	var date=time.getDate();
	var year=time.getYear();
	if (year < 2000)    // Y2K Fix, Isaac Powell
	year = year + 1900; // http://onyx.idbsu.edu/~ipowell  
	document.write(date + " " + lmonth + " "); // + " " + year)
	//Date now = new Date();
    //DateFormat df4 = DateFormat.getDateInstance(DateFormat.FULL); 
	//String s4 = df4.format(now);
	//document.write("X " + s4); 
}
