<!--helmetmoving logo-->

var helmetbrOK=false;
var mie=false;
var aver=parseInt(navigator.appVersion.substring(0,1));
var aname=navigator.appName;
var helmetmystop=0;

function helmetcheckbrOK()
{if(aname.indexOf("Internet Explorer")!=-1)
{if(aver>=4) helmetbrOK=navigator.javaEnabled();
mie=true;
}
if(aname.indexOf("Netscape")!=-1)  
{if(aver>=4) helmetbrOK=navigator.javaEnabled();}
}
var vmin=2;
var vmax=5;
var vr=2;
var timer1;

function helmetchip(chipname,width,height)
{
this.named=chipname;
this.vx=vmin+vmax*Math.random();
this.vy=vmin+vmax*Math.random();
this.w=width;
this.h=height;
this.xx=0;
this.yy=0;
this.timer1=null;
}

function helmetmovechip(chipname)
{
if(helmetbrOK && helmetmystop==0)
{eval("helmetchip="+chipname);
if(!mie)
{pageX=window.pageXOffset;
pageW=window.innerWidth;
pageY=window.pageYOffset;
pageH=window.innerHeight;
}
else
{pageX=window.document.body.scrollLeft;
pageW=window.document.body.offsetWidth-8;
pageY=window.document.body.scrollTop;
pageH=window.document.body.offsetHeight;
} 
helmetchip.xx=helmetchip.xx+helmetchip.vx;
helmetchip.yy=helmetchip.yy+helmetchip.vy;
helmetchip.vx+=vr*(Math.random()-0.5);
helmetchip.vy+=vr*(Math.random()-0.5);
if(helmetchip.vx>(vmax+vmin))  helmetchip.vx=(vmax+vmin)*2-helmetchip.vx;
if(helmetchip.vx<(-vmax-vmin)) helmetchip.vx=(-vmax-vmin)*2-helmetchip.vx;
if(helmetchip.vy>(vmax+vmin))  helmetchip.vy=(vmax+vmin)*2-helmetchip.vy;
if(helmetchip.vy<(-vmax-vmin)) helmetchip.vy=(-vmax-vmin)*2-helmetchip.vy;
if(helmetchip.xx<=pageX)
{helmetchip.xx=pageX;
helmetchip.vx=vmin+vmax*Math.random();
}
if(helmetchip.xx>=pageX+pageW-helmetchip.w)
{helmetchip.xx=pageX+pageW-helmetchip.w;
helmetchip.vx=-vmin-vmax*Math.random();
}
if(helmetchip.yy<=pageY)
{helmetchip.yy=pageY;
helmetchip.vy=vmin+vmax*Math.random();
}
if(helmetchip.yy>=pageY+pageH-helmetchip.h)
{helmetchip.yy=pageY+pageH-helmetchip.h;
helmetchip.vy=-vmin-vmax*Math.random();
}
if(!mie)
{eval('document.'+helmetchip.named+'.top ='+helmetchip.yy);
eval('document.'+helmetchip.named+'.left='+helmetchip.xx);
} 
else
{eval('document.all.'+helmetchip.named+'.style.pixelLeft='+helmetchip.xx);
eval('document.all.'+helmetchip.named+'.style.pixelTop ='+helmetchip.yy); 
}
	helmetchip.timer1=setTimeout("helmetmovechip('"+helmetchip.named+"')",100);
}
}
function helmetstop(x)
{
helmetbrOK=true;
helmetmystop=x;
helmetmovechip("helmettome");
}
var helmettome;
var helmetchip;
function helmettome()
{helmetcheckbrOK(); 
helmettome=new helmetchip("helmettome",80,80);
if(helmetbrOK) 
{ helmetmovechip("helmettome");
}
}

ns4=(document.layers)?true:false;
ie4=(document.all)?true:false;

function helmetover()
{
if(ns4){
	//document.helmet.left=window.innerWidth/2-400;
	eval('document.helmet.left=document.'+helmetchip.named+'.left');
	eval('document.helmet.top=document.'+helmetchip.named+'.top-15');
	document.helmet.visibility="show";
	}else if(ie4) 
	{
	//document.all.helmet.style.left=window.document.body.offsetWidth/2-400;
	document.all.helmet.style.left=parseInt(document.all.helmettome.style.left);
	document.all.helmet.style.top=parseInt(document.all.helmettome.style.top)-20;
	document.all.helmet.style.visibility="visible";
	helmetstop(1);
	}
}

function helmetout()
{
if(ns4){
	document.helmet.visibility="hide";
	}else if(ie4) 
	{
	document.all.helmet.style.visibility="hidden";
	helmetstop(0);
	}
}


<!--moving logo ½لتّ-->
function imgOver(imgObj)
{
	var imgSrc = imgObj.src;
	var imgSrcOver = imgSrc.replace("_on.gif", "-2.gif");
	imgObj.src = imgSrcOver;
}
// 
function imgOut(imgObj)
{
	var imgSrc = imgObj.src;
	var imgSrcOut = imgSrc.replace("-2.gif", "_on.gif");
	imgObj.src = imgSrcOut;
}




