<!---
/* by Peter Frost www.bristol-pc.co.uk 24 May 2005 */

function hand(title) {
 document.write('<span  class="hand" title="'+nowHours+':'+nowMins+' '+title+' Hand." style="top:'+vwrk+'; left:'+hwrk+'; line-height:'+size+'px; width:'+size+'px; height:'+size+'px;">&nbsp;</span>') 
}
function pos(d6) {
 if (d6>44) {mins=d6-45;h=-hpos[60-d6];v=vpos[60-d6]}
 if (d6>29 && d6<45) {mins=d6-30;h=-hpos[mins];v=-vpos[mins]}
 if (d6>14 && d6<30) {mins=d6-15;h=hpos[15-mins];v=-vpos[15-mins]}
 if (d6<15) {mins=parseInt(d6);h=hpos[mins];v=vpos[mins]}
 if (d6==08) {mins=8;h=hpos[8];v=vpos[8]}
 if (d6==09) {mins=9;h=hpos[9];v=vpos[9]}
 lAdj=(7.5-(Math.abs(7.5-mins)))*.05+1
 h=h*lAdj;v=v*lAdj
}
function numerals(tp,lf,nm) {
 document.write('<span style="position:absolute; top:'+tp+'; left:'+lf+';"><b>'+nm+'</b></span>')
}

root='a href="../../'
wk='<table cellpadding=4 cellspacing=4><tr class="cell">'
if (del=="15") {wd="15";wn="15 Mins";ad="60";an="Hourly"} else {wd="60";wn="Hourly";ad="15";an="15 Mins"}
if (typ=="b") {wk=wk+'<td class=bristol title="'+an+' Bristol Clock"><'+root+'speaking-image'+ad+'.htm">'+an+'</a></td>'} else {wk=wk+'<td class=bristol title="'+wn+' Bristol Clock"><'+root+'speaking-image'+wd+'.htm">Bristol</a></td>'}
if (typ=="d") {wk=wk+'<td class=dino title="'+an+' Dino\'s Clock"><'+root+'dino'+ad+'.htm">'+an+'</a></td>'} else {wk=wk+'<td class=dino title="'+wn+' Dino\'s Clock"><'+root+'dino'+wd+'.htm">Dino</a></td>'}
if (typ=="c") {wk=wk+'<td class=chime title="'+an+' Chiming Clock"><'+root+'chime-clock'+ad+'.htm">'+an+'</a></td>'} else {wk=wk+'<td class=chime title="'+wn+' Chiming Clock"><'+root+'chime-clock'+wd+'.htm">Chime</a></td>'}
if (typ=="p") {wk=wk+'<td class=plain title="'+an+' Plain Clock"><'+root+'speaking-clock'+ad+'.htm">'+an+'</a></td>'} else {wk=wk+'<td class=plain title="'+wn+' Plain Clock"><'+root+'speaking-clock'+wd+'.htm">Plain</a></td>'}
wk=wk+'</tr></table>'
document.write(wk) 

hcen=110
vcen=110
h=0
v=0
hpos = new Array("0",".0667",".1333",".2",".2667",".3333",".4",".4667",".5333",".6",".6667",".7333",".8",".8667",".9333","1")
vpos = new Array("1",".9333",".8667",".8",".7333",".6667",".6",".5333",".4667",".4",".3333",".2667",".2",".1333",".0667","0")

c1="gold";c2="silver";c3=c1
if (bdr==3) {c1="green";c2="blue";c3="green"}
if (bdr==2) {c1="black";c2="grey";c3=c1}
document.write('<div onclick="Javascript:window.location.reload();" style="position:relative; top:0; left:0; width:220px; height:220px; border:4px solid '+c1+'; padding:0px; margin:0px;">')
document.write('<span title="Click to Refresh Clock" style="position:absolute; top:0; left:0; width:212px; height:212px; border:4px dotted '+c2+'; padding:0px; margin:0px;">')
document.write('<span style="position:absolute; top:0; left:0; width:204px; height:204px; border:4px solid '+c3+'; padding:0px; margin:0px;">')

document.write(image)

numerals(1,92,12);numerals(95,2,9);numerals(182,100,6);numerals(95,186,3)
document.write('</span></span>')

pos(nowMins)
scale=1;size=10
while (scale<85) {
 hwrk=hcen+(h*scale)-(size/2);vwrk=vcen-(v*scale)-(size/2)
 hand("Minute")
 size-=.28;scale+=8
}

d6=(nowHours*5+(Math.round(nowMins/12)))
if (d6>59) d6-=60
pos(d6)
scale=1;size=12
while (scale<50) {
 hwrk=hcen+(h*scale)-(size/2);vwrk=vcen-(v*scale)-(size/2)
 hand("hour")
 size-=.6;scale+=8
}

document.write('<div onclick="Javascript:window.location.reload()" title="Bristol Clock: Speaking Clock designed by Peter Frost" style="position:absolute; top:103; left:103; width:14px; height:14px; line-height:14px; background:#000000;">&nbsp;</div>') 
document.write('</div>')
//--->
