ezjik.js
var bV=parseInt(navigator.appVersion);
var ns=(document.layers) ? 1 : 0;
var ie=((document.getElementById) && (bV >= 4)) ? 1 : 0;
var ff = ((navigator.appName == "Netscape") && (bV >= 5)) ? 1 : 0;
var flag = (ns || ie) ? 1 : 0;
var timerID;
var timerIDl;
var timerIDr;
var kurs = -0.5;
var nomer = 0;
var lasta = 8;
var egx = 0;
var egy = 0;
var egvx = 4;
var egvy = 2;
var tut = 200;
var vmin = 1;
var vmax = 10;
var vr = 5;
function createLayer(name, left, top, visible, content) {
var layer;
if (ns) {
document.writeln('<layer name="' + name + '" left=' + left + ' top=' + top + ' width=120 height=84 visibility=' + (visible ? '"show"' : '"hide"') + '>');
document.writeln(content);
document.writeln('</layer>');
layer = getLayer(name);
layer.width = 120;
layer.height = 84;
}
if (ie) {
document.writeln('<div id="' + name + '" style="position:absolute; left:' + left + 'px; top:' + top + 'px; width:120px; height:84px; visibility:' + (visible ? 'visible;' : 'hidden;') + '">');
document.writeln(content);
document.writeln('</div>');
}
}
function Flake(chipname) {this.name = chipname; }
function startFlakes() {
if (!flag) { return; }
var i;
getWindowSize();
egx = pageW * Math.random() + pageX;
egy = pageH * Math.random() + pageY;
for (i = 0; i < flakes.length; i++) {
moveLayer(flakes[i].name, egx, egy);
hideLayer(flakes[i].name);
}
buzz();
}
function moveLayer(name, x, y) {
var layer = getLayer(name);
if (ns) { layer.moveTo(x, y); }
if (ie) { layer.left = x; layer.top = y; }
}
function showLayer(name) {
var layer = getLayer(name);
if (ns) { layer.visibility = "show"; }
if (ie) { layer.visibility = "visible"; }
}
function hideLayer(name) {
var layer = getLayer(name);
if (ns) { layer.visibility = "hide"; }
if (ie) { layer.visibility = "hidden"; }
}
function getLayer(name) {
if (ns) {
return(document.layers[name]);
} else if (ie) {
layer = eval('document.getElementById("' + name + '").style');
return(layer);
} else {
return(null);
}
}
{
nomer = nomer + 2;
if ( nomer >= 8 ) { nomer = nomer - 8; }
lasta = nomer + 0.5 + kurs;
moveLayer(flakes[ lasta ].name, egx, egy);
showLayer(flakes[ lasta ].name);
timerID = setTimeout("buzz()", tut);
}
}
function buzl() {
hideLayer(flakes[ lasta ].name);
lasta = 8;
moveLayer(flakes[ lasta ].name, egx, egy);
showLayer(flakes[ lasta ].name);
}
function buzr() {
hideLayer(flakes[ lasta ].name);
lasta = 9;
moveLayer(flakes[ lasta ].name, egx, egy);
showLayer(flakes[ lasta ].name);
}