if(!AE.widget.clickShow){
AE.widget.clickShow = function (){

		var _self=this;
		var defConfig={
			targetId:"clickShowTargetId",		//相对定位的目标ID
			switchId:"",	//激活事件的目标ID
			contentId:"clickShowContentId",
			showOrHidden:true,
			needMask:false,
			needXY:true,
			excursion:[0,0],
			
			onInit:function(){},
			unInit:function(){},
			onShow:function(){},
			unShow:function(){},
			onHidden:function(){},
			unHidden:function(){}
			};
		var config;
		var isInited = false;
		var dTarget,dContent,dSwitch,iframeMask;
		var canClose=true;
		_self.init=function(oConfig){
				
			if(isInited)return false;
			config  = TB.applyIf(oConfig||{}, defConfig);
		
			config.onInit.apply(_self);
			dTarget=get(config.targetId);
			dContent=get(config.contentId);
			dSwitch=(config.switchId==""?dTarget:get(config.switchId));
			if(!dSwitch)
				return;
			YUE.on(dTarget,"click",_self.showDirectly);
			YUE.on(document.body,"click",_self.hiddenDirectly);

			YUE.on(dSwitch,"mouseover",function(){canClose=false;});
			YUE.on(dContent,"mouseover",function(){canClose=false;});
			YUE.on(dSwitch,"mouseout",function(){canClose=true;});
			YUE.on(dContent,"mouseout",function(){canClose=true;});

			if(config.needMask){				
				iframeMask = document.createElement("iframe");
				iframeMask.className = "maskIframe";
				iframeMask.style.display="none";
				iframeMask.style.zIndex=YUD.getStyle(dContent, 'zIndex')-1;
				iframeMask.style.top="0px";
				iframeMask.style.left="0px";
				iframeMask.frameBorder=0;
				dContent.parentNode.appendChild(iframeMask);
				}
			config.unInit.apply(_self);
	};
		
	_self.showDirectly = function(){
		config.onShow.apply(_self);
		if(config.showOrHidden && dContent.style.display != "none"){
			canClose=false;
			_self.hiddenDirectly(null,true); 
			return ;
		}
		
		if(config.needXY){
			var xy  = YUD.getXY(dTarget);
			dContent.style.visibility='hidden';
			dContent.style.display="";
			parsePos(config.excursion);	//解析字符串坐标值
			xy[0]+=config.excursion[0];
			xy[1]+=config.excursion[1];
			dContent.style.visibility='visible';
			YUD.setXY(dContent,xy);
		}else{
			dContent.style.display="";
		}
		
		if(config.needMask){
			iframeMask.style.display="";
			iframeMask.style.width = dContent.offsetWidth+"px";
			iframeMask.style.height = dContent.offsetHeight+"px";
			if(config.needXY){YUD.setXY(iframeMask,xy);}
			iframeMask.style.visibility="visible";
		}
		config.unShow.apply(_self);
	};
			
	_self.hiddenDirectly = function(ev,force){
		config.onHidden.apply(_self);	
		if(canClose || force){
			dContent.style.display="none";
			if(config.needMask){
			iframeMask.style.display="none";
			}
			config.unHidden.apply(_self); 
		}
	};
		
	_self.getConfig=function(){
			return config;
	};

	var parsePos=function(aPos){
			if(typeof(aPos[0])=="string"){
				switch(aPos[0]){
					case'center':aPos[0]=paseInt(dTarget.offsetWidth/2);break;
					case'right':aPos[0]=(dSwitch.offsetWidth - dContent.offsetWidth);break;
					default:aPos[0]=0;
				}
			}
			if(typeof(aPos[1])=="string"){
				switch(aPos[1]){
					case'center':aPos[1]=paseInt(dTarget.offsetHeight/2);break;
					case'bottom':aPos[1]=dTarget.offsetHeight;break;
					default:aPos[1]=0;
				}
			}
			return aPos;
		}
	};
}