// created: 2000-2004 ricocheting.com
// http://www.ricocheting.com/js/
dpath = '/images/digits';
dg0 = new Image();dg0.src = dpath + '/0.gif';
dg1 = new Image();dg1.src = dpath + '/1.gif';
dg2 = new Image();dg2.src = dpath + '/2.gif';
dg3 = new Image();dg3.src = dpath + '/3.gif';
dg4 = new Image();dg4.src = dpath + '/4.gif';
dg5 = new Image();dg5.src = dpath + '/5.gif';
dg6 = new Image();dg6.src = dpath + '/6.gif';
dg7 = new Image();dg7.src = dpath + '/7.gif';
dg8 = new Image();dg8.src = dpath + '/8.gif';
dg9 = new Image();dg9.src = dpath + '/9.gif';
dgc = new Image();dgc.src = dpath + '/colon.gif';
dgd = new Image();dgd.src = dpath + '/dash.gif';
sdg0 = new Image();sdg0.src = dpath + '/s0.gif';
sdg1 = new Image();sdg1.src = dpath + '/s1.gif';
sdg2 = new Image();sdg2.src = dpath + '/s2.gif';
sdg3 = new Image();sdg3.src = dpath + '/s3.gif';
sdg4 = new Image();sdg4.src = dpath + '/s4.gif';
sdg5 = new Image();sdg5.src = dpath + '/s5.gif';
sdg6 = new Image();sdg6.src = dpath + '/s6.gif';
sdg7 = new Image();sdg7.src = dpath + '/s7.gif';
sdg8 = new Image();sdg8.src = dpath + '/s8.gif';
sdg9 = new Image();sdg9.src = dpath + '/s9.gif';

function dotime() { 
theTime=setTimeout('dotime()',1000);
d = new Date();
yy= d.getFullYear();
mm= d.getMonth()+101;
dd= d.getDate()+100;
tdate=''+dd+mm+yy;
document.dd1.src = dpath+'/'+tdate.substring(1,2)+'.gif';
document.dd2.src = dpath+'/'+tdate.substring(2,3)+'.gif';
document.mm1.src = dpath+'/'+tdate.substring(4,5)+'.gif';
document.mm2.src = dpath+'/'+tdate.substring(5,6)+'.gif';
document.yy1.src = dpath+'/'+tdate.substring(6,7)+'.gif';
document.yy2.src = dpath+'/'+tdate.substring(7,8)+'.gif';
document.yy3.src = dpath+'/'+tdate.substring(8,9)+'.gif';
document.yy4.src = dpath+'/'+tdate.substring(9,10)+'.gif';
hr= d.getHours()+100;
mn= d.getMinutes()+100;
sc= d.getSeconds()+100;
ttime=''+hr+mn+sc;
document.hr1.src = dpath+'/'+ttime.substring(1,2)+'.gif';
document.hr2.src = dpath+'/'+ttime.substring(2,3)+'.gif';
document.mn1.src = dpath+'/'+ttime.substring(4,5)+'.gif';
document.mn2.src = dpath+'/'+ttime.substring(5,6)+'.gif';
document.sc1.src = dpath+'/s'+ttime.substring(7,8)+'.gif';
document.sc2.src = dpath+'/s'+ttime.substring(8,9)+'.gif';
}

//save a reference to the original onload
window.oldOnload = window.onload;
function newOnload(){
  //call the original onload
  if (window.oldOnload) window.oldOnload();
  //call your new onload function
  dotime();
} 
//add a new onload to a custom function.
window.onload = newOnload;
