document.ns = navigator.appName == "Microsoft Internet Explorer"
var floatPicHandler={
	prifix:'floatPic',
	idIndex:0,
	all:{},
	add:function (x){if(x==null)return;x.index=this.idIndex++;x.name=''+(this.prifix+(x.index));this.all[x.name]=x;}
	};

function FloatPic(Src,Url,Width,Height,posx,posy){
this.src = Src;
this.url = Url;
this.height=Height;
this.width=Width;
this.x=0;
this.y=0;
this.xstep=2;
this.ystep=2;
this.interval=100;
this.name="";
floatPicHandler.add(this);
document.write(this.toString());
this.loadMe(posx,posy);
}
function abs(num){
	if(num>=0)return num;
	if(num<0)return -num;
	}
FloatPic.prototype.loadMe=function(xx,yy)
{
	var me=document.all[this.name];
	
	this.x=xx;
	this.y=yy;
	me.style.pixelTop=document.body.scrollTop+this.y;
	me.style.pixelLeft=document.body.scrollLeft+this.x;
	this.move();
}

FloatPic.prototype.move=function()
 {
	 var me=document.all[this.name];
	 this.x+=this.xstep;
	 this.y+=this.ystep;
	 if(this.x>document.body.offsetWidth-this.width){
		this.xstep=0-abs(this.xstep); 
	 }
	 if(this.x<0){
		 this.xstep=abs(this.xstep);
	 }
	 if(this.y<0){
		this.ystep=abs(this.ystep);
	 }
	 if(this.y>document.body.clientHeight-this.height||this.y>window.screen.height-window.screenTop-this.height){
		this.ystep=0-abs(this.ystep);
	 }
	 me.style.pixelTop=document.body.scrollTop+this.y;
 	 me.style.pixelLeft=document.body.scrollLeft+this.x;
	 setTimeout("move("+this.index+")",100);//floatPicHandler.all["++"].
 }
function move(index){
		floatPicHandler.all[floatPicHandler.prifix+index].move();
	}
FloatPic.prototype.toString=function (){
	return "<div id="+this.name+" style='position: absolute;width:"+this.width+"px;top:"+this.y+"px;left:"+this.y+"px;visibility: visible;z-index: 1'><a href='" + this.url + "' target = '_blank'><img src='" + this.src + "' WIDTH="+this.width+"px HEIGHT="+this.height+"px  border = 0></a></div>"
	}
