
var width = screen.width;

wpul=width/2;
wpluspul=width+wpul;

// ***********************************************************************
time1=self.setInterval('jest1move()', (50+Math.random()*55));
self.setTimeout('jest1stop()', 1000+Math.random()*2000);

function jest1stop() {
self.clearInterval(time1);
self.setTimeout('jest1start()',  800+Math.random()*1300);
}

function jest1start() {
time1=self.setInterval('jest1move()',  (50+Math.random()*55));
self.setTimeout('jest1stop()',  1000+Math.random()*2000);
if (pos1>=width) {
 r1=3*Math.random();
 pos1=-40;
};
}

i1=0;
pos1=-40;
r1=3*Math.random();
function jest1move() {
if (i1==0) {
 if (r1>=1.3) document.images['jest1'].src='./img/j5.gif'; else  document.images['jest1'].src='./img/j1.gif';
 s=String(pos1);
 document.images['jest1'].style.left=s;
 i1=1;pos1+=12;
} else { 
 if (r1>=1.3) document.images['jest1'].src='./img/j6.gif'; else document.images['jest1'].src='./img/j2.gif'
 s=String(pos1);
 document.images['jest1'].style.left=s;
 i1=0;pos1+=12;
};
}
// ***********************************************************************

time2=self.setInterval('jest2move()', (50+Math.random()*55));
self.setTimeout('jest2stop()', 1000+Math.random()*2000);

function jest2stop() {
self.clearInterval(time2);
self.setTimeout('jest2start()',  800+Math.random()*1300);
}

function jest2start() {
time2=self.setInterval('jest2move()',  (50+Math.random()*55));
self.setTimeout('jest2stop()',  1000+Math.random()*2000);
if (pos2<=-50) {
 pos2=width;
 r2=3*Math.random();
};
}

i2=0;
pos2=width;
r2=3*Math.random();
function jest2move() {
if (i2==0) {
 if (r2>=1.3) document.images['jest2'].src='./img/j7.gif'; else  document.images['jest2'].src='./img/j3.gif';
 s=String(pos2);
 document.images['jest2'].style.left=s;
 i2=1;pos2=pos2-12;
} else { 
 if (r2>=1.3) document.images['jest2'].src='./img/j8.gif'; else document.images['jest2'].src='./img/j4.gif';
 s=String(pos2);
 document.images['jest2'].style.left=s;
 i2=0;pos2=pos2-12;
};
}
// ***********************************************************************


// ***********************************************************************
time3=self.setInterval('jest3move()', (50+Math.random()*55));
self.setTimeout('jest3stop()', 1000+Math.random()*2000);

function jest3stop() {
self.clearInterval(time3);
self.setTimeout('jest3start()',  800+Math.random()*1300);
}

function jest3start() {
time3=self.setInterval('jest3move()',  (50+Math.random()*55));
self.setTimeout('jest3stop()',  1000+Math.random()*2000);
if (pos3>=width) {
 r3=3*Math.random();
 pos3=-40;
};
}

i3=0;
pos3=-wpul;
r3=3*Math.random();
function jest3move() {
if (i3==0) {
 if (r3>=1.3) document.images['jest3'].src='./img/j5.gif'; else  document.images['jest3'].src='./img/j1.gif';
 s=String(pos3);
 document.images['jest3'].style.left=s;
 i3=1;pos3+=12;
} else { 
 if (r3>=1.3) document.images['jest3'].src='./img/j6.gif'; else document.images['jest3'].src='./img/j2.gif'
 s=String(pos3);
 document.images['jest3'].style.left=s;
 i3=0;pos3+=12;
};
}
// ***********************************************************************

time4=self.setInterval('jest4move()', (50+Math.random()*55));
self.setTimeout('jest4stop()', 1000+Math.random()*2000);

function jest4stop() {
self.clearInterval(time4);
self.setTimeout('jest4start()',  800+Math.random()*1300);
}

function jest4start() {
time4=self.setInterval('jest4move()',  (50+Math.random()*55));
self.setTimeout('jest4stop()',  1000+Math.random()*2000);
if (pos4<=-50) {
 pos4=width;
 r4=3*Math.random();
};
}

i4=0;
pos4=wpluspul;
r4=3*Math.random();
function jest4move() {
if (i4==0) {
 if (r4>=1.3) document.images['jest4'].src='./img/j7.gif'; else  document.images['jest4'].src='./img/j3.gif';
 s=String(pos4);
 document.images['jest4'].style.left=s;
 i4=1;pos4=pos4-12;
} else { 
 if (r4>=1.3) document.images['jest4'].src='./img/j8.gif'; else document.images['jest4'].src='./img/j4.gif';
 s=String(pos4);
 document.images['jest4'].style.left=s;
 i4=0;pos4=pos4-12;
};
}
// ***********************************************************************


