<HTML>
<HEAD>
<TITLE>Moving eyes</TITLE>
<SCRIPT TYPE="text/javascript">
<!--
img = new Array();
img[0] = new Image();img[0].src='image/face0.gif';
img[1] = new Image();img[1].src='image/face1.gif';
img[2] = new Image();img[2].src='image/face2.gif';
img[3] = new Image();img[3].src='image/face3.gif';
img[4] = new Image();img[4].src='image/face4.gif';
img[5] = new Image();img[5].src='image/face5.gif';
img[6] = new Image();img[6].src='image/face6.gif';
img[7] = new Image();img[7].src='image/face7.gif';
img[8] = new Image();img[8].src='image/face8.gif';
var num = 0;
var pointX = 0;
var pointY = 0;
if (navigator.appName=="Netscape"){
function nMouse(e){
pointX = e.pageX;
pointY = e.pageY;
awidth = innerWidth;
aheight = innerHeight;
mmv();
}
document.onmousemove = nMouse;
}
else{
function iMouse(){
pointX = event.x+document.body.scrollLeft;
pointY = event.y+document.body.scrollTop;
awidth = document.body.clientWidth;
aheight = document.body.clientHeight;
mmv();
}
document.onmousemove = iMouse;
}
function mmv(){
awidth = (awidth-98) / 2;
bwidth = awidth + 98;
aheight = (aheight-70) / 2;
bheight = aheight + 70;
if(pointY < aheight && pointX > awidth && pointX < bwidth){ num = 1; }
else if(pointY > bheight && pointX > awidth && pointX < bwidth){ num = 2; }
else if(pointY >= aheight && pointY <= bheight && pointX <= awidth){ num = 3; } else if(pointY >= aheight && pointY <= bheight && pointX >= bwidth){ num = 4; } else if(pointY < aheight && pointX < awidth){ num = 5; }
else if(pointY < aheight && pointX > bwidth){ num = 6; }
else if(pointY > bheight && pointX < awidth){ num = 7; }
else if(pointY > bheight && pointX > bwidth){ num = 8; }
else{ num = 0; }
document.myface.src=img[num].src;
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" WIDTH="100%" HEIGHT="100%">
<TR>
<TD ALIGN="CENTER"><IMG SRC="image/face0.gif" WIDTH="98" HEIGHT="70" NAME="myface"></TD>
</TR>
</TABLE>
</BODY>
</HTML> |