function $float(obj){
	//显示浮窗,支持各种形态
	var option={
		id:"",	//	唯一id
		title:"",
		html:"",
		iframe:"",	//目标iframeurl，如果为空则输出html内容，否则html代码无效。
		left:"",
		top:"",
		width:"400",
		showClose:true,
		height:"",
		leaver:2,	//浮层等级
		fix:false,	//是否固定居中随屏幕滚动，如果为true则left和top无效
		style:"stand",	//stand\none\poptip
		autoResize:false,	//自动调整高度
		cover:true,	//显示覆盖背景
		cssUrl:"/css/module_box.css",
		dragble:false,//title部分手否可拖动。默认不可拖动
		onInit:function(o){return true;},//显示完成事件
		onClose:function(o){return true;}	//关闭事件
	};
	for(var i in obj)option[i]=obj[i];
	//初始化
	window._PP_core_float_data?"":floatInit(option.cssUrl);
	//获得唯一标记
	window._PP_core_float_data.zIndex++;
	option.id=option.id?option.id:window._PP_core_float_data.zIndex;
	option.iframe?option.html='<iframe src="'+option.iframe+'"  scrolling="no" vspace="0" hspace="0" frameborder="0"  height="'+(parseInt(option.height)-30)+'" width="'+(parseInt(option.width)-2)+'"></iframe>':"";
	//关闭浮层的方法
	option.close=closeFloat;
	//销毁浮层的方法
	option.destruct=destructFloat;
	//关闭同等级或者低等级的浮层
	option.closeOther=closeOther;
	//保持浮层随屏幕滚动
	option.keepBoxFix=keepBoxFix;
	//调整浮层大小
	option.resize=resize;
	//显示浮层内容
	option.show=showBox;
	//执行操作
	option.closeOther();
	option.show();
	window._PP_core_float_data.list.push(option);
	//如果标题title可拖动那么执行拖动操作
	if(option.dragble){
		$initDragItem({
			barDom:option.boxTitleHandel,
			targetDom:option.boxHandel
		});
	}
	return option;
	//关闭浮层的方法
	function closeFloat(){
		if(!option.onClose(option)){return;}
		//关闭兄弟和子浮层
		option.closeOther();
		option.destruct();
		
	}
	//销毁浮层的方法
	function destructFloat(){
		//关闭低级浮层
		this.cover?window._PP_core_float_data.closeCover():"";
		if(this.sizeTimer){
			clearInterval(this.sizeTimer);
		}
		if(this.fixTimer){
			clearInterval(this.fixTimer);
		}
		this.boxHandel?document.body.removeChild(this.boxHandel):"";
		this.boxHandel=null;
		for(var i=0;i<window._PP_core_float_data.list.length;i++){
			if(!window._PP_core_float_data.list[i]){continue;}
			if(this.id==window._PP_core_float_data.list[i].id){
				window._PP_core_float_data.list[i]=null;
			}
		}
	}
	//关闭同等级或者低等级的浮层
	function closeOther(){
		for(var i=0;i<window._PP_core_float_data.list.length;i++){
			if(!window._PP_core_float_data.list[i]){continue;}
			if(window._PP_core_float_data.list[i].leaver>=this.leaver && this.id!=window._PP_core_float_data.list[i].id){
				window._PP_core_float_data.list[i].destruct();
			}
		}
	}
	//显示浮层内容
	function showBox(){
		this.cover?window._PP_core_float_data.showCover():"";
		var c=document.createElement("div");
		c.id='floatBox_'+this.id;
		this.boxId='floatBox_'+this.id;
		c.style.position="absolute";
		//根据样式输出不同模板，有标题和关闭按钮的
		if(option.style=="stand"){
			c.className="module_box_normal";
			c.innerHTML='<iframe frameBorder="0" style="position:absolute;left:0;top:0;width:100%;z-index:-1;display:none;border:none;" id="float_iframe_'+this.id+'"></iframe><div class="box_title"><h4>'+this.title+'</h4><a href="javascript:;" style="display:'+(this.showClose?'':'none')+';"  class="bt_close" id="float_closer_'+this.id+'"></a></div><div class="box_content">'+this.html+'</div>';
		}
		//根据样式输出不同模板,无任何样式的时候输出一个空的div
		if(option.style==""){
			c.className="module_box_normal";
			c.innerHTML='<iframe frameBorder="0" style="position:absolute;left:0;top:0;width:100%;z-index:-1;display:none;border:none;" id="float_iframe_'+this.id+'"></iframe><div class="box_content">'+this.html+'</div>';
		}
		if(option.style=="none"){
			//完全空白，不含样式的模板
			c.className="";
			c.innerHTML='<iframe frameBorder="0" style="position:absolute;left:0;top:0;width:100%;z-index:-1;display:none;border:none;" id="float_iframe_'+this.id+'"></iframe><div class="box_content">'+this.html+'</div>';
		}
		document.body.appendChild(c);
		this.boxHandel=document.getElementById('floatBox_'+this.id);
		this.boxIframeHandel=document.getElementById('float_iframe_'+this.id);
		this.boxTitleHandel = this.boxIframeHandel.nextSibling;
		this.boxCloseHandel=document.getElementById('float_closer_'+this.id);
		this.height?(this.boxHandel.style.height=(option.height=="auto"?option.height:option.height+"px")):"";
		this.width?(this.boxHandel.style.width=(option.width=="auto"?option.width:option.width+"px")):"";
		this.boxHandel.style.zIndex=999999;
		this.sw=parseInt(this.boxHandel.offsetWidth);//窗口可见宽度
		this.sh=parseInt(this.boxHandel.offsetHeight);//窗口可见高度
		//窗口定位，如果没有指定坐标则居中
		var p=[0,0];
		p[0]=parseInt(this.left?this.left:($getPageScrollWidth()+($getWindowWidth()-this.sw)/2));
		p[1]=parseInt(this.top?this.top:($getPageScrollHeight()+($getWindowHeight()-this.sh)/2));
		//如果超出屏幕则自动移入
		//超出右侧
		(p[0]+this.sw)>($getPageScrollWidth()+$getWindowWidth())?(p[0]=$getPageScrollWidth()+$getWindowWidth()-this.sw-10):"";
		//超出底部
		(p[1]+this.sh)>($getPageScrollHeight()+$getWindowHeight())?(p[1]=$getPageScrollHeight()+$getWindowHeight()-this.sh-10):"";

		//超出顶部
		p[1]<$getPageScrollHeight()?p[1]=$getPageScrollHeight():"";
		//超出左侧
		p[0]<$getPageScrollWidth()?p[0]=$getPageScrollWidth():"";
		//调整iframe的高度与浮窗一样大小
		this.boxIframeHandel.height=this.sh+"px";
		this.boxIframeHandel.width=this.sw+"px";
		//显示iframe坐标
		this.boxHandel.style.left=p[0]+"px";
		this.boxHandel.style.top=p[1]+"px";
		var _this=this;
		this.boxCloseHandel?this.boxCloseHandel.onclick=function(){_this.close();}:"";
		this.keepBoxFix()
		if(!this.onInit(option)){return;}
	}
	//调整浮层大小
	function resize(w,h){
		this.sw=w;//窗口可见宽度
		this.sh=h;//窗口可见高度
		this.boxHandel.style.height=this.sh+"px";
		this.boxHandel.style.width=this.sw+"px";
		this.boxIframeHandel.height=this.sh+"px";
		this.boxIframeHandel.width=this.sw+"px";
	}
	//保持浮层随屏幕滚动
	function keepBoxFix(){
		if(this.fix){
			if($isBrowser("ie6")){
			//if(navigator.appVersion.split(";")[1].replace(/[ ]/g,"")=="MSIE6.0"){
				var _this=this;
				this.fixTimer=setInterval(function(){
					_this.boxHandel.style.left=($getPageScrollWidth()+($getWindowWidth()-_this.sw)/2)+"px";
					_this.boxHandel.style.top=($getPageScrollHeight()+($getWindowHeight()-_this.sh)/2)+"px";
				},30);
			}else{
				this.boxHandel.style.position="fixed";
				this.boxHandel.style.left=($getWindowWidth()-this.sw)/2+"px";
				this.boxHandel.style.top=($getWindowHeight()-this.sh)/2+"px";
			}
		}
	};
	//当内容的发生变化时自动调整窗口高度
	function autoResize(){
		if(this.autoResize){
			var _this=this;
			this.sizeTimer=setInterval(function(){
				this.sw=this.boxHandel.offsetWidth;//窗口可见宽度
				this.sh=this.boxHandel.offsetHeight;//窗口可见高度
				//调整iframe的高度与浮窗一样大小
				this.boxIframeHandel.height=this.sh+"px";
				this.boxIframeHandel.width=this.sw+"px";
			},50);
		}
	};
	//初始化全局浮层cache
	function floatInit(cssUrl){
		//加载css,如果cssUrl为空则不异步加载样式
		if (cssUrl){
			$loadCss(cssUrl);
		}
		window._PP_core_float_data={};
		//起始层号从255开始
		window._PP_core_float_data.zIndex=255;
		//浮层库列表
		window._PP_core_float_data.list=[];
		//增加一个覆盖的半透明浮层
		createCover();
		_PP_core_float_data.showCover=showCover;
		_PP_core_float_data.closeCover=closeCover;
		//创建浮层对象
		function createCover(){
			var c=document.createElement("div");
			c.id="floatCover";
			with(c.style){
				display="none";
				width="0px";
				height="0px";
				backgroundColor ="#cccccc";
				zIndex=250;
				position="fixed";
				hasLayout=-1;
				left="0px";
				top="0px";
				filter="alpha(opacity=50);";
				opacity="0.5";
			}
			document.body.appendChild(c);
			if($isBrowser("ie6")){
			//if(navigator.appVersion.split(";")[1].replace(/[ ]/g,"")=="MSIE6.0"){
				c.innerHTML='<iframe frameBorder="0" style="position:absolute;left:0;top:0;width:100%;z-index:-1;border:none;" id="floatCover_iframe"></iframe>';
				c.style.position="absolute";
			}
			window._PP_core_float_data.cover=document.getElementById("floatCover");
			window._PP_core_float_data.coverIframe=document.getElementById("floatCover_iframe");
			window._PP_core_float_data.coverIsShow=false;
			window._PP_core_float_data.coverSize=[0,0];
		}
		//显示灰色浮层背景对象
		function showCover(){
			window._PP_core_float_data.cover.style.display="block";
			window._PP_core_float_data.coverIsShow=true;
			keepCoverShow();
			window._PP_core_float_data.coverTimer=setInterval(function(){
				keepCoverShow();
			},50);
			//保持浮层的全屏幕覆盖尺寸
			function keepCoverShow(){
				var _d=window._PP_core_float_data
				if(_d.coverIsShow){
					var ch=$getContentHeight(),wh=$getWindowHeight(),cw=$getContentWidth(),ww=$getWindowWidth();
					var newSize=[wh,ww];
					if($isBrowser("ie6")){
					//if(navigator.appVersion.split(";")[1].replace(/[ ]/g,"")=="MSIE6.0"){
						_d.cover.style.top=$getPageScrollHeight()+"px";
						newSize[0]+=600;
					};
					if(newSize.toString()!=window._PP_core_float_data.coverSize.toString()){

						_d.coverSize=newSize;
						_d.cover.style.height=newSize[0].toFixed(0)+"px";
						_d.cover.style.width=newSize[1].toFixed(0)+"px";
						if(_d.coverIframe){
							_d.coverIframe.style.height=newSize[0].toFixed(0)+"px";
							_d.coverIframe.style.width=newSize[1].toFixed(0)+"px";
						}
					}
				}
			}
		}
		//关闭灰色浮层背景对象
		function closeCover(){
			window._PP_core_float_data.cover.style.display="none";
			window._PP_core_float_data.coverIsShow=false;
			clearInterval(window._PP_core_float_data.coverTimer);
		}
	};
};
function $getContentHeight(){
//获取页面内容的实际高度
var bodyCath=document.body;
var doeCath=document.compatMode=='BackCompat'?bodyCath:document.documentElement;
return (window.MessageEvent&&navigator.userAgent.toLowerCase().indexOf('firefox')==-1)?bodyCath.scrollHeight:doeCath.scrollHeight;
}
function $getContentWidth(){
//获取页面内容的实际宽度
	var bodyCath=document.body;
	var doeCath=document.compatMode=='BackCompat'?bodyCath:document.documentElement;
	return (window.MessageEvent&&navigator.userAgent.toLowerCase().indexOf('firefox')==-1)?bodyCath.scrollWidth:doeCath.scrollWidth;
}
function $getPageScrollHeight(){
	var bodyCath=document.body;
	var doeCath=document.compatMode=='BackCompat'?bodyCath:document.documentElement;
	return (window.MessageEvent && navigator.userAgent.toLowerCase().indexOf('firefox')==-1)?bodyCath.scrollTop:doeCath.scrollTop;
}
function $getPageScrollWidth(){
	var bodyCath=document.body;
	var doeCath=document.compatMode=='BackCompat'?bodyCath:document.documentElement;
	return (window.MessageEvent&&navigator.userAgent.toLowerCase().indexOf('firefox')==-1)?bodyCath.scrollLeft:doeCath.scrollLeft;
}
function $getWindowHeight(){
	var bodyCath=document.body;
	return (document.compatMode=='BackCompat'?bodyCath:document.documentElement).clientHeight;
}
function $getWindowWidth(){
	var bodyCath=document.body;
	return (document.compatMode=='BackCompat'?bodyCath:document.documentElement).clientWidth;
}
function $initDragItem(obj){
	//控制组件拖动方法
	var option = {
		barDom: "", //拖动区域的dom对象
		targetDom: "" //被拖动区域的dom对象
	};
	for (var i in obj) {
		option[i] = obj[i];
	}
	window._dragOption ? "" : window._dragOption = {};
	//设置状态
	option.barDom.style.cursor = 'move';
	option.targetDom.style.position = "absolute";
	option.barDom.onmousedown = function(e){
		var e = window.event || e;
		window._dragOption.barDom = this;
		window._dragOption.targetDom = option.targetDom;
		var currPostion = [parseInt(option.targetDom.style.left) ? parseInt(option.targetDom.style.left) : 0, parseInt(option.targetDom.style.top) ? parseInt(option.targetDom.style.top) : 0];
		window._dragOption.diffPostion = [$getMousePosition({
			evt: e
		})[0] - currPostion[0], $getMousePosition({
			evt: e
		})[1] - currPostion[1]];
		document.onselectstart = function(){
			return false
		};
		window.onblur = window.onfocus = function(){
			document.onmouseup()
		};
		return false;
	};
	option.targetDom.onmouseup = document.onmouseup = function(){
		if (window._dragOption.barDom) {
			window._dragOption = {};
			document.onselectstart = window.onblur = window.onfocus = null;
		}
	};
	option.targetDom.onmousemove = document.onmousemove = function(e){
		try {
			var e = window.event || e;
			if (window._dragOption.barDom && window._dragOption.targetDom) {
				window._dragOption.targetDom.style.left = ($getMousePosition({
					evt: e
				})[0] - window._dragOption.diffPostion[0]) + "px";
				window._dragOption.targetDom.style.top = ($getMousePosition({
					evt: e
				})[1] - window._dragOption.diffPostion[1]) + "px";
			}
		} 
		catch (e) {
		}
	};
}
function $getMousePosition(e){
	//获取鼠标的位置
	var e=window.event?window.event:e.evt;
	var pos=[];
	if(typeof e.pageX!="undefined"){
		pos=[e.pageX,e.pageY];
	}else if(typeof e.clientX!="undefined"){
		pos=[e.clientX+$getScrollPosition()[0],e.clientY+$getScrollPosition()[1]];
	}
	return pos;
}
function $getScrollPosition(){
	//获取滚动条的位置
	var pos=[];
	if(typeof window.pageXOffset!="undefined"){
		pos=[window.pageXOffset,window.pageYOffset];
	}else if(document.body&&typeof document.body!="undefined"){
		pos=[document.body.scrollLeft,document.body.scrollTop];
	}else{
		pos=[document.documentElement.scrollLeft,document.documentElement.scrollTop];
	}
	return pos;
};
function $isBrowser(str){
	str=str.toLowerCase();
	var b=navigator.userAgent.toLowerCase();
	var arrB=[];
	arrB['firefox']=b.indexOf("firefox")!=-1;
	arrB['opera']=b.indexOf("opera")!=-1;
	arrB['safari']=b.indexOf("safari")!=-1;
	arrB['gecko']=!arrB['opera']&&!arrB['safari']&&b.indexOf("gecko")>-1;
	arrB['ie']=!arrB['opera']&&b.indexOf("msie")!=-1;
	arrB['ie6']=!arrB['opera']&&b.indexOf("msie 6")!=-1;
	arrB['ie7']=!arrB['opera']&&b.indexOf("msie 7")!=-1;
	return arrB[str];
};
function $loadCss(path){
	if(!window["_loadCss"+path]){
			var l = document.createElement('link');
			l.setAttribute('type', 'text/css');
			l.setAttribute('rel', 'stylesheet');
			l.setAttribute('href', path);
			l.setAttribute("id","loadCss"+Math.random());
			document.getElementsByTagName("head")[0].appendChild(l);
			window["_loadCss"+path]=true;
	}
	return true;
}
