<!--

// bugs here
if (top.location.href.indexOf("index.html") != -1) {
	var Pic = new Array('images/pchela_index1.gif','images/pchela_index2.gif','images/pchela_index1.gif','images/pchela_index3.gif');
} else {
	var Pic = new Array('images/pchela_news1.gif','images/pchela_news2.gif','images/pchela_news1.gif','images/pchela_news3.gif');
}

// speed
var MaxSpeed = 3;
var MinSpeed = 1;

var load = new Array()
for(i=0; i < Pic.length; i++) {
	load[i] = new Image();
	load[i].src = Pic[i];
}
var n = Pic.length;
var n6 = (document.getElementById&&!document.all);
var ns = (document.layers);
var ie = (document.all);
var d = (ns || ie)?'document.':'document.getElementById("';
var a = (ns || n6)?'':'all.';
var n6r = (n6)?'")':'';
var s = (ns)?'':'.style';
if (ns){
for (i=0; i < n; i++)
	document.write("<LAYER NAME='pics"+i+"' LEFT=0 TOP=0><img name='netpics' src="+load[i].src+"></LAYER>");
}
if (ie||n6){
	for (i=0; i < n; i++)
	document.write("<div id='pics"+i+"' style='position:absolute;top:0px;left:0px;z-index:25'><img src="+load[i].src+"></div>");
}

var VB=0;
var HB=0;
var R=new Array();
var PB=new Array();
var RD=new Array();
var Y=new Array();
var X=new Array();
var D=new Array();
var SP=new Array();
var BY=new Array();
var BX=new Array();
for (i=0; i < n; i++){
 Y[i]=10;
 X[i]=10;
 D[i]=Math.floor(Math.random()*70+10);
 SP[i]=Math.floor(Math.random()*MaxSpeed+MinSpeed);
}
function Curve() {
	var plusMinus=new Array(1,-1,2,-2,3,-3,0,1,-1,0,5,-5)
	for (i=0; i < n; i++){
		R[i]=Math.floor(Math.random()*plusMinus.length);
		RD[i]=plusMinus[R[i]];
	}
	setTimeout('Curve()',1500);
}
function MoveRandom(){
var H=(ns||n6)?window.innerHeight:document.body.clientHeight;
var W=(ns||n6)?window.innerWidth:document.body.clientWidth;
var YS=(ns||n6)?window.pageYOffset:document.body.scrollTop;
var XS=(ns||n6)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < n; i++){
BY[i]=-load[i].height;
BX[i]=-load[i].width;
PB[i]=D[i]+=RD[i];
y = SP[i]*Math.sin(PB[i]*Math.PI/180);
x = SP[i]*Math.cos(PB[i]*Math.PI/180);
if (D[i] < 0) D[i]+=360;
Y[i]+=y;
X[i]+=x;
VB=180-D[i];
HB=0-D[i];
if ((Y[i] < 1) && (X[i] < 1)) {Y[i]=1;X[i]=1;D[i]=45;}
if ((Y[i] < 1) && (X[i] > W+BX[i])) {Y[i]=1;X[i]=W+BX[i];D[i]=135;}
if ((Y[i] > H+BY[i]) && (X[i] < 1)) {Y[i]=H+BY[i];X[i]=1;D[i]=315;}
if ((Y[i] > H+BY[i]) && (X[i] > W+BX[i])) {Y[i]=H+BY[i];X[i]=W+BX[i];D[i]=225;}
if (Y[i] < 1) {Y[i]=1;D[i]=HB;}  
if (Y[i] > H+BY[i]) {Y[i]=H+BY[i];D[i]=HB;}  
if (X[i] < 1) {X[i]=1;D[i]=VB;} 
if (X[i] > W+BX[i]) {X[i]=W+BX[i];D[i]=VB;} 
var temp = eval(d+a+'pics'+i+n6r+s);
temp.top = Y[i]+YS;
temp.left = X[i]+XS;
}
setTimeout('MoveRandom()',10);
}

var	mi = 0;
function MoveMeMore() {
	var line = eval(d+a+'positionb'+n6r+s);
	line.left = parseInt(line.left) + 1;
	line.top = parseInt(line.top) - 1;
	
	if(mi<18) { setTimeout('MoveMeMore()',1000); }
	mi++;
//	return mi;
}

var ma = 0;
function MoveMeMuch() {
	var line_ = eval(d+a+'positiona'+n6r+s);
	line_.left = parseInt(line_.left) + 1;
	line_.top = parseInt(line_.top) - 1;	
	
	if(ma<10) { setTimeout('MoveMeMuch()',2000); }
	ma++;
//	return mi;
}

function MoveMe() {
	if (top.location.href.indexOf("index.html") != -1) {
		var H=(ns||n6)?window.innerHeight:document.body.clientHeight;
		var W=(ns||n6)?window.innerWidth:document.body.clientWidth;
		var ww = (W/2) + 60;
		var hh = (H < 623)?'480':(H / 2)+170;
		var line = eval(d+a+'positionb'+n6r+s);
		line.left = ww;
		line.top = parseInt(hh);
		var ww_ = (W < 640)?'140':(W/2)-180;
		var hh_ = (H < 623)?'234':(H / 2)-76;
		var line_ = eval(d+a+'positiona'+n6r+s);
		line_.left = ww_;
		line_.top = parseInt(hh_);
		setTimeout('MoveMeMuch()',3000);
		setTimeout('MoveMeMore()',5000);
	}
}

onresize=MoveMe;
//onload=MoveMe;

Curve();
MoveRandom();
//-->
