function piaofu(_1){
	this.winHeight=window.innerHeight?window.innerHeight:document.documentElement.clientHeight;
	this.winWidth=window.innerWidth?window.innerWidth:document.documentElement.clientWidth;	

	window.pfBox=document.getElementById(_1.boxId);
	window.pfParent=pfBox.parentNode;
	//window.pfBaseUrl=this.pfBaseUrl=config.piaofu.baseAddr+_1.catalog+"/";
	window.pfBaseUrl=this.pfBaseUrl='/site_media/float/'+config.piaofu.baseAddr+_1.catalog+"/";
	window.onresize=function(){
		this.winHeight=window.innerHeight?window.innerHeight:document.documentElement.clientHeight;
		this.winWidth=window.innerWidth?window.innerWidth:document.documentElement.clientWidth;
	};
	var _2=!!window.ActiveXObject;
	this.isIE6=_2&&!window.XMLHttpRequest;
	
	this.pfNumSet=_1.num;
	this.imgArr=[];
	this.init(_1);
}

piaofu.init=piaofu.prototype.init=function(_3){
	if(!this.isIE6){
	pfParent.style.position="fixed";
	pfParent.style.top=0;
	pfParent.style.left=0;
}else{
}

var _4=this.pfNumSet.length;
var _5=Math.round(Math.random()*_4)%_4;
_5=_5>=_4?_4:_5;
var _6=this.pfNumSet[_5];
for(var i=0;i<_6;i++){
	this.crePFDom({box:pfBox,domId:_3.domName+"_"+i});
	}
};

piaofu.crePFDom=piaofu.prototype.crePFDom=function(_8){
	var _9=document.createElement("img");
	_9.id=_8.domId;
	_9.src=pfBaseUrl+"float_"+Math.round(Math.random()*4)%4+".gif";
	this.imgArr[this.imgArr.length]=_8.domId;
	_9.style.position="absolute";
	_9.style.display="none";
	_9.style.left=(this.winWidth-20)*Math.random()+"px";
	_9.style.top=this.winHeight*Math.random()+"px";
	pfBox.appendChild(_9);
};
piaofu.start=piaofu.prototype.start=function(){
	imgArr=this.imgArr;
	for(var i=0,l=this.imgArr.length;i<l;i++){
		var _c=imgArr[i];
		document.getElementById(_c).style.display="";
		this.animate(_c,Math.random()*180);
	}
	pfParent.style.display="block";
};
piaofu.animate=piaofu.prototype.animate=function(_d,_e){
	var _f=document.getElementById(_d);
	var cx=_f.offsetLeft;
	var cy=_f.offsetTop;
	var _12=_f.clientWidth;
	var _13=_f.clientHeight;
	_f.style.position="absolute";
	winWidth=this.winWidth;
	winHeight=this.winHeight;
	if(!this.isIE6){
		window.pfTimer=setInterval(function(){
			var _14=Math.cos(_e/180*Math.PI)*3*Math.random();
			var _15=6*Math.random();
			_15=_15>0?_15:-_15;	
			var l=_f.offsetLeft+_14;
			var t=_f.offsetTop+_15;
			_f.style.left=l+"px";
			_f.style.top=t+"px";
			
			if(l<0||l>winWidth-_12||t>this.winHeight-config["piaofu"].initBottom){
				_f.style.left=winWidth*Math.random()+"px";
				_f.style.top=config["piaofu"].initTop+"px";
				_f.src=pfBaseUrl+"float_"+Math.round(Math.random()*4)%4+".gif";
			}
		_e++;
		},50);
	}else{
		window.pfTimer=setInterval(function(){
			var _18=Math.cos(_e/180*Math.PI)*3*Math.random();
			var _19=6*Math.random();
			_19=_19>0?_19:-_19;
			var l=_f.offsetLeft+_18;
			var t=_f.offsetTop+_19;
			_f.style.left=l+"px";
			_f.style.top=t+"px";
			
			if(l<0||l>winWidth-_12||t>winHeight-_13-20+parseInt(document.documentElement.scrollTop||document.body.scrollTop)){
				_f.style.left=winWidth*Math.random()+"px";
				_f.style.top=config["piaofu"].initTop+parseInt(document.documentElement.scrollTop||document.body.scrollTop)+"px";
				_f.src=pfBaseUrl+"float_"+Math.round(Math.random()*4)%4+".gif";
			}
		_e++;
		},500);
	}
};


