﻿//**********************************************************
//REAL TIME CLOCK SINCE IT IS TEMPO TIME :)
//**********************************************************
function DisplayTimeDate()
{
	var t = new Date();
	
	//DATE SECTION
	var getYear = t.getFullYear();
	var getMonth = t.getMonth();
	var getDay = t.getDay();
	var getDate = t.getDate();
	var currentMonth
	var currentDay
		
	if (getMonth == 0)
	  currentMonth = "January";
	if (getMonth == 1)
	  currentMonth = "February";
	if (getMonth == 2)
	  currentMonth = "March";
	if (getMonth == 3)
	  currentMonth = "April";
	if (getMonth == 4)
	  currentMonth = "May";
	if (getMonth == 5)
	  currentMonth = "June";
	if (getMonth == 6)
	  currentMonth = "July";
	if (getMonth == 7)
	  currentMonth = "August";
	if (getMonth == 8)
	  currentMonth = "September";                  
	if (getMonth == 9)
	  currentMonth = "October";
	if (getMonth == 10)
	  currentMonth = "November";
	if (getMonth == 11)
	  currentMonth = "December";
	  
	if (getDay == 0)
	  currentDay = "Sunday";
	if (getDay == 1)
	  currentDay = "Monday";
	if (getDay == 2)
	  currentDay = "Tuesday";
	if (getDay == 3)
	  currentDay = "Wednesday";
	if (getDay == 4)
	  currentDay = "Thursday";
	if (getDay == 5)
	  currentDay = "Friday";
	if (getDay == 6)
	  currentDay = "Saturday";            
	   
	      
	//TIME SECTION
	var hours = t.getHours();
	var min = t.getMinutes();
	var sec = t.getSeconds();

	var status = "AM";
	if (hours > 11)
	  status = "PM";
	if (hours == 0)
	  hours = 12;
	if (hours > 12)
	  hours -= 12;
	if (min < 10)
	  min = "0" + min;
	if (sec < 10)
	  sec = "0" + sec;

	document.getElementById('divDisplayDate').innerHTML = currentDay + ", " + currentMonth + " " + getDate + ", " + getYear;
	document.getElementById('divDisplayTime').innerHTML = "Time: " + hours + ":" + min + ":" + sec + " " + status;
	window.setTimeout("DisplayTimeDate()", 1000);
	
}
