var WW_isloaded =0; var WW_handcnt =0; var WW_displaytree = false; var WW_IntervalID = null; var WW_blackhandobject = null; var WW_coloredhandcnt = 5; var WW_relativetime = 0; var WW_lasthandarraypos = 2; WW_coloredhandobjects = new Array(); WW_coloredhandtimes = new Array(); WW_blackhandimages = new Array(); WW_arraysofimages = new Array(); WW_redhandimages = new Array(); WW_bluehandimages = new Array(); WW_greenhandimages = new Array(); WW_treeimage = new Image(); WW_baseclockimage = new Image(); function WW_clocktick() { WW_relativetime++; WW_handcnt++; if( WW_handcnt > 29) WW_handcnt = 0; if( WW_displaytree ) return; WW_blackhandobject.document.images[0].src = WW_blackhandimages[WW_handcnt].src; for( var m=0; m < WW_coloredhandcnt; m++ ) { if(WW_coloredhandobjects[m].visibility == 'hide') continue; if(WW_coloredhandtimes[m] < WW_relativetime-30) { WW_coloredhandtimes[m] = 0; WW_coloredhandobjects[m].visibility = 'hide'; } } var rannum = Math.random(); if(rannum < .033 ) { WW_addcoloredhand(0); return; } if(rannum < .067) { WW_addcoloredhand(1); return; } if(rannum < .1 ) { WW_addcoloredhand(2); } return; } // End WW_clocktick() function WW_addcoloredhand(colorindicator) { if( WW_isloaded == 0 ) return; ++WW_lasthandarraypos; if( WW_lasthandarraypos >= WW_coloredhandcnt) WW_lasthandarraypos = 0; var imageplace = WW_arraysofimages[0]; if( (colorindicator < 3) && (colorindicator > 0) ) imageplace = WW_arraysofimages[colorindicator]; WW_coloredhandobjects[WW_lasthandarraypos].document.images[0].src = imageplace[WW_handcnt].src; WW_coloredhandobjects[WW_lasthandarraypos].visibility = 'show'; WW_coloredhandtimes[WW_lasthandarraypos] = WW_relativetime; return true; } // End WW_addcoloredhand(colorindicator) function WW_clockmouseclick() { WW_displaytree = !WW_displaytree; if( WW_displaytree ) { WW_blackhandobject.visibility = 'hide'; for( var m=0; m < WW_coloredhandcnt; m++ ) { WW_coloredhandobjects[m].visibility = 'hide'; } WW_baseclockobject.document.images[0].src = WW_treeimage.src; } else { WW_baseclockobject.document.images[0].src = WW_baseclockimage.src; WW_blackhandobject.document.images[0].src = WW_blackhandimages[WW_handcnt].src; WW_blackhandobject.visibility = 'show'; } return true; } // End WW_clockmouseclick() function WW_pageloaded() { // Initialize when page loaded WW_isloaded=1; WW_treeimage.src = 'blackclock/smallsquaretree.gif'; WW_baseclockimage.src = 'blackclock/base.gif'; for(var m= 0;m <30; m++) { var mlabel = 2*m; if( m == 0 ) mlabel = 60; mlabel = mlabel.toString()+'.gif' WW_blackhandimages[m] = new Image(); WW_blackhandimages[m].src = 'blackclock/' + mlabel; WW_redhandimages[m] = new Image(); WW_redhandimages[m].src = 'redclock/' + mlabel; WW_bluehandimages[m] = new Image(); WW_bluehandimages[m].src = 'blueclock/' + mlabel; WW_greenhandimages[m] = new Image(); WW_greenhandimages[m].src = 'greenclock/' + mlabel; } WW_arraysofimages[0] = WW_redhandimages; WW_arraysofimages[1] = WW_bluehandimages; WW_arraysofimages[2] = WW_greenhandimages; WW_baseclockobject = document.layers['WWbaseclock']; WW_blackhandobject = document.layers['WWblackhand']; WW_coloredhandobjects[0] = document.layers['WWcoloredhand1']; WW_coloredhandobjects[1] = document.layers['WWcoloredhand2']; WW_coloredhandobjects[2] = document.layers['WWcoloredhand3']; WW_coloredhandobjects[3] = document.layers['WWcoloredhand4']; WW_coloredhandobjects[4] = document.layers['WWcoloredhand5']; for(var m=0;m