function getMenuPanel(id){var pnl={domObj:getObject(id),id:id,title:getObject(id+"_title"),setTitle:function(t){this.title.innerHTML=t;},buttonRow:getObject(id+"_buttons"),body:getObject(id+"_body"),setBody:function(b){this.body.innerHTML=b;},getBtnOk:function(){return getObject("btn"+id+"_ok");},getBtnCancel:function(){return getObject("btn"+id+"_cancel");},getBtnClose:function(){return getObject("btn"+id+"_close");},setOkHandler:function(fn){this.getBtnOk().onclick=fn;},getIconClose:function(){return getObject("icon"+id+"_close");},setCancelHandler:function(fn){this.getBtnCancel().onclick=this.getIconClose().onclick=fn;},setCloseHandler:function(fn){this.getBtnClose().onclick=fn;}};return pnl;}var MenuPanelUtils={activePanel:null,activePanels:[],parentPanels:{},setActivePanel:function(pnl){this.activePanel=pnl;this.activePanels.push(pnl);},panels:[],hideSelects:function(){var showSelect=function(e,p){if(p===document.body){return true;}while(e=e.parentNode){if(e===p){return true;}}return false;};if(acx.browser.ie6){var selectArray=document.getElementsByTagName("SELECT");var currPanel=this.activePanel?getObject(this.activePanel):document.body;for(var i=0;i<selectArray.length;i++){var el=selectArray[i];if(!showSelect(el,currPanel)){el.style.visibility="hidden";}else{if(el.style.visibility==="hidden"){el.style.visibility="visible";}}}}},cachedOnEnterHandler:null,showPanel:showDialogPanel,hideMenuPanel:function(pnlId){hideMenuPanel(pnlId);},createModel:function(doc,parent){var docSize=getDocumentSize(doc);var fParent=(doc==window.document&&parent)?parent:doc.body;if(fParent.tagName=="FORM"){fParent=fParent.parentNode;}var m=getObject("modal",doc)||createElement({id:"modal"},fParent);m.style.width=docSize.x+"px";m.style.height=docSize.y+"px";if(m.parentNode!=fParent){m.parentNode.removeChild(m);fParent.appendChild(m);}},showModalLayer:function(parent){var fList=top.document.getElementsByTagName("frame");var isFrame=(fList.Length>0);if(isFrame){for(var i=0;i<fList.length;i++){this.createModel(fList[i].contentWindow.document,parent);}}else{this.createModel(document);}if(MenuPanelUtils.activePanel!=null){getObject(MenuPanelUtils.activePanel).style.zIndex="1";}},minimiseModal:function(doc){var m=getObject("modal",doc);if(m){m.style.height="0";m.style.width="0";}},hideModalLayer:function(){var fList=top.document.getElementsByTagName("frame");var isFrame=(fList.Length>0);if(isFrame){for(var i=0;i<fList.length;i++){this.minimiseModal(fList[i].contentWindow.document);}}else{this.minimiseModal(document);}},hidePanel:function(){if(this.activePanel){hideMenuPanel(this.activePanel);}if(this.cachedOnEnterHandler){document.onkeypress=this.cachedOnEnterHandler;this.cachedOnEnterHandler=null;}},hideActivePanel:function(){this.activePanel=this.activePanels.pop();if(!this.parentPanels[this.activePanel]){this.hideModalLayer();this.hidePanel();}else{var parentPanel=this.parentPanels[this.activePanel];getObject(parentPanel).style.zIndex=99;if(this.activePanel){this.hidePanel();}}return false;},hideAllActivePanels:function(){for(var i=this.activePanels.length;i>0;i--){this.hideActivePanel();}},showLoadingPanel:function(msg){showLoadingPanel(msg);}};function showFloatingMessagePanel(msg,triggerObj,xOffset,yOffset,autoRemove){var pnlId="fp";var fp;if(getObject(pnlId)){fp=getObject(pnlId);document.body.removeChild(fp);}else{fp=document.createElement("div");fp.id=pnlId;}fp.innerHTML="<img src='/html/Images/backgrounds/loading.gif' alt='' height='13' width='13' valign='middle' /> "+msg;fp.className="floatingMessagePanel";fp.onclick=function(){hide(this);};document.body.appendChild(fp);setSpawnedElementPosition(fp,triggerObj,false,xOffset,yOffset);if(autoRemove){window.setTimeout(function(){hide("fp");},4000);}return fp;}function showMenuPanel(callingObj,offHeight){var pnlObj=getObject(callingObj.id+"_panel");if(pnlObj.style.display!="none"){MenuPanelUtils.hideActivePanel();}else{MenuPanelUtils.hideActivePanel();MenuPanelUtils.hideSelects();var menuPosObj=getObject("toolbar");var menuOffsetHeight=100;if(typeof offHeight!="undefined"){menuOffsetHeight=offHeight;}var topPos=getElementOffset(menuPosObj).y+menuPosObj.offsetHeight+menuOffsetHeight;var leftPos=getElementOffset(callingObj).x;if(document.all){topPos=topPos-10;}var screenWidth=document.body.clientWidth;var pnlWidth=parseInt(pnlObj.style.width);if(pnlWidth+leftPos>screenWidth){leftPos=screenWidth-(pnlWidth+20);}pnlObj.style.left=leftPos+"px";pnlObj.style.top=topPos+"px";pnlObj.style.display="block";MenuPanelUtils.activePanel=pnlObj.id;}return false;}function showPanel(panelId){MenuPanelUtils.panels[panelId].show();}function showLoadingPanel(msg){var pnl=getObject("_loadingPanel");if(!pnl){pnl=document.createElement("div");pnl.className="loadingPanel";pnl.style.padding="20px";pnl.style.width="250px";pnl.id="_loadingPanel";document.body.appendChild(pnl);}pnl.innerHTML="<img src='/html/Images/backgrounds/loading.gif' alt='' height='13' width='13' valign='middle' /> "+msg;MenuPanelUtils.hideSelects();MenuPanelUtils.showPanel(pnl.id,true);return pnl;}function setPanelPos(pnlObj,posPoint){var leftPos,topPos;if(typeof posPoint!="undefined"){leftPos=posPoint.x;topPos=posPoint.y;}else{var screenWidth=document.body.offsetWidth;var screenHeight=document.body.offsetHeight;var scrollTop=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;var scrollLeft=document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;var visibleWidth=window.innerWidth?window.innerWidth:(document.body.parentElement.clientWidth?document.body.parentElement.clientWidth:document.body.clientWidth);var visibleHeight=window.innerHeight?window.innerHeight:(document.body.parentElement.clientHeight?document.body.parentElement.clientHeight:document.body.clientHeight);pnlObj.style.display="block";var pnlWidth=parseInt(pnlObj.style.width);if(isNaN(pnlWidth)){pnlWidth=0;}var pnlHeight=parseInt(pnlObj.offsetHeight);leftPos=((visibleWidth-pnlWidth)/2)+scrollLeft;topPos=((visibleHeight-pnlHeight)/3)+scrollTop;if((pnlWidth+(leftPos-scrollLeft))>visibleWidth){leftPos=screenWidth-(pnlWidth+20);}}if(leftPos<0){leftPos=0;}if(topPos<0){topPos=0;}pnlObj.style.left=leftPos+"px";pnlObj.style.top=topPos+"px";}function showDialogPanel(panelId,isModal){var pnlObj=getObject(panelId);if(isModal){MenuPanelUtils.parentPanels[pnlObj.id]=MenuPanelUtils.activePanel;MenuPanelUtils.showModalLayer(pnlObj.parentNode);}setPanelPos(pnlObj);var inputs=pnlObj.getElementsByTagName("input");var i;for(i=0;i<inputs.length;i++){try{var currInput=inputs[i];if(currInput.type=="text"&&!currInput.disabled&&currInput.parentNode.className!="lookupWrapper"){currInput.focus();break;}}catch(e){}}MenuPanelUtils.setActivePanel(pnlObj.id);MenuPanelUtils.hideSelects();return false;}function showCalloutPanel(panelId,relativeEl,extraOffset){extraOffset=extraOffset||{x:0,y:0};var pnlObj=getObject(panelId);var relObj=getObject(relativeEl);if(MenuPanelUtils.activePanel!=null){MenuPanelUtils.parentPanels[panelId]=MenuPanelUtils.activePanel;}MenuPanelUtils.showModalLayer(pnlObj.parentNode);replaceClass(pnlObj,"right","left");pnlObj.style.visibility="hidden";pnlObj.style.display="block";var relPos=getElementOffset(relObj);var relSiz=getElementSize(relObj);var pnlSiz=getElementSize(getElementBySelector("DIV.dialogbox",pnlObj)).addX(24);var voiceTop=(pnlSiz.y-20)/2;finalLoc=new vector(relPos.x+relSiz.x,relPos.y+(relSiz.y/2)-24-voiceTop).add(extraOffset);var conBR=getElementOffset(pnlObj.parentNode).add(getElementSize(pnlObj.parentNode));var pnlBR=finalLoc.add(pnlSiz);if(pnlBR.x>conBR.x){replaceClass(pnlObj,"left","right");finalLoc=finalLoc.subX(pnlSiz.x);}if(pnlBR.y>conBR.y){finalLoc=finalLoc.subY(pnlBR.y-conBR.y);voiceTop+=(pnlBR.y-conBR.y);}if(finalLoc.y<0){voiceTop+=finalLoc.y;finalLoc.y=0;}getObject(pnlObj.id+"_voice").style.marginTop=Math.floor(voiceTop)+"px";moveElement(pnlObj,finalLoc);pnlObj.style.visibility="visible";var inputs=pnlObj.getElementsByTagName("input");for(var i=0;i<inputs.length;i++){try{if(inputs[i].type=="text"&&!inputs[i].disabled){inputs[i].focus();break;}}catch(e){}}MenuPanelUtils.setActivePanel(pnlObj.id);MenuPanelUtils.hideSelects();return false;}function hideMenuPanel(pnl){var pnlObj=getObject(pnl);if(pnlObj){hide(pnlObj);MenuPanelUtils.activePanel=MenuPanelUtils.parentPanels[pnlObj.id]||null;MenuPanelUtils.hideSelects();}return false;}sldValue=0;sldTop=0;sldLeft=0;doDrag=false;sldMouseLeft=0;sldMouseTop=0;var draggedObj=null;function setLeft(o,oLeft){o.style.left=oLeft+"px";}function setTop(o,oTop){o.style.top=oTop+"px";}function setMousePosition(o,oLeft,oTop){setLeft(o,oLeft);setTop(o,oTop);}function dragPanel(e,obj){if(!e){e=window.event;}doDrag=true;o=obj;sldLeft=getElementOffset(o).x;sldTop=getElementOffset(o).y;sldMouseLeft=e.clientX-sldLeft;sldMouseTop=e.clientY-sldTop;draggedObj=o;}function dropPanel(e){doDrag=false;draggedObj=null;var m=getObject("modal");if(m){var docSize=getDocumentSize();m.style.width=docSize.x+"px";m.style.height=docSize.y+"px";}}function hideMenuPanels(){if(MenuPanelUtils.activePanel!=""&&MenuPanelUtils.activePanel!=null&&typeof MenuPanelUtils.activePanel!="undefined"){MenuPanelUtils.hideActivePanel();}}function doMouseMove(e){if(!e){e=window.event;}if(doDrag){o=draggedObj;setMousePosition(o,e.clientX-sldMouseLeft,e.clientY-sldMouseTop);return false;}}addEvent(document,"mousemove",doMouseMove);