function popOutBox(boxEl, triggerEl){
	var box=this;
	var YUD=YAHOO.util.Dom;
	var YUE=YAHOO.util.Event;
	box.boxObj=YUD.get(boxEl);
	box.boxObj.style.visibility='hidden'; 
	box.triggerObj=YUD.get(triggerEl);
	box.zoomerObject=document.createElement('DIV');
	box.zoomerObject.style.position='absolute';
	box.zoomerObject.style.border='1px solid #999999';
	box.zoomerObject.style.display='none';
	box.zoomerObject.borderPropValue=box.zoomerObject.style.border;
	var triggerLevel=parseInt(box.triggerObj.style.zIndex);
	if(isNaN(triggerLevel))	triggerLevel=0;
	box.zoomerObject.style.zIndex = triggerLevel>999 ? triggerLevel+1 : 999;
	box.boxIsVisible=false;
	box.bgcolor='transparent';
	box.animDurationIn=0.25;
	box.animDurationOut=0.2;
	box.onbeforeanimation=null;
	box.onbeforeanimationparams=null;
	if(document.body.childNodes.length>0)	document.body.insertBefore(box.zoomerObject, document.body.childNodes.item(0));
	else	document.body.appendChild(box.zoomerObject);
	box.mouseOver=function(evt){ 
		box.popUp();
	}
	box.mouseOut=function(evt){ 
		box.hide(true);
	}
	box.popUp=function(){ // console.log('popup')
		box.boxObj.style.zIndex=1001;
		clearTimeout(box.timerId);
		if(box.boxIsVisible)	return;
		YUD.addClass(box.triggerObj, 'popupstate');
		if(box.onbeforeanimation) box.onbeforeanimation(box.onbeforeanimationparams);
		box.boxIsVisible=true;
		if(box.animDurationOut>0){
			box.zoomerObject.style.display='';
			box.zoomerObject.style.backgroundColor=box.bgcolor;
			if(box.bgcolor!='transparent'){
				box.zoomerObject.borderPropValue =  box.zoomerObject.style.border;
				box.zoomerObject.style.border =  '';
			}
			var pos=YUD.getXY(box.triggerObj);
			var anim = new YAHOO.util.Anim(box.zoomerObject);
			box.zoomerObject.anim=anim;
			anim.getEl().style.left=pos[0]+'px';
			anim.getEl().style.top=pos[1]+'px';	
			anim.getEl().style.width=box.triggerObj.offsetWidth+'px';
			anim.getEl().style.height=box.triggerObj.offsetHeight+'px';
			anim.getEl().style.display='';
			anim.attributes.width={to: box.boxObj.offsetWidth}; 
			anim.attributes.height={to: box.boxObj.offsetHeight}; 
			anim.attributes.top={to: YUD.getY(box.boxObj)}; 
			anim.attributes.left={to: YUD.getX(box.boxObj)}; 
			anim.method=YAHOO.util.Easing.easeOut;
			anim.duration=box.animDurationIn;
			anim.onComplete.subscribe(function(){box.boxObj.style.visibility='visible'; box.zoomerObject.style.display='none'; });  
			anim.animate();
		}else
			box.boxObj.style.visibility='visible';
	}
	box.timerId=null;
	box.hide=function(delay){ 
		box.boxObj.style.zIndex=1000; 
		if(!box.boxIsVisible)	return;
		clearTimeout(box.timerId);
		if(delay==true || (box.zoomerObject.anim && box.zoomerObject.anim.isAnimated && box.zoomerObject.anim.isAnimated())){
			box.timerId = setTimeout(box.hide, 0);
		}else{
			YUD.removeClass(box.triggerObj, 'popupstate');
			box.boxIsVisible=false;
			if(box.animDurationOut>0){
				box.zoomerObject.style.display='';
				box.zoomerObject.style.backgroundColor='';
				box.zoomerObject.style.border=box.zoomerObject.borderPropValue;
				var pos=YUD.getXY(box.boxObj);
				var anim = new YAHOO.util.Anim(box.zoomerObject);
				anim.getEl().style.left=pos[0]+'px';
				anim.getEl().style.top=pos[1]+'px';	
				anim.getEl().style.width=box.boxObj.offsetWidth+'px';
				anim.getEl().style.height=box.boxObj.offsetHeight+'px';
				anim.getEl().style.display='';
				anim.attributes.width={to: box.triggerObj.offsetWidth}; 
				anim.attributes.height={to: box.triggerObj.offsetHeight}; 
				anim.attributes.top={to: YUD.getY(box.triggerObj)}; 
				anim.attributes.left={to: YUD.getX(box.triggerObj)}; 
				anim.duration=box.animDurationOut;
				anim.onComplete.subscribe(function(){box.zoomerObject.style.display='none'; });  
				box.boxObj.style.visibility='hidden';
				anim.animate();
			}else
				box.boxObj.style.visibility='hidden';
		}
	}
	box.setDuration=function(dIn, dOut){
		if(typeof(dIn)=='number')	box.animDurationIn=dIn;
		if(typeof(dOut)=='number')	box.animDurationOut=dOut;
	}
	box.setEffectAttributes=function(attr){
		if(!attr)	return;
		if(attr.borderWidth)
			box.zoomerObject.style.borderWidth=attr.borderWidth;
		if(attr.borderColor)
			box.zoomerObject.style.borderColor=attr.borderColor;
		if(attr.bgcolor)
			box.bgcolor=attr.bgcolor;
		if(attr.duration)
			box.setDuration(attr.duration[0], attr.duration[1]);
	}
	if(box.triggerObj) YUE.addListener(box.triggerObj, 'mouseover', box.mouseOver);
	if(box.triggerObj) YUE.addListener(box.triggerObj, 'mouseout', box.mouseOut);
	if(box.triggerObj) YUE.addListener(box.boxObj, 'mouseover', box.mouseOver);
	if(box.triggerObj) YUE.addListener(box.boxObj, 'mouseout', box.mouseOut);
	
	
	return box;
}