function ReportReviewPopup(anchor){this.elemId=null;this.calloutId=null;this.calloutPadding=0;this.dropShadowId=null;this.color=null;this.xOffset=null;this.yOffset=null;this.blur={iRadius:null,iSigma:null};this.opacity=null;this.xShrink=null;this.yShrink=null;this.shadowStyle=null;this.images=new Array;this.setBlur=DropShadowInterface_SetBlur;this.timer=null;this.visible=false;this.delay=null;this.linked=new Array;this.cancelTimer=DelayedPopupInterface_CancelTimer;this.hide=DelayedPopupInterface_Hide;this.toggle=PopupInterface_Toggle;this.anchorId=null;this.getAnchorX=AnchoredInterface_GetAnchorX;this.getAnchorY=AnchoredInterface_GetAnchorY;this.getAnchorZ=AnchoredInterface_GetAnchorZ;this.getAnchorWidth=AnchoredInterface_GetAnchorWidth;this.getAnchorHeight=AnchoredInterface_GetAnchorHeight;this.getAnchorPosition=AnchoredInterface_GetAnchorPosition;this.getElemWidth=AnchoredInterface_GetElemWidth;this.getElemHeight=AnchoredInterface_GetElemHeight;this.setAnchor=AnchoredInterface_SetAnchor;this.disableScroll=true;this.erase=ReportReviewPopup_Erase;this.draw=ReportReviewPopup_Draw;this.init=ReportReviewPopup_Init;this.show=ReportReviewPopup_Show;this.alignElement=ReportReviewPopup_AlignElement;this.def=null;this.term=null;this.setElement=ReportReviewPopup_SetElement;this.setDefinition=ReportReviewPopup_SetDefinition;this.setTerm=ReportReviewPopup_SetTerm;this.setTermColor=ReportReviewPopup_SetTermColor;this.implement(DropShadowInterface);this.implement(CalloutInterface);this.implement(DelayedPopupInterface);this.implement(AnchoredInterface);this.id='ReportReviewPopup';this.style='Default';this.delay=0;this.init();}
ReportReviewPopup.prototype=new BaseObject;ReportReviewPopup.prototype.constructor=ReportReviewPopup;ReportReviewPopup.superclass=BaseObject.prototype;ReportReviewPopup.styles={Default:{term:{font:{family:'Verdana, Arial, Helvetica, sans-serif',size:'11px',weight:'bold'},color:'#589c1c'},font:{family:'Verdana, Arial, Helvetica, sans-serif',size:'11px',weight:'normal'},backgroundColor:'#ffffff',borderColor:'#E9E9E9',weight:'bold',color:'#000000'}}
function ReportReviewPopup_SetElement(elem){this.elemId=elem.id;}
function ReportReviewPopup_Init(){var elem=document.createElement('div');document.getElementsByTagName('body')[0].appendChild(elem);this.elemId='report_review_content';elem.id=this.elemId;elem.style.backgroundColor=ReportReviewPopup.styles[this.style].backgroundColor;elem.style.zIndex=10000;var term=document.createElement('span');this.termId=this.elemId+'_term';term.id=this.termId;if(typeof(writeDebug)=='function')writeDebug('style name: '+this.style+"\ncolor: "+ReportReviewPopup.styles[this.style].term.color);term.style.color=ReportReviewPopup.styles[this.style].term.color;term.style.paddingBottom='5px';term.style.fontFamily=ReportReviewPopup.styles[this.style].term.font.family;term.style.fontSize=ReportReviewPopup.styles[this.style].term.font.size;term.style.fontWeight=ReportReviewPopup.styles[this.style].term.font.weight;elem.appendChild(term);var def=document.createElement('div');this.defId=this.elemId+'_def';def.id=this.defId;def.style.color=ReportReviewPopup.styles[this.style].color;def.style.fontFamily=ReportReviewPopup.styles[this.style].font.family;def.style.fontSize=ReportReviewPopup.styles[this.style].font.size;def.style.fontWeight=ReportReviewPopup.styles[this.style].font.weight;elem.appendChild(def);this.calloutPadding=10;this.cornerStyle='Default';this.shadowStyle='Default';DropShadowInterface_Init.call(this);}
function ReportReviewPopup_Erase(){CalloutInterface_Erase.call(this);DropShadowInterface_Erase.call(this);this.linked=new Array;}
function ReportReviewPopup_Draw(){this.linked=new Array;var elem=document.getElementById(this.elemId);if(!elem)throw new Error('Unable to find element: '+this.elemId);var anchor=document.getElementById(this.anchorId);if(!anchor)throw new Error('Unable to find anchor element: '+this.anchorId);bHeight=2;elem.style.border='1px solid '+ReportReviewPopup.styles[this.style].borderColor;elem.style.backgroundColor=ReportReviewPopup.styles[this.style].backgroundColor;elem.style.color=ReportReviewPopup.styles[this.style].color;var pos=this.getAnchorPosition();var aLeft=DomUtils.getElementLeft(anchor);var aTop=DomUtils.getElementTop(anchor);var aHeight=DomUtils.getElementHeight(anchor);var aWidth=DomUtils.getElementWidth(anchor);var eHeight=DomUtils.getElementHeight(elem);var eWidth=DomUtils.getElementWidth(elem);switch(pos){case AnchoredInterface.ALIGN.RIGHT_TOP:elem.style.left=parseInt(aLeft)+'px';elem.style.top=parseInt(aTop-eHeight-8)+'px';break;case AnchoredInterface.ALIGN.RIGHT_BOTTOM:elem.style.left=parseInt(aLeft)+'px';elem.style.top=parseInt(aTop+aHeight+8)+'px';break;case AnchoredInterface.ALIGN.LEFT_TOP:if((aLeft+aWidth-eWidth)<0){elem.style.left=0;}
else{elem.style.left=parseInt(aLeft+aWidth-eWidth)+'px';}
elem.style.top=parseInt(aTop-eHeight)+'px';break;case AnchoredInterface.ALIGN.LEFT_BOTTOM:default:if((aLeft+aWidth-eWidth)<0){elem.style.left=0;}
else{elem.style.left=parseInt(aLeft+aWidth-eWidth)+'px';}
elem.style.top=parseInt(aTop+aHeight)+'px';break;}
DropShadowInterface_Draw.call(this);window.addEvent(elem,'mouseover',this.cancelTimer,this,true);window.addEvent(elem,'mouseout',this.hide,this,true);this.linked.push(this.dropShadowId);}
function ReportReviewPopup_Show(){this.cancelTimer();var elem=document.getElementById(this.elemId);if(!elem)throw new Error('Unable to find element: '+this.elemId);var anchor=document.getElementById(this.anchorId);if(!anchor)throw new Error('Unable to find anchor element: '+this.anchorId);var wasVisible=this.visible;if(this.visible)PopupInterface_Hide.call(this);if(!this.visible){this.erase();elem.style.zIndex=parseInt(DomUtils.getZIndex(elem)+3);this.draw();var dropShadow=document.getElementById(this.dropShadowId);if(!dropShadow)throw new Error('Unable to find drop shadow element: '+this.dropShadowId);dropShadow.style.zIndex=parseInt(DomUtils.getZIndex(elem))-2;if(wasVisible)PopupInterface_Show.call(this);else DelayedPopupInterface_Show.call(this);}
return true;}
function ReportReviewPopup_AlignElement(pos){CalloutInterface_AlignElement.call(this,pos);DropShadowInterface_AlignElement.call(this,pos);}
function ReportReviewPopup_SetDefinition(definitionString){var def=document.getElementById(this.defId);if(!def)throw new Error('Unable to find definition element: '+this.defId);def.innerHTML=definitionString;}
function ReportReviewPopup_SetTerm(termString){var term=document.getElementById(this.termId);if(!term)throw new Error('Unable to find term element: '+this.termId);while(term.hasChildNodes())term.removeChild(term.firstChild);var txtTerm=document.createTextNode(termString);term.appendChild(txtTerm);}
function ReportReviewPopup_SetTermColor(color){var term=document.getElementById(this.termId);if(!term)throw new Error('Unable to find term element: '+this.termId);term.style.color=color;}
ReportReviewPopup.instance=null;ReportReviewPopup.getInstance=function(){if(!ReportReviewPopup.instance)ReportReviewPopup.instance=new ReportReviewPopup();return ReportReviewPopup.instance;}
ReportReviewPopup.show=function(anchorElement,termString,definitionString){ReportReviewPopup.getInstance().setAnchor(anchorElement);ReportReviewPopup.getInstance().setDefinition(definitionString);ReportReviewPopup.getInstance().setTerm(termString);ReportReviewPopup_Show.call(ReportReviewPopup.getInstance());}
ReportReviewPopup.hide=function(){DelayedPopupInterface_Hide.call(ReportReviewPopup.getInstance());}
ReportReviewPopup.toggle=function(anchorElement,termString,definitionString){if(ReportReviewPopup.getInstance().visible)ReportReviewPopup.hide();else ReportReviewPopup.show(anchorElement,termString,definitionString);}

