<html> <title>Semantic Designs: ECMAScript (JavaScript) Obfuscator Example: MouseClock <i>Unobfuscated</i></title> <body> <!-- the JavaScript 'global' and initialization values --> <script language="JavaScript"> dCol='000000';//date colour. fCol='000000';//face colour. sCol='000000';//seconds colour. mCol='000000';//minutes colour. hCol='000000';//hours colour. ClockHeight=40; ClockWidth=40; ClockFromMouseY=0; ClockFromMouseX=100; var toID; //Alter nothing below! Alignments will be lost! d=new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"); m=new Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"); date=new Date(); day=date.getDate(); year=date.getYear(); if (year < 2000) year=year+1900; TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year; D=TodaysDate.split(''); H='...'; H=H.split(''); M='....'; M=M.split(''); S='.....'; S=S.split(''); Face='1 2 3 4 5 6 7 8 9 10 11 12'; font='Arial'; size=1; speed=0.6; ns=(document.layers); ie=navigator.userAgent.toLowerCase().indexOf("msie") != -1 mz=(navigator.userAgent.toLowerCase().indexOf("mozilla") != -1) && !ie Face=Face.split(' '); n=Face.length; a=size*10; ymouse=0; xmouse=0; scrll=0; props="<font face="+font+" size="+size+" color="+fCol+"><B>"; props2="<font face="+font+" size="+size+" color="+dCol+"><B>"; Split=360/n; Dsplit=360/D.length; HandHeight=ClockHeight/4.5 HandWidth=ClockWidth/4.5 HandY=-7; HandX=-2.5; scrll=0; step=0.06; currStep=0; y=new Array(); x=new Array(); Y=new Array(); X=new Array(); for (i=0; i < n; i++){ y[i]=0;x[i]=0;Y[i]=0;X[i]=0 } Dy=new Array(); Dx=new Array(); DY=new Array(); DX=new Array(); for (i=0; i < D.length; i++){ Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0 } //================================================================ if (ie){ document.write('<div id="'+(('Od'))+'" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < D.length; i++) document.write('<div id="'+(('ieDate'))+'" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>'); document.write('</div></div>'); document.write('<div id="'+(('Of'))+'" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < n; i++) document.write('<div id="'+(('ieFace'))+'" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>'); document.write('</div></div>'); document.write('<div id="'+(('Oh'))+'" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < H.length; i++) document.write('<div id="'+(('ieHours'))+'" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>'); document.write('</div></div>'); document.write('<div id="'+(('Om'))+'" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < M.length; i++) document.write('<div id="'+(('ieMinutes'))+'" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>'); document.write('</div></div>') document.write('<div id="'+(('Os'))+'" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < S.length; i++) document.write('<div id="'+(('ieSeconds'))+'" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>'); document.write('</div></div>') } else if (mz){ for (i=0; i < D.length; i++) document.write('<div id="'+(('mzDate'))+i+'" style="position:absolute;top:0px;left:0px" height="'+a+'" width="'+a+'"><center>'+props2+D[i]+'</font></center></div>'); for (i=0; i < n; i++) document.write('<div id="'+(('mzFace'))+i+'" style="position:absolute;top:0px;left:0px" height="'+a+'" width="'+a+'"><center>'+props+Face[i]+'</font></center></div>'); for (i=0; i < S.length; i++) document.write('<div id="'+(('mzSeconds'))+i+' style="position:absolute;top:0px;left:0px" width="15" height="15"><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></div>'); for (i=0; i < M.length; i++) document.write('<div id="'+(('mzMinutes'))+i+' style="position:absolute;top:0px;left:0px" width="15" height="15"><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></div>'); for (i=0; i < H.length; i++) document.write('<div id="'+(('mzHours'))+i+' style="position:absolute;top:0px;left:0px" width="15" height="15"><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></div>'); } else if (ns){ for (i=0; i < D.length; i++) document.write('<layer name="'+(('nsDate'))+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>'); for (i=0; i < n; i++) document.write('<layer name="'+(('nsFace'))+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>'); for (i=0; i < S.length; i++) document.write('<layer name="'+(('nsSeconds'))+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>'); for (i=0; i < M.length; i++) document.write('<layer name="'+(('nsMinutes'))+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>'); for (i=0; i < H.length; i++) document.write('<layer name="'+(('nsHours'))+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>'); } (ns)?window.captureEvents(Event.MOUSEMOVE):0; </script> <!-- Include the JS functions --> <script language="JavaScript" src="UnobfuscatedJavaScriptMouseClock.js.txt" type="text/javascript"></script> <!-- Clear the initial values, all piled up on top of each other in the --> <!-- top left corner of the display browser. --> <script>Clear();</script> <!-- the HTML page itself --> <H2>Obfuscating web pages containing HTML and ECMASCript (JavaScript)</H2> <p> This page has mouse clicks to run a JavaScript (ECMAScript) program that shows a clever little dynamic time-of-day clock around the current mouse position. After you've played with it, click BACK to continue with Obfuscation example. </p> <p> <b>Be sure to view the source of this page.</b> </p> <p> <input type="button" value="Start" onclick="if (ns||ie||mz) Delay();"> <input type="button" value="Stop" onclick="StopDelay()"> <input type="button" value="Clear" onclick="if (ns||ie||mz) Clear();"> </p> </body> </html>