// Declare Variables and Arrays //

now = new Date()

var theTime = now.getHours()

var theWeekday = new Array(7)
	theWeekday[0] = "Sunday"
	theWeekday[1] = "Monday"
	theWeekday[2] = "Tuesday"
	theWeekday[3] = "Wednesday"
	theWeekday[4] = "Thursday"
	theWeekday[5] = "Friday"
	theWeekday[6] = "Saturday"
	
var theDay = now.getDate()

var theMonth = new Array(12)
	theMonth[0] = "January"
	theMonth[1] = "February"
	theMonth[2] = "March"
	theMonth[3] = "April"
	theMonth[4] = "May"
	theMonth[5] = "June"
	theMonth[6] = "July"
	theMonth[7] = "August"
	theMonth[8] = "September"
	theMonth[9] = "October"
	theMonth[10] = "November"
	theMonth[11] = "December"
	
var theYear = now.getFullYear()

// Define Functions //

function writeDay() {
	if (theDay == 1 || theDay == 21 || theDay == 31) {
		return theDay + "st";
	} else if  (theDay == 2 || theDay == 22) {
		return theDay + "nd";
	} else if (theDay == 3 || theDay == 23) {
		return theDay + "rd"; 
	} else {
		return theDay + "th";
	}
}

function writeGreeting() {
	if (theTime < 12) {
		return "Good Morning";
	} else if (theTime > 11 && theTime < 17) {
		return "Good Afternoon";
	} else {
		return "Good Evening";
	}
}

function writeSeasonGreeting() {
	if (theDay == 25 && now.getMonth() == 11) {
		return "MERRY CHRISTMAS, ";
	} else if (theDay == 1 && now.getMonth() == 0) { 
		return "HAPPY NEW YEAR, ";
	} else if (theDay == 14 && now.getMonth() == 1) {
		return "HAPPY VALENTINE'S DAY, ";
	} else if (theDay == 30 && now.getMonth() == 7) {
		return "HAPPY BIRTHDAY, RED SPIDER, ";
	} else if (theDay == 31 && now.getMonth() == 9) { 
		return "HAPPY HALLOWEEN, ";
	} else {  
		return "";
	}
}


// additional javascript for the pop up media player & shocked window //

function mediaPlayer(mediaURL) {
   window.open(mediaURL, 'mediaPlayer', 'width=400,height=470', false);
   }

function shocked(shockedURL) {
   window.open(shockedURL, 'shocked', 'width=660,height=580', false);
   }
   
function viewer(viewerURL) {
	theWindow = window.open(viewerURL, 'viewer', 'width=280,height=360,scrollbars=yes', false);
	theWindow.focus();
	}

// function for opening alert box to preserve copyright //

function presCopy() {
	alert('Images are for preview only of copyrighted material.\nPlease respect this and contact me for enlargements.');
	}