var dummy;var undefined;window.currentMenu=null;document.onmousemove=function(a){autoSuggestOnMouseMove(a);quickaddDraggerOnMouseMove(a);portletDraggerOnMouseMove(a);ddmOnMouseMove(a);dropdownOnMouseMove(a);};window.clickCount=0;document.onclick=function(a){++window.clickCount;ddmOnClick(a);if(window.NLPopupSelect_onClickHandler){NLPopupSelect_onClick(a);}};document.onmousedown=function(b){quickaddDraggerOnMouseDown(b);portletDraggerOnMouseDown(b);dropdownOnMouseDown(b);NLPopupAutoSuggest_onMouseDown(b);if(window.divsToClose&&typeof(window.divsToClose)!="undefined"){for(var a=0;a<window.divsToClose.length;a++){document.getElementById(window.divsToClose[a]).style.display="none";}window.divsToClose=null;}};document.onmouseup=function(a){quickaddDraggerOnMouseUp();portletDraggerOnMouseUp();dropdownOnMouseUp(a);if(window.NLCalendar_onMouseUp){NLCalendar_onMouseUp(a);}if(window.NLMachine_onMouseUp){NLMachine_onMouseUp(a);}if(window.OrderedListOnMouseUp!=null){window.OrderedListOnMouseUp(a);}};document.onkeydown=function(a){handleHotKeys(a);NLPopupAutoSuggest_onKeyDown(a);return dropdownOnKeyDown(a);};function addDivToClose(a){if(typeof(window.divsToClose)!="Array"){window.divsToClose=new Array();}window.divsToClose[window.divsToClose.length]=a;}function handleHotKeys(b){if(getEventKeypress(b)==71&&getEventAltKey(b)){var a=document.getElementById("_searchstring");if(a!=null){a.focus();a.select();}}}function getMouseX(a){return getEvent(a).clientX;}function getMouseY(a){return getEvent(a).clientY;}function moveToolTip(a,c){var b=getToolTip();if(parseInt(a)+parseInt(b.offsetWidth)<=getDocumentWidth()){b.style.left=a-9;}else{b.style.left=getDocumentWidth()-b.offsetWidth;}b.style.top=c+document.body.scrollTop+5;}function showToolTip(c,b){if(isValEmpty(c)&&isValEmpty(b)){return;}var a='<table border="0" width="250" cellspacing="0" cellpadding="0" bgcolor="#999999"><tr><td width="100%"><table border="0" width="100%" cellspacing="1" cellpadding="2" align="center">';if(!isValEmpty(c)){a+='<tr><td width="100%" class="bglt"><font class="smalltextb">'+c+"</font></td></tr>";}if(!isValEmpty(b)){a+='<tr><td width="100%" bgcolor="#FFFFFF"><font class="smalltext">'+b+"</font></td></tr>";}a+="</table></td></tr></table>";var d=getToolTip();d.movetooltip=isValEmpty(d.tooltipcontent)||d.tooltipcontent!=a;d.tooltipcontent=a;if(d.hidetooltiptimer!=null){clearTimeout(d.hidetooltiptimer);}d.showtooltiptimer=setTimeout("var tooltip = getToolTip(); if (tooltip.movetooltip) moveToolTip(lastX+20,lastY); tooltip.innerHTML=tooltip.tooltipcontent; tooltip.style.visibility = 'visible'",500);}function stopToolTipHide(){var a=getToolTip();if(a.hidetooltiptimer!=null){clearTimeout(a.hidetooltiptimer);}}function hideToolTip(){var a=getToolTip();if(a.showtooltiptimer!=null){clearTimeout(a.showtooltiptimer);}a.tooltipcontent="";a.hidetooltiptimer=setTimeout("var tooltip = getToolTip(); tooltip.tooltipcontent = null; tooltip.style.visibility = 'hidden'",1000);}function getToolTip(){var a=document.getElementById("NLToolTip");if(a==null){a=document.createElement("DIV");a.id="NLToolTip";a.style.position="absolute";a.style.width="250px";a.style.top="0px";a.style.left="0px";a.style.zIndex=4;a.style.visibility="hidden";document.body.appendChild(a);}return a;}window.menusAreOpen=false;window.rolloverDelay=0;var m_multiButtons=new Array();function getNLMultiButtonByName(a){return m_multiButtons[a];}function NLMultiButton(h,n,k,b,m,d){var e=new Array();this.sName=h;m_multiButtons[h]=this;this.sTaskId=b;this.sPrimaryButtonName=m;this.bSecondary=d;this.bEnabled=true;var g=0;for(i=0;i<n.length;i++){if(n[i][0]==k){this.nDefault=i;}else{e[g]=[n[i][0],"javascript:NLMultiButton_doAction('"+h+"', '"+n[i][1]+"');return false;",""];g++;}}this.sParams=e;this.pValues=n;this.nButtons=n.length;var a="submit";var c=d?2:4;var f=d?"lower_":"upper_";var l=!d?"padding-top:2; ":!isIE?"padding-top:1; ":"";this.sHTML='<table cellpadding=0 cellspacing=0 border=0 style="cursor:hand;"><tr><td nowrap class="rndbuttoncaps" style="'+NLMultiButton_getBackgroundImageHtml("/images/buttons/"+f+"left_cap.gif")+'"><img src="/images/nav/stretch.gif" border=0 height=1 width='+c+'></td><TD id="spn_'+h+'" nowrap class="rndbuttonbody" style="'+l+NLMultiButton_getBackgroundImageHtml("/images/buttons/"+f+"body.gif")+';"><input onblur="NLMultiButton_clearMultiButtonMenus();" onkeydown="return getNLMultiButtonByName(\''+h+"').onKeyPress(event);\" onclick=\"getNLMultiButtonByName('"+h+'\').onMainButtonClick(this);return false;" id="btn_'+h+'" type="'+a+'" class="rndbuttoninpt'+(d?"small":"")+'" style="vertical-align:middle;" value="'+k+"\" onkeypress=\"setEventCancelBubble(event);\" onmousedown=\"this.setAttribute('_mousedown','T'); setButtonDown(true, "+(d?"true":"false")+", this);\" onmouseup=\"this.setAttribute('_mousedown','F'); setButtonDown(false, "+(d?"true":"false")+", this);\" onmouseout=\"if(this.getAttribute('_mousedown')=='T') setButtonDown(false, "+(d?"true":"false")+", this);\" onmouseover=\"if(this.getAttribute('_mousedown')=='T') setButtonDown(true, "+(d?"true":"false")+', this);"></td><td nowrap class="rndbuttoncaps" onmouseout="NLMultiButton_onArrowMouseOut(\''+h+"')\" onmouseover=\"NLMultiButton_onArrowMouseOver('"+h+"')\" onclick=\"getNLMultiButtonByName('"+h+'\').onDropDownClick(this, event);"><img id="multibtnimg_'+h+'" src="/images/buttons/'+(d?"lower_":"")+'multi_right_cap.gif" alt="More Options"></td></tr></table>';this.toString=function(){return this.sHTML;};this.writeInlineHTML=function(){document.write(sHTML);};}function NLMultiButton_clearMultiButtonMenus(){for(i in menus){if(menus[i].tabName!=null&&menus[i].tabName.indexOf("mulitibutton")>=0){menus[i].close();}}}function NLMultiButton_getBackgroundImageHtml(a){return"background-image:url("+a+");";}NLMultiButton.prototype.onMainButtonClick=function(a){NLMultiButton_doAction(this.sName,this.pValues[this.nDefault][1]);};NLMultiButton.prototype.setState=function(b){if(this.bEnabled==b){return;}this.bEnabled=b;var a=document.getElementById("btn_"+this.sName);a.disabled=!b;};function NLMultiButton_doAction(b,c){var a=document.forms.main_form;var e;if(a&&a.elements[c]!=null){e=a.elements[c];}else{e=document.getElementById(c);}if((e.type=="submit")&&b){var d=getNLMultiButtonByName(b);if(d.sTaskId&&d.sPrimaryButtonName&&d.pValues[d.nDefault][1]!=c){a.elements._multibtnstate_.value=d.sTaskId+":"+d.sPrimaryButtonName+":"+e.name;}}e.click();}function NLMultiButton_openMenu(b){clearAllMenusExcept(b);var a=getNLMultiButtonByName(b);if(!a.bEnabled){return;}var c=a.getMenu();c.setOpenMenuUpwardIfNotBelow(true);c.setAllowArbitraryHtmlInMenuEntries(true);c.showHide(true);}function NLMultiButton_onArrowMouseOut(a){clearTimeout(window.rolloverDelay);}function NLMultiButton_onArrowMouseOver(a){window.rolloverDelay=setTimeout("NLMultiButton_openMenu('"+a+"')",100);}NLMultiButton.prototype.onKeyPress=function(a){if(!isIE){return true;}var b=getEventKeypress(a);var c=this.getMenu();if(!c.isOpen&&(b==40)){c.open(null,false);this.nSelected=0;c.setCurrentCellInMenu(c.getCellInMenuAt(this.nSelected));}else{if(c.isOpen){if(b==13){setEventPreventDefault(a);if(c.getCurrentCellInMenu()){c.getCurrentCellInMenu().onclick();}return false;}else{if(b==40||b==38){this.nSelected+=((b==38)?-1:1);if(this.nSelected>=(this.nButtons-1)){this.nSelected=this.nButtons-2;}else{if(this.nSelected<0){this.nSelected=0;c.close();return false;}}c.setCurrentCellInMenu(c.getCellInMenuAt(this.nSelected));}}}}return true;};NLMultiButton.prototype.getMenu=function(){var b=this.menu;if(!b){var a=this.sName;b=this.menu=new NLMenu(a,this.sParams,0,null);menus[a]=b;menuTimers[b.tabName]=0;b.setScaleToLauncher(true);b.setMenuCSSClass(this.bSecondary?"ddmDivButtonSec":"ddmDivButton");b.setXandYoverride(4,-4);b.setCloseAction("getNLMultiButtonByName('"+a+"').onMenuClose();");b.setAfterOpenAction("getNLMultiButtonByName('"+a+"').onAfterMenuOpen();");this.imgbtn=document.getElementById("multibtnimg_"+a);this.btnMain=document.getElementById("btn_"+a);}return b;};NLMultiButton.prototype.onDropDownClick=function(b,a){if(!this.bEnabled){return true;}setEventCancelBubble(a);var c=this.getMenu();c.showHide(true);return false;};NLMultiButton.prototype.onMenuClose=function(){this.nSelected=-1;};NLMultiButton.prototype.onAfterMenuOpen=function(){this.nSelected=0;var e=this.getMenu();var d=this.pValues;var a=0;for(var b=0;b<d.length;b++){if(b!=this.nDefault){var c=document.getElementById(d[a][1]);e.getCellInMenuAt(a).firstChild.className=c.disabled?"ddmAnchorDisabled":"ddmAnchor";a++;}}};function NLDoMainFormButtonAction(a,d){var c=getNLMultiButtonByName("multibutton_"+a);if(c){if(d){document.forms.main_form.elements["btn_"+c.sName].focus();}c.onMainButtonClick();}else{var b=document.forms.main_form.elements[a];if(b){if(d){b.focus();}b.click();}}}function makeMenu(b,a,d,c){if(window.menuData==null){window.menuData=new Array();}if(window.menuLevel==null){window.menuLevel=new Array();}if(window.menuParent==null){window.menuParent=new Array();}window.menuData[b]=a;window.menuLevel[b]=d;window.menuParent[b]=c;}function ddmOnMouseMove(a){if(window.currentMenu!=null){return window.currentMenu.handleMouseMove(a);}}function ddmOnClick(d){var b=getEventTarget(d);var a=findClassUp(b,"ddmSpan");if(a==null){var c=findClassUp(b,"ddmDiv");if(c==null){clearAllMenusExcept("ALL_MENUS_PLEASE");}}}var zoomPercent=["75","90","","125","150"];var iZoomDefault=2;var iZoomIndex=iZoomDefault;function getZoomFile(c){var a=c.lastIndexOf(".");var b=c.substr(0,a)+zoomPercent[iZoomIndex]+c.substr(a);return b;}function setMenuZoomFactor(a){if(a!=undefined){if(a<0.9){iZoomIndex=0;}else{if(a<1){iZoomIndex=1;}else{if(a>1.25){iZoomIndex=4;}else{if(a>1){iZoomIndex=3;}else{iZoomIndex=2;}}}}}}setMenuZoomFactor(1);var tdCounter=0;function NLMenu(c,a,d,b){this.tabName=c.substring(0,c.indexOf("_"));this.div=null;this.currentCell=null;this.isOpen=false;this.level=d;this.parentMenu=b;this.name=c;this.values=a;this.span=document.getElementById("spn_"+this.name);this.overrideX=0;this.rightjustify=false;this.overrideY=0;this.onCloseAction=null;this.onOpenAction=null;this.bHasImageTd=false;this.sHelperText=null;}var menus=new Object();var menuTimers=new Array();var friendlyDelay=0;function resetNavMenuTimer(a){clearTimeout(menuTimers[a]);}function startTimer(a){menuTimers[a]=setTimeout("clearAllMenus(-100, '"+a+"');",500);}function clearAllMenus(a,b){clearTimeout(friendlyDelay);for(i in menus){if(menus[i].tabName==b){if(menus[i].level>a){menus[i].close();}}}}function clearAllMenusExcept(b){for(i in menus){if(menus[i].tabName!=b){var a=document.getElementById(menus[i].tabName+"_nav_arrow");if(a!=null){a.src="/images/nav/nav_arrow.gif";}menus[i].close();}}}function getAndOpenMenu(d,c,b){lastMenuRequestedParent=c;var a=getMenu(d);if(a){a.open(c,b);}}NLMenu.prototype.setXandYoverride=function(a,b){this.overrideX=a;this.overrideY=b;};NLMenu.prototype.setHelperText=function(a){this.sHelperText=a;};NLMenu.prototype.setCloseAction=function(a){this.onCloseAction=new Function(a);};NLMenu.prototype.setOpenAction=function(a){this.onOpenAction=new Function(a);};NLMenu.prototype.setAfterOpenAction=function(a){this.onAfterOpen=new Function(a);};NLMenu.prototype.setRightJustify=function(a){this.rightjustify=a;};NLMenu.prototype.setScaleToLauncher=function(a){this.scaletolauncher=a;};NLMenu.prototype.setMenuBackgroundColor=function(a){this.sMenuBackgroundColor=a;};NLMenu.prototype.setMenuCSSClass=function(a){this.sOverrideClass=a;};NLMenu.prototype.setAllowArbitraryHtmlInMenuEntries=function(a){this.bUseSpanForMenuEntry=a;};NLMenu.prototype.setOpenMenuUpwardIfNotBelow=function(a){this.bOpenMenuUpwardsIfNotBelow=a;};function NLMenu_addHelperTextRows(a,c,d){var b=document.createElement("TR");var e=document.createElement("TD");a.appendChild(b);b.appendChild(e);e.className="text";e.innerHTML=c;if(d){e.colSpan=2;}}NLMenu.prototype.open=function(X,U){if(this.isOpen==true){return;}if(this.level>0&&typeof X!="undefined"&&document.getElementById(X)==null){return;}if(!this.span){this.span=document.getElementById("spn_"+this.name);}clearTimeout(friendlyDelay);if(this.onOpenAction!=null){this.onOpenAction();}var w=false;if(this.level>0){w=true;clearAllMenus(this.level-1,this.tabName);}if(document.getElementById("div_"+this.name)){return;}this.div=document.createElement("div");this.div.className="ddmDiv";if(this.sMenuBackgroundColor){this.div.style.backgroundColor=this.sMenuBackgroundColor;}if(this.sOverrideClass){this.div.className=this.sOverrideClass;}this.div.id="div_"+this.name;this.div.onmouseover=new Function("resetNavMenuTimer('"+this.tabName+"');");if(U){this.div.onmouseout=new Function("startTimer('"+this.tabName+"');");}var S=document.createElement("table");S.className="ddmInnerTable";this.div.appendChild(S);var G=document.createElement("tbody");S.appendChild(G);S.cellSpacing=0;S.cellPadding=4;var p=new Array();var s=0;var T,W,e,O,J,k,g,b,D,B,h,m;var R=false;var N=false;for(T=0;T<this.values.length;T++){J=this.values[T][0];g=this.values[T][1];k=this.values[T][2];m=this.values[T][3];if(k.length>0){R=true;}if(m!=null&&m.length>0){this.bHasImageTd=true;}var l=J=="ddmSeperator";var v=g=="ADMI_HEADING";if(v){N=true;}W=document.createElement("tr");G.appendChild(W);e=document.createElement("td");if(N&&!v){e.style.paddingLeft="20px";}e.id="nl"+ ++tdCounter;h=document.createElement("a");h.className="ddmAnchor";h.onclick=new Function("return false;");if(k.length>0){e.className="ddmTextHasChild";var M="clearTimeout(friendlyDelay); var timeout = "+(this.level==0?250:0)+"; friendlyDelay = setTimeout(\"getAndOpenMenu('"+k+"','"+e.id+"',"+(U?"true":"false")+')",timeout)';e.onmouseover=new Function(M);}else{e.className="ddmText";e.onmouseover=new Function("clearTimeout(friendlyDelay); clearAllMenus("+(this.level)+", '"+this.tabName+"');");}if(g.length>0&&!l&&!v){var g=this.values[T][1];h.href=g;var P=this.values[T][4];if(g.substring(0,g.indexOf(":")).toLowerCase()=="javascript"){g=g.substring(g.indexOf(":")+1);}else{g="try { "+(P?"window.open(":"window.location = ")+"'"+g+"'"+(P?")":"")+"; } catch (e) { }";}e.onclick=new Function("clearAllMenusExcept('clear all'); "+g);}var n=null;if(this.bUseSpanForMenuEntry){n=document.createElement("span");n.innerHTML=J;}else{n=document.createTextNode(J);}if((g==null||g.length<1)&&k.length>0){S.style.width="165";p[s]=document.createElement("div");p[s].className="ddmArrow";p[s].id=this.tabName+"_arrow_"+T;p[s].innerHTML="4";e.appendChild(p[s]);s++;h.style.paddingRight="10px";}if(!l){e.appendChild(h);if(this.bHasImageTd){var d=e.cloneNode(true);d.id=d.id+"_img";d.style.paddingRight="2";var c=document.createElement("img");c.border=0;c.src=m;c.height=14;c.width=18;d.firstChild.appendChild(c);d.onclick=e.onclick;d.firstChild.onclick=e.firstChild.onclick;d.style.verticalAlign="middle";d.style.align="left";W.appendChild(d);}h.appendChild(n);if(v){h.style.fontWeight="bold";h.style.color="#666666";}W.appendChild(e);}if(l||v){B=document.createElement("tr");G.appendChild(B);var V=document.createElement("td");V.style.padding="0";V.style.margin="0";B.appendChild(V);V.className="ddmSeperator";V.style.height="2";if(this.bHasImageTd){V.colSpan=2;}var q=document.createElement("div");q.style.height="2";q.style.backgroundImage="url(/images/nav/menuseparator.gif)";V.appendChild(q);var Q=document.createElement("img");Q.src="/images/nav/stretch.gif";Q.border="0";Q.style.height="2";q.appendChild(Q);}if(this.sHelperText!=null&&T==(this.values.length-1)){NLMenu_addHelperTextRows(G,this.sHelperText,this.bHasImageTd);}}var o=0;var A=this.span;var z=this.span;document.body.appendChild(this.div);if(w){A=this.div;if(X!=null){z=document.getElementById(X);}if(this.level>0){var K=getMenu(this.tabName+"_d1");if(K!=null&&K.isOpen&&K.div!=null){o+=K.div.offsetWidth+K.div.offsetLeft;}}if(this.level>1&&this.parentMenu!=null){var a=getMenu(this.parentMenu);if(a!=null&&a.isOpen&&a.div!=null){o+=a.div.offsetWidth;}}o-=(this.level*4);}var I=parseInt(S.style.width);if(s>0&&R){S.style.width=I-4;}var H=A?findPosX(A):event.x;var L=H;var u=document.body.scrollLeft;if(this.rightjustify){H+=this.span.offsetWidth-this.div.offsetWidth;}if(w){H=o-1;}else{H=H-8;}if(this.rightjustify&&(H<L)){this.div.style.left=L;}else{if(H+this.div.offsetWidth<(getDocumentWidth()+u)){this.div.style.left=H+this.overrideX;}else{this.div.style.left=(getDocumentWidth()+u)-this.div.offsetWidth;}}var F=findClassUp(this.span,"scrollarea");var f=0;if(F!=null){f=F.scrollTop;}var E=z?findPosY(z):event.y;if(z){if(E+z.offsetHeight+this.div.offsetHeight>getDocumentHeight()+f+document.body.scrollTop){if(this.bOpenMenuUpwardsIfNotBelow){E=findPosY(z)-this.div.offsetHeight+3;}else{E=getDocumentHeight()-this.div.offsetHeight+5+f+document.body.scrollTop;}}else{E=E+z.offsetHeight;}}if(w){var r=22;E-=r;}E=E+3+this.overrideY-f;if(this.div.offsetHeight>(getDocumentClientHeight()-20)){E=5;}this.div.style.top=E;if(this.level==0){window.menusAreOpen=true;}this.div.style.zIndex=1500;var t=isIE?3:2;var C=isIE?19:17;if(s>0&&this.level==0){for(j=0;j<p.length;j++){p[j].style.left=I-C;p[j].style.top=p[j].offsetTop-t;}}if(this.scaletolauncher){if(this.div.offsetWidth<this.span.offsetWidth){this.div.style.width=this.span.offsetWidth;S.style.width="100%";}}if(isIE){nlInsertCanvas(this.div);}this.isOpen=true;if(this.onAfterOpen){this.onAfterOpen();}};NLMenu.prototype.close=function(){if(!this.isOpen){return;}if(this.level==0){window.menusAreOpen=false;}nlRemoveCanvas(this.div);document.body.removeChild(this.div);this.currentCell=null;this.div=null;this.isOpen=false;if(this.onCloseAction!=null){this.onCloseAction();}};NLMenu.prototype.getCellInMenuAt=function(a){return this.div.firstChild.rows[a].cells[0];};NLMenu.prototype.getCurrentCellInMenu=function(){return this.currentCell;};NLMenu.prototype.setCurrentCellInMenu=function(a){if(!this.isOpen){return;}if(this.currentCell!=null&&this.currentCell.className!="ddmTextSeperator"){this.currentCell.className="ddmText";}if(a!=null&&a.className!="ddmTextSeperator"){a.className="ddmTextOver";}this.currentCell=a==null?this.div.firstChild.rows[0].cells[0]:a;};NLMenu.prototype.getIndex=function(a){for(i=0;i<this.values.length;i+=2){if(this.values[i]==a){return i/2;}}return 0;};NLMenu.prototype.showHide=function(a){clearAllMenusExcept(this.tabName);this.becomeCurrent();this.open(null,a);return true;};NLMenu.prototype.handleMouseMove=function(b){if(!this.isOpen){return;}var a=getEventTarget(b);while(a!=null){if((a.className!=null)&&((a.className=="ddmText")||(a.className=="ddmTextHasChild")||(a.className=="ddmTextSeperator"))){this.setCurrentCellInMenu(a);break;}a=a.parentNode;}};NLMenu.prototype.becomeCurrent=function(){if(window.currentMenu!=this){window.currentMenu=this;}};function loadDelayedScriptReference(c,b){var a=document.getElementById("nmdscript"+c);if(a!=null&&(a.src==null||a.src.length==0)){lastMenuRequested=b;var d=a._actualsrc;a.src=d;return true;}return false;}function loadDelayedNMD(e,a){lastMenuRequested=a;var c=document.createElement("script");c.setAttribute("type","text/javascript");var d,g;if("cneg21_d1"==a){d="/core/elements/compound/NLRecentMenu.nl?t="+getStickyTag("RECENTRECORDS");g="nmdscript-21";}else{if(a.indexOf("_recentreports")>0){var f=a.indexOf("neg")==1?"-":"";var b=a.substring(f=="-"?4:1,a.indexOf("_"));d="/core/elements/compound/NLRecentReports.nl__t="+getStickyTag("RECENTREPORTS")+"&sections="+f+b+".nlqs";g="nmdscriptcneg9_recentreports";}else{if("cRR_d1"==a){d="/core/elements/compound/NLRoleMenu.nl?t="+getStickyTag("ROLEMENU");g="nmdscript-RR";}else{d="/app/center/NLNavMenuData.nl__t="+getStickyTag("NAVMENUS")+"&sections="+e+".nlqs";g="nmdscript"+e;}}}c.setAttribute("src",d);c.setAttribute("id",g);document.getElementsByTagName("head")[0].appendChild(c);return true;}function getMenu(b){var a=menus[b];if(a==null){if(!menuDataExists(b)){loadDelayedNMD(b,b);return null;}a=new NLMenu(b,window.menuData[b],window.menuLevel[b],window.menuParent[b]);menus[b]=a;if(a.level==0){var c=0;menuTimers[a.tabName]=c;}}return a;}function menuDataExists(a){if(!isOffline()&&(window.menuData==null||window.menuData[a]==null||window.menuData[a].length<1)){return false;}else{return true;}}var lastMenuRequested=null;var lastMenuRequestedParent=null;function openLastMenuRequested(){try{var a=lastMenuRequested;lastMenuRequested=null;if(a==null||!menuDataExists(a)){return false;}var b=lastMenuRequestedParent;if(b!=null){lastMenuRequestedParent=null;if(document.getElementById(b)!=null){return getMenu(a).open(b,false);}}else{return getMenu(a).showHide(true);}}catch(c){}}function showMenu(h,g,d,b){try{if(!window.loadcomplete){if(isNaN(b)){b=0;}b++;setTimeout(function(){showMenu(h,g,d,b);},1000*b+1);return false;}var c=document.getElementById(h);if(c!=null){var a=c.id.substring(4,c.id.length);if((!window.menuData||window.menuData[a]==null)&&d!=null){return loadDelayedNMD(d,a);}if(!menuDataExists(a)){return false;}lastMenuRequested=null;return getMenu(a).showHide(g);}}catch(f){}}var currentDropdown=null;var dropdownCounter=0;window.dropdownloadtime=0;function makeDropdown(y,s,b,k,t,r,u,d,a,c,m,n){var h=new Date();if(c==null){c=document;}if(k==null){k=0;}var f="";if(b.length<1){b=["",""];}else{for(var v=0;v<b.length;v+=2){if(b[v].indexOf("&")>-1){b[v]=unEscapeHtml(b[v]);}if(b[v].length>f.length+2||(Math.abs(b[v].length-f.length)<=2&&(getTextWidth(b[v])>getTextWidth(f)))){f=b[v];}}}var g=++dropdownCounter;var o=y+g;if(r==""){r=" ";}if(n!=null){var q=c.createElement("INPUT");q.name="inpt_"+y;q.id="inpt_"+o;q.type="text";q.className="dropdownInput";q.value=r;q.contentEditable="false";q.autocomplete="off";q.onkeydown=new Function("event","getDropdown(this).handleKeydown(event)");q.onkeypress=new Function("event","getDropdown(this).handleKeypress(event)");if(d!=null){q.onfocus=new Function("event",'getElementById("hddn_'+o+'").onfocus(event); this.select();');}n.appendChild(q);var p=c.createElement("INPUT");p.name=y;p.id="hddn_"+o;p.type="hidden";p.className="nldropdown";p.value=t;if(u!=null){p.onchange=(typeof u=="function")?u:new Function(u);}if(d!=null){p.onfocus=(typeof d=="function")?d:new Function(d);}n.appendChild(p);var l=c.createElement("INPUT");l.id="indx_"+o;l.type="hidden";l.value=k;n.appendChild(l);}else{if(u!=null){u='onchange="'+u+'"';}else{u="";}var e="onfocus='this.select()'";if(d!=null){d='onfocus="'+d+'"';e="onfocus='getElementById(\"hddn_"+o+"\").onfocus(event); this.select();'";}else{d="";}c.write("<input name='inpt_"+y+"' id='inpt_"+o+"' type='text' value='"+r+"' class='dropdownInput' onkeydown='getDropdown(this).handleKeydown(event);' onkeypress='getDropdown(this).handleKeypress(event);' "+e+" contenteditable='false' autocomplete='off' >");c.write("<input name='"+y+"' id = 'hddn_"+o+"' type='hidden' class='nldropdown' value='"+t+"' "+u+" "+d+">");c.write("<input id = 'indx_"+o+"' type='hidden' value='"+k+"'>");}var w=new NLDropdown(y,b,k,g,c);if(window.dropdowns[o]==null){window.dropdowns[o]=w;}w.setWidth(s,a,f);w.flags=m;w.bRequired=w.hasAttribute(128);w.disabled=w.hasAttribute(2048);w.typeAhead=w.hasAttribute(2147483648);if(w.hasAttribute(2048)){w.setDisabled(true);}if(w.hasAttribute(1073741824)){w.setArrowImage("");}var x=new Date();window.dropdownloadtime+=(x.getTime()-h.getTime());return w;}function unEscapeHtml(b){if(b==null){return null;}if(b.length==0){return"";}var d=document.createElement("a");d.innerHTML=b+"\n";var c=d.firstChild;if(c!=null&&c.nodeName!="#text"){c=c.firstChild;}if(c!=null){var a=c.data;if(a.charAt(a.length-1)==" "){a=a.substr(0,a.length-1);}return a;}else{return"";}}function getWindowIsValid(){if(typeof window.isvalid=="undefined"){window.isvalid=true;}return window.isvalid;}function dropdownOnMouseDown(d){if(!window.loadcomplete||!getWindowIsValid()){return true;}var b=getEventTarget(d);if(isNLMultiDropDown(b)){var c=b.getAttribute("nlmultidropdown");getMultiDropdownFromNameC(c).handleMouseDown(d);}var a=findClassUp(b,"dropdownInput");if(a!=null){return getDropdown(a).handleMouseDown(d);}}function dropdownOnMouseUp(d){var b=getEventTarget(d);if(b.tagName=="scrollbar"){return;}if(currentMultiDropdown!=null&&currentMultiDropdown.onMouseMoveIdx!=-1){currentMultiDropdown.onMouseMoveIdx=-1;currentMultiDropdown=null;}else{if(currentDropdown!=null){var a=findClassUp(b,"dropdownInput");if(a==null&&currentDropdown.seenMouseMove){if(b.className=="dropdownDiv"){return;}var c=findClassUp(b,"dropdownSelected");if(c!=null){currentDropdown.setAndClose(c.nlrow);}currentDropdown.close();currentDropdown=null;}}}}var lastX=0;var lastY=0;function dropdownOnMouseMove(b){if(isIE){b=event;}if(b.clientX==lastX&&b.clientY==lastY){return;}lastX=b.clientX;lastY=b.clientY;var a=getEventTarget(b);if(currentMultiDropdown!=null){currentMultiDropdown.handleMouseMove(b);}if(currentDropdown!=null){currentDropdown.handleMouseMove(b);}}function dropdownOnKeyDown(d){var b=getEventTarget(d);var a=findClassUp(b,"dropdownInput");if(isNLMultiDropDown(b)){var c=b.getAttribute("nlmultidropdown");return getMultiDropdownFromNameC(c).handleKeydown(d);}else{return true;}}function getButtonId(a){if(isIE){return event.button;}else{if(isNS){return a.button;}else{return null;}}}function dumpObj(a){for(var c in a){var b=c+": "+a[c];document.body.appendChild(document.createTextNode(b));document.body.appendChild(document.createElement("BR"));}}NLDropdown.prototype.setMandatoryBackgroundColor=function NLDropdown_setMandatoryBackgroundColor(a){this.sMandatoryBgColor=a;};NLDropdown.prototype.hasAttribute=function NLDropdown_hasAttribute(a){return(this.flags&a)!=0;};function NLDropdown(a,k,e,h,c){if(a==null){throw"cannot create dropdown with null name";}if(k==null){throw"cannot create dropdown with null values";}this.name=a;this.nameC=a+h;this.textArray=new Array(k.length/2);this.valueArray=new Array(k.length/2);this.valueToIndexMap=new Array();this.defaultIndex=e;this.indexAtRenderTime=e;this.isOpen=false;this.divWidthHasBeenSet=false;this.disabled=false;this.div=null;this.currentCell=null;this.searchString="";this.typeAhead=false;this.cancelEventOnEnterKey=false;this.width=null;this.flags=0;this.sMandatoryBgColor="#FFFFE5";this.bRequired=false;this.initializeElements(c);this.inpt.onmousedown=new Function("var dd=getDropdown(this); if (!dd.disabled && getWindowIsValid()) dd.setArrowImage('/images/forms/ddarrowPress.gif');");this.inpt.onmouseup=new Function("getDropdown(this).setArrowImage('/images/forms/ddarrow.gif' );");this.setArrowImage("/images/forms/ddarrow.gif");this.bInitialize=true;for(var f=0,d=0;f<k.length;f+=2,d++){var g=k[f];var b=k[f+1];this.textArray[d]=g;this.valueArray[d]=b;this.valueToIndexMap[String(b)]=d;}this.setIndex(e,true);}NLDropdown.prototype.initializeElements=function NLDropdown_initializeElements(a){if(a==null){a=document;}this.inpt=a.getElementById("inpt_"+this.nameC);this.ddbtn=this.inpt;this.hddn=a.getElementById("hddn_"+this.nameC);this.indx=a.getElementById("indx_"+this.nameC);this.span=this.inpt.parentNode;if(!this.isSelectable()){this.inpt.unselectable="on";}this.elementsAreInitialized=true;this.bInitialize=false;};NLDropdown.prototype.setWidth=function NLDropdown_setWidth(a,g,f){var d=null;if(g!=null){this.minimumWidth=g;}if(a!=null){this.width=a;this.setWidthDirect(a+16);d=a+16;}else{if(f!=null){var e=document.createElement("DIV");e.className="dropdownDiv";e.style.visibility="hidden";var c=document.createTextNode(f);e.appendChild(c);document.body.insertBefore(e,document.body.firstChild);d=Math.max((e.offsetWidth+16),(g==null?0:g));document.body.removeChild(e);this.setWidthDirect(d);}else{if(this.div==null){this.buildDiv();}var h=this.div;var b;document.body.insertBefore(h,document.body.firstChild);if(h.offsetHeight<200){b=h.offsetWidth+5+16;if(b<40){b=40;}}else{b=h.offsetWidth+15+16;}document.body.removeChild(h);if(this.inpt.originalWidth!=b){d=b;this.setWidthDirect(b);this.inpt.originalWidth=null;if(this.inpt.afterWidthSet!=null){this.inpt.afterWidthSet();}}}}this.setText(null,true,d);};NLDropdown.prototype.setWidthDirect=function NLDropdown_setWidthDirect(a){if((this.minimumWidth!=null)&&(a<this.minimumWidth)){a=this.minimumWidth;}a=Math.min(a,300);this.inpt.style.width=a;};NLDropdown.prototype.buildDiv=function NLDropdown_buildDiv(){var e=document.createElement("div");this.div=e;e.className="dropdownDiv";e.unselectable=this.inpt.unselectable;e.style.zIndex=1001;this.divWidthHasBeenSet=false;var c=new Array(this.textArray.length);this.divArray=c;var b,a;for(b=0;b<this.textArray.length;b++){var d=this.textArray[b];if(d==null||d.length==0){d="&nbsp;";}a=document.createElement("div");c[b]=a;if(d!="&nbsp;"&&d.indexOf("&")>-1){d=d.replace("&","&amp;");}a.innerHTML=d;a.unselectable=e.unselectable;a.id="nl"+ ++tdCounter;a.nlrow=b;a.className="dropdownNotSelected";e.appendChild(a);}e.onkeydown=new Function("event","getDropdownFromNameC('"+this.nameC+"').handleKeydown(event)");e.onkeypress=new Function("event","getDropdownFromNameC('"+this.nameC+"').handleKeypress(event)");e.onmousedown=new Function("return false;");};NLDropdown.prototype.sizeDiv=function NLDropdown_sizeDiv(){var b=this.div;if(!this.divWidthHasBeenSet){var c=b.offsetWidth;var k=this.inpt.offsetWidth;b.style.overflow="hidden";if(c<k){b.style.width=k;}else{b.style.width=c+4;}}var h=findPosY(this.inpt);var g=h-document.body.scrollTop;var d=getDocumentHeight()-((h-document.body.scrollTop)+this.inpt.offsetHeight);var e=Math.max(g,d);if(b.offsetHeight<Math.min(200,e)){if(isNS){var f=b.offsetHeight;b.style.height=f;if(b.offsetHeight>f){b.style.height=(f*2<b.offsetHeight)?0:(f*2-b.offsetHeight);}}}else{var a=Math.min(e,200);b.style.height=a-2;b.style.overflow="auto";if(!this.divWidthHasBeenSet){if(isIE){b.style.width=b.offsetWidth+18;}else{if(isNS){b.style.width=b.offsetWidth-12;}}}}this.divWidthHasBeenSet=true;};NLDropdown.prototype.getForm=function NLDropdown_getForm(){var a=null;try{a=this.elementsAreInitialized?this.hddn.form:null;}catch(b){this.elementsAreInitialized=false;this.bInitialize=true;}return a;};NLDropdown.prototype.open=function NLDropdown_open(){if(this.bInitialize){this.initializeElements();}if(this.disabled||this.textArray.length==0){return;}if(this.div==null){this.buildDiv();}this.div.style.visibility="hidden";document.body.insertBefore(this.div,document.body.firstChild);this.sizeDiv();if(this.hasAttribute(256)){this.positionRelativeDiv();}else{this.positionDiv(this.inpt,this.div);}this.isOpen=true;this.seenMouseMove=false;this.setCurrentCellInMenu(null);if(isIE&&this.currentCell!=null){this.div.scrollTop=this.currentCell.offsetTop;}if(!this.hasAttribute(256)){if(isIE){nlInsertCanvas(this.div);}}this.div.style.visibility="visible";};NLDropdown.prototype.positionRelativeDiv=function NLDropdown_positionRelativeDiv(){this.span.style.zIndex=1;this.span.insertBefore(this.div,this.span.firstChild);var a=findPosX(this.span);var b=findPosY(this.span);this.div.style.left=0;if((b+this.inpt.offsetHeight+this.div.offsetHeight)-document.body.scrollTop>getDocumentHeight()){this.div.style.top=3-this.div.offsetHeight;}else{this.div.style.top=this.inpt.offsetHeight-1;}};NLDropdown.prototype.positionDiv=function NLDropdown_positionDiv(c,b){var a=findAbsolutePosX(c);if(a+b.offsetWidth-document.body.scrollLeft<=getDocumentClientWidth()){b.style.left=a;}else{b.style.left=getDocumentClientWidth()-b.offsetWidth+document.body.scrollLeft;}var d=findAbsolutePosY(c);if(d+c.offsetHeight+b.offsetHeight>getDocumentClientHeight()){b.style.top=Math.max(d-b.offsetHeight,0);}else{if(isIE){b.style.top=d+c.offsetHeight-1;}else{if(isNS){b.style.top=d+c.offsetHeight;}}}};NLDropdown.prototype.close=function NLDropdown_close(){if(!this.isOpen){return;}this.setFocus();if(this.indexOnDeck!=null){this.setIndex(this.indexOnDeck);this.indexOnDeck=null;}if(this.currentCell!=null){this.currentCell.className="dropdownNotSelected";this.currentCell=null;}this.span.style.zIndex="";if(!this.hasAttribute(256)){nlRemoveCanvas(this.div);}this.div.parentNode.removeChild(this.div);this.isOpen=false;};NLDropdown.prototype.isSelectable=function NLDropdown_isSelectable(){return this.span.unselectable=="on"?false:true;};NLDropdown.prototype.setFocus=function NLDropdown_setFocus(){try{this.inpt.focus();if(this.isSelectable()){this.inpt.select();}}catch(a){}};NLDropdown.prototype.setText=function NLDropdown_setText(a,c,b){if(a==null){a=this.getText();}this.inpt.title=a;if(a==null||a==""){a=" ";}if(b==null){b=this.inpt.offsetWidth;}b-=17;a=elideTxt(a,b);this.inpt.value=a;if(!c||this==currentDropdown){try{this.inpt.focus();if(!this.isOpen&&this.isSelectable()){this.inpt.select();}}catch(d){}}};NLDropdown.prototype.getText=function NLDropdown_getText(a){if(a==null){a=this.getIndex();}if((a==null)||(a<0)||(a>this.textArray.length)){return"";}return this.textArray[a];};NLDropdown.prototype.getValue=function(){var a=this.hddn.value;return a;};NLDropdown.prototype.getTexts=function(){return this.textArray;};NLDropdown.prototype.getValues=function(){return this.valueArray;};NLDropdown.prototype.setAndClose=function NLDropdown_setAndClose(a){this.indexOnDeck=null;this.close();this.setIndex(a);};function getNext(b){var a=b.firstChild;if(a==null){a=b.nextSibling;if((a==null)&&(a.parentNode!=null)){a=b.parentNode.nextSibling;}}return a;}NLDropdown.prototype.setCurrentCellInMenu=function NLDropdown_setCurrentCellInMenu(a){if(!this.isOpen){return;}var b=a;if(a==null){var c=this.getIndex();if(c<0||c>this.divArray.length||c===undefined){c=0;}a=this.divArray[c];}if(this.currentCell!=null){this.currentCell.className="dropdownNotSelected";}if(a!=null){a.className="dropdownSelected";}this.currentCell=a;};NLDropdown.prototype.getIndex=function NLDropdown_getIndex(){return Number(this.indx.value);};NLDropdown.prototype.setIndex=function NLDropdown_setIndex(d,c){if(d==null){return;}d=Number(d);if(d<0||d>=this.valueArray.length){return;}var a=this.getIndex();this.indx.value=d;this.hddn.value=this.valueArray[d];this.setText(this.textArray[d],c);if(a==d){return;}if((!c)&&(this.hddn.onchange!=null)){var b=this.hddn.onchange();if(b==false){this.indx.value=a;this.hddn.value=this.valueArray[a];this.setText(this.textArray[a],c);return;}}};NLDropdown.prototype.setValue=function NLDropdown_setValue(c,b){var a=this.getIndexForValue(c);if(a==null){return;}this.setIndex(a,b);};NLDropdown.prototype.getValueAtIndex=function NLDropdown_getValueAtIndex(a){return this.valueArray[a];};NLDropdown.prototype.getTextAtIndex=function NLDropdown_getTextAtIndex(a){return this.textArray[a];};NLDropdown.prototype.respondToArrow=function NLDropdown_respondToArrow(h){var c;if(this.matchTimeout!=null){clearTimeout(this.matchTimeout);this.matchTimeout=null;}if(this.currentCell==null){if(this.arrowIndex==null){c=this.getIndex();}else{c=this.arrowIndex;}}else{c=this.currentCell.nlrow;}c+=h;if(c<0){c=0;}if(c>=this.valueArray.length){c=this.valueArray.length-1;}if(this.isOpen){var a=this.textArray[c];this.setText(a);this.setCurrentCellInMenu(this.divArray[c]);if(isIE){var g=this.currentCell.parentNode.scrollTop;var b=this.currentCell.offsetTop;var e=this.currentCell.parentNode.offsetHeight;var d=this.currentCell.offsetHeight;if(g>b){this.currentCell.scrollIntoView(true);}else{if(g+e<b+d){this.currentCell.scrollIntoView(false);}}}this.indexOnDeck=c;}else{var f=this.valueArray[c];if((f==-1)&&(h>0)){if(c+1<this.valueArray.length){this.respondToArrow(h+1);}}else{this.arrowIndex=c;this.matchTimeout=setTimeout("this.getDropdownFromNameC('"+this.nameC+"').arrowIndex = null; this.getDropdownFromNameC('"+this.nameC+"').setIndex("+c+");",250);}}};NLDropdown.prototype.gotoNext=function NLDropdown_gotoNext(e){if(this.searchStringTimeout!=null){clearTimeout(this.searchStringTimeout);this.searchStringTimeout=null;}if(this.matchTimeout!=null){clearTimeout(this.matchTimeout);this.matchTimeout=null;this.arrowIndex==null;}var h=this.getIndex();if(this.currentCell!=null){h=this.currentCell.nlrow;}var f=h;var d;var b=this.textArray.length;this.searchString+=String.fromCharCode(e).toUpperCase();if(this.searchString.length==1){++f;}var a=false;for(var g=0;g<b;g++){d=f%b;var c=this.textArray[d].substr(getTypeAheadStartIndex(this.textArray[d]),this.searchString.length).toUpperCase();if(c==this.searchString){a=true;break;}++f;}if(a){if(this.isOpen){this.setText(this.textArray[d]);this.setCurrentCellInMenu(this.divArray[d]);this.div.scrollTop=this.currentCell.offsetTop;this.indexOnDeck=d;}else{this.matchTimeout=setTimeout("getDropdownFromNameC('"+this.nameC+"').setIndex("+d+");",250);}}if(this.typeAhead==true){this.searchStringTimeout=setTimeout("clearSearchString('"+this.nameC+"')",2000);}else{this.searchString="";}};function getTypeAheadStartIndex(b){for(var a=0;a<b.length;a++){if(b.charCodeAt(a)!=32&&b.charCodeAt(a)!=160){return a;}}return 0;}function clearSearchString(a){getDropdownFromNameC(a).searchString="";}NLDropdown.prototype.getTextForValue=function NLDropdown_getTextForValue(b){var a=this.getIndexForValue(b);if(a!=null){return this.textArray[a];}else{return"";}};NLDropdown.prototype.getIndexForText=function NLDropdown_getIndexForText(b){for(var a=0;a<this.textArray.length;a++){if(trim(this.textArray[a])==trim(b)){return a;}}return -1;};NLDropdown.prototype.getIndexForValue=function NLDropdown_getIndexForValue(a){return this.valueToIndexMap[String(a)];};NLDropdown.prototype.restoreToOriginalValue=function NLDropdown_restoreToOriginalValue(){this.setIndex(this.indexAtRenderTime,true);};NLDropdown.prototype.gotoDefault=function NLDropdown_gotoDefault(){this.setIndex(this.defaultIndex,true);};NLDropdown.prototype.resetDropDown=function NLDropdown_resetDropDown(){this.gotoDefault();};NLDropdown.prototype.setDefaultIndex=function NLDropdown_setDefaultIndex(a){if(a==null){return;}if(this.bInitialize){this.initializeElements();}this.defaultIndex=Number(a);};NLDropdown.prototype.handleMouseDown=function NLDropdown_handleMouseDown(a){this.becomeCurrent();if(this.isOpen){this.close();}else{this.open();}};NLDropdown.prototype.handleKeydown=function NLDropdown_handleKeydown(c){if(this.disabled){return true;}if(this.bInitialize){this.initializeElements();}var b=getEventKeypress(c);switch(b){case 8:case 16:case 17:case 18:case 20:case 46:case 93:return;}this.becomeCurrent();switch(b){case 9:this.close();currentDropdown=null;break;case 13:if(this.currentCell!=null){var a=this.currentCell.nlrow;this.setIndex(a);}if(this.isOpen){this.close();if(!this.cancelEventOnEnterKey){setEventCancelBubble(c);setEventPreventDefault(c);}}break;case 38:if(getEventAltKey(c)){if(this.isOpen){this.close();}}else{this.respondToArrow(-1);setEventCancelBubble(c);setEventPreventDefault(c);}break;case 40:if(getEventAltKey(c)){if(!this.isOpen){this.open();}}else{this.respondToArrow(+1);setEventCancelBubble(c);setEventPreventDefault(c);}break;case 37:case 39:return true;case 33:this.respondToArrow(-14);if(this.isOpen){this.div.scrollTop=this.currentCell.offsetTop;}setEventCancelBubble(c);setEventPreventDefault(c);break;case 34:this.respondToArrow(+14);if(this.isOpen){this.div.scrollTop=this.currentCell.offsetTop;}setEventCancelBubble(c);setEventPreventDefault(c);break;case 35:this.respondToArrow(this.valueArray.length);if(this.isOpen){this.div.scrollTop=this.currentCell.offsetTop;}setEventCancelBubble(c);setEventPreventDefault(c);break;case 36:this.respondToArrow(-this.valueArray.length);if(this.isOpen){this.div.scrollTop=this.currentCell.offsetTop;}setEventCancelBubble(c);setEventPreventDefault(c);break;default:break;}};NLDropdown.prototype.handleKeypress=function NLDropdown_handleKeypress(b){if(this.disabled){return true;}if(this.bInitialize){this.initializeElements();}this.becomeCurrent();var a=getEventKeypress(b);switch(a){case 9:break;case 13:if(this.isOpen){setEventCancelBubble(b);setEventPreventDefault(b);}break;default:this.gotoNext(a);setEventPreventDefault(b);break;}};NLDropdown.prototype.handleMouseMove=function NLDropdown_handleMouseMove(b){if(!this.isOpen){return true;}this.seenMouseMove=true;var a=getEventTarget(b);while(a!=null){if((a.className!=null)&&(a.className=="dropdownNotSelected")){this.setCurrentCellInMenu(a);break;}a=a.parentNode;}};NLDropdown.prototype.becomeCurrent=function NLDropdown_becomeCurrent(){if((currentDropdown!=null)&&(currentDropdown!=this)){currentDropdown.close();}if(currentDropdown!=this){currentDropdown=this;this.indexOnDeck=null;}};NLDropdown.prototype.setDisabled=function NLDropdown_setDisabled(a){this.disabled=a;this.inpt.disabled=a;this.hddn.disabled=a;if(this.disabled){this.close();this.setArrowImage("/images/forms/ddarrowDisabled.gif");}else{this.setArrowImage("/images/forms/ddarrow.gif");}if(this.div==null&&this.width==null){this.setWidth();}};NLDropdown.prototype.setHidden=function NLDropdown_setHidden(a){this.span.style.display=a?"none":"";};NLDropdown.prototype.addOption=function NLDropdown_addOption(e,d,a){if(d==null){throw"cannot create an option with null value";}if(e==null){throw"cannot create an option with null text";}var c=(this.textArray.length==0);e=String(e);if(e.indexOf("&")>-1){e=unEscapeHtml(e);}d=String(d);if(typeof(a)==="undefined"||a>this.valueArray.length){a=this.valueArray.length;}for(var b=a;b<this.valueArray.length;++b){this.valueToIndexMap[this.valueArray[b]]=b+1;}this.valueToIndexMap[d]=a;this.textArray.splice(a,0,e);this.valueArray.splice(a,0,d);if(this.defaultIndex>=a){++this.defaultIndex;}if(this.getIndex()>=a){this.setIndex(this.getIndex()+1,true);}this.div=null;if(c){this.defaultIndex=0;this.setIndex(0,true);}if(!this.disabled&&this.width==null){this.setWidth();}};NLDropdown.prototype.deleteAllOptions=function NLDropdown_deleteAllOptions(){this.close();this.valueArray.length=0;this.textArray.length=0;this.valueToIndexMap=new Array();this.div=null;this.defaultIndex=0;this.setText("",true);this.hddn.value="";this.indx.value="-1";};NLDropdown.prototype.deleteOneOption=function NLDropdown_deleteOneOption(d,c){d=String(d);var a=this.valueToIndexMap[d];if(a==null){return;}this.close();for(var b=a+1;b<this.valueArray.length;++b){this.valueToIndexMap[this.valueArray[b]]=b-1;}delete this.valueToIndexMap[d];this.valueArray.splice(a,1);this.textArray.splice(a,1);this.div=null;if(!c&&this.width==null){this.setWidth();}if(a==this.defaultIndex){this.defaultIndex=0;}else{if(this.defaultIndex>a){--this.defaultIndex;}}if(this.getIndex()>a){this.setIndex(this.getIndex()-1,true);}if(d==this.getValue()){this.gotoDefault();}};NLDropdown.prototype.setOptionText=function NLDropdown_setOptionText(c,b){c=String(c);var a=this.valueToIndexMap[c];if(a==null){return;}this.close();this.textArray[a]=b;if(c==this.getValue()){this.setText(b,true);}this.div=null;if(this.width==null){this.setWidth();}};NLDropdown.prototype.setArrowImage=function NLDropdown_setArrowImage(a){if(!this.overrideImage){if(a=="/images/forms/ddarrow.gif"||a=="/images/forms/ddarrowPress.gif"||a=="/images/forms/ddarrowDisabled.gif"){a=getZoomFile(a);}this.ddbtn.style.backgroundImage="url("+a+")";}};NLDropdown.prototype.overrideArrowImage=function NLDropdown_overrideArrowImage(a){this.ddbtn.style.backgroundImage="url("+a+")";this.overrideImage=true;};NLDropdown.prototype.setBackgroundColor=function NLDropdown_setBackgroundColor(a){this.inpt.style.backgroundColor=a;};NLDropdown.prototype.setRequired=function NLDropdown_setRequired(a){this.bRequired=a;if(a){this.setBackgroundColor(this.sMandatoryBgColor);}else{this.setBackgroundColor("");}};NLDropdown.prototype.setDefaultOrNotRequired=function NLDropdown_setDefaultOrNotRequired(a){this.setRequired(a?this.hasAttribute(128):false);};NLDropdown.prototype.getRequired=function NLDropdown_getRequired(a){return this.bRequired;};NLDropdown.prototype.getContainer=function NLDropdown_getContainer(){return this.span;};var dropdowns=new Array();function getDropdownFromNameC(b,c){if(typeof c=="undefined"||c==null){c=window;}var a=c.dropdowns[b];if((a==null)&&(c.parent!=null)&&(c.parent.dropdowns!=null)){a=c.parent.dropdowns[b];}return a;}function getDropdown(b,d){if(b.tagName=="SPAN"){var a=b.getElementsByTagName("INPUT");for(var c=0;c<a.length;c++){if(a[c].type=="hidden"&&a[c].id!=null&&a[c].id.indexOf("hddn_")==0){b=a[c];break;}}}if(b.id){return getDropdownFromNameC(b.id.substring(5),d);}}var textWidthDiv=document.createElement("div");textWidthDiv.className="dropdownDiv";textWidthDiv.style.position="absolute";textWidthDiv.style.padding=0;textWidthDiv.style.margin=0;textWidthDiv.style.border=0;var widthCache=new Array();function getTextWidth(a){var c=widthCache[a];if(c!=null){return c;}textWidthDiv.innerHTML=((a==" ")?"&nbsp;":a);document.body.appendChild(textWidthDiv);var b=textWidthDiv.offsetWidth;document.body.removeChild(textWidthDiv);widthCache[a]=b;return b;}function elideTxt(b,h){if(h<=0){return b;}if(getTextWidth(b)<h){return b;}b=b.replace(/^(\s|\u00A0)*/,"").replace(/(\s|\u00A0)*$/,"");if(getTextWidth(b)<h){return b;}var c="...";var f=getTextWidth(c);if(f>=h){return c;}var a=b.length;for(var e=0;e<a;e++){var d=b.length/2;b=b.substr(0,d)+b.substr(d+1);var g=getTextWidth(b);if(g+f<h){break;}}return b.substr(0,d)+c+b.substr(d);}var multidropdowns=new Object();var currentMultiDropdown=null;function getMultiDropdownFromNameC(b,c){if(c==null){c=window;}var a=c.multidropdowns[b];if((a==null)&&(c.parent!=null)&&(c.parent.multidropdowns!=null)){a=c.parent.multidropdowns[b];}return a;}function getMultiDropdown(b,d){if(b.tagName=="SPAN"&&isValEmpty(b.getAttribute("nlmultidropdown"))){var a=b.getElementsByTagName("INPUT");for(var c=0;c<a.length;c++){if(!isValEmpty(a[c].getAttribute("nlmultidropdown"))){return getMultiDropdownFromNameC(a[c].getAttribute("nlmultidropdown"),d);}}}return getMultiDropdownFromNameC(b.getAttribute("nlmultidropdown"),d);}NLMultiDropdown.prototype.setMandatoryBackgroundColor=function NLMultiDropdown_setMandatoryBackgroundColor(a){this.sMandatoryBgColor=a;};NLMultiDropdown.prototype.setRequired=function NLMultiDropdown_setRequired(a){this.bRequired=a;if(a){this.setBackgroundColor(this.sMandatoryBgColor);}else{this.setBackgroundColor("");}};NLMultiDropdown.prototype.getRequired=function NLMultiDropdown_getRequired(){return this.bRequired;};NLMultiDropdown.prototype.hasAttribute=function NLMultiDropdown_hasAttribute(a){return(this.flags&a)!=0;};function NLMultiDropdown(b,k,a,l,h,d,m){if(b==null){throw"cannot create multi-select dropdown with null name";}if(k==null){throw"cannot create multi-select dropdown with null values";}this.renderDocument=d;this.name=b;this.nameC=b+h;this.textArray=new Array(k.length/2);this.valueArray=new Array(k.length/2);this.valueToIndexMap=new Array();this.defaultValues=a;this.selectedVals=isValEmpty(this.defaultValues)?new Array():this.defaultValues.split(String.fromCharCode(5));this.sMandatoryBgColor="#FFFFE5";this.bRequired=false;this.staticWidth=m;this.numRows=parseInt(l)+(!isIE?1:0);this.disabled=false;this.span=null;this.table=null;this.width=null;this.flags=0;this.hiddenField=d.getElementById("hddn_"+this.nameC);this.parentSpan=this.getParentSpan();this.parentSpan.setAttribute("nlmultidropdown",this.nameC);this.parentSpan.onselectstart=new Function("return false;");this.currentIdx=-1;this.previousIdx=-1;this.onMouseMoveIdx=-1;for(var g=0,e=0;g<k.length;g+=2,e++){var f=k[g];var c=k[g+1];this.textArray[e]=f;this.valueArray[e]=c;this.valueToIndexMap[String(c)]=e;}this.setWidth();this.defaultBorderColor=this.table.style.borderColor;}function makeMultiDropdown(b,o,n,g,h,d,c,a,p){if(d==null){d=document;}if(n.length>0){for(var e=0;e<n.length;e+=2){n[e]=trim(unEscapeHtml(n[e]));}}else{n=["",""];}var f=++dropdownCounter;var l=b+f;if(a!=null){var k=d.createElement("INPUT");k.name=b;k.id="hddn_"+l;k.type="hidden";k.setAttribute("nlmultidropdown",l);k.value=g;if(h!=null){k.onchange=(typeof h=="function")?h:new Function(h);}a.appendChild(k);}else{if(h!=null){h='onchange="'+h+'"';}else{h="";}d.write("<input name='"+b+"' id = 'hddn_"+l+"' type='hidden' nlmultidropdown='"+l+"' value='"+g+"' "+h+">");}var m=new NLMultiDropdown(b,n,g,o,f,d,p);if(window.multidropdowns[l]==null){window.multidropdowns[l]=m;}m.flags=c;if(m.hasAttribute(2048)){m.setDisabled(true);}return m;}NLMultiDropdown.prototype.getParentSpan=function NLMultiDropdown_getParentSpan(){var a=this.hiddenField.parentNode;while(a!=null){if(a.tagName=="SPAN"&&a.id!=null&&a.id.indexOf(this.name)!=-1){return a;}a=a.parentNode;}return a;};NLMultiDropdown.prototype.buildSpan=function NLMultiDropdown_buildSpan(){this.span=this.renderDocument.createElement(isIE?"span":"div");this.parentSpan.insertBefore(this.span,this.hiddenField);this.span.className="dropdownDiv";this.span.style.position="relative";this.span.style.height=parseInt(this.numRows)*15;this.span.tabIndex=0;this.span.style.overflow="auto";this.span.setAttribute("nlmultidropdown",this.nameC);this.table=this.renderDocument.createElement("table");this.span.appendChild(this.table);this.table.cellSpacing=0;this.table.width="100%";this.table.cellPadding=0;this.table.style.borderCollapse="collapse";this.table.setAttribute("nlmultidropdown",this.nameC);var c=this.renderDocument.createElement("tbody");this.table.appendChild(c);for(var d=0;d<this.textArray.length;d++){var e=this.renderDocument.createElement("tr");c.appendChild(e);var g=this.renderDocument.createElement("td");e.appendChild(g);g.className=this.contains(d)?"dropdownSelected":"dropdownNotSelected";g.style.whiteSpace="nowrap";g.style.borderWidth="0px";g.style.borderStyle="solid";g.style.borderColor="#FFFFFF";g.nlrow=d;g.setAttribute("nlmultidropdown",this.nameC);var f=this.textArray[d];if(isValEmpty(f)){f="&nbsp;";}if(isIE){g.innerHTML=f;g.onclick=new Function("event",'getMultiDropdownFromNameC("'+this.nameC+'").setFocus();');}else{var b=this.renderDocument.createElement("a");g.appendChild(b);b.onclick=new Function("event",'getMultiDropdownFromNameC("'+this.nameC+'").setFocus();');b.innerHTML=f;b.nlrow=d;b.setAttribute("nlmultidropdown",this.nameC);}g.onkeypress=new Function("event",'getMultiDropdownFromNameC("'+this.nameC+'").handleKeypress(event);');}this.span.onkeypress=new Function("event",'getMultiDropdownFromNameC("'+this.nameC+'").handleKeypress(event);');};NLMultiDropdown.prototype.positionHelperIconsForNonIE=function NLMultiDropdown_positionHelperIconsForNonIE(){try{if(isIE){return;}var a=document.getElementById(this.name+"_helperwidgets");if(a){a.style.position="relative";a.style.left=parseInt(this.span.offsetWidth)+10;a.style.top=parseInt(Math.floor(this.span.offsetHeight/2))-parseInt(Math.floor(a.offsetHeight/2))+4;this.span.style.top=-10;}}catch(b){}};function getFocusElement(b){if(!b){return null;}if(b.focus){return b;}var a=b.firstChild;b=null;while(a&&!b){b=getFocusElement(a);a=a.nextSibling;}return b;}NLMultiDropdown.prototype.setFocus=function NLMultiDropdown_setFocus(){var b=getFocusElement(this.span);try{b.focus();if(this.selectedVals.length==0){this.highLightBorder(0);}}catch(a){}};NLMultiDropdown.prototype.setWidth=function NLMultiDropdown_setWidth(){if(this.span==null){this.buildSpan();}if(this.staticWidth!=null){this.span.style.width=this.staticWidth;}else{var a=this.table.offsetWidth;if(a<40){a=40;}a=Math.min(a,300);this.table.style.width=a;this.parentSpan.style.width=a;this.width=a;}this.positionHelperIconsForNonIE();};NLMultiDropdown.prototype.becomeCurrent=function NLMultiDropdown_becomeCurrent(){if(currentMultiDropdown!=this){currentMultiDropdown=this;}};NLMultiDropdown.prototype.resetDropDown=function NLMultiDropdown_resetDropDown(){this.removeAll();this.previousIdx=-1;this.currentIdx=-1;this.selectedVals=isValEmpty(this.defaultValues)?new Array():this.defaultValues.split(String.fromCharCode(5));var b=this.selectedVals.length;var a=0;while(a<b){this.add(this.valueToIndexMap[this.selectedVals[a++]],true);}if(this.width==null){this.setWidth();}this.setHiddenField();};NLMultiDropdown.prototype.getTextForValue=function NLMultiDropdown_getTextForValue(b){var a=this.getIndexForValue(b);if(a!=null){return this.textArray[a];}else{return"";}};NLMultiDropdown.prototype.getIndexForValue=function NLMultiDropdown_getIndexForValue(a){return this.valueToIndexMap[String(a)];};NLMultiDropdown.prototype.setValue=function NLMultiDropdown_setValue(a){this.setIndex(valueToIndexMap[a]);};NLMultiDropdown.prototype.setIndex=function NLMultiDropdown_setIndex(a,b){if(this.disabled){return;}if(getEventShiftKey(b)){this.handleShiftKey(Math.min(this.currentIdx,a),Math.max(this.currentIdx,a));}else{if(getEventCtrlKey(b)||getEventMacCommandKey(b)){if(this.contains(a)){this.remove(a,true);}else{this.add(a,true);}}else{this.removeAll();this.add(a,true);}}this.highLightBorder(a);this.previousIdx=a;this.setHiddenField(true);};NLMultiDropdown.prototype.addIndex=function NLMultiDropdown_addIndex(a){if(this.disabled){return;}this.add(a,true);this.highLightBorder(a);this.previousIdx=a;this.setHiddenField(true);};NLMultiDropdown.prototype.setValues=function NLMultiDropdown_setValues(c,d){this.removeAll();this.previousIdx=-1;var b=c.split(String.fromCharCode(5));var a=0;for(a=0;a<b.length;a++){this.add(this.getIndexForValue(b[a]),true);}this.setHiddenField(!d);};NLMultiDropdown.prototype.getValues=function NLMultiDropdown_getValues(){return this.valueArray;};NLMultiDropdown.prototype.highLightBorder=function NLMultiDropdown_highLightBorder(a){if(this.previousIdx!=-1){this.getCell(this.previousIdx).style.borderStyle="solid";this.getCell(this.previousIdx).style.borderColor="#FFFFFF";}this.getCell(a).style.borderStyle="dotted";this.getCell(a).style.borderColor=this.defaultBorderColor;};NLMultiDropdown.prototype.handleScrolling=function NLMultiDropdown_handleScrolling(a){if(this.span!=null){var c=this.span.scrollTop;var b=this.span.scrollTop+this.getCell(a).offsetHeight*Math.max(1,this.numRows-1);if(this.getCell(a).offsetTop>(b+this.getCell(a).offsetHeight)||this.getCell(a).offsetTop<(c-this.getCell(a).offsetHeight)){this.span.scrollTop=this.getCell(a).offsetTop;}else{if(this.getCell(a).offsetTop>b){this.span.scrollTop+=this.getCell(a).offsetHeight;}else{if(this.getCell(a).offsetTop<c){this.span.scrollTop-=this.getCell(a).offsetHeight;}}}}};NLMultiDropdown.prototype.getSelectedValues=function NLMultiDropdown_getSelectedValues(){return this.selectedVals.join(String.fromCharCode(5));};NLMultiDropdown.prototype.getSelectedText=function NLMultiDropdown_getSelectedText(c){var b="";if(isValEmpty(c)){c=",";}if(this.selectedVals.length>0){for(var a=0;a<this.selectedVals.length;a++){b+=(a==0?"":c)+this.getText(this.valueToIndexMap[this.selectedVals[a]]);}}return b;};NLMultiDropdown.prototype.getSelectedTextFromValues=function NLMultiDropdown_getSelectedTextFromValues(a,e){var d="";if(isValEmpty(e)){e=",";}if(!isValEmpty(a)){var c=a.split(String.fromCharCode(5));for(var b=0;b<c.length;b++){d+=(b==0?"":e)+this.getText(this.valueToIndexMap[c[b]]);}}return d;};NLMultiDropdown.prototype.setHiddenField=function NLMultiDropdown_setHiddenField(a){this.hiddenField.value=this.getSelectedValues();if(a){this.hiddenField.onchange();}};NLMultiDropdown.prototype.removeAll=function NLMultiDropdown_removeAll(){var c=this.selectedVals;for(var b=0;b<c.length;b++){var a=this.valueToIndexMap[c[b]];this.remove(a,true);this.getCell(a).style.borderStyle="solid";this.getCell(a).style.borderColor="#FFFFFF";}};NLMultiDropdown.prototype.add=function NLMultiDropdown_add(a,b){if(a==null){return;}this.currentIdx=a;arrayAdd(this.selectedVals,this.getValue(a));if(b){this.getCell(a).className="dropdownSelected";}};NLMultiDropdown.prototype.remove=function NLMultiDropdown_remove(a,b){if(a==null){return;}this.selectedVals=arrayRemove(this.selectedVals,this.getValue(a));if(b){this.getCell(a).className="dropdownNotSelected";}};NLMultiDropdown.prototype.contains=function NLMultiDropdown_contains(a){return arrayContains(this.selectedVals,this.valueArray[a]);};NLMultiDropdown.prototype.getCell=function NLMultiDropdown_getCell(a){return this.table.rows[a].cells[0];};NLMultiDropdown.prototype.getValue=function NLMultiDropdown_getValue(a){return this.valueArray[a];};NLMultiDropdown.prototype.getText=function NLMultiDropdown_getText(a){return this.textArray[a];};NLMultiDropdown.prototype.setBackgroundColor=function NLMultiDropdown_setBackgroundColor(a){this.defaultBorderColor=a;this.table.style.backgroundColor=a;this.span.style.backgroundColor=a;};NLMultiDropdown.prototype.handleShiftKey=function NLMultiDropdown_handleShiftKey(c,a){if(c>a||c<0||a>=this.valueArray.length){return;}else{var b=0;while(b<this.valueArray.length){if(b>=c&&b<=a){this.add(b,true);}else{this.remove(b,true);}b++;}}};NLMultiDropdown.prototype.handleMoveSelection=function NLMultiDropdown_handleMoveSelection(d,c){var b=this.valueArray.length;var a=this.currentIdx;a+=c;a=Math.min(a,b-1);a=Math.max(a,0);if(getEventShiftKey(d)){this.handleShiftKey(Math.min(this.previousIdx,a),Math.max(this.previousIdx,a));}else{this.removeAll();}this.add(a,true);this.highLightBorder(a);if(!getEventShiftKey(d)){this.previousIdx=a;}this.handleScrolling(a);this.setHiddenField(true);};NLMultiDropdown.prototype.handleTypeAhead=function NLMultiDropdown_handleTypeAhead(f){var g=Math.max(this.currentIdx,0)+1;var e;var b=this.textArray.length;var d=String.fromCharCode(f).toUpperCase();var a=false;for(var h=0;h<b;h++){e=g%b;var c=this.textArray[e].substr(0,d.length).toUpperCase();if(c==d){a=true;break;}++g;}if(a){this.removeAll();this.add(e,true);this.highLightBorder(e);this.previousIdx=e;this.handleScrolling(e);this.setHiddenField(true);}};NLMultiDropdown.prototype.handleMouseMove=function NLMultiDropdown_handleMouseMove(g){if(this.disabled){return;}if(this.onMouseMoveIdx==-1){return;}else{if(isIE&&(getEvent(g).button==0)){this.onMouseMoveIdx=-1;if(currentMultiDropdown==this){currentMultiDropdown=null;}return;}}var f=getEventTarget(g);while(f!=null){if(f.className!=null&&!isNaN(f.nlrow)&&f.nlrow!="undefined"){var a=f.nlrow;var b=this.onMouseMoveIdx!=this.previousIdx&&this.contains(this.onMouseMoveIdx)&&Math.abs(this.previousIdx-this.onMouseMoveIdx)>Math.abs(this.previousIdx-a);if(b){this.remove(this.onMouseMoveIdx,true);}else{var e=Math.min(this.previousIdx,a);var c=Math.max(this.previousIdx,a);for(var d=e;d<=c;d++){if(!this.contains(d)){this.add(d,true);}}}this.handleScrolling(a);this.onMouseMoveIdx=a;break;}f=f.parentNode;}this.setHiddenField(true);};NLMultiDropdown.prototype.handleMouseDown=function NLMultiDropdown_handleMouseDown(b){if(this.disabled){return;}this.becomeCurrent();var a=getEventTarget(b);if(a!=null&&!isNaN(a.nlrow)&&a.nlrow!="undefined"){this.onMouseMoveIdx=a.nlrow;this.setIndex(a.nlrow,b);this.handleScrolling(a.nlrow);}};NLMultiDropdown.prototype.handleKeydown=function NLMultiDropdown_handleKeydown(c){if(this.disabled){return;}this.becomeCurrent();var b=false;var a=getEventKeypress(c);switch(a){case 33:this.handleMoveSelection(c,-this.numRows);break;case 34:this.handleMoveSelection(c,+this.numRows);break;case 35:this.handleMoveSelection(c,this.valueArray.length-this.currentIdx);break;case 36:this.handleMoveSelection(c,-this.currentIdx);break;case 38:this.handleMoveSelection(c,-1);break;case 40:this.handleMoveSelection(c,+1);break;default:b=true;break;}return b;};NLMultiDropdown.prototype.handleKeypress=function NLMultiDropdown_handleKeypress(b){if(this.disabled){return true;}this.becomeCurrent();var a=getEventKeypress(b);this.handleTypeAhead(a);};NLMultiDropdown.prototype.setDisabled=function NLMultiDropdown_setDisabled(c){this.disabled=c;this.hiddenField.disabled=c;if(this.table!=null){this.table.disabled=c;if(!isIE){var a=this.table.getElementsByTagName("A");for(var b=0;b<a.length;b++){a[b].style.color=c?"#AAAAAA":"";}}}if(!this.disabled&&this.span==null&&this.width==null){this.setWidth();this.setBackgroundColor(this.defaultBorderColor);}};NLMultiDropdown.prototype.setHidden=function NLMultiDropdown_setHidden(a){if(this.span!=null){this.span.style.display=a?"none":"";}};NLMultiDropdown.prototype.addOption=function NLMultiDropdown_addOption(d,c,b,a){if(c==null){throw"cannot create an option with null value";}if(d==null){throw"cannot create an option with null text";}d=String(d);c=String(c);if(typeof(a)=="undefined"){a=this.valueArray.length;}this.textArray.splice(a,0,d);this.valueArray.splice(a,0,c);this.valueToIndexMap[c]=a;if(b){this.add(a,false);}if(this.span!=null){this.parentSpan.removeChild(this.span);}this.span=null;this.width=null;this.setWidth();this.setBackgroundColor(this.defaultBorderColor);this.setHiddenField();if(!this.disabled){this.handleScrolling(a);}};NLMultiDropdown.prototype.deleteAllOptions=function NLMultiDropdown_deleteAllOptions(){this.valueArray.length=0;this.textArray.length=0;this.valueToIndexMap=new Array();this.previousIdx=-1;this.currentIdx=-1;this.selectedVals=new Array();if(this.span!=null){this.parentSpan.removeChild(this.span);}this.span=null;this.width=null;this.setWidth();this.setBackgroundColor(this.defaultBorderColor);this.setHiddenField();};NLMultiDropdown.prototype.deleteOneOption=function NLMultiDropdown_deleteOneOption(b){b=String(b);var a=this.valueToIndexMap[b];if(a==null){return;}this.valueArray.splice(a,1);this.textArray.splice(a,1);delete this.valueToIndexMap[b];this.selectedVals=arrayRemove(this.selectedVals,b);if(this.span!=null){this.parentSpan.removeChild(this.span);}this.span=null;this.width=null;this.setWidth();this.setBackgroundColor(this.defaultBorderColor);this.setHiddenField();};NLMultiDropdown.prototype.getContainer=function NLMultiDropdown_getContainer(){return this.span;};function resetNLDropDowns(b){if(window.dropdowns!=null){for(i in window.dropdowns){var a=window.dropdowns[String(i)];if(a.elementsAreInitialized&&(b==null||a.getForm()==b)){a.resetDropDown();}}}if(window.multidropdowns!=null){for(i in window.multidropdowns){var a=window.multidropdowns[String(i)];if(b==null||a.hiddenField.form==b){a.resetDropDown();}}}}var _popup_help="<Enter first few letters then tab>";var _short_popup_help="<Type then tab>";var _mult_popup_help="<Type & tab for single value>";var _popup_help_search="Type & tab...";function convertDropdowns(b){if(b==null){b=document;}var c=b.getElementsByTagName("SELECT");var d=new Array();for(var a=0;a<c.length;a++){d[d.length]=c[a];}for(var a=0;a<d.length;a++){convertDropdown(d[a]);}}function convertDropdown(h){var k=getSelectValueArray(h);var c=getSelectTextArray(h);var a=new Array();for(var e=0;e<k.length;e++){a[a.length]=c[e];a[a.length]=k[e];}var g=null;var b=h.form;var d=nvl(h.getAttribute("iFlags"),"0");var f=document.createElement("SPAN");f.style.whiteSpace="nowrap";f.id=h.getAttribute("id");h.parentNode.replaceChild(f,h);if(h.type=="select-one"){f.className="nldropdown";g=makeDropdown(h.name,h.getAttribute("defaultWidth"),a,getSelectIndex(h),getSelectValue(h),getSelectText(h),h.getAttribute("onchange"),null,h.getAttribute("minimumWidth"),document,parseInt(d),f);if(b!=null){b.elements[h.name]=g.hddn;}}else{g=makeMultiDropdown(h.name,h.size,a,getMultiSelectValues(h),h.getAttribute("onchange"),document,parseInt(d),f);if(b!=null){b.elements[h.name]=g.hiddenField;}}g.setMandatoryBackgroundColor(getStyleForClass("inputreq","backgroundColor"));g.setRequired(getRequired(h));}function getStyleForClass(d,g){var f=document.styleSheets;for(var b=0;b<f.length;b++){var h=f[b].rules?f[b].rules:f[b].cssRules;for(var a=0;a<h.length;a++){var c=h[a].style;var e=h[a].selectorText.replace(".","");if(!isValEmpty(c[g])&&e==d){return c[g];}}}return null;}var dragger=null;var mouseX=0,mouseY=0;var currentPortlet=null;var bar=null;var EVENT_PORTLET_MAX=0;var EVENT_PORTLET_MIN=1;var EVENT_PORTLET_MOVE=2;var EVENT_PORTLET_DROP=3;var EVENT_PORTLET_DRAG=4;function NLPortletDragger(){this.trToBeMoved=null;this.divContainer=null;this.headerTR=null;this.width=null;this.originalColumn=null;this.originalNext=null;this.originalContainer=null;this.widthPlaceHolder=null;this.portletID=null;}function movedToDifferentWidthColumn(a,b){return((a==1||a==3)&&b==2)||((b==1||b==3)&&a==2);}NLPortletDragger.prototype.putDownPortlet=function NLPortletDragger_putDownPortlet(){if(bar&&bar.parentNode){bar.parentNode.removeChild(bar);}var a=currentPortlet;if(!isNS){this.divContainer.parentNode.removeChild(this.divContainer);}if(a!=null){var b=getCellIndex(a.parentNode.parentNode.parentNode)+1;a.parentNode.insertBefore(this.trToBeMoved,a);if(this.updateLayoutInDatabase){this.updateLayoutInDatabase(this.portletID,a.portletID,b,this.originalColumn,this.trToBeMoved.id);}else{updateLayoutInDatabase(this.portletID,a.portletID,b,this.originalColumn);}if(movedToDifferentWidthColumn(this.originalColumn,b)){this.headerTR.setAttribute("ptlt_hasdisplayed","F");}}else{if(this.widthPlaceHolder){this.originalContainer.insertBefore(this.trToBeMoved,this.originalNext);}}if(this.widthPlaceHolder){this.originalContainer.removeChild(this.widthPlaceHolder);}currentPortlet=null;};NLPortletDragger.prototype.putDownRow=function NLPortletDragger_putDownRow(){if(bar&&bar.parentNode){bar.parentNode.removeChild(bar);}var moveTo=currentPortlet;if(this.divContainer!=null){this.divContainer.parentNode.removeChild(this.divContainer);this.originalContainer.insertBefore(this.trToBeMoved,this.originalNext);}if(moveTo==null){return;}if(moveTo.isOrderedList&&OrderedListMoveLineTo){OrderedListMoveLineTo(moveTo.machineName,moveTo.rowIndex);}else{if(moveTo.machineName!=null){var newRowIdx=moveTo.rowIndex;var currentRowIdx=eval(moveTo.machineName+"_machine.getMachineIndex()");var isInlineEdit=eval(moveTo.machineName+"_machine.isinline");var machine=getMachineByName(moveTo.machineName);if(isInlineEdit&&currentRowIdx<moveTo.rowIndex&&machine.moveButtons){newRowIdx--;}eval(moveTo.machineName+"_machine.movelineto("+newRowIdx+")");}}if(OrderedListMarkRowNavigation){OrderedListMarkRowNavigation(moveTo,false);}currentPortlet=null;};function getCellIndex(a){return a.cellIndex;}function movePortlet(f,l){try{var k=getEventTarget(l);if(k.parentNode.nodeName=="A"){return true;}var b=findClassUp(f,"portletHandle");dragger=new NLPortletDragger();dragger.portletID=getPortletId(f.id);dragger.headerTR=f;dragger.trToBeMoved=b;dragger.originalColumn=getCellIndex(b.parentNode.parentNode.parentNode)+1;dragger.originalContainer=b.parentNode;dragger.originalNext=b.nextSibling;dragger.width=b.offsetWidth;dragger.divContainer=document.createElement("div");dragger.divContainer.style.position="absolute";dragger.divContainer.style.width=dragger.width;dragger.divContainer.style.background=document.body.bgColor;if(isIE){dragger.divContainer.style.filter="alpha(opacity=92)";}else{dragger.divContainer.style.opacity=(0.92);dragger.divContainer.style.MozOpacity=(0.92);}dragger.widthPlaceHolder=document.createElement("tr");var a=document.createElement("td");var c=document.createElement("img");a.appendChild(c);dragger.widthPlaceHolder.appendChild(a);c.src="/images/nav/stretch.gif";c.width=dragger.width;c.height="0";if(dragger.widthPlaceHolder){dragger.originalContainer.appendChild(dragger.widthPlaceHolder);}dragger.originalContainer.removeChild(b);var g=document.createElement("table");g.style.borderWidth=0;g.width="100%";var h=document.createElement("tbody");g.appendChild(h);h.appendChild(b);dragger.divContainer.appendChild(g);if(!isNS){document.body.appendChild(dragger.divContainer);positionFloatingPortlet(dragger.divContainer,4);}}catch(d){dragger=null;}}function portletDraggerOnMouseMove(b){updateMousePosition(b);if(dragger){if((document.body.scrollHeight>getDocumentHeight())&&(getDocumentHeight()-mouseY)<10){document.body.scrollTop=document.body.scrollHeight-getDocumentHeight();}else{if(mouseY<15&&document.body.scrollTop>0){document.body.scrollTop=0;}}if(!isNS){positionFloatingPortlet(dragger.divContainer,4);}var a=getEventTarget(b);a=findClassUp(a,"portletHandle");if((a!=null)&&(a!=currentPortlet)&&a!=dragger.trToBeMoved){currentPortlet=a;if(bar!=null&&bar.parentNode!=null){bar.parentNode.removeChild(bar);}bar=getPositionUpdateBar();currentPortlet.portletID=getPortletId(currentPortlet.id);currentPortlet.parentNode.insertBefore(bar,currentPortlet);}notifyPortlet(dragger.portletID,EVENT_PORTLET_MOVE);}}function updateMousePosition(a){mouseX=getMouseX(a);mouseY=getMouseY(a);}function getPositionUpdateBar(b){var c=document.createElement("tr");var d=document.createElement("td");c.appendChild(d);var a=document.createElement("hr");a.style.width="100%";a.className="portletDragDropBar";d.appendChild(a);if(b&&b.cells.length>0){d.colSpan=b.cells.length;a.style.width="95%";}return c;}function positionFloatingPortlet(e,a){var b=8;var c=10;var d=a;var f=getDocumentClientWidth();if(mouseX<15){e.style.left=b;}else{if((mouseX+e.offsetWidth)>(f-c)){e.style.left=(f-c)-e.offsetWidth;}else{e.style.left=mouseX-10;}}if(mouseY<getDocumentHeight()){if((mouseY+e.offsetHeight)<getDocumentHeight()){e.style.top=mouseY+document.body.scrollTop+d;}else{e.style.top=(mouseY+document.body.scrollTop+d)-e.offsetHeight-15;}}}function portletDraggerOnMouseDown(d){if(dragger||getButtonId(d)>1){return;}var b=getEventTarget(d);var a=findClassUp(b,"portletlabelDragDrop");if(a!=null&&a.id!=null){movePortlet(a,d);var c=getPortletId(a.id);notifyPortlet(c,EVENT_PORTLET_DRAG);}}function portletDraggerOnMouseUp(){if(dragger){dragger.putDownPortlet();notifyPortlet(dragger.portletID,EVENT_PORTLET_DROP);dragger=null;return false;}}function getPortletId(a){if(a==null){return -1;}else{return a.substring(a.lastIndexOf("_")+1,a.length);}}function updateLayoutInDatabase(a,f,e,c){var d="/app/center/portletlayout.nl?movedid="+a+"&replacedid="+f+"&sectionid=-29&newcolumn="+e+"&oldcolumn="+c;var b=getParameter("entityid",document);if(b!=null){d+="&entityid="+b;}sendRequestToFrame(d,"server_commands");}function hidePortlet(e,a,b){var c=document.getElementById(b);c=findClassUp(c,"portletHandle");if(c!=null){var d="/app/center/setup/dashboard.nl?portletid="+a+"&sectionid="+e+"&dynamic=T&elementid="+b;d+="&method=hideportlet";if(window.editDashboard){d+="&e=T";}sendRequestToFrame(d,"server_commands");}}function doHidePortlet(a){var b=document.getElementById(a);b=findClassUp(b,"portletHandle");if(b!=null){b.parentNode.removeChild(b);}}function minimizePortlet(k,m,e,h,n,g){var d=document.getElementById(e);if(d!=null&&d.parentNode.nodeName=="TBODY"){var a=d.getAttribute("ptlt_hasdisplayed")=="T";var l=d.nextSibling.style.display=="none";var f=l?"":"none";if(!l||a||!g){for(var c=1;c<d.parentNode.rows.length;c++){d.parentNode.rows[c].style.display=f;}if(l){document.getElementById(e+"_maxmin").src="/images/forms/minimize.gif";}else{document.getElementById(e+"_maxmin").src="/images/forms/maximize.gif";}}d.setAttribute("ptlt_hasdisplayed","T");var b="/app/center/setup/minimizeportlet.nl?portletid="+m+"&sectionid="+k;b=addParamToURL(b,"elemid",h);b=addParamToURL(b,"sticky",n);b=addParamToURL(b,"_minimize",(l?"F":"T"));b=addParamToURL(b,"_reload",(l&&!a&&g?"T":"F"));sendRequestToFrame(b,"server_commands");notifyPortlet(m,l?EVENT_PORTLET_MAX:EVENT_PORTLET_MIN);}}function refreshPortlet(f,l,e,g,m,d,h,c,k,a){setPortletToUpdating(f);var b="/app/center/setup/portletrefresher.nl?elemid="+f+"&sticky="+l;if(e!=null){b+="&noreload="+(e?"T":"F");}if(g!=null){b+="&sc="+g;}if(m!=null){b+="&portletid="+m;}if(d!=null){b+="&entityid="+d+"&haschild="+(h?"T":"F");}if(c!=null){b+="&searchid="+c;}if(a!=null){b+="&lineid="+a;}if(k!=null&&k.length>0){if(k.charAt(0)=="?"){k=k.substring(1);}b+="&addparams="+escape(k);}sendRequestToFrame(b,"server_commands");}function disablePortletLinks(c){for(var b=0;;b++){var a=document.getElementById(c+b);if(a==null){break;}a.disabled=true;}return true;}function sendRequestToFrame(a,c){try{document.frames[c].document.location.replace(a);}catch(b){}}function getFrame(a){try{return document.frames[a];}catch(b){}}var quickAddDragger=null;function quickaddDraggerOnMouseDown(c){if(quickAddDragger||getButtonId(c)>1){return;}var b=getEventTarget(c);var a=findClassUp(b,"quickaddDragDropIcon");if(a!=null&&a.id!=null){quickAddDragger=findClassUp(a,"quickadddragger");}}function quickaddDraggerOnMouseMove(a){if(quickAddDragger!=null){positionFloatingPortlet(quickAddDragger,0);}}function quickaddDraggerOnMouseUp(){quickAddDragger=null;return false;}function setPortletToUpdating(g){var f="rfsh_"+g;var c=document.getElementById(f);if(c!=null){var d=c.parentNode.previousSibling!=null?c.parentNode.previousSibling.firstChild:null;if(d!=null&&d.nodeName=="IMG"){d.src="/images/nav/dingbats/btn_cl_refresh.gif";}while(c.firstChild!=null){c.removeChild(c.firstChild);}var b=document.createElement("font");b.color="#999999";var e=document.createTextNode("Refreshing");b.appendChild(e);c.appendChild(b);var a=document.createElement("img");a.src="/images/setup/updating.gif";a.border=0;c.appendChild(a);}}var fontNames={Font:"",Verdana:"Verdana",Arial:"Arial","Courier New":"Courier New","Times New Roman":"Times New Roman","Comic Sans":"Comic Sans MS",Georgia:"Georgia",Tahoma:"Tahoma",Trebuchet:"Trebuchet MS"};var fontColors={Color:"",Black:"#000000",Red:"#FF0000",Blue:"#0000FF","Dark Blue":"#00008B","Navy Blue":"#000080",Brown:"#A52A2A",Green:"#008000",Orange:"#FFA500","Light Grey":"#D3D3D3",Silver:"#C0C0C0"};var fontSizes={Size:"","8":"1","10":"2","12":"3","14":"4","18":"5","24":"6","36":"7"};function _getFontSizePts(b){for(var a in fontSizes){if(fontSizes[a]==b){return a;}}return null;}var htmleditors=new Array();var useNLDropdownMenu=false;function makeHtmlEditor(b,k,h,c,l,g,d,a,e){if(document.getElementById(b+"_fs")==null){return null;}if(!isNaN(l)){l=Math.min(l*20,500);}if(!isNaN(c)){c=Math.min(c*6,800);}var f=new NLHtmlEditor(b,k,h,c,l,g,d);window.htmleditors[b]=f;if(a!=null){f.defaultFont=a;}if(e!=null){f.defaultFontSize=e;}f.launchEditor();if(f.hasAttribute(128)){f.setMandatory(true);}if(f.hasAttribute(2048)){f.setDisabled(true);}return f;}var NLHTMLEDITOR_FORMATTED_LABEL="Formatted Text";var NLHTMLEDITOR_SOURCECODE_LABEL="HTML Source Code";var NLHTMLEDITOR_FORMATTED_HELPER_TEXT="Type text and format it using the toolbar.";var NLHTMLEDITOR_SOURCECODE_HELPER_TEXT="<!-- Type or paste HTML code -->";function NLHtmlEditor(e,g,d,f,a,c,b){this.name=e;this.span=document.getElementById(e+"_fs");this.value=g;this.defaultValue=g;this.main=null;this.editor=null;this.toggleHeader=null;this.toolbar=null;this.hddn=null;this.defaultTextMode=c;this.textMode=c;this.width=f!=null?f:400;this.height=a!=null?a:200;this.onChangeFunc=d;this.flags=b?b:0;this.toggleSpan=null;this.disabled=false;this.mandatory=false;this.mandatoryBgColor="#FFFFE5";this.defaultFont=null;this.defaultFontSize=null;this.responseLock=false;this.responseQueue=0;}NLHtmlEditor.prototype.launchEditor=function NLHtmlEditor_launchEditor(){this.main=document.createElement("DIV");this.main.id=this.name+"_main";this.main.unselectable="on";this.main.style.border="solid 1px #999999";this.main.style.backgroundColor="#EEEEEE";this.span.appendChild(this.main);this.buildToggleHeader();this.buildToolBar();this.buildEditor();this.setEditorMode(this.textMode);};NLHtmlEditor.prototype.buildEditor=function NLHtmlEditor_buildEditor(){this.editor=document.createElement("DIV");this.editor.id=this.name+"_editor";this.editor.unselectable="on";this.editor.style.width="100%";this.editor.style.borderWidth="1px 0 0px 0";this.editor.style.borderStyle="solid";this.editor.style.borderColor="#999999";this.main.appendChild(this.editor);this.editorHtml=document.createElement("IFRAME");this.editorHtml.id=this.name+"_html";this.editorHtml.src="javascript:false";this.editorHtml.style.height=this.height;this.editorHtml.style.width="100%";this.editorHtml.frameBorder="0";this.editorText=document.createElement("TEXTAREA");this.editorText.id=this.name+"_text";this.editorText.className="input"+(this.mandatory?"req":"");this.editorText.onkeypress=new Function("event","setEventCancelBubble(event); return true");this.editorText.style.height=this.height;this.editorText.style.width="100%";this.editorText.style.borderWidth="0px";};NLHtmlEditor.prototype.buildToggleHeader=function NLHtmlEditor_buildToggleHeader(){this.toggleHeader=document.createElement("DIV");this.toggleHeader.id=this.name+"_footer";this.toggleHeader.unselectable="on";this.toggleHeader.style.padding="5px 2px 3px 5px";this.toggleHeader.style.width=this.width;this.toggleSpan=document.createElement("SPAN");this.toggleSpan.className="tinytext";var b=document.createElement("A");b.className="tinytextnolink";var a=document.createElement("A");a.className="tinytextnolink";this.setToggleLinks(b,a);this.toggleSpan.appendChild(b);this.toggleSpan.appendChild(a);this.toggleHeader.appendChild(this.toggleSpan);this.hddn=document.createElement("INPUT");this.hddn.type="hidden";this.hddn.value=this.value;this.hddn.name=this.name;this.hddn.id=this.name;if(this.onChangeFunc!=null){this.hddn.onchange=new Function(this.onChangeFunc);}this.toggleHeader.appendChild(this.hddn);this.main.appendChild(this.toggleHeader);this.span.parentNode.style.paddingBottom="5px";};NLHtmlEditor.prototype.buildToolBar=function NLHtmlEditor_buildToolBar(){this.toolbar=document.createElement("DIV");this.toolbar.id=this.name+"_toolbar";this.toolbar.style.padding="4 4 2 4";this.toolbar.style.height="22px";this.toolbar.unselectable="on";this.toolbar.style.backgroundColor="#EEEEEE";this.toolbar.style.borderWidth="0px";this.main.appendChild(this.toolbar);this.buildToolBarIcon("fontname","Font","FontName");this.buildToolBarIcon("fontsize","Size","FontSize");this.buildToolBarIcon("fontcolor","Color","ForeColor");if(isNaN(this.width)||parseInt(this.width)>425){this.buildToolBarLiner();}else{this.buildToolBarLineBreak();}this.buildToolBarIcon("bold","Bold","Bold");this.buildToolBarIcon("italic","Italic","Italic");this.buildToolBarIcon("underline","Underline","Underline");this.buildToolBarLiner();this.buildToolBarIcon("justifyleft","Justify Left","JustifyLeft");this.buildToolBarIcon("justifycenter","Justify Center","JustifyCenter");this.buildToolBarIcon("justifyright","Justify Right","JustifyRight");this.buildToolBarLiner();this.buildToolBarIcon("insertorderedlist","Ordered List","InsertOrderedList");this.buildToolBarIcon("insertunorderedlist","Unordered List","InsertUnorderedList");this.buildToolBarIcon("outdent","Outdent","Outdent");this.buildToolBarIcon("indent","Indent","Indent");};NLHtmlEditor.prototype.buildToolBarIcon=function NLHtmlEditor_buildToolBarIcon(b,l,f){var d=this.name+"_toolbar_"+b;if(f=="FontName"||f=="FontSize"||f=="ForeColor"){var k=new Array();var a;if(f=="FontName"){a=fontNames;}else{if(f=="FontSize"){a=fontSizes;}else{a=fontColors;}}for(var m in a){k[k.length]=m;k[k.length]=a[m];}if(useNLDropdownMenu){var n=document.createElement("SPAN");n.id=d+"_fs";n.unselectable="on";n.className="nldropdown";n.style.whiteSpace="nowrap";this.toolbar.appendChild(n);var o=makeDropdown(d,null,k,null,"","",'getHtmlEditor("'+this.name+'").setFocus(); getHtmlEditor("'+this.name+'").handleToolBarEvent("'+f+'", getSelectValue(this)); window.ischanged = true;',null,null,document,1,n);o.inpt.tabIndex=-1;}else{var p=document.createElement("SELECT");p.name=d;p.id=d+"_fs";p.className="input";p.unselectable="on";p.tabIndex=-1;p.onchange=new Function('getHtmlEditor("'+this.name+'").setFocus(); getHtmlEditor("'+this.name+'").handleToolBarEvent("'+f+'", getSelectValue(this)); window.ischanged = true;');for(var h=0;h<k.length;h+=2){var c=document.createElement("OPTION");c.text=k[h];c.value=k[h+1];c.unselectable="on";p.add(c);}this.toolbar.appendChild(p);}}else{var e=document.createElement("BUTTON");e.id=d;e.btnCommand=f;e.tabIndex=-1;e.className="editorbutton";e.unselectable="on";e.title=l;e.style.padding="1px";e.style.margin=0;e.style.marginTop="3px";e.style.backgroundColor="#EEEEEE";e.onmouseover=new Function("if (this.className =='editorbutton') this.className='editorbuttonhover'");e.onmousedown=new Function("this.className='editorbuttondown';");e.onmouseout=new Function("if (this.className =='editorbuttonhover') this.className='editorbutton'");e.onclick=new Function("getHtmlEditor('"+this.name+"').handleToolBarEvent('"+f+"'); return false;");var g=document.createElement("IMG");g.src="/images/nav/editor/"+b+".gif";g.unselectable="on";g.padding=0;g.margin=0;g.border=0;g.style.height="18";g.style.width="18";e.appendChild(g);this.toolbar.appendChild(e);}};NLHtmlEditor.prototype.buildToolBarLineBreak=function NLHtmlEditor_buildToolBarLiner(){var a=document.createElement("BR");a.unselectable="on";this.toolbar.appendChild(a);};NLHtmlEditor.prototype.buildToolBarLiner=function NLHtmlEditor_buildToolBarLiner(){var a=document.createElement("SPAN");a.style.width="1px";a.style.height="16px";a.style.border="1px inset";a.style.margin="0 3 0 3";a.unselectable="on";this.toolbar.appendChild(a);};NLHtmlEditor.prototype.hasAttribute=function NLHtmlEditor_hasAttribute(a){return(this.flags&a)!=0;};NLHtmlEditor.prototype.getValue=function NLHtmlEditor_getValue(){return this.value;};NLHtmlEditor.prototype.getDisplayValue=function NLHtmlEditor_getDisplayValue(){var a=null;if(this.textMode){a=this.editorText.value;}else{a=this.editorHtml.contentWindow.document.body.innerHTML;}a=this.handleEscaping(a,false);return a;};NLHtmlEditor.prototype.setValue=function NLHtmlEditor_setValue(d,c){var b=this.value;this.value=d;this.hddn.value=this.value;if(this.onChangeFunc!=null){var a=this.hddn.onchange();if(a!=null&&!a){this.value=this.hddn.truncatedValue?this.hddn.value:b;this.hddn.value=this.value;this.setDisplayValue(this.value);}}if(c){this.setDisplayValue(this.value);}};NLHtmlEditor.prototype.setDisplayValue=function NLHtmlEditor_setDisplayValue(f){var h=this.handleEscaping(f,true);var g=isValEmpty(h);if(this.textMode){if(g){this.editorText.value=NLHTMLEDITOR_SOURCECODE_HELPER_TEXT;this.editorText.style.fontFamily="courier";this.editorText.style.color="#666666";}else{this.editorText.value=h;this.editorText.style.fontFamily="";this.editorText.style.color="";}}else{if(g){h="<font color='#666666'>"+NLHTMLEDITOR_FORMATTED_HELPER_TEXT+"</font>";}this.editorHtml.contentWindow.document.open();var e=getStyleForClass("smalltext","fontSize");var b=getCascadedStyle(document.body,"fontFamily","font-family");this.editorHtml.contentWindow.document.write("<html><body contenteditable='true' width=100%; height=100%; topmargin=1 leftmargin=1 style='font-size: "+e+"; font-family: "+b+"'>");var d=(this.defaultFontSize!=null||this.defaultFont!=null)&&this.value==this.defaultValue;if(d){var k=this.defaultFontSize!=null?"size="+fontSizes[this.defaultFontSize]:"";var c=this.defaultFont!=null?"face='"+this.defaultFont+"'":"";this.editorHtml.contentWindow.document.write("<FONT "+k+" "+c+">");}var a=/\s*<div>(.*)<\/div>\s*$/i;if(!a.test(h.split("\n").join("\r"))){h="<DIV>"+h+"</DIV>";}this.editorHtml.contentWindow.document.write(h);if(d){this.editorHtml.contentWindow.document.write("</FONT>");}this.editorHtml.contentWindow.document.write("</body></html>");this.editorHtml.contentWindow.document.close();if(this.mandatory){this.editorHtml.contentWindow.document.body.style.backgroundColor=this.mandatoryBgColor;}else{this.editorHtml.contentWindow.document.body.style.backgroundColor=getRuntimeStyle(this.editorText,"background-color");}setTimeout(this.setupEventHandlers.bind(this),2000);}};NLHtmlEditor.prototype.stripExtraDivs=function NLHtmlEditor_stripExtraDivs(d){var e=/<div/i;var c=/<\/div>/i;var m=/^>/;var a=/^>.*<BR(>| .*>)\s*$/i;var b=/<BR(>| .*>)\s*$/i;var l=(" "+d+" ").split(e);var o=new Array();o.push(l[0]);for(var g=1;g<l.length;g++){var p=l[g].split(c);o.push(p[0]);for(var f=1;f<p.length;f++){var h=o.pop();if(a.test(h)){h=h.substring(1);}else{if(m.test(h)){h=h.substring(1)+"<BR>";}else{if(!m.test(h)){h="<div"+h+"</div>";}}}o.push(o.pop()+h+p[f]);}}var n=o.pop();n=n.substring(0,n.length-1);while(b.test(n)){n=n.replace(b,"");}o.push(n);d=o.join("<div");d=d.substring(1);return d;};NLHtmlEditor.prototype.handleEscaping=function NLHtmlEditor_handleEscaping(b,a){if(!isValEmpty(b)&&!this.textMode){b=this.stripExtraDivs(b);b=b.replace(/<STRONG>/gi,"<B>").replace(/<\/STRONG>/gi,"</B>").replace(/<EM>/gi,"<I>").replace(/<\/EM>/gi,"</I>");b=a?b.replace(/<NL([^>]{2,})>/g,"&lt;NL$1&gt;"):b.replace(/&lt;NL([^&\]]{2,})(&gt;|>)/g,"<NL$1>");b=a?b.replace(/<(SCRIPT)\b/gi,"<!--NLHIDE:$1").replace(/(<\/SCRIPT\s*)>/gi,"$1:NLHIDE-->"):b.replace(/<\!--NLHIDE:/g,"<").replace(/:NLHIDE-->/g,">");}return b;};NLHtmlEditor.prototype.insertValue=function NLHtmlEditor_insertValue(h,l){if(isValEmpty(h)){return;}if(this.disabled){return;}if(!l){this.setFocus();setTimeout(new Function("getHtmlEditor('"+this.name+"').insertValue('"+h+"',true)"),200);return;}var e=this.handleEscaping(h,true);var a,d;var g=this.textMode?document:this.editorHtml.contentWindow.document;if((this.textMode&&this.editorText.value==NLHTMLEDITOR_SOURCECODE_HELPER_TEXT)||(!this.textMode&&this.getValue()!=null&&this.getDisplayValue().indexOf(NLHTMLEDITOR_FORMATTED_HELPER_TEXT)!=-1)){this.setDisplayValue(e);}else{if(window.getSelection){a=this.textMode?window.getSelection():this.editorHtml.contentWindow.getSelection();d=a.getRangeAt(0);var c=g.createTextNode(this.textMode?e:h);if(d.startContainer.tagName=="DIV"&&d.startContainer.firstChild.tagName=="TEXTAREA"){var b=d.startContainer.firstChild;var f=b.selectionEnd+e.length;b.value=b.value.substring(0,b.selectionEnd)+e+b.value.substring(b.selectionEnd);b.selectionStart=b.selectionEnd=f;}else{if(d.collapsed){d.insertNode(c);}else{var k=g.createDocumentFragment();k.appendChild(d.extractContents());k.appendChild(c);d.insertNode(k);}d.selectNodeContents(c);d.collapse(false);d.commonAncestorContainer.normalize();}}else{if(g.selection){a=g.selection;d=a.createRange();if(this.textMode){d.text=d.text+e;}else{d.pasteHTML(d.htmlText+e);}d.collapse(false);d.select();}}}this.setValue(this.getDisplayValue());};NLHtmlEditor.prototype.setMandatory=function NLHtmlEditor_setMandatory(b,a){this.mandatory=b;this.mandatoryBgColor=a!=null?a:"#FFFFE5";if(this.mandatoryBgColor.charAt(0)!="#"){this.mandatoryBgColor="#"+this.mandatoryBgColor;}this.editorText.className="input"+(this.mandatory?"req":"");this.editorHtml.contentWindow.document.body.style.backgroundColor=this.mandatory?this.mandatoryBgColor:"#FFFFFF";};NLHtmlEditor.prototype.getMandatory=function NLHtmlEditor_getMandatory(){return this.mandatory;};NLHtmlEditor.prototype.handleToolBarEvent=function NLHtmlEditor_handleToolBarEvent(b,a){if(this.disabled){return;}if(this.textMode){return;}if(b=="FontName"||b=="FontSize"||b=="ForeColor"){if(!isValEmpty(a)){this.editorHtml.contentWindow.document.execCommand(b,false,a);var c=this.editorHtml.contentWindow.document.body.firstChild;if(isValEmpty(c.innerHTML)&&c.nodeType!=3){if(b=="FontName"){c.style.fontFamily=a;}else{if(b=="FontSize"){c.style.fontSize=_getFontSizePts(a)+"pt";}else{if(b=="ForeColor"){c.style.color=a;}}}}}}else{this.editorHtml.contentWindow.document.execCommand(b,false,null);}this.setValue(this.getDisplayValue());this.syncToolBarWithEditor(b,a);};NLHtmlEditor.prototype.scheduleEditorEventHandler=function NLHtmlEditor_scheduleEditorEventHandler(b,a){if(this.disabled){return;}setTimeout(new Function("getHtmlEditor('"+this.name+"').handleEditorEvent('"+b+"')"),a);};NLHtmlEditor.prototype.handleEditorEvent=function NLHtmlEditor_handleEditorEvent(b,c){if(this.disabled){return true;}if(this.responseLock){if(b!="mouseup"){this.responseQueue++;}return true;}this.responseLock=true;var a=new Function("var editor = getHtmlEditor('"+this.name+"'); editor.responseLock = false; if ( editor.responseQueue > 0 ) { editor.responseQueue = 0; editor.handleEditorEvent('"+b+"'); }");setTimeout(a,333);if(this.getValue()!=null&&this.getDisplayValue().indexOf(NLHTMLEDITOR_FORMATTED_HELPER_TEXT)==-1&&this.getDisplayValue()!=this.getValue()){this.setValue(this.getDisplayValue());}if(this.ToolbarUpdateTimer){clearTimeout(this.ToolbarUpdateTimer);}this.ToolbarUpdateTimer=setTimeout(function(){this.syncToolBarWithEditor();}.bind(this),100);return true;};NLHtmlEditor.prototype.resetEditor=function NLHtmlEditor_resetEditor(){this.setValue(this.defaultValue);var a=this.toggleHeader.firstChild;if(a!=null&&((this.defaultTextMode&&!a.checked)||(!this.defaultTextMode&&a.checked))){this.toggleHeader.firstChild.checked=this.defaultTextMode;}this.setEditorMode(this.defaultTextMode);};NLHtmlEditor.prototype.setDisabled=function NLHtmlEditor_setDisabled(a){this.disableToolBar(a);this.editor.disabled=a;if(this.textMode){this.editorText.disabled=a;}else{this.editorHtml.contentWindow.document.body.disabled=a;}this.toggleHeader.disabled=a;this.toggleHeader.firstChild.disabled=a;this.disabled=a;};NLHtmlEditor.prototype.disableToolBar=function NLHtmlEditor_disableToolBar(c){this.toolbar.disabled=c;var a=this.toolbar.getElementsByTagName("BUTTON");for(var b=0;b<a.length;b++){a[b].disabled=c;if(c&&a[b].className=="editorbuttondown"){a[b].className="editorbutton";}}a=this.toolbar.getElementsByTagName("SPAN");for(var b=0;b<a.length;b++){a[b].disabled=c;}a=this.toolbar.getElementsByTagName("IMG");for(var b=0;b<a.length;b++){a[b].disabled=c;}if(useNLDropdownMenu){var a=this.toolbar.getElementsByTagName("INPUT");for(var b=0;b<a.length;b++){if(a[b].className=="nldropdown"){disableSelect(a[b],c);}}}else{var a=this.toolbar.getElementsByTagName("SELECT");for(var b=0;b<a.length;b++){disableSelect(a[b],c);}}};NLHtmlEditor.prototype.syncToolBarWithEditor=function NLHtmlEditor_syncToolBarWithEditor(c,k){if(this.disabled){return;}if(this.textMode){return;}var h=this.editorHtml.contentWindow.document;var d=this.toolbar.getElementsByTagName("BUTTON");for(var f=0;f<d.length;f++){var c=d[f].btnCommand;try{if(h.queryCommandState(c)){d[f].className="editorbuttondown";}else{d[f].className="editorbutton";}}catch(g){d[f].className="editorbutton";}}var k=h.queryCommandValue("fontsize");if(!k||k.length==0){k="";}setSelectValue(document.getElementById(this.name+"_toolbar_fontsize_fs"),k);k=h.queryCommandValue("fontname");var b=document.getElementById(this.name+"_toolbar_fontname_fs");var a=b.options;if(k){for(var f=0;f<a.length;f++){if(a[f].value.length>0&&k.indexOf(a[f].value)>=0){b.selectedIndex=f;break;}}}if(f==a.length){setSelectValue(document.getElementById(this.name+"_toolbar_fontname_fs"),"");}k=h.queryCommandValue("forecolor");var l="";if(k){var l=(String(k).charAt(0)=="#")?k:getHexColorValue(k);}setSelectValue(document.getElementById(this.name+"_toolbar_fontcolor_fs"),l);};function getHexColorValue(b){if(typeof b!="number"){if(b.indexOf("rgb(")==0){var a=b.substring(4,b.length-1).split(",");return"#"+getTwoDigitHexString(a[0])+getTwoDigitHexString(a[1])+getTwoDigitHexString(a[2]);}}else{return getHexValueFromDecimal(b);}}NLHtmlEditor.prototype.setToggleLinks=function NLHtmlEditor_setToggleLinks(b,a){this.setActiveToggleLink(b,this.textMode?NLHTMLEDITOR_SOURCECODE_LABEL:NLHTMLEDITOR_FORMATTED_LABEL);this.setInactiveToggleLink(a,this.textMode?NLHTMLEDITOR_FORMATTED_LABEL:NLHTMLEDITOR_SOURCECODE_LABEL,!this.textMode);};NLHtmlEditor.prototype.setActiveToggleLink=function NLHtmlEditor_setActiveToggleLink(b,a){b.onclick=new Function("return false;");b.removeAttribute("href");b.innerHTML="<b>"+a+"</b>&nbsp;";b.className="textnolink";};NLHtmlEditor.prototype.setInactiveToggleLink=function NLHtmlEditor_setInactiveToggleLink(b,a,c){b.onclick=new Function("getHtmlEditor('"+this.name+"').setEditorMode("+c+"); return false;");b.href="javascript:void('"+a+"')";b.innerHTML="(<u>"+a+"</u>)";};NLHtmlEditor.prototype.setEditorMode=function NLHtmlEditor_setEditorMode(a){if(this.disabled){return;}this.textMode=a;if(a){if(this.editorText==null){return;}if(document.getElementById(this.editorHtml.id)!=null){this.editor.removeChild(this.editorHtml);if(this.editorText.style.width=="100%"){this.editorText.style.width=document.getElementById(this.name+"_main").offsetWidth;}}this.setDisplayValue(this.value);this.editor.appendChild(this.editorText);this.toolbar.style.display="none";this.setupEventHandlers();}else{if(this.editorHtml==null){return;}if(document.getElementById(this.editorText.id)!=null){this.editor.removeChild(this.editorText);}this.editor.appendChild(this.editorHtml);this.setDisplayValue(this.value);this.toolbar.style.display="inline";}this.setToggleLinks(this.toggleSpan.childNodes[0],this.toggleSpan.childNodes[1]);};NLHtmlEditor.prototype.getFieldId=function NLHtmlEditor_getFieldId(){return(this.textMode)?this.editorText.id:this.editorHtml.id;};NLHtmlEditor.prototype.getField=function NLHtmlEditor_getField(){return(this.textMode)?this.editorText:this.editorHtml.contentWindow.document.body;};NLHtmlEditor.prototype.setupEventHandlers=function NLHtmlEditor_setupEventHandlers(){if(this.textMode){this.editorText.onblur=new Function("var editor = getHtmlEditor('"+this.name+"'); editor.setValue( editor.getDisplayValue() )");this.editorText.onfocus=new Function("getHtmlEditor('"+this.name+"').textareaOnfocus()");}else{if(document.addEventListener){this.editorHtml.contentWindow.document.onkeydown=null;this.editorHtml.contentWindow.document.onkeypress=null;this.editorHtml.contentWindow.document.onkeyup=null;this.editorHtml.contentWindow.document.onmousedown=null;this.editorHtml.contentWindow.document.onmouseup=null;this.editorHtml.contentWindow.document.body.oncut=null;this.editorHtml.contentWindow.document.body.onpaste=null;this.editorHtml.contentWindow.document.onfocus=null;this.editorHtml.contentWindow.document.addEventListener("keydown",function(a){return this.handleEditorEvent("keydown",a);}.bind(this),false);this.editorHtml.contentWindow.document.addEventListener("keypress",function(a){return this.handleEditorEvent("keypress",a);}.bind(this),false);this.editorHtml.contentWindow.document.addEventListener("mouseup",function(a){return this.handleEditorEvent("mouseup",a);}.bind(this),false);this.editorHtml.contentWindow.document.addEventListener("mousedown",function(a){return this.handleEditorEvent("mousedown",a);}.bind(this),false);this.editorHtml.contentWindow.document.addEventListener("cut",function(a){this.scheduleEditorEventHandler("cut",100,a);}.bind(this),false);this.editorHtml.contentWindow.document.addEventListener("paste",function(a){this.scheduleEditorEventHandler("paste",100,a);}.bind(this),false);this.editorHtml.contentWindow.document.addEventListener("focus",function(a){this.iFrameOnfocus();}.bind(this),true);}else{this.editorHtml.contentWindow.document.onkeydown=new Function("getHtmlEditor('"+this.name+"').handleEditorEvent('keydown')");this.editorHtml.contentWindow.document.onkeypress=new Function("getHtmlEditor('"+this.name+"').handleEditorEvent('keypress')");this.editorHtml.contentWindow.document.onkeyup=new Function("getHtmlEditor('"+this.name+"').handleEditorEvent('keyup')");this.editorHtml.contentWindow.document.onmousedown=new Function("getHtmlEditor('"+this.name+"').handleEditorEvent('mousedown')");this.editorHtml.contentWindow.document.onmouseup=new Function("getHtmlEditor('"+this.name+"').handleEditorEvent('mouseup')");this.editorHtml.contentWindow.document.body.oncut=new Function("getHtmlEditor('"+this.name+"').scheduleEditorEventHandler( 'cut', 100 )");this.editorHtml.contentWindow.document.body.onpaste=new Function("getHtmlEditor('"+this.name+"').scheduleEditorEventHandler( 'paste', 100 )");this.editorHtml.onfocus=new Function("getHtmlEditor('"+this.name+"').iFrameOnfocus()");this.editorHtml.onblur=new Function("getHtmlEditor('"+this.name+"').iFrameOnblur();");}}};NLHtmlEditor.prototype.iFrameOnfocus=function NLHtmlEditor_iFrameOnfocus(){var a=this.editorHtml.contentWindow.document;a.body.contentEditable=true;if(a.body.innerHTML.indexOf(NLHTMLEDITOR_FORMATTED_HELPER_TEXT)>-1){a.body.innerHTML="<div><br></div>";a.body.focus();}};NLHtmlEditor.prototype.iFrameOnblur=function NLHtmlEditor_iFrameOnblur(){var a=this.editorHtml.contentWindow.document;a.body.contentEditable=false;return true;};NLHtmlEditor.prototype.textareaOnfocus=function NLHtmlEditor_textareaOnfocus(){if(this.editorText.value==NLHTMLEDITOR_SOURCECODE_HELPER_TEXT){this.editorText.style.fontFamily="";this.editorText.style.color="";this.editorText.value="";}};NLHtmlEditor.prototype.setFocus=function NLHtmlEditor_setFocus(){if(this.disabled){return;}if(this.textMode){setTimeout(new Function("getHtmlEditor('"+this.name+"').editorText.focus()"),100);}else{setTimeout(new Function("getHtmlEditor('"+this.name+"').editorHtml.contentWindow.document.body.focus()"),100);}};function insertHtmlValue(b,f){var c=getHtmlEditor(b);if(c!=null){c.insertValue(f,false);return;}var e=document.getElementById(b);if(e){var d=e.textLength;var g=e.selectionStart;var a=e.selectionEnd;if(a==1||a==2){a=d;}e.value=e.value.substring(0,g)+f+e.value.substr(a,d);}}function setHtmlFieldValue(a,d,c){if(a==null){return;}if(c==null){c=window;}var b=c.getHtmlEditor(a.name);if(b!=null){b.setValue(d,true);}else{a.value=d;}}function disableHtmlField(c,a){if(a==null){return;}var b=getHtmlEditor(a.name);if(b!=null){b.setDisabled(c);}else{a.disabled=c;}}function resetHtmlEditors(b){if(window.htmleditors!=null){for(i in window.htmleditors){var a=getHtmlEditor(String(i));if(b==null||a.hddn.form==b){a.resetEditor();}}}}function getHtmlEditor(a){return window.htmleditors[a];}function getSelectedElement(b){var a=null;if(b.document.selection){selection=b.document.selection;range=selection.createRange();try{a=range.parentElement();}catch(c){return null;}}else{try{selection=b.getSelection();range=selection.getRangeAt(0);}catch(c){return null;}a=range.commonAncestorContainer;}return a;}function updateQuickDateSelector(d){var c=document.getElementById("quickdateselector");if(c!=null){var e=c.onchange;c.onchange=null;var b=getDropdown(c);if(b!=null){var a=b.getIndexForValue(d);b.setIndex(a);}c.onchange=e;}}function statusMessage(a,b){if(a==null){a=2000;}window.status=b;setTimeout("window.status = ''",a);}function NLAccelMenu_cancelCurrentTimer(){var a=window.accelMenuDiv;if(a&&a.nTimerId){clearTimeout(a.nTimerId);a.nTimerId=0;}}function NLAccelMenu_closeCurrentMenu(){var b=window.accelMenuDiv;if(b){var a=b.getAttribute("bMachine")=="T";NLAccelMenu_cancelCurrentTimer();b=b.parentNode.removeChild(b);b.origParent.appendChild(b);b.style.position="relative";b.style.top=b.style.origTop;b.style.left=b.style.origLeft;b.style.zIndex="";nlRemoveCanvas(b);b.style.display="none";b.img.src="/images/nav/popupselectup"+(a?"":"2")+".gif";}window.accelMenuDiv=null;}function NLAccelMenu_onMouseOut(a){var b=window.accelMenuDiv;if(b){b.nTimerId=setTimeout(function(){NLAccelMenu_closeCurrentMenu();},200);}}function NLAccelMenu_onMouseOver(a){NLAccelMenu_cancelCurrentTimer();}function NLAccelMenu_onButtonClick(b,c,f,d){var e=document.getElementById(c);e.setAttribute("bMachine",f?"T":"F");d.src="/images/nav/popupselectdown"+(f?"":"2")+".gif";e.img=d;NLAccelMenu_closeCurrentMenu();window.accelMenuDiv=e;e.parentNode.style.display="inline";e.style.display="";var a=e.firstChild.offsetWidth;e.style.width=a;e.style.display="block";e.parentNode.style.zIndex="9000";NLAccelMenu_positionDIV(e);e.style.zIndex=e.parentNode.style.zIndex;e.origParent=e.parentNode;e.style.origLeft=e.style.left;e.style.origTop=e.style.top;offsetY=findPosY(e);offsetX=findPosX(e);e.style.position="absolute";e=e.parentNode.removeChild(e);document.body.insertBefore(e,document.body.firstChild);e.style.left=offsetX;e.style.top=offsetY;nlInsertCanvas(e);if(e.firstChild.firstChild){e.firstChild.firstChild.style.borderWidth="0px";}}function NLAccelMenu_positionDIV(e){var d=findPosY(e.img);var c=d+17;var a=getDocumentHeight();var b=parseInt(e.offsetHeight);if(c+b>a){d=-b;}else{d=17;}e.style.top=d;}function NLAccelMenuButton_onMouseDown(a){a.firstChild.onclick();}function NLAccelMenuButton_onMouseOver(a){a.className="btnmenuentryover";}function NLAccelMenuButton_onMouseOut(a){a.className="btnmenuentry";}var burstTimer=0;var bursting=-1;var newBGImageMap=new Array();newBGImageMap[0]="/images/icons/dashboard/top_bkg.gif";newBGImageMap[1]="/images/icons/dashboard/left_edge_bkg.gif";newBGImageMap[2]="/images/icons/dashboard/right_edge_bkg.gif";newBGImageMap[3]="/images/icons/dashboard/bottom_edge_bkg.gif";function showBurstRollover(h,d,b,p){try{clearTimeout(burstTimer);if(bursting==b+"_"+p){return;}if(h!=null&&d!=null&&d.length>0){var m=findPosY(h);var c=findPosX(h);var n=document.getElementById("rptsnap"+p);if(n!=null){m-=n.scrollTop;}var a=document.getElementById("burst_div_"+p);if(a!=null){if(a.getAttribute("_setBG")!="T"){var l=a.firstChild.getElementsByTagName("TD");for(var g=0;g<l.length;g++){if(l[g].getAttribute("_resbg")!=null){var o=Number(l[g].getAttribute("_resbg"));l[g].style.backgroundImage="url("+newBGImageMap[o]+")";}}a.setAttribute("_setBG","T");}dateSpan=document.getElementById("date_span_"+p);dateSpan.removeChild(dateSpan.firstChild);var f=document.createTextNode(d);dateSpan.appendChild(f);a.style.display="block";a.style.position="absolute";a.style.top=m+8;a.style.left=c-32;bursting=b+"_"+p;}}}catch(k){}}function removeBurst(a){burstTimer=setTimeout(new Function("removeBurstNow('"+a+"');"),200);}function removeBurstNow(a){var b=document.getElementById("burst_div_"+a);if(b!=null){b.style.display="none";bursting=-1;}}function expandCollapseNode(m,a){var h=document.getElementById(m+"_top");var c=document.getElementById(m+"_total");if(h==null||c==null){return;}var g=findClassUp(h,"enhtable");var l=h.getAttribute("_nototals")=="T";var n=g.rows[h.rowIndex+1];var e=n.style.display==""||n.style.display=="block"?"none":"";setHrefToggleLabel(e,a);if(!l){if(e!="none"){expandNodeRestoreData(h);}else{collapseNodeCopyData(h,c);}}var k=null;var f=0;for(var d=h.rowIndex+1;d<=c.rowIndex;d++){k=g.rows[d];if(f>0&&k.id==null){continue;}var b=f;if(e!="none"&&k.id!=null){if(k.id.substring(k.id.length-4)=="_top"&&k.firstChild.firstChild.getAttribute("_state")=="plus"){f++;}else{if(k.id.substring(k.id.length-6)=="_total"&&document.getElementById(k.id.substring(0,k.id.length-6)+"_top").firstChild.firstChild.getAttribute("_state")=="plus"){f=Math.max(f-1,0);}}if(b>0){continue;}}if(!(e!="none"&&l&&k.id.substring(k.id.length-6)=="_total")){k.style.display=e;}}}function setHrefToggleLabel(b,a){if(b!="none"){a.firstChild.src="/images/nav/reporting/tree_minus.gif";a.setAttribute("_state","minus");}else{a.firstChild.src="/images/nav/reporting/tree_plus.gif";a.setAttribute("_state","plus");}}function expandNodeRestoreData(a){if(a!=null){for(var b=1;b<a.cells.length;b++){if(a.cells[b].getAttribute("_orightml")!=null&&a.cells[b].getAttribute("_orightml").length>1){a.cells[b].innerHTML=a.cells[b].getAttribute("_orightml");a.cells[b].className=a.cells[b].getAttribute("_origclass");a.cells[b].align=a.cells[b].getAttribute("_origalign");}else{a.cells[b].innerHTML="&nbsp;";}}}}function collapseNodeCopyData(b,a){if(a!=null&&b!=null){for(var c=1;c<a.cells.length;c++){b.cells[c].setAttribute("_orightml",b.cells[c].innerHTML);b.cells[c].setAttribute("_origclass",b.cells[c].className);b.cells[c].setAttribute("_origalign",b.cells[c].align);b.cells[c].align=a.cells[c].align;b.cells[c].className=a.cells[c].className;b.cells[c].innerHTML=a.cells[c].innerHTML;}}}function manageScrollDiv(d,c){var b=document.getElementById(d);if(b!=null){if(b.className=="scrollarea"&&b.scrollHeight>325){return;}var a=false;if(b.offsetHeight>325){b.className="scrollarea";b.style.height="325";document.getElementById("scrl_line_"+d).style.display="";a=true;}else{b.className="";b.style.height="";document.getElementById("scrl_line_"+d).style.display="none";}if(c!=null&&c!=-1){resetLabelRowCellSizes(document.getElementById("enhlabel"+c),b.firstChild,a);}}}function resetLabelRowCellSizes(k,a,q){if(k!=null&&a!=null){clearAllWidths(a);var f=a.rows[0];f.style.display="";var l=a.rows[1];if(l==null||l.cells.length<=1){f.style.display="none";return;}var d=a.offsetWidth-(q?17:0);var c=k.parentNode.parentNode.offsetWidth;var e=new Array();for(var b=0;b<l.cells.length;b++){e[b]=l.cells[b].offsetWidth;}for(var h=(k.cells.length-1);h>=0;h--){var s=null;var r=h==(k.cells.length-1);var n=k.cells.length<=2||h>1;if(r){if(q){k.cells[h].style.paddingRight="16px";}else{k.cells[h].style.paddingRight="";}}var o=(((e[h]+(r&&q?17:0))/c)*100);var m=((e[h]/d)*100);k.cells[h].style.width=n?o+"%":(e[h]+(r&&q?17:0));for(var g=0;g<a.rows.length;g++){s=a.rows[g];if(s.cells[h]==null||s.id=="_totallinerow"){continue;}s.cells[h].style.width=n?m+"%":e[h];}}f.style.display="none";}}function clearAllWidths(c){for(var b=0;b<c.rows.length;b++){for(var a=0;a<c.rows[b].cells.length;a++){c.rows[b].cells[a].style.width="";}}}var menuCtx=null;var menuCtxTarget=null;document.oncontextmenu=function(a){if(menuCtx&&window.isinited){menuCtxTarget=getEventTarget(a);menuCtx.menu.showHide(true);return false;}else{return true;}};function NLContextMenu(b){var d=new Array();for(i=0;i<b.length;i++){d[i]=[b[i][0],"javascript:"+b[i][1]+"; return false;",""];}this.sParams=d;var a="contextmenu";var c=this.menu=new NLMenu(a,d,0,null);menus[a]=c;menuTimers[a]=0;c.setBackgroundColor("2AA4C6");menuCtx=this;}var iMAX_SUGGESTIONS=25;var popupsuggesttimer=0;var hidesuggesttimer=0;var loadingimagetimer=0;var hideloadingimagetimer=0;var popupAutoSuggest=null;var autoSuggestSeqNum=0;var highestSeqNumReturned=0;function NLPopupAutoSuggest(){this.inputfield;this.mapkey;this.uniqueuserkey;this.initialLastUserVal;this.fieldname;this.fieldname_hidden;this.fieldvalue;this.optionmasterfield;this.xPos;this.yPos;this.suggestiondiv;this.visible=false;this.currentcell;this.bUbersearch=false;this.bmultiselect=false;this.bautoselectsingleresult=true;this.bOnlyOneResult=false;}NLPopupAutoSuggest.prototype.setAttributes=function NLPopupAutoSuggest_setAttributes(b,a,c,d){this.inputfield=b;this.mapkey=a;this.fieldname=b.name;this.fieldname_hidden=this.fieldname.indexOf("_display")>0?this.fieldname.substring(0,this.fieldname.indexOf("_display")):this.fieldname;this.fieldvalue=b.value;this.optionmasterfields=d;this.bautoselectsingleresult=c;this.xPos=findPosX(b);this.yPos=findPosY(b);this.currentcell=-1;this.bUbersearch=a=="uberautosuggest";this.bmultiselect=NLPopupAutoSuggest_isMultiSelect(b);if(isValEmpty(this.uniqueuserkey)){this.uniqueuserkey=b.getAttribute("uniqueuserkey");this.initialLastUserVal=GetCookie("lastUser")+"_"+GetCookie("JSESSIONID");}};function constructSuggestionBoxFromResponse(response){if(popupAutoSuggest!=null){hideAutoSuggestLoadingImage();var objJSON,autoFillResults;try{objJSON=eval("("+response.getBody()+")");var seqNum=parseInt(objJSON.circid);if(highestSeqNumReturned>seqNum){return;}highestSeqNumReturned=seqNum;if(objJSON.uniqueuserkey!=popupAutoSuggest.uniqueuserkey){logAutoSuggestSessionError(popupAutoSuggest,objJSON.uniqueuserkey);return;}autoFillResults=objJSON.autofill;}catch(e){return;}if(autoFillResults.length>0){var i;var sHtml=new StringBuffer();sHtml.append("<table cellpadding=0 cellspacing=0 border=0><tbody>");for(i=0;i<autoFillResults.length;i++){sHtml.append("<tr>");popupAutoSuggest.constructCell(sHtml,autoFillResults[i],popupAutoSuggest.fieldname_hidden);sHtml.append("</tr>");}if(i==iMAX_SUGGESTIONS){sHtml.append("<tr>");popupAutoSuggest.constructMoreCell(sHtml,popupAutoSuggest.fieldname_hidden,popupAutoSuggest.fieldvalue);sHtml.append("</tr>");}sHtml.append("</tbody></table>");popupAutoSuggest.showSuggestionBox(sHtml.toString());if(popupAutoSuggest.bautoselectsingleresult&&i==1){popupAutoSuggest.selectNextCell();popupAutoSuggest.bOnlyOneResult=true;}}else{popupAutoSuggest.showSuggestionBox(getAutoSuggestMessageHTML("No results found"));hidesuggesttimer=setTimeout("popupAutoSuggest.hideSuggestionBox()",2000);}}}function logAutoSuggestSessionError(b,c){var d=b.uniqueuserkey+"%20|%20"+b.initialLastUserVal;var a=c+"%20|%20"+GetCookie("lastUser")+"_"+GetCookie("JSESSIONID");parent.document.location="/core/pages/logAutoSuggestSessionError.nl?olduserkey="+d+"&newuserkey="+a;}function getAutoSuggestMessageHTML(a){var b=new StringBuffer();b.append("<table cellpadding=0 cellspacing=0 border=0><tbody>");b.append("<tr><td style='padding:2' class=tinygraytext>"+a+"</td></tr>");b.append("</tbody></table>");return b.toString();}function hideAutoSuggestLoadingImage(){clearTimeout(loadingimagetimer);clearTimeout(hideloadingimagetimer);if(popupAutoSuggest!=null){popupAutoSuggest.inputfield.style.backgroundImage="";}}function showAutoSuggestRefineSearchMessage(){if(popupAutoSuggest!=null){popupAutoSuggest.showSuggestionBox(getAutoSuggestMessageHTML("Please enter more characters or click Go"));hidesuggesttimer=setTimeout("popupAutoSuggest.hideSuggestionBox()",4000);}}function showAutoSuggestLoadingImage(){clearTimeout(hideloadingimagetimer);if(popupAutoSuggest!=null){popupAutoSuggest.inputfield.style.backgroundImage="url(/images/help/animated_loading.gif)";popupAutoSuggest.inputfield.style.backgroundRepeat="no-repeat";popupAutoSuggest.inputfield.style.backgroundPosition="100% 1";hideloadingimagetimer=setTimeout("hideAutoSuggestLoadingImage(); showAutoSuggestRefineSearchMessage();",10*1000);}}NLPopupAutoSuggest.prototype.constructSuggestionBox=function NLPopupAutoSuggest_constructSuggestionBox(){if(this.fieldvalue!=null&&trim(this.fieldvalue).length>0){try{var d="cur_val="+encode(this.bmultiselect?getCurrentMultiSelectUserInputValue(this.inputfield):this.fieldvalue);if(this.optionmasterfields!=null){for(var a in this.optionmasterfields){d+="&si_"+a+"="+encode(getSelectValue(this.optionmasterfields[a]));}}var b="/app/common/autosuggest.nl?mapkey="+this.mapkey+"&circid="+(++autoSuggestSeqNum)+"&"+d;loadingimagetimer=setTimeout("showAutoSuggestLoadingImage()",1000);nlXMLRequestURL(b,d,null,new Function("response","constructSuggestionBoxFromResponse(response);"),true);}catch(c){}}};NLPopupAutoSuggest.prototype.constructCell=function NLPopupAutoSuggest_constructCell(b,d,a){if(this.bUbersearch){var c=(d.bedit=="T");b.append("<td nowrap style='padding:1 3 2 3;' class='autosuggcell text'>");b.append("<table cellpadding=0 cellspacing=0 border=0 width='100%'><tr>");b.append("<td nowrap>");b.append('<a class=smalltextnolink href="'+d.key+"\" onclick='popupAutoSuggest.hideSuggestionBox(true); return true;'>");if(!isValEmpty(d.descr)){b.append("<span>"+d.sname+"</span><span style='color:#666666'><i>&nbsp;("+d.descr+")</i></span>");}else{b.append(d.sname);}b.append("</a>");b.append("</td>");b.append("<td style='padding-left:7; padding-right:2' class=text align=right valign=bottom>");b.append("<span style='visibility:hidden'>");if(!isValEmpty(d.dashurl)){b.append("<a"+(c?" style='position:relative; top:2'":"")+" href='"+d.dashurl+"' onclick='popupAutoSuggest.hideSuggestionBox(true); return true;' class=text title='View Dashboard'>");b.append("<img border=0 src='/images/icons/dashboard/dashboard.gif' width=14 height=12>");b.append("</a>");if(c){b.append("&nbsp;&nbsp;");}}b.append('<a href="'+d.key+"&e=T\" onclick='popupAutoSuggest.hideSuggestionBox(true); return true;' class=textwhite"+(!c?" style='display:none'":"")+">Edit</a>");b.append("</span>");b.append("</td>");b.append("</tr>");b.append("</table>");b.append("</td>");}else{b.append("<td nowrap style='padding:1 3 2 3; cursor:hand;' class='autosuggcell text' ");b.append(" onmousedown='popupAutoSuggest.setValueFromSuggestion(\""+a+'", "'+d.key+"\", this, event); return false;'>");b.append(d.sname);b.append("</td>");}};NLPopupAutoSuggest.prototype.constructMoreCell=function NLPopupAutoSuggest_constructMoreCell(c,b,a){c.append("<td nowrap style='cursor:pointer; padding:1 3 2 3; font-style:italic;' class='autosuggcell text' ");c.append('onmousedown="NLPopupAutoSuggest_hidePopupSuggestion(); ');if(this.bUbersearch){c.append("popupAutoSuggest.runMoreUbersearch();");}else{var d=a.replace(/\'/g,"\\'").replace(/\"/g,"\\\\&quot;");c.append("NLPopupSelect_runMoreSearch('"+b+"', '"+d+"');");}c.append(' return false;">');c.append("More...");c.append("</td>");};NLPopupAutoSuggest.prototype.runMoreUbersearch=function NLPopupAutoSuggest_runMoreUbersearch(){document.getElementById("_searchSubmitter").onclick();};NLPopupAutoSuggest.prototype.selectCell=function NLPopupAutoSuggest_selectCell(a){if(a!=null){this.unSelectCurrentCell();a.className="dropdownSelected";if(this.bUbersearch&&a.firstChild&&a.firstChild.rows){setAutoSuggestCellProperties(a,true);}else{if(a.childNodes.length>1){a.childNodes[1].style.color="#EEEEEE";}}this.currentcell=Number(a.parentNode.rowIndex);}};NLPopupAutoSuggest.prototype.unSelectCell=function NLPopupAutoSuggest_unSelectCell(a){if(a!=null){a.className="autosuggcell text";if(this.bUbersearch&&a.firstChild&&a.firstChild.rows){setAutoSuggestCellProperties(a,false);}else{if(a.childNodes.length>1){a.childNodes[1].style.color="#666666";}}this.currentcell=-1;}};function setAutoSuggestCellProperties(d,c){var a=d.firstChild.rows[0].cells[0];var b=d.firstChild.rows[0].cells[1];a.firstChild.className=c?"textwhitenolink":"smalltextnolink";if(a.firstChild.childNodes.length>1){a.firstChild.childNodes[1].style.color=c?"#EEEEEE":"#666666";}b.firstChild.style.visibility=c?"visible":"hidden";}NLPopupAutoSuggest.prototype.selectCellByIndex=function NLPopupAutoSuggest_selectCellByIndex(b){var a=this.getCell(b);this.selectCell(a);};NLPopupAutoSuggest.prototype.unSelectCurrentCell=function NLPopupAutoSuggest_unSelectCurrentCell(){if(this.currentcell>=0){var a=this.getCell(this.currentcell);this.unSelectCell(a);}};NLPopupAutoSuggest.prototype.doUberSearchClick=function NLPopupAutoSuggest_doUberSearchClick(){var a=this.getCell(this.currentcell);if(a!=null&&a.firstChild&&a.firstChild.rows){var c=a.firstChild.rows[0].cells[0];c.firstChild.onclick();var b=c.firstChild.href;if(this.bOnlyOneResult&&!isValEmpty(this.fieldvalue)){if(this.fieldvalue.toUpperCase().indexOf("E ")==0||isUpperCase(this.fieldvalue.charAt(0))){b=addParamToURL(b,"e","T",true);}if(this.fieldvalue.indexOf("::")>0||this.fieldvalue.indexOf("^")>0){nlOpenWindow(b,"uberres2");}else{document.location=b;}}else{document.location=b;}}else{a.onmousedown();}};NLPopupAutoSuggest.prototype.getTableRows=function NLPopupAutoSuggest_getTableRows(){return this.suggestiondiv.firstChild.firstChild.childNodes;};NLPopupAutoSuggest.prototype.getCell=function NLPopupAutoSuggest_getCell(a){if(a>=0&&a<(this.getTableRows()).length){return this.getTableRows()[a].firstChild;}else{return null;}};NLPopupAutoSuggest.prototype.selectNextCell=function NLPopupAutoSuggest_selectNextCell(){var a=this.currentcell;this.unSelectCurrentCell();if(a>=0){if(++a>this.getTableRows().length-1){a=0;}this.selectCellByIndex(a);}else{this.selectCellByIndex(0);}};NLPopupAutoSuggest.prototype.selectPreviousCell=function NLPopupAutoSuggest_selectPreviousCell(){var a=this.currentcell;this.unSelectCurrentCell();if(a>=1){this.selectCellByIndex(a-1);}else{this.selectCellByIndex(this.getTableRows().length-1);}};NLPopupAutoSuggest.prototype.getSuggestionBoxDiv=function NLPopupAutoSuggest_getSuggestionBoxDiv(){if(this.suggestiondiv==null){this.suggestiondiv=document.createElement("DIV");this.suggestiondiv.style.position="absolute";this.suggestiondiv.style.backgroundColor="#FFFFFF";this.suggestiondiv.className="popupsuggest";this.suggestiondiv.style.borderColor="#999999";this.suggestiondiv.style.borderStyle="solid";this.suggestiondiv.style.borderWidth="1 1 1 1";this.suggestiondiv.style.display="none";this.suggestiondiv.style.zIndex="2";document.body.appendChild(this.suggestiondiv);}return this.suggestiondiv;};NLPopupAutoSuggest.prototype.showSuggestionBox=function NLPopupAutoSuggest_showSuggestionBox(a){clearTimeout(hidesuggesttimer);var b=this.getSuggestionBoxDiv();b.innerHTML=a;b.style.display="";this.visible=true;this.positionSuggestionBox();};NLPopupAutoSuggest.prototype.positionSuggestionBox=function NLPopupAutoSuggest_positionSuggestionBox(){var c=this.getSuggestionBoxDiv();if(c.offsetWidth>400){c.style.overflow="hidden";c.style.width=Math.min((getDocumentClientWidth()-100),c.offsetWidth);}var b=this.xPos+(this.bmultiselect?1:0);var a=this.yPos+this.inputfield.offsetHeight-1;if(c.offsetWidth<this.inputfield.offsetWidth){c.firstChild.style.width=this.inputfield.offsetWidth-2;}if(((this.yPos+this.inputfield.offsetHeight-1+c.offsetHeight)>getDocumentHeight())&&(this.yPos>(getDocumentHeight()-this.yPos))){a=this.yPos-c.offsetHeight+(this.bmultiselect?1:0);}if((this.xPos+c.offsetWidth+10)>getDocumentWidth()){b=this.xPos-(c.offsetWidth-this.inputfield.offsetWidth);}c.style.top=a;c.style.left=b;};NLPopupAutoSuggest.prototype.hideSuggestionBox=function NLPopupAutoSuggest_hideSuggestionBox(a){if(this.visible){clearTimeout(popupsuggesttimer);this.suggestiondiv.style.display="none";this.suggestiondiv.style.width="";this.suggestiondiv.style.overflow="";this.visible=false;if(a){this.inputfield.value="";}}};NLPopupAutoSuggest.prototype.addMultipleSelectValue=function NLPopupAutoSuggest_addMultipleSelectValue(d,c){var a=getFormElement(this.inputfield.form,this.fieldname);var b=getFormElement(this.inputfield.form,this.fieldname_hidden);addMultiSelectValue(b,d,c);a.value+="\n";setSelectionRange(a,a.value.length,a.value.length);};NLPopupAutoSuggest.prototype.setValueFromSuggestion=function NLPopupAutoSuggest_setValueFromSuggestion(d,g,c,h){setEventPreventDefault(h);setEventCancelBubble(h);NLPopupAutoSuggest_hidePopupSuggestion();if(this.bUbersearch){if(this.fieldvalue.indexOf("::")>0||this.fieldvalue.indexOf("^")>0){nlOpenWindow(g,"uberres2");}else{document.location=g;this.inputfield.value="";}}else{var b=getFormElement(this.inputfield.form,this.fieldname);if(b!=null){var f=c.innerHTML.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");var a=getFormElement(this.inputfield.form,this.fieldname_hidden);if(this.bmultiselect){this.addMultipleSelectValue(g,f);b.haschanged=true;b.isvalid=true;if(a.onchange){a.onchange();}}else{b.value=f;var e=a.value;a.value=g;if(a.onchange){if(a.onchange()==false){a.value=e;b.value=b.getAttribute("previousvalue");}else{b.haschanged=true;b.isvalid=true;b.setAttribute("previousvalue",b.value);}}}NLPopupSelect_removeLoadingMessage();}}};function NLPopupAutoSuggest_makePopupSuggestion(b,a,c,d){if(popupAutoSuggest==null){popupAutoSuggest=new NLPopupAutoSuggest();}popupAutoSuggest.setAttributes(b,a,c,d);clearTimeout(popupsuggesttimer);popupsuggesttimer=setTimeout("popupAutoSuggest.constructSuggestionBox()",popupAutoSuggest.bUbersearch?250:200);}function autoSuggestOnMouseMove(a){if(popupAutoSuggest!=null){var b=findClassUp(getEventTarget(a),"autosuggcell text");if(b!=null){popupAutoSuggest.selectCell(b);}}}function NLPopupAutoSuggest_onMouseDown(a){if(popupAutoSuggest!=null){clearTimeout(popupsuggesttimer);if(popupAutoSuggest.visible){var b=findClassUp(getEventTarget(a),"popupsuggest");if(b==null){popupAutoSuggest.hideSuggestionBox();}}}}function NLPopupAutoSuggest_onKeyDown(a){try{if(popupAutoSuggest!=null&&popupAutoSuggest.visible){var b=getEventKeypress(a);if(b==40){popupAutoSuggest.selectNextCell();}else{if(b==38){popupAutoSuggest.selectPreviousCell();}else{if((b==13||b==9)&&popupAutoSuggest.currentcell>=0){if(popupAutoSuggest.bUbersearch){popupAutoSuggest.doUberSearchClick();}else{popupAutoSuggest.getCell(popupAutoSuggest.currentcell).onmousedown();}}}}}}catch(c){}}function NLPopupAutoSuggest_ignoreKeyStrokes(a){if(popupAutoSuggest!=null&&popupAutoSuggest.visible){var b=getEventKeypress(a);if(b==40||b==38||(popupAutoSuggest.currentcell>=0&&(b==13||b==9))){return true;}}return false;}function NLPopupAutoSuggest_isMultiSelect(a){return a.getAttribute("bmultiautosuggest")=="T";}function NLPopupAutoSuggest_handleKeyStroke(g,l,m,a,e){var h=NLPopupAutoSuggest_isMultiSelect(g)?getCurrentMultiSelectUserInputValue(g):g.value;var c=getEventKeypress(m);if(c==37||c==39){return false;}var b=trim(h);var k=b.length;var f=l=="uberautosuggest";if(f){var d=b.indexOf(":");if(d>0){k-=(d+1);}}if((k<=2&&b.charCodeAt(0)<2048&&(h!="%"||f))||c==13||c==9){NLPopupAutoSuggest_hidePopupSuggestion();}else{NLPopupAutoSuggest_makePopupSuggestion(g,l,a,e);}}function NLPopupAutoSuggest_hidePopupSuggestion(){clearTimeout(popupsuggesttimer);if(popupAutoSuggest!=null){popupAutoSuggest.hideSuggestionBox();}}function NLPopupSelect_runMoreSearch(fieldname,sValue){eval("Search"+fieldname+'("'+sValue+'")');}function NLPopupSelect_positionDIV(){var div=window.popupDIV;var bListOnly=div.getAttribute("bListOnly")=="T";var bActualMultiSelect=div.getAttribute("bMultiselect")=="T"&&!bListOnly;var bIsMultiButton=div.getAttribute("bIsMultiButton")=="T";var btn=div.getAttribute("displayField")!=null?NLPopupSelect_getDisplayField(div.getAttribute("displayField")):NLPopupSelect_getLaunchButton(div.getAttribute("launchbutton"),bIsMultiButton,bListOnly);var x;var y;if(div.getAttribute("bPositionWithMachine")=="T"&&div.getAttribute("machineName")!=null){var table=eval(div.getAttribute("machineName")+"_machine.tableobj;");var machine=table.machine;var column=0;for(var i=0;i<machine.countFormElements();i++){var elem=machine.getFormElement(i);if(elem!=null&&(elem.name==window.popupDIV.getAttribute("fieldName")||elem.name==window.popupDIV.getAttribute("fieldName")+"_display")){break;}if(elem.type!="hidden"&&machine.getFormElementLabel(i)!=null){column++;}}var cell=table.rows[(machine.currentRowNum)].cells[column];x=findPosX(cell);y=findPosY(cell)+5;}else{x=btn==null?Math.max(lastX,10):findPosX(btn)+(bIsMultiButton?1:0);y=btn==null?Math.max(lastY,10):findPosY(btn)+(bIsMultiButton?1:0);}var scrollTopOffset=0;var scrollLeftOffset=0;if(btn!=null){var scrollDiv=findClassUp(btn,"scrollarea");if(scrollDiv!=null){scrollTopOffset=scrollDiv.scrollTop;scrollLeftOffset=scrollDiv.scrollLeft;}}var fx=x-scrollLeftOffset;var fy=y+15-scrollTopOffset;var iDocHeight=getDocumentHeight();var iDocWidth=getDocumentWidth()-40;if(window.opener&&(iDocHeight<=250||iDocWidth<=510)){window.resizeTo(Math.max(600,iDocWidth),Math.max(350,iDocHeight));iDocHeight=getDocumentHeight();iDocWidth=getDocumentWidth()-40;}var innerDiv=document.getElementById("inner_popup_div");var innerTable=innerDiv.firstChild;var iDivHeight=parseInt(div.offsetHeight);var iMaxDivHeight=325;if(iDivHeight>iMaxDivHeight||iDivHeight>=iDocHeight){var iSelectListHeight=Math.min(300,Math.abs(iDocHeight-150));innerDiv.style.height=iSelectListHeight;if(bActualMultiSelect){var multiSelectListDiv=document.getElementById("popup_select_list");multiSelectListDiv.style.height=iSelectListHeight;}if(!isIE&&bActualMultiSelect){document.getElementById("popup_outer_table").style.height=iSelectListHeight+20;}}iDivHeight=parseInt(div.offsetHeight);var bMultiColumn=innerTable.rows[0].cells.length>2;if(bMultiColumn){if(bActualMultiSelect){if(isIE){var w=Math.min(850,iDocWidth);div.style.width=w;innerDiv.style.width=Math.floor((w/3)*2);document.getElementById("lower_header_label").width=Math.floor((w/3)*2);}else{var listWidth=600;var selectionWidth=250;if(iDocWidth<(listWidth+selectionWidth)){var wFactor=Math.floor(iDocWidth/3);listWidth=2*wFactor;selectionWidth=wFactor;}innerDiv.style.width=listWidth;document.getElementById("lower_header_label").style.width=listWidth;document.getElementById("popup_select_list").style.width=selectionWidth;}}else{if(isIE){div.style.width=Math.min(650,iDocWidth);}else{innerDiv.style.width=Math.min(650,iDocWidth);}}}else{if(bActualMultiSelect){if(isIE){div.style.width=Math.min(600,iDocWidth);}else{var listWidth=600;if(iDocWidth<listWidth){listWidth=iDocWidth;}innerDiv.style.width=Math.floor(listWidth/2);document.getElementById("popup_select_list").style.width=Math.floor(listWidth/2);}}else{div.style.width=Math.min(350,iDocWidth);}}var iDivWidth=parseInt(div.offsetWidth);if(fy+iDivHeight>iDocHeight){if((y-scrollTopOffset-document.body.scrollTop-iDivHeight)>0){fy=y-scrollTopOffset-iDivHeight+1;}else{fy=parseInt((iDocHeight-iDivHeight)/2)+document.body.scrollTop;}if(div.getAttribute("bPositionWithMachine")=="T"){fy-=5;}}if((fx+iDivWidth)>iDocWidth){fx=getDocumentWidth()-iDivWidth;}if(fx+iDivWidth>iDocWidth){fx=getDocumentWidth()-iDivWidth-40;}if(fx<document.body.scrollLeft){fx=document.body.scrollLeft;}NLPopupSelect_removeLoadingMessage();div.style.left=fx;div.style.top=fy;}function NLPopupSelect_isLoadingOrSearching(){return window.popupDIV!=null||(window.popupDivLoadingMessage!=null&&document.getElementById(window.popupDivLoadingMessage.id)!=null);}function NLPopupSelect_removeLoadingMessage(){if(window.popupDivLoadingMessage!=null&&document.getElementById(window.popupDivLoadingMessage.id)!=null){document.body.removeChild(window.popupDivLoadingMessage);}NLPopupAutoSuggest_hidePopupSuggestion();}function NLPopupSelect_init(f,a,d,c,b){NLPopupSelect_close();var e=document.createElement("DIV");e.style.zIndex=1000;e.id="popup_outerdiv";e.className="popupouter";e.setAttribute("bIsMultiButton",(a?"T":"F"));e.setAttribute("bListOnly",(d?"T":"F"));e.setAttribute("bMultiselect",(f?"T":"F"));e.setAttribute("bPositionWithMachine",(c?"T":"F"));e.setAttribute("bShowQuantities",(b?"T":"F"));document.body.appendChild(e);window.popupDIV=e;if(isIE){window.attachEvent("onresize",new Function("NLPopupSelect_reposition();"));}}function NLPopupSelect_reposition(){if(window.popupDIV!=null){NLPopupSelect_positionDIV();}}function NLPopupSelect_open(g,e){if(window.popupDIV!=null){var a=window.popupDIV.getAttribute("bIsMultiButton")=="T";var d=window.popupDIV.getAttribute("bListOnly")=="T";var f=window.popupDIV.getAttribute("bMultiselect")=="T";window.popupDIV.setAttribute("fieldName",g);if(e!=null){window.popupDIV.setAttribute("machineName",e);}var c=g+(d?"_popup_listonly":a?"_popup_multi":"_popup_list");var b=NLPopupSelect_getLaunchButton(c,a,d);if(b!=null&&b.nodeName=="IMG"){window.popupDIV.setAttribute("launchbutton",c);if(!a&&!d){b.src="/images/forms/list2down.gif";}}if(f&&(typeof top.popupAnchorId!="undefined"&&top.popupAnchorId!=null&&document.getElementById(top.popupAnchorId)!=null)){window.popupDIV.setAttribute("displayField",top.popupAnchorId);}if(!f&&document.getElementById(g+"_display")!=null){window.popupDIV.setAttribute("displayField",(g+"_display"));}NLPopupSelect_positionDIV();window.NLPopupSelect_onClickHandler=NLPopupSelect_onClick;if(isIE){nlInsertCanvas(window.popupDIV);}}}function NLPopupSelect_getLaunchButton(d,a,c){var b=document.getElementById(d);if(b!=null&&!a&&!c){b=b.firstChild;}return b;}function NLPopupSelect_getDisplayField(a){return document.getElementById(a);}function NLPopupSelect_getDisplayFieldByValueInput(a){return getFormElement(a.form,a.name+"_display");}function NLPopupSelect_displayLoadingDiv(l,d,m){if(window.popupDivLoadingMessage==null){var b=document.createElement("DIV");b.id="popup_load_message";b.style.backgroundColor="white";b.style.position="absolute";b.style.borderWidth="1px";b.style.borderStyle="solid";b.style.borderColor="black";b.style.width="150";window.popupDivLoadingMessage=b;}var e=m==null?"Loading":m;window.popupDivLoadingMessage.innerHTML="<table width='100%'><tr><td valign='middle' class='texttablectr'>"+e+"</td></tr></table>";document.body.appendChild(window.popupDivLoadingMessage);var g=document.getElementById(l+"_display");var k=0;var f=0;var h=findClassUp(g,"scrollarea");var c=0;var a=0;if(h!=null){c=h.scrollTop;a=h.scrollLeft;}if(g!=null&&!d){k=findPosY(g)+g.offsetHeight-1-c;f=findPosX(g)-a;window.popupDivLoadingMessage.style.width=Math.max(75,g.offsetWidth);}else{k=Math.max(lastY,10)+document.body.scrollTop;f=Math.max(lastX,10)+document.body.scrollLeft;}if((k+30)>(getDocumentHeight()+document.body.scrollTop-10)){k=getDocumentHeight()+document.body.scrollTop-30;}if((f+150)>(getDocumentWidth()+document.body.scrollLeft-10)){f=getDocumentWidth()+document.body.scrollLeft-175;}window.popupDivLoadingMessage.style.left=f;window.popupDivLoadingMessage.style.top=k;window.popupDivLoadingMessage.style.zIndex=10;}function NLPopupSelect_onClick(d){var a=window.popupDIV;if(a!=null){var b=getEventTarget(d);var c=findClassUp(b,"popupouter");if(c==null||c!=a){NLPopupSelect_close();}}}function NLPopupSelect_close(b){if(window.popupDIV!=null){if(isIE){nlRemoveCanvas(window.popupDIV);}if(window.popupDIV.getAttribute("launchbutton")!=null&&window.popupDIV.getAttribute("bIsMultiButton")=="F"){var a=NLPopupSelect_getLaunchButton(window.popupDIV.getAttribute("launchbutton"),window.popupDIV.getAttribute("bIsMultiButton")=="T",window.popupDIV.getAttribute("bListOnly")=="T");if(a!=null){a.src="/images/forms/list2.gif";}}document.body.removeChild(window.popupDIV);if(b){var c=document.getElementById(window.popupDIV.getAttribute("fieldName")+"_display");if(c!=null){NLPopupSelect_focusNextInputField(c.name,c.form,true);}}window.popupDIV=null;}}function NLPopupSelect_getElementOrFromParent(a){var b=document.getElementById(a);if(b==null){b=parent.document.getElementById(a);}return b;}function NLPopupSelect_addSelection(d,b){var a=NLPopupSelect_getElementOrFromParent("popup_select_list");var c=a.firstChild;NLPopupSelect_addSelectionRow(d,b,c,a);}function NLPopupSelect_addSelectionRow(l,k,n,g){var e=window.popupDIV.getAttribute("bShowQuantities")=="T";var h=document.createElement("tr");h.className="multiselecttr";var c=document.createElement("td");c.className="text";c.style.width="14px";c.style.whitespace="nowrap";c.style.verticalAlign=e?"top":"middle";c.style.align="right";var f=document.createElement("a");f.href="javascript:void(0)";l=l.replace(/'/g,"\\'");f.onclick=new Function("NLPopupSelect_updateSelection('"+l+"','', false, this); return false;");var b=document.createElement("img");b.border="0";b.height=13;b.width=13;b.src="/images/forms/btn_x.gif";f.appendChild(b);c.appendChild(f);h.appendChild(c);c=document.createElement("td");c.className="text";if(e){c.style.verticalAlign="top";}var d=null;if(window.popupDIV.getAttribute("bShowQuantities")=="T"){var a=NLPopupSelect_getQuantityArray(k);if(a!=null){k=a[0];d=a[1];}}c.innerHTML=k;h.appendChild(c);if(window.popupDIV.getAttribute("bShowQuantities")=="T"){var m=document.createElement("td");m.className="text";m.style.whitespace="nowrap";m.style.verticalAlign="top";m.style.align="right";m.innerHTML="<input class=input type=text name='quantity_"+l+"' size=4 value='"+(d!=null?d:"")+"' onChange='NLPopupSelect_updateQuantity(\""+l+"\",this.value)'>";h.appendChild(m);}if(n.rows.length==(e?2:1)&&n.rows[e?1:0].className=="noselections"){n.deleteRow(e?1:0);}n.firstChild.appendChild(h);if(g!=null&&(g.scrollHeight>g.offsetHeight)){g.scrollTop=(g.scrollHeight-g.offsetHeight);}}function NLPopupSelect_getQuantityArray(c){var b=new RegExp("^\\s*(\\S+)\\s*\\(\\s*(-?\\d+\\.?\\d*)\\s*\\)\\s*$");var a=b.exec(c);if(a!=null){return new Array(a[1],a[2]);}else{return new Array(c,"");}}function NLPopupSelect_getQuantityText(a,b){if(isNaN(b)){return a;}else{return a+"("+b+")";}}function NLPopupSelect_updateQuantity(n,c){var b=NLPopupSelect_getElementOrFromParent("multisel_complete");var m=b.elements._mdata;var h=b.elements._mlabels;var g=trim(m.value),l=trim(h.value);var k=g.split(String.fromCharCode(5)),e=l.split(String.fromCharCode(5));var f=false;for(var d=0;d<k.length;d++){var a=NLPopupSelect_getQuantityArray(k[d]);if(a[0]==n){f=true;k[d]=NLPopupSelect_getQuantityText(n,c);e[d]=k[d];}}if(f){m.value=k.join(String.fromCharCode(5));h.value=e.join(String.fromCharCode(5));}}var nlpopupselect_removerow=null;function NLPopupSelect_removeSelection(d,c){var a=NLPopupSelect_getElementOrFromParent("popup_select_list").firstChild;var b=findClassUp(c,"multiselecttr");nlpopupselect_removerow=b;setTimeout("NLPopupSelect_removeRowAfterTimeout()",1);}function NLPopupSelect_removeRowAfterTimeout(){var a=nlpopupselect_removerow.parentNode.parentNode;nlpopupselect_removerow.parentNode.deleteRow(nlpopupselect_removerow.rowIndex);NLPopupSelect_insertNoSelectionRow(a.firstChild);nlpopupselect_removerow=null;}function NLPopupSelect_insertNoSelectionRow(b){var e=window.popupDIV.getAttribute("bShowQuantities")=="T";var a=b.rows.length==(e?1:0);if(a){var d=document.createElement("tr");var f=document.createElement("td");d.className="noselections";f.className="textctr";f.innerHTML="No Selections Made";if(e){f.colSpan=3;}d.appendChild(f);b.appendChild(d);var c=NLPopupSelect_getElementOrFromParent("multisel_complete");c.elements._mdata.value="";c.elements._mlabels.value="";}}function NLPopupSelect_updateSelection(o,n,a,m){var b=NLPopupSelect_getElementOrFromParent("multisel_complete");var p=b.elements._mdata;var h=b.elements._mlabels;var g=trim(p.value),l=trim(h.value);var k,e;if(isValEmpty(g)){k=new Array();e=new Array();}else{k=g.split(String.fromCharCode(5));e=l.split(String.fromCharCode(5));}var r=false;if(a){var q=true;for(i=0;i<k.length;i++){if(k[i]==o){q=false;break;}}var f=(typeof NLPopupSelect_canAddSelection=="undefined"||NLPopupSelect_canAddSelection==null)?true:NLPopupSelect_canAddSelection(o,n,k);if(q&&f){if(g==""){h.value=n;p.value=o;}else{p.value+=String.fromCharCode(5)+o;h.value+=String.fromCharCode(5)+n;}r=true;NLPopupSelect_addSelection(o,n);}}else{var d=window.popupDIV.getAttribute("bShowQuantities")=="T";r=true;var c=0;p.value="";h.value="";for(i=0;i<k.length;i++){if(k[i]==o||(d&&NLPopupSelect_getQuantityArray(k[i])[0]==o)){NLPopupSelect_removeSelection(o,m);continue;}else{p.value+=(c==0?"":String.fromCharCode(5))+k[i];h.value+=(c==0?"":String.fromCharCode(5))+e[i];c++;}}}}function NLPopupSelect_focusNextInputField(a,g,f){try{if(a==null||g==null){return;}var d=false;for(var c=0;c<g.elements.length;c++){if(!d){if(g.elements[c].name==a){d=true;}continue;}var b=g.elements[c];if(isFocusable(b)){if(b.className=="nldropdown"){setSelectFocus(b);}else{if(b.focus){b.focus();}}if(f&&b.select){b.select();}return;}}}catch(h){}}function setSafeBlurValue(b,c){var a="document.getElementById('"+b+"').value='"+c+"'";setTimeout(a,0);}function setButtonDown(a,d,c){var h=a?"_dn":"";var g=d?"lower_":"upper_";var e=c.parentNode;var f=e.previousSibling;var b=e.nextSibling;e.style.backgroundImage="url('/images/buttons/"+g+"body"+h+".gif')";f.style.backgroundImage="url('/images/buttons/"+g+"left_cap"+h+".gif')";if(b.style.backgroundImage!=null){b.style.backgroundImage="url('/images/buttons/"+g+"right_cap"+h+".gif')";}}function onTristateClick(a){setTristate(a,a.nextSibling.value+1);}function onTristateHighlight(c,a){var b=c.nextSibling;c.src="/images/icons/controls/checkbox_"+(b.value&3)+(a?"_hl.gif":".gif");return true;}function setTristate(b,c){var a=b.nextSibling;a.value=4|(c%3);b.src="/images/icons/controls/checkbox_"+(a.value&3)+".gif";return true;}function disableLineRefresh(a){a.disabled=true;a.firstChild.src="/images/icons/dashboard/refresh_line_disabled.gif";}function doNewbarAction(b){var a=document.getElementById(b);if(a!=null&&a.onclick){a.onclick();}}function nlQuickLooksPopup(a){var c="/images/guide/quicklooks.html?"+a;var b=window.open(c,"popupguide","toolbar=no,statusbar=no,menubar=no,resizable=no,left=1,top=1,height=700,width=300");b.focus();}var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};NLProgressBar=Class.create();NLProgressBar.prototype={initialize:function(a){this.hndDialogDiv=null;this.sId=a||"NLProgressBar";},show:function(c){var d=document.body.clientWidth/2;var b=document.body.clientHeight/2;if(!this.hndDialogDiv){this.hndDialogDiv=document.createElement("div");var a='<table style="font-size:70%;" cellpadding=0 cellspacing=0 border=0 width=350>    <tr>        <td colspan=3><IMG SRC="/images/icons/progress/progress_waitBar_top.gif" ALT="" WIDTH=350 HEIGHT=10 BORDER=0></td>    </tr>    <tr>        <td background="/images/icons/progress/progress_waitBar_l.gif"><IMG SRC="/images/icons/progress/progress_x.gif" ALT="" WIDTH=4 HEIGHT=1 BORDER=0></td>        <td bgcolor="#F1F1F1" align=center>            <IMG SRC="/images/icons/progress/progress_x.gif" ALT="" WIDTH=342 HEIGHT=4 BORDER=0><br>            <table cellpadding=0 cellspacing=0 border=0>                <tr><td colspan=2  style="font-size:70%;">'+c+'</td></tr>                <tr><td colspan=2><IMG SRC="/images/icons/progress/progress_x.gif" ALT="" WIDTH=1 HEIGHT=3 BORDER=0></td></tr>                <tr>                    <td align=center><IMG SRC="/images/icons/progress/progress_waitBar.gif" ALT="" WIDTH=249 HEIGHT=20 BORDER=0></td>                    <td>&nbsp;</td>                </tr>                <tr><td colspan=2><IMG SRC="/images/icons/progress/progress_x.gif" ALT="" WIDTH=1 HEIGHT=10 BORDER=0></td></tr>            </table>        </td>        <td background="/images/icons/progress/progress_waitBar_r.gif"><IMG SRC="/images/icons/progress/progress_x.gif" ALT="" WIDTH=4 HEIGHT=1 BORDER=0></td>    </tr>    <tr>        <td background="/images/icons/progress/progress_waitBar_l.gif"><IMG SRC="/images/icons/progress/progress_x.gif" ALT="" WIDTH=4 HEIGHT=1 BORDER=0></td>        <td bgcolor="#F1F1F1" align=center>            <IMG SRC="/images/icons/progress/progress_x.gif" ALT="" WIDTH=342 HEIGHT=10 BORDER=0><br>        </td>        <td background="/images/icons/progress/progress_waitBar_r.gif"><IMG SRC="/images/icons/progress/progress_x.gif" ALT="" WIDTH=4 HEIGHT=1 BORDER=0></td>    </tr>    <tr>        <td colspan=3><IMG SRC="/images/icons/progress/progress_waitBar_bot.gif" ALT="" WIDTH=350 HEIGHT=10 BORDER=0></td>    </tr></table>';this.hndDialogDiv.innerHTML=a;this.hndDialogDiv.style.display="none";this.hndDialogDiv.style.zIndex="1000";this.hndDialogDiv.style.position="absolute";document.body.appendChild(this.hndDialogDiv);}if(this.hndDialogDiv.style.display=="block"){return;}this.hndDialogDiv.style.display="block";this.hndDialogDiv.style.top=b-(this.hndDialogDiv.clientHeight/2);this.hndDialogDiv.style.left=d-(this.hndDialogDiv.clientWidth/2);},hide:function(){if(this.hndDialogDiv!=null){this.hndDialogDiv.style.display="none";}}};function getIFrameDocument(a){var b=null;if(document.getElementById(a).contentDocument){b=document.getElementById(a).contentDocument;}else{b=document.frames[a].document;}return b;}function getIFrameWindow(a){var b=null;if(document.getElementById(a).contentWindow){b=document.getElementById(a).contentWindow;}else{b=document.frames[a].window;}return b;}function notifyPortlet(a,b){if(a=="-10018"){if(window.schedulersef!="undefiined"&&window.schedulersef!=null){if(b==EVENT_PORTLET_MIN){window.schedulersef.handlePortletMin();}else{if(b==EVENT_PORTLET_MAX){window.schedulersef.handlePortletMax();}else{if(b==EVENT_PORTLET_MOVE){window.schedulersef.handlePortletMove();}else{if(b==EVENT_PORTLET_DROP){window.schedulersef.handlePortletDrop();}else{if(b==EVENT_PORTLET_DRAG){window.schedulersef.handlePortletDrag();}}}}}}}}function setImageButtonState(c,e,a,b){var f=document;if(typeof b!="undefined"&&b!=null){f=b.document;}var d=f.getElementById(c);if(d==null){return;}d.disabled=!e;if(typeof a=="undefined"&&a==null){return;}d=d.getElementsByTagName("img")[0];if(d){d.src=a;}}function setMultiButtonState(b,c){var a=getNLMultiButtonByName(b);if(a!=null){a.setState(c);}}function setLabelState(e,b,a){var d=document;if(typeof a!="undefined"&&a!=null){d=a.document;}var c=d.getElementById(e);if(c==null){return;}c.className=b;}function setNewbarGif(a){var b=document.getElementById("img_newbar_more");if(b!=null){b.src="/images/newbar/more"+(a?"":"down")+".gif";}}var allSpinners=new Array();var spinnerCounter=0;var NLSpinner=Class.create();NLSpinner.prototype={initialize:function(b,a,c,e,d){this.sTagName=b;this.currentValue=a;this.step=c;this.lowerBound=parseFloat(e);this.upperBound=parseFloat(d);this.interval=parseInt(500);this.repeatInterval=parseInt(200);this.timer=null;this.direction=1;},_step:function(){if(this.direction>=0){var a=parseFloat(parseFloat($(this.sTagName).value)+parseFloat(this.step));}else{var a=parseFloat(parseFloat($(this.sTagName).value)-parseFloat(this.step));}if(a>this.upperBound){a=this.upperBound;}else{if(a<this.lowerBound){a=this.lowerBound;}}$(this.sTagName).value=parseFloat(a);},_mousedown:function(b){this._step();var a=this._mousedown.bind(this,"F");this.timer=setTimeout(a,(b=="T"?this.interval:this.repeatInterval));},_releasemouse:function(){if(this.timer){clearTimeout(this.timer);this.timer=null;$(this.sTagName).onchange();}if(this.direction>=0){$(this.sTagName+"_rarrow").setAttribute("src","/images/forms/rarrow.gif");}else{$(this.sTagName+"_larrow").setAttribute("src","/images/forms/larrow.gif");}},_scrollUp:function(){this.direction=1;$(this.sTagName+"_rarrow").setAttribute("src","/images/forms/rarrow_down.gif");this._mousedown("T");},_scrollDown:function(){this.direction=-1;$(this.sTagName+"_larrow").setAttribute("src","/images/forms/larrow_down.gif");this._mousedown("T");}};function makeSpinner(a,h,b,d,f){var k=new NLSpinner(a,h,b,d,f);$(a).value=h;var e=document.createElement("img");e.setAttribute("id",a+"_larrow");e.setAttribute("src","/images/forms/larrow.gif");$(a+"_fs").appendChild(e);$(a+"_larrow").onmousedown=function(){k._scrollDown();};$(a+"_larrow").onmouseup=function(){k._releasemouse();};$(a+"_larrow").onmouseout=function(){k._releasemouse();};var c=document.createElement("img");c.setAttribute("id",a+"_rarrow");c.setAttribute("src","/images/forms/rarrow.gif");$(a+"_fs").appendChild(c);$(a+"_rarrow").onmousedown=function(){k._scrollUp();};$(a+"_rarrow").onmouseup=function(){k._releasemouse();};$(a+"_rarrow").onmouseout=function(){k._releasemouse();};spinnerCounter++;var g=a+spinnerCounter;if(window.allSpinners[g]==null){window.allSpinners[g]=k;}return k;}function NLDragDrop(a,b,c){this.doc=c?c:document;this.sourceElem=a;this.listener=b;this.eventSource=null;this.bInitDrag=true;if(window.loadcomplete){this.attachEventHandlers(a);}else{attachEventHandler("load",window,function(d){this.attachEventHandlers();}.bind(this));}}NLDragDrop.prototype.attachEventHandlers=function NLDragDrop_attachEventHandlers(){if(typeof this.sourceElem=="string"){this.sourceElem=doc.getElementById(sourceElem);}if(!this.sourceElem){return;}attachEventHandler("mousedown",this.sourceElem,function(a){this.handleMouseDown(a);}.bind(this));attachEventHandler("mousemove",this.doc,function(a){this.handleMouseMove(a);}.bind(this));attachEventHandler("mouseup",this.doc,function(a){this.handleMouseUp(a);}.bind(this));};NLDragDrop.prototype.handleMouseDown=function NLDragDrop_handleMouseDown(a){var a=getEvent(a);this.eventSource=getEvent(a);if(!this.onMouseDown(a)){return true;}var a=getEvent(a);this.mouseDown=true;return true;};NLDragDrop.prototype.handleMouseMove=function NLDragDrop_handleMouseMove(b){if(!this.mouseDown){return true;}var b=getEvent(b);var a=true;if(this.bInitDrag){a=this.onInitMouseMove(b);}if(a){this.bInitDrag=false;}else{this.clear();b.cancelBubble=true;b.returnValue=false;return false;}this.onMouseMove(b);b.cancelBubble=true;b.returnValue=false;return false;};NLDragDrop.prototype.handleMouseUp=function NLDragDrop_handleMouseUp(a){if(!this.mouseDown){return true;}var a=getEvent(a);this.onMouseUp(a);this.clear();a.cancelBubble=true;a.returnValue=false;return false;};NLDragDrop.prototype.clear=function NLDragDrop_clear(){this.mouseDown=false;this.eventSource=null;this.bInitDrag=true;};NLDragDrop.prototype.onMouseDown=function NLDragDrop_onMouseDown(a){if(this.listener&&this.listener.onMouseDown){return this.listener.onMouseDown(a);}return true;};NLDragDrop.prototype.onInitMouseMove=function NLDragDrop_onInitMouseMove(a){if(this.listener&&this.listener.onInitMouseMove){return this.listener.onInitMouseMove(a);}return true;};NLDragDrop.prototype.onMouseMove=function NLDragDrop_onMouseMove(a){if(this.listener&&this.listener.onMouseMove){return this.listener.onMouseMove(a);}return true;};NLDragDrop.prototype.onMouseUp=function NLDragDrop_onMouseUp(a){if(this.listener&&this.listener.onMouseUp){return this.listener.onMouseUp(a);}return true;};var NLDRAG_LEFT=1;var NLDRAG_RIGHT=2;var NLDRAG_LEFT_RIGHT=3;var NLDRAG_UP=4;var NLDRAG_DOWN=8;var NLDRAG_UP_DOWN=12;function NLAttachSimpleColumnResizer(c,g,f,b,a,d,e){return new NLSimpleColumnResizer(c,g,f,b,a,d,e);}function NLSimpleColumnResizer(c,g,f,b,a,d,e){e=e?e:document;this.triggerElem=(typeof c=="string")?e.getElementById(c):c;this.targetElem=(typeof g=="string")?e.getElementById(g):g;new NLDragDrop(this.triggerElem,this,e);this.direction=(f==NLDRAG_UP_DOWN)?NLDRAG_UP_DOWN:NLDRAG_LEFT_RIGHT;this.min=b>=0?b:0;this.max=(a>=0&&a>b)?a:Number.MAX_VALUE;this.listener=d;this.initVal=null;this.sCursor=this.direction==NLDRAG_UP_DOWN?"n-resize":"w-resize";this.setCursor(this.sCursor,this.triggerElem);}NLSimpleColumnResizer.prototype.getValue=function NLSimpleColumnResizer_getValue(a){if(this.direction==NLDRAG_LEFT_RIGHT){return getMouseX(a);}else{if(this.direction==NLDRAG_UP_DOWN){return getMouseY(a);}}return null;};NLSimpleColumnResizer.prototype.onMouseDown=function NLSimpleColumnResizer_onMouseDown(b){var a=getEventTarget(b);if(!contains(this.triggerElem,a)){return false;}this.initVal=this.getValue(b);if(!this.canResize(b)){return false;}return true;};NLSimpleColumnResizer.prototype.onInitMouseMove=function NLSimpleColumnResizer_onInitMouseMove(a){var a=getEvent(a);if(this.listener&&this.listener.onStartResize){this.dragDiv=this.listener.onStartResize(a,this);}else{this.startResize(a,this);}return true;};NLSimpleColumnResizer.prototype.onMouseMove=function NLSimpleColumnResizer_onMouseMove(a){var a=getEvent(a);if(!this.canResize(a)){return false;}if(this.listener&&this.listener.onResize){this.listener.onResize(a,this);}else{this.resize(a);}return true;};NLSimpleColumnResizer.prototype.onMouseUp=function NLSimpleColumnResizer_onMouseUp(a){var a=getEvent(a);if(this.listener&&this.listener.onEndResize){this.listener.onEndResize(a,this);}else{this.endResize(a);}this.resetCursor();};NLSimpleColumnResizer.prototype.canResize=function NLSimpleColumnResizer_canResize(d){if(this.listener&&this.listener.onCanResize){return this.listener.onCanResize(d,this);}var c=this.getValue(d)-this.initVal;var b=(this.direction==NLDRAG_LEFT_RIGHT)?this.targetElem.offsetWidth:this.targetElem.offsetHeight;var a=b+c;if(a>=this.min&&a<=this.max){return true;}else{if(a<this.min&&c>0){return true;}else{if(a>this.max&&c<0){return true;}}}return false;};NLSimpleColumnResizer.prototype.startResize=function NLSimpleColumnResizer_startResize(a){this.setCursor(this.sCursor);this.showDragDiv(a);};NLSimpleColumnResizer.prototype.resize=function NLSimpleColumnResizer_resize(a){this.positionDragDiv(a);};NLSimpleColumnResizer.prototype.endResize=function NLSimpleColumnResizer_endResize(b){var a=null;if(this.direction==NLDRAG_LEFT_RIGHT){a=this.targetElem.offsetWidth+this.getValue(b)-this.initVal;}else{a=this.targetElem.offsetHeight+this.getValue(b)-this.initVal;}if(a>this.max){a=this.max;}else{if(a<this.min){a=this.min;}}if(this.direction==NLDRAG_LEFT_RIGHT){this.targetElem.style.width=a;}else{this.targetElem.style.height=a;}this.cleanUp();};NLSimpleColumnResizer.prototype.showDragDiv=function NLSimpleColumnResizer_showDragDiv(b){if(this.dragDiv==null){this.dragDiv=document.createElement("div");this.dragDiv.style.position="absolute";var a=document.createElement("img");a.src="/images/nav/stretch.gif";a.width="3";this.dragDiv.appendChild(a);this.dragDiv.style.backgroundColor="#999999";setObjectOpacity(80,this.dragDiv);document.body.appendChild(this.dragDiv);}if(this.direction==NLDRAG_LEFT_RIGHT){this.dragDiv.style.top=findPosY(this.targetElem);this.dragDiv.firstChild.height=this.targetElem.offsetHeight;}else{this.dragDiv.style.left=findPosX(this.targetElem);this.dragDiv.firstChild.width=this.targetElem.offsetWidth;}this.dragDiv.style.display="";this.positionDragDiv(b);};NLSimpleColumnResizer.prototype.cleanUp=function NLSimpleColumnResizer_cleanUp(){this.hideDragDiv();this.initVal=null;};NLSimpleColumnResizer.prototype.hideDragDiv=function NLSimpleColumnResizer_hideDragDiv(){this.dragDiv.style.display="none";};NLSimpleColumnResizer.prototype.positionDragDiv=function NLSimpleColumnResizer_positionDragDiv(b){var a=this.getValue(b);if(this.direction==NLDRAG_LEFT_RIGHT){this.dragDiv.style.left=a;}else{this.dragDiv.style.top=a;}};NLSimpleColumnResizer.prototype.setCursor=function NLSimpleColumnResizer_setCursor(a,b){if(!b){b=document.body;}if(!b.origCursor){b.origCursor=b.style.cursor;}b.style.cursor=a;};NLSimpleColumnResizer.prototype.resetCursor=function NLSimpleColumnResizer_restoreCursor(a){if(!a){a=document.body;}if(a.origCursor&&a.origCursor.length>0){a.style.cursor="default";a.origCursor=null;}else{a.style.cursor="default";}};