	var divCount = 0 ; //浮动广告对象数量
function floatAdver(){
	this.fDivs = new Array();//浮动广告对象数组
	this.h = 560;//距离顶部距离
	this.fDiv;
	this.lDiv = "";
	this.rDiv = "";
	this.lsmaDiv = "";
	this.rsmaDiv = "";
	this.lDivCssText = "position:absolute;top:0px;left:10px;width:120px;height:290px;display:block;";
	this.rDivCssText = "position:absolute;top:0px;right:10px;width:120px;height:290px;display:block;";
	this.lsmaDivCssText = "position:absolute;top:0px;left:10px;width:120px;height:290px;display:none;";
	this.rsmaDivCssText = "position:absolute;top:0px;right:10px;width:120px;height:290px;display:none;";
	this.lbigDivInner = "";
	this.lsmaDivInner = "";
	this.rbigDivInner = "";
	this.rsmaDivInner = "";
	this.objtime = "";
}
floatAdver.prototype = {
	createInfo:function(lcss,rcss,lsmacss,rsmacss,linfo,rinfo,lsmainfo,rsmainfo,h){ //设置两边浮动层信息
		this.lDivCssText += lcss;
		this.rDivCssText += rcss;
		this.lsmaDivCssText += lsmacss;
		this.rsmaDivCssText += rsmacss;
		this.lbigDivInner = linfo;
		this.rbigDivInner = rinfo;
		this.lsmaDivInner = lsmainfo;
		this.rsmaDivInner = rsmainfo;
		this.h = h;
	},
	createFloatDiv:function(){ // 创建２个浮动层
		this.lDiv = document.createElement("div");	
		this.rDiv = document.createElement("div");
		this.lsmaDiv = document.createElement("div");	
		this.rsmaDiv = document.createElement("div");
		this.lDiv.style.cssText = this.lDivCssText;	
		this.rDiv.style.cssText = this.rDivCssText;
		this.lsmaDiv.style.cssText = this.lsmaDivCssText;	
		this.rsmaDiv.style.cssText = this.rsmaDivCssText;
		this.lDiv.innerHTML = this.lbigDivInner;
		this.rDiv.innerHTML = this.rbigDivInner;
		this.lsmaDiv.innerHTML = this.lsmaDivInner;
		this.rsmaDiv.innerHTML = this.rsmaDivInner;
		document.body.appendChild(this.rDiv);
		document.body.appendChild(this.lDiv);
		document.body.appendChild(this.rsmaDiv);
		document.body.appendChild(this.lsmaDiv);
		this.rDiv.id="r"+divCount;
		this.lDiv.id="l"+divCount;
		this.rsmaDiv.id="rsma"+divCount;
		this.lsmaDiv.id="lsma"+divCount;
	},
	createAdvPro:function(){ //类内部创建层的浮动过程
		var bodyScrollTop = document.documentElement.scrollTop+document.body.scrollTop;		
		if(this.rDiv != bodyScrollTop + this.h)
		{
			this.$(this.rDiv).style.top = parseInt(this.$(this.rDiv).style.top) + Math.ceil((bodyScrollTop + this.h - parseInt(this.$(this.rDiv).style.top))/20)	+ "px";	
			this.$(this.lDiv).style.top = this.$(this.rDiv).style.top;
			
			this.$(this.rsmaDiv).style.top = parseInt(this.$(this.rsmaDiv).style.top) + Math.ceil((bodyScrollTop + this.h - parseInt(this.$(this.rsmaDiv).style.top))/20)	+ "px";	
			this.$(this.lsmaDiv).style.top = this.$(this.rsmaDiv).style.top;
		}		
	},
	
	createAdv:function(){ //调用内部浮动 入口!!
		var _this = this;
		_this.createFloatDiv();
		setInterval(function(){_this.createAdvPro();},10);
		_this.objtime = setTimeout(function(){_this.closediv();},10000);
		divCount++;	
	},
	floatPro:function(){//非类内部创建层的 浮动效果
		var bodyScrollTop = document.documentElement.scrollTop+document.body.scrollTop;		
		if(this.fDiv.style.top != bodyScrollTop + this.h)
		{
			this.$(this.fDiv).style.top = parseInt(this.$(this.fDiv).style.top) + Math.ceil((bodyScrollTop + this.h - parseInt(this.$(this.fDiv).style.top))/20)	+ "px";
			
		}
	},
	$:function(o){ //获取对象
		if(typeof(o) == "string")
		return document.getElementById(o);
		return o;
	},
	begins:function(o,h){//调用浮动 入口!!
		var _this = this;
		_this.fDiv = _this.$(o);
		_this.h = h;
		//alert(this.fDiv.id);
		setInterval(function(){_this.floatPro();},10);
	},
	reopendiv:function(){//切换大图
		var _this = this;
		_this.lDiv.style.display="block";
		_this.rDiv.style.display="block";
		_this.lsmaDiv.style.display="none";
		_this.rsmaDiv.style.display="none";
		if(_this.objtime){
			clearTimeout(_this.objtime);
		}
		_this.objtime = setTimeout(function(){_this.closediv();},5000);
	},
	closediv:function(){//切换小图
		this.lDiv.style.display="none";
		this.rDiv.style.display="none";
		this.lsmaDiv.style.display="block";
		this.rsmaDiv.style.display="block";
	}
}
