/// 网页中跟随鼠标位置不断旋转的彩星
/// script with "javascript" for IE olny


//-- 预置样式

if(document.all){
var docstr="<div id=starsDiv style=position:absolute;top:0px;left:0px>";
var docstr=docstr+"<div style=position:relative;width:3px;height:3px;background:#ffffff;font-size:3px;visibility:visible></div>";
var docstr=docstr+"<div style=position:relative;width:3px;height:3px;background:#ffff00;font-size:3px;visibility:visible></div>";
var docstr=docstr+"<div style=position:relative;width:3px;height:3px;background:#ffa000;font-size:3px;visibility:visible></div>";
var docstr=docstr+"<div style=position:relative;width:3px;height:3px;background:#ff0000;font-size:3px;visibility:visible></div>";
var docstr=docstr+"<div style=position:relative;width:3px;height:3px;background:#00ff00;font-size:3px;visibility:visible></div>";
var docstr=docstr+"<div style=position:relative;width:3px;height:3px;background:#0000ff;font-size:3px;visibility:visible></div>";
var docstr=docstr+"<div style=position:relative;width:3px;height:3px;background:#FF00FF;font-size:3px;visibility:visible></div>";
var docstr=docstr+"</div>";
document.write(docstr);
}


if (document.all){

var yBase = 200;
var xBase = 200;
var yAmpl = 10;
var yMax = 40;
var step = .2;
var ystep = .5;
var currStep = 0;
var tAmpl=1;
var Xpos = 1;
var Ypos = 1;
var i = 0;
var j = 0;

function MoveHandler(){
Xpos = document.body.scrollLeft + event.x;
Ypos = document.body.scrollTop + event.y;
}
document.onmousemove = MoveHandler;

function animateLogo() {
yBase = window.document.body.offsetHeight / 4;
xBase = window.document.body.offsetWidth / 4;

for (i = 0 ; i < starsDiv.all.length; i++) {
starsDiv.all[i].style.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
starsDiv.all[i].style.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
   }

currStep += step;
setTimeout("animateLogo()", 10);
}
animateLogo();

}
//-- If the IE then use this function.
//-- else no use.


// End -->



