//Change "digitdir" to the directory for your digit images
var digitdir=""

//Change "height" to the height of your images
//Don't use quotation marks around the number.
var height=19

//Change "digitw" to the width of the images "0.gif" through "9.gif"
//Change "ampmw" to the width of the images "am.gif" & "pm.gif"
//Change "colonw" to the width of the images "colona.gif" & "colonb.gif"
//Don't use quotation marks around the number.
var digitw=13
var ampmw=25
var colonw=7

//Choose an option for the number separators
//	"FLASH" - flashes between "colona.gif" & "colonb.gif"
//	"A" - just "colona.gif"
//	"B" - just "colonb.gif"
//	"NO" - no image
//then change "colon" to that option
var colon="FLASH"

//Turn seconds "ON" or "OFF"
var seconds="ON"

function imageArray(length,imageWidth,imageHeight){
 	this.length=length
  	for (i=0;i<length;i++){this[i]=new Image(imageWidth,imageHeight)}
}
if (parseInt(navigator.appVersion.substring(0,1))>=3&&!(parseInt(navigator.appVersion.substring(0,1))==3&&navigator.userAgent.indexOf("MSIE")!=-1)) {
	digits=new imageArray(10, digitw, height)
	digits[0].src=digitdir+"0.gif"
	digits[1].src=digitdir+"1.gif"
	digits[2].src=digitdir+"2.gif"
	digits[3].src=digitdir+"3.gif"
	digits[4].src=digitdir+"4.gif"
	digits[5].src=digitdir+"5.gif"
	digits[6].src=digitdir+"6.gif"
	digits[7].src=digitdir+"7.gif"
	digits[8].src=digitdir+"8.gif"
	digits[9].src=digitdir+"9.gif"
	ampmimg=new imageArray(2, ampmw, height)
	ampmimg[0].src =digitdir+"am.gif"
	ampmimg[1].src =digitdir+"pm.gif"
	colonimg=new imageArray(2, colonw, height)
	colonimg[0].src =digitdir+"colona.gif"
	colonimg[1].src =digitdir+"colonb.gif"
	var tempDate=new Date()
	var macfix=(new Date(tempDate.toLocaleString())).getTime()-tempDate.getTime()
	var communicatorfix=0
}

function goClock() {
if (parseInt(navigator.appVersion.substring(0,1))>=3&&!(parseInt(navigator.appVersion.substring(0,1))==3&&navigator.userAgent.indexOf("MSIE")!=-1)) {
        var now=new Date()
        var amPm=0
        var nowHours=now.getHours()
        var nowMinutes=now.getMinutes()
        var nowSeconds=now.getSeconds()

        if (nowHours<0) {nowHours+=24}
        if (nowHours>23) {nowHours-=24}
        var nowSecondshalf=parseInt(nowSeconds)/2
        var colonnum="0"

        if (nowHours>12) {nowHours-=12; amPm=1}
        if (nowHours==12) {amPm=1}
        if (nowHours==0) {nowHours=12}
        if (nowHours<=9) {nowHours="0"+nowHours} else {nowHours=""+nowHours}
        if (nowMinutes<=9) {nowMinutes="0"+nowMinutes} else {nowMinutes=""+nowMinutes}
        if (nowSeconds<=9) {nowSeconds="0"+nowSeconds} else {nowSeconds=""+nowSeconds}

        if (colon=="FLASH") {if (nowSecondshalf==parseInt(nowSecondshalf)) {colonnum="0"} else {colonnum="1"}}
        if (colon=="A") {colonnum="1"}
        if (colon=="B") {colonnum="0"}

        //if (nowHours.charAt(0)!=0) {document.Hourspic0.src=digits[nowHours.charAt(0)].src}
        document.Hourspic0.src=digits[nowHours.charAt(0)].src
        document.Hourspic1.src=digits[nowHours.charAt(1)].src
        document.Colonpic0.src=colonimg[colonnum].src
        document.Minutespic0.src=digits[nowMinutes.charAt(0)].src
        document.Minutespic1.src=digits[nowMinutes.charAt(1)].src
        if (seconds=="ON") {
                document.Colonpic1.src=colonimg[colonnum].src
                document.Secondspic0.src=digits[nowSeconds.charAt(0)].src
                document.Secondspic1.src=digits[nowSeconds.charAt(1)].src
                }
        document.Ampmpic.src=ampmimg[amPm].src
        setTimeout("goClock()",1000)
        }
}

function theClock() {
if (parseInt(navigator.appVersion.substring(0,1))>=3&&!(parseInt(navigator.appVersion.substring(0,1))==3&&navigator.userAgent.indexOf("MSIE")!=-1)) {
        if (colon=="NO") {colonw="0"}
        document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+digitw+" HEIGHT="+height+" BORDER=0 NAME=Hourspic0>")
        document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+digitw+" HEIGHT="+height+" BORDER=0 NAME=Hourspic1>")
        document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+colonw+" HEIGHT="+height+" BORDER=0 NAME=Colonpic0>")
        document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+digitw+" HEIGHT="+height+" BORDER=0 NAME=Minutespic0>")
        document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+digitw+" HEIGHT="+height+" BORDER=0 NAME=Minutespic1>")
        if (seconds=="ON") {
                document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+colonw+" HEIGHT="+height+" BORDER=0 NAME=Colonpic1>")
                document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+digitw+" HEIGHT="+height+" BORDER=0 NAME=Secondspic0>")
                document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+digitw+" HEIGHT="+height+" BORDER=0 NAME=Secondspic1>")
        }
        document.write("<IMG SRC="+digitdir+"blank.gif WIDTH="+ampmw+" HEIGHT="+height+" BORDER=0 NAME=Ampmpic>")
}
}
