//pcLITTLEsites LIVE DATE javascript, Monday June 28, 2009
//Copyright (c) 2009 David Bennie (http://pclittlesites.com)

// -- "LIVE DATE" script
	//Normally the entire code below and this line >> <span id="clock"></span> is pasted where you want the clock to
	//appear on the page and then you format text, font, color, etc.
	//However if you call an external *.js file for the function, do the following:
	//   1.)Copy and paste this line onload="goforit()" --- in the <body> tag itself i.e. - <body onload="goforit()">
	//   2.)Copy and paste this line in <head> tags to call the script - <script type="text/javascript" src="js/livedate.js" >
	//   3.)Copy and paste this line anywhere in the body on the page where you want the clock to show up - 
	//      <p class="meta"><span ***</span><span href="javascript:livedate" id="clock"></span><span ***</span>
	//      I have the 3 stars before and after the id=clock to identify the area you have to format where the clock is placed
	//      but these stars can be deleted after you format your clock.
	//   4.)You will not be able to see the clock while designing, but to modify, font, text size, color, etc., you can modify the
	//      code below or select the area where you pasted the id=clock and set attributes of it's appearance that way.

/*
Live Date Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
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 seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='FFFF00' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}
//END
