
var PopItUp_htmlTemplates=new Array();PopItUp=function(innerHTML,popupId,targetTag,classes,tagDepth,startDel,goDel,fadeWay,closeOnClick){var tagD=(isNaN(tagDepth)||tagDepth==null)?3:tagDepth;var sDel=(isNaN(startDel)||startDel==null)?0.7:startDel;var gDel=(isNaN(goDel)||goDel==null)?0.1:goDel;var fWay=(isNaN(fadeWay)||fadeWay==null)?10:fadeWay;PopItUp_htmlTemplates[popupId]=innerHTML;addRunTagFunc(targetTag,"if(tag.title=='"+popupId+"')popItUp_initTrigger(tag,"+tagD+","+sDel+","+gDel+","+fWay+",'"+classes+"',"+((closeOnClick)?true:false)+")");}
popItUp_initTrigger=function(tag,tagD,sDel,gDel,fWay,classes,closeOnClick){var ph=3;var startDelay=sDel;var goDelay=gDel;var tagDepth=tagD;var fadeWay=fWay;var actionWait;var popupGroup=tag.title;var zIndex=2000;tag.title="";var myPopup=d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));myPopup.className=classes;myPopup.style.display="none";myPopup.fadeInt=50;myPopup.trigger=tag;layout_add(myPopup);fade_add(myPopup,true);myPopup.onmouseover=function(e,force){if(!this.hookedTo)return;if(!force){var e=e||window.event;standardizeEvent(e);if(!onMouseReally(this,e,tagDepth))return;}
if(e.relatedTarget==this.hookedTo||isParentNode(this.hookedTo,e.relatedTarget,tagDepth))return;this.hookedTo.onmouseover(null,true);}
myPopup.onmouseout=function(e,force){if(!this.hookedTo)return;if(!force){var e=e||window.event;standardizeEvent(e);if(!onMouseReally(this,e,tagDepth)||e.relatedTarget&&e.relatedTarget.tagName.match(/^xul:/i))return;}
if(e.relatedTarget==this.hookedTo||isParentNode(this.hookedTo,e.relatedTarget,tagDepth))return;this.hookedTo.onmouseout(null,true);}
if(closeOnClick){myPopup.onclick=function(e,force){if(!this.hookedTo)return;this.hookedTo.popOff();}}
if(tag.onmouseover)ph=tag.onmouseover();if(!ph.length)ph=new Array();myPopup.innerHTML=replacePlaceholder(PopItUp_htmlTemplates[popupGroup],ph);layout_registerDocPos(tag);tag.onmouseover=function(e,force){var delay=startDelay;if(!force){var e=e||window.event;standardizeEvent(e);if(!onMouseReally(this,e,tagDepth))return;if(myPopup.hookedTo&&myPopup.hookedTo==this&&e.relatedTarget==myPopup||isParentNode(myPopup,e.relatedTarget,tagDepth))return;}
clearTimeout(actionWait);if(myPopup.hookedTo&&myPopup.hookedTo!=this){myPopup.hookedTo.popOff();delay=Math.max(startDelay,goDelay)*2;}
actionWait=setTimeout("document.getElementById('"+getId(this)+"').popOn();",delay*1000);}
tag.popOn=function(){if(myPopup.hookedTo==this)return;myPopup.hookedTo=this;myPopup.style.zIndex=zIndex;if(!myPopup.fadeIsRunning)myPopup.posToPoint(this.getRandomPoint(),20);myPopup.moveToPoint(this.docGetCenter().subtractMe(myPopup.docGetRelativeCenter()),myPopup.START_FAST,500,20,20);myPopup.fade(1);}
tag.onmouseout=function(e,force){if(!force){var e=e||window.event;standardizeEvent(e);if(!onMouseReally(this,e,tagDepth))return;if(myPopup.hookedTo&&myPopup.hookedTo==this&&e.relatedTarget==myPopup||isParentNode(myPopup,e.relatedTarget,tagDepth))return;}
clearTimeout(actionWait);actionWait=setTimeout("document.getElementById('"+getId(this)+"').popOff();",goDelay*1000);}
tag.popOff=function(){if(myPopup.hookedTo!=this)return;myPopup.hookedTo=null;myPopup.style.zIndex=zIndex-1;myPopup.moveToPoint(this.getRandomPoint(),myPopup.START_SLOW,900,20,20);myPopup.fade(0);}
tag.getRandomPoint=function(){return this.docGetCenter().subtract(myPopup.docGetRelativeCenter()).subtract(new Point(((Math.random()>.5)?-1:+1)*fadeWay,((Math.random()>.5)?-1:+1)*fadeWay))}}