Make sure that these files are in/uploaded to the same directory/folder as the web page using the script:
staticeyes.js eye.gif pupils.gif
You can paste <script type="text/javascript" src="staticeyes.js"></script> as many times as you like in to the same page.
However, if you want each set to follow a different style sheet, open and study "more.zip".
*/
//Static Eyes - http://www.btinternet.com/~kurt.grigg/javascript <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>
<p>DON'T FORGET - DO NOT PUT INSIDE ANY OTHER DIV!</p> <script type="text/javascript" > //Static Eyes - http://www.btinternet.com/~kurt.grigg/javascript if ((document.getElementById) && window.addEventListener || window.attachEvent){
(function(){ var e_img = new Image(); e_img.src = "eye.gif"; var p_img = new Image(); p_img.src = "pupils.gif";
var d = document;
var pix = "px";
var idx = document.images.length; if (document.getElementById("cont"+idx)) idx++;
var eyeballs = ""; var pupil1 = ""; var pupil2 = "";
function watchTheMouse(y,x){ var osy = eyeballs.offsetTop; var osx = eyeballs.offsetLeft; var c1y = osy + 17; var c1x = osx + 17; var c2y = osy + 17; var c2x = osx + 52; var dy1 = y - c1y; var dx1 = x - c1x; var d1 = Math.sqrt(dy1*dy1 + dx1*dx1); var dy2 = y - c2y; var dx2 = x - c2x; var d2 = Math.sqrt(dy2*dy2 + dx2*dx2); var ay1 = y - c1y; var ax1 = x - c1x; var angle1 = Math.atan2(ay1,ax1)*180/Math.PI; var ay2 = y - c2y; var ax2 = x - c2x; var angle2 = Math.atan2(ay2,ax2)*180/Math.PI; var dv = 1.7; var onEyeBall1 = (d1 < 17)?d1/dv:10; var onEyeBall2 = (d2 < 17)?d2/dv:10; pupil1.top = c1y-6+onEyeBall1 * Math.sin(angle1*Math.PI/180)-osy+pix; pupil1.left = c1x-6+onEyeBall1 * Math.cos(angle1*Math.PI/180)-osx+pix; pupil2.top = c2y-6+onEyeBall2 * Math.sin(angle2*Math.PI/180)-osy+pix; pupil2.left = c2x-6+onEyeBall2 *Math.cos(angle2*Math.PI/180)-osx+pix; }
function mouse(e){ var y,x; if (!e) e = window.event; if (typeof e.pageY == 'number'){ y = e.pageY; x = e.pageX; } else{ var ref = document.documentElement||document.body; y = e.clientY + ref.scrollTop; x = e.clientX + ref.scrollLeft; } watchTheMouse(y,x); }