// create a test node off the browser screen to calculate high contrast mode
var testNode = document.createElement("div");
testNode.className = "highContrastTestNode";
document.body.appendChild(testNode);
// look at the computed style for the test node
var styles = null;
try {
styles = document.defaultView.getComputedStyle(testNode, "");
} catch(e) {
styles = testNode.currentStyle;
}
var testImg = styles.backgroundImage;
if ((styles.borderTopColor == styles.borderRightColor) || (testImg != null && (testImg == "none" || testImg == "url(invalid-url:)" ))) {
document.getElementsByTagName("body")[0].className+=" lotusImagesOff";
}
document.body.removeChild(testNode);!function(){var e=ibmCfg.portalConfig.contentHandlerURI+"?uri=menu:${id}";"undefined"!=typeof wptheme&&wptheme||(wptheme={}),i$.mash(wptheme,{getWindowIDFromSkin:function(e){for(;null!=(e=e.parentNode);)if(i$.hasClass(e,"component-control")){var t=e&&(e.className||"").match(/id-([\S]+)/);return t&&t[1]}return null},getPortletState:function(e){var t=i$.byId("portletState");return t?(t._cache||(t._cache=i$.fromJson(t.innerHTML),t._cache._defaults={windowState:"normal",portletMode:"view"}),t._cache[e]?t._cache[e]:t._cache._defaults):{}},isValidOp:function(e){if(e.visibility===!1)return!1;var t=e.metadata||{};switch(e.id){case"ibm.portal.operations.changePortletMode":return wptheme.getPortletState(t.wid).portletMode!=t.portletMode;case"ibm.portal.operations.changeWindowState":return wptheme.getPortletState(t.wid).windowState!=t.windowState}return!0},operation:{changeToHelpMode:function(e){var t=window.location.href;if(e.actionUrl)if(0==e.actionUrl.indexOf("?")){var n=t.indexOf("#");if(-1!=n){var o=t.substring(0,n),i=t.substring(n);t=o+(-1==o.indexOf("?")?"?":"&")+e.actionUrl.substring(1),t+=i}else t+=(-1==t.indexOf("?")?"?":"&")+e.actionUrl.substring(1)}else t=e.actionUrl;window.open(t,"","resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=no,width=800,height=600,screenX=10,screenY=10,top=10,left=10")}},canImpersonate:function(){return ibmCfg.portalConfig.canImpersonate},contextMenu:{cache:{},css:{focus:"wpthemeMenuFocus",disabled:"wpthemeMenuDisabled",show:"wpthemeMenuShow",error:"wpthemeMenuError",menuTemplate:"wpthemeTemplateMenu",submenuTemplate:"wpthemeTemplateSubmenu",loadingTemplate:"wpthemeTemplateLoading"},init:function(e,t,n){e._contextMenu=e._contextMenu||{},e._contextMenu.id=e._contextMenu.id||Math.round(1e9*Math.random()),e.setAttribute("id",e._contextMenu.id),e._contextMenu.menuId=t,e._contextMenu.jsonQuery=n;var o=e._contextMenu,i=function(e){if(e.displayMenu){i$.fireEvent("wptheme/contextMenu/close/all"),wptheme.contextMenu._updateAbsolutePosition(i$.byId(o.id));var t=wptheme.contextMenu._adjustScreenPositionStart();i$.addClass(o.shadowNode?o.shadowNode:i$.byId(o.id),wptheme.contextMenu.css.show),wptheme.contextMenu._adjustScreenPositionEnd(t);var n=i$.byId(o.id)._firstSelectable;n&&(n.focus(),i$.byId(o.id)._currentSelected=n),i$.addListener("wptheme/contextMenu/close/all",function(){var e=i$.byId(o.id);i$.removeClass(o.shadowNode?o.shadowNode:e,wptheme.contextMenu.css.show)})}};wptheme.contextMenu._initialize(e).then(i,i),e=null},initSubmenu:function(e,t,n){e._contextMenu=e._contextMenu||{},e._contextMenu._submenu=!0,e._contextMenu._menuitemTemplate=n._menuitemTemplate,e._contextMenu._subMenuTemplate=n._subMenuTemplate,e._contextMenu._loadingTemplate=n._loadingTemplate,wptheme.contextMenu.init(e,t,n.jsonQuery)},_findFocusNode:function(e){var t,n,o,i=function(e,r){var a=e.childNodes.length;for(n=0;a>n&&!t;n++){if(o=e.childNodes[n],i$.hasClass(o,wptheme.contextMenu.css.focus)){t=o;break}o.childNodes&&(n=i(o,n))}return r};return i(e),t},_findNodes:function(e){var t,n,o,i,r,a=function(e,u){for(i=e.childNodes.length-1;i>=0;i--)r=e.childNodes[i],i$.hasClass(r,wptheme.contextMenu.css.menuTemplate)?t=r:i$.hasClass(r,wptheme.contextMenu.css.submenuTemplate)?n=r:i$.hasClass(r,wptheme.contextMenu.css.loadingTemplate)?o=r:r.childNodes&&(i=a(r,i));return u};return a(e),{menu:t,submenu:n,loading:o}},_invalidateCallback:function(){wptheme.contextMenu.cache={}},_initialize:function(e){var t=!0,n=e._contextMenu;if(wptheme.contextMenu.cache[n.id]||n._inProgress)return i$.promise.resolved({displayMenu:t});n._inProgress=!0,i$.addListener("wptheme/contextMenu/invalidate/all",wptheme.contextMenu._invalidateCallback);var o,i,r=i$.createDom("div");if(n._submenu)r.innerHTML=n._subMenuTemplate.replace(/\$\{submenu-id\}/g,n.id+"_menu"),e.appendChild(r.firstChild),o=i$.byId(n.id+"_menu"),i=i$.createDom("div"),i.innerHTML=n._loadingTemplate;else{var a=wptheme.contextMenu._findNodes(n.shadowNode?n.shadowNode:e);o=a.menu,n._menuitemTemplate||(n._menuitemTemplate=i$.trim(o.innerHTML)),n._loadingTemplate||(i=i$.createDom("div"),i.appendChild(a.loading),n._loadingTemplate=i$.trim(i.innerHTML),i=null),i=i$.createDom("div"),i.innerHTML=n._loadingTemplate,r.appendChild(a.submenu.cloneNode(!0)),n._subMenuTemplate||(n._subMenuTemplate=i$.trim(r.innerHTML))}for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(i);var u;return u=n.shadowNode?n.shadowNode:wptheme.contextMenu._transformIntoAbsolutePosition(e),i$.addClass(u?u:e,wptheme.contextMenu.css.show),i$.bindDomEvt(u?u:e,"onmouseleave",function(){n._inProgress&&(t=!1);var e=i$.byId(n.id);if(i$.removeClass(n.shadowNode?n.shadowNode:e,wptheme.contextMenu.css.show),!n.activeAction){var o=e._currentSelected;o&&o.blur();var i=wptheme.contextMenu._findFocusNode(e);(i?i:e).focus()}}),wptheme.contextMenu._load(n).then(function(i){var r=wptheme.contextMenu._parseData(i).then(function(i){if(i=wptheme.contextMenu._filterMenu(i),i&&0!=i.length)wptheme.contextMenu._buildMenu(n,o,i);else{var r=i$.createDom("div");for(r.innerHTML=wptheme.contextMenu._fromTemplate(n._menuitemTemplate,wptheme.contextMenu.css.error,wptheme.contextMenu.nls.NO_ITEMS_0);o.firstChild;)o.removeChild(o.firstChild);o.appendChild(r)}return n._inProgress=!1,wptheme.contextMenu.cache[n.id]=!0,i$.removeClass(u?u:e,wptheme.contextMenu.css.show),{displayMenu:t}});return r},function(){var e=i$.createDom("div");for(e.innerHTML=wptheme.contextMenu._fromTemplate(n._menuitemTemplate,wptheme.contextMenu.css.error,wptheme.contextMenu.nls.ERROR_LOADING_0);o.firstChild;)o.removeChild(o.firstChild);return o.appendChild(e),n._inProgress=!1,wptheme.contextMenu.cache[n.id]=!0,{displayMenu:t}})},_load:function(t){var n=e.replace(/\$\{id\}/g,t.menuId);return t.jsonQuery&&(n+=(-1==n.indexOf("?")?"?":"&")+i$.toQuery(t.jsonQuery)),i$.xhrGet({url:n,headers:{"X-IBM-XHR":"true"},responseType:"json"}).then(function(e){return e.data},function(e){var n=e.xhr.getResponseHeader("Content-Type")||"";return(0==n.indexOf("text/html")||401==e.xhr.status)&&window.setTimeout(function(){document.location.reload()},0),console.log("Error trying to load the context menu feed for '"+t.menuId+"': "+e),null})},_parseData:function(e){var t=[];return i$.each(e,function(e){var n=i$.fromPath("moduleInfo.deferred",!1,e)?i$.modules.loadDeferred():i$.promise.resolved(!0);t.push(n.then(function(){var t=wptheme.contextMenu._checkFunction(e,e.visibilityFn,e,"undefined"!=typeof e.visibility?e.visibility:!0),n=wptheme.contextMenu._checkFunction(e,e.enableFn,e,"undefined"!=typeof e.enabled?e.enabled:!0);return i$.whenAll(t,n).then(function(t){return e._visible=t[0],e._enabled=t[1],e})}))}),i$.whenAll.apply(i$,t)},_filterMenu:function(e){for(var t,n=[],o={type:"Separator"},i=e.length-1;i>=0;i--)if(t=e[i],t._visible){if("Separator"==t.type){if("Separator"==o.type)continue}else if("Header"==t.type&&("Separator"==o.type||"Header"==o.type))continue;o=t,n.unshift(t)}for(;n.length>0&&"Separator"==n[0].type;)n=n.slice(1);return n},_buildMenu:function(e,t,n){for(var o,i,r,a,u=document.createDocumentFragment(),s=i$.createDom("div"),c=0,d=n.length;d>c;c++)for(o=n[c],s.innerHTML=wptheme.contextMenu._fromTemplate(e._menuitemTemplate,o);i=s.firstChild;)1==i.nodeType&&("Submenu"==o.type?(i._menuitem=o,i._jsonData=e,i$.bindDomEvt(i,"onmouseover",wptheme.contextMenu._applySubmenu)):o._enabled&&(i.links={previous:r,next:null,sub:null},r&&(r.links.next=i),a||"Header"==o.type||(a=i),i._menuitem=o,r=i,i$.bindDomEvt(i,"onclick",function(t){wptheme.contextMenu._stopEventPropagation(t),wptheme.contextMenu._applyAction(t),setTimeout(function(){var t=i$.byId(e.id);i$.removeClass(e.shadowNode?e.shadowNode:t,wptheme.contextMenu.css.show)},0)}),i$.bindDomEvt(i,"onkeydown",function(e){return wptheme.contextMenu._applyKeyAction(e)}),i$.bindDomEvt(i,"onmouseover",function(e){return wptheme.contextMenu._applyFocusAction(e)})),o.title&&i$.isRTL(o.title.lang)&&(i$.addClass(i,"rtl"),i.setAttribute("dir","RTL")),o.markupId&&i.setAttribute("id",o.markupId)),u.appendChild(i);for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(u),i$.byId(e.id)._firstSelectable=a,i$.byId(e.id)._currentSelected=null},_fromTemplate:function(e,t,n){var o,i,r;return"string"==typeof t?(o=t,i=n,r=""):(o="type"+t.type,t.itemClass&&(o+=" "+t.itemClass),t._enabled||(o+=" "+wptheme.contextMenu.css.disabled),i=t.title?t.title.value:"",r=t.description?t.description.value:""),e.replace(/\$\{title\}/g,i).replace(/"\$\{css-class\}"/g,'"'+o+'"').replace(/\$\{css-class\}/g,'"'+o+'"').replace(/"\$\{description\}"/g,'"'+r+'"').replace(/\$\{description\}/g,'"'+r+'"')},_checkFunction:function(e,t,n,o){if(t){e.fromPath||(e.fromPath={});var i=e.fromPath[t]||i$.fromPath(t);if(e.fromPath[t]=i,i$.isFunction(i))try{return i(n)}catch(r){console.log("error executing function "+t+" - "+r)}}return i$.promise.resolved(o)},_stopEventPropagation:function(e){e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},_applyKeyAction:function(e){for(var t=e.target||e.srcElement,n=t,o=null;!o;)n=n.parentNode,n._contextMenu&&(o=n);var i=o._contextMenu;switch(e.keyCode){case 13:wptheme.contextMenu._stopEventPropagation(e);var r=i$.byId(i.id);i$.removeClass(i.shadowNode?i.shadowNode:r,wptheme.contextMenu.css.show);var a=wptheme.contextMenu._findFocusNode(r);return(a?a:o).focus(),window.setTimeout(function(){wptheme.contextMenu._applyAction(e)},0),!1;case 9:case 27:var r=i$.byId(i.id);i$.removeClass(i.shadowNode?i.shadowNode:r,wptheme.contextMenu.css.show);var a=wptheme.contextMenu._findFocusNode(r);(a?a:o).focus();break;case 40:return wptheme.contextMenu._moveFocus(e,i,t,"next"),!1;case 38:return wptheme.contextMenu._moveFocus(e,i,t,"previous"),!1}return!0},_moveFocus:function(e,t,n,o){var i=n.links[o];if(i&&("Header"==i._menuitem.type||"Separator"==i._menuitem.type)){for(var r=!1,a=null;!a&&!r;)i=i.links[o],i?"Header"!=i._menuitem.type&&"Separator"!=i._menuitem.type&&(a=i):r=!0;i=a}if(i){var u=i$.byId(t.id)._currentSelected;u&&u.blur(),i$.byId(t.id)._currentSelected=i,i.focus()}e.preventDefault&&e.preventDefault()},_applyFocusAction:function(e){for(var t=e.target||e.srcElement,n=t,o=null,i=t._menuitem;!o;)n=n.parentNode,n._contextMenu&&(o=n),i||(t=t.parentNode,i=t._menuitem);var r=o._contextMenu,a=i$.byId(r.id)._currentSelected;return a!=t&&(a&&(a.blur(),i$.byId(r.id)._currentSelected=null),"Header"!=i.type&&"Separator"!=i.type&&(i$.byId(r.id)._currentSelected=t,t.focus())),!1},_applyAction:function(e){for(var t=e.target||e.srcElement,n=t,o=null,i=t._menuitem;!o;)n=n.parentNode,n._contextMenu&&(o=n),i||(t=t.parentNode,i=t._menuitem);var r=o._contextMenu;r.activeAction=!0;var a=wptheme.contextMenu._checkFunction(i,i.actionFn,i,i.actionUrl);a&&a.then(function(e){if(e&&i$.isString(e)){var t=i.actionHttpMethod||"GET";if("GET"!=t){var n=i$.createDom("form");switch(n.setAttribute("action",e),t=t.toLowerCase()){case"get":n.setAttribute("method","GET");break;case"delete":case"put":var o=i$.createDom("input",{type:"hidden",name:"x-method-override",value:t.toUpperCase()});n.appendChild(o);case"post":n.setAttribute("method","POST"),n.setAttribute("enctype","multipart/form-data")}i$.byId("wpthemeComplementaryContent").appendChild(n),n.submit()}else window.location.href=e}})},_applySubmenu:function(e){var t=e.target||e.srcElement;t._jsonData||(t=t.parentNode),t._jsonData&&(t.setAttribute("id",t._jsonData.id+"_"+t._menuitem.id),wptheme.contextMenu.initSubmenu(t,t._menuitem.id,t._jsonData))},_transformIntoAbsolutePosition:function(e){for(var t,n=e.childNodes,o=0,i=!1;t=n[o++];){if(i$.hasClass(t,"wpthemeMenuRight")){i=!0;break}if(i$.hasClass(t,"wpthemeMenuLeft"))break}var r=i$.createDom("div");r.className=e.className,r.appendChild(t),i$.byId("wpthemeComplementaryContent").appendChild(r),r._contextMenu=e._contextMenu,e._contextMenu.shadowNode=r,e._contextMenu._menuIsRight=i;var a=i$.createDom("span");return r.appendChild(a),i$.addClass(a,"wpthemeMenuOverlay"),e._contextMenu.overlayNode=a,e._contextMenu.menuNode=t,wptheme.contextMenu._updateAbsolutePosition(e),r},_updateAbsolutePosition:function(e){var t=e._contextMenu._menuIsRight,n=e._contextMenu.menuNode,o=e._contextMenu.overlayNode,i=wptheme.contextMenu._findPos(e),r=2;o.style.left=i[0]-r+"px",o.style.top=i[1]-r+"px",o.style.width=e.offsetWidth+2*r+"px",o.style.height=e.offsetHeight+2*r+"px";var a=document.getElementsByTagName("html")[0].getAttribute("dir");a=null!=a?a.toLowerCase():"",n.style.left="rtl"!=a?(t?i[0]+e.offsetWidth:i[0])+"px":(t?i[0]+e.offsetWidth-e.scrollWidth:i[0])+"px",n.style.top=i[1]+"px"},_adjustScreenPositionStart:function(){return document.documentElement.scrollHeight},_adjustScreenPositionEnd:function(e){var t=document.documentElement.scrollHeight;e!=t&&(document.documentElement.scrollTop=document.documentElement.scrollHeight)},_findPos:function(e){var t=curtop=0;if(e.offsetParent){do t+=e.offsetLeft,curtop+=e.offsetTop;while(e=e.offsetParent);return[t,curtop]}}}})}();(function(){
i$.merge({
"NO_ITEMS_0":"No items to display",
"ERROR_LOADING_0":"Error happened while loading the menu."
},i$.fromPath("wptheme.contextMenu.nls",true));
})();
!function(){i$.isIE||i$.addOnLoad(function(){for(var a=document.getElementsByTagName("SECTION"),e=0;e/g,">").replace(/=0;i--){
if(this._messages[i]._type==_d._type&&this._messages[i]._message==_d._message&&this._messages[i]._details==_d._details){
this._messages.splice(i,1);
}
}
if(this._messages.length==0){
this.clear();
}else{
if(this._messages.length<100){
this.render(this._getStatusContainer());
}
}
}
},addMessage:function(_e){
if(_e.uid&&_e.uid!=this.uid){
return;
}
var _f=_e.message;
this._messages.push(_f);
if(this._messages.length<100){
this.render(this._getStatusContainer());
}
},render:function(_10){
if(_10==null){
_10=this._getStatusContainer();
}
_10.innerHTML="";
if(this._messages.length>1){
this.renderHeader(_10);
}else{
if(this._messages.length==1){
this.renderMessage(_10,this._messages[0],this.showDetails,0);
}
}
if(this.showDetails&&this._messages.length>1){
for(x in this._messages){
this.renderMessage(_10,this._messages[x],this.showDetails,x);
}
}
},renderHeader:function(_11){
if(this._messages.length>1){
var _12=2;
for(var i=0;i1&&_18>=0){
_1a.style.marginLeft="10px";
}
var _1b=document.createElement("img");
_1b.className="lotusIcon "+(_19._styleClass=="lotusError"?"lotusIconMsgError":_19._styleClass=="lotusWarning"?"lotusIconMsgWarning":"lotusIconMsgInfo");
_1b.src=_19._iconPath;
_1b.alt=_1b.title=_19._iconAlt;
_1a.appendChild(_1b);
var _1c=document.createElement("span");
_1c.className="lotusAltText";
_1c.innerHTML=this._escapeHTML(_19._iconAlt+":");
_1a.appendChild(_1c);
var _1d=document.createElement("div");
_1d.className="lotusMessageBody";
_1d.innerHTML=this._escapeHTML(_16._message);
_1a.appendChild(_1d);
if((this._messages.length>1&&_18<0)||(this._messages.length==1)){
if(_16._details&&_16._details.length>0||_18<0){
var _1e=document.createElement("a");
_1e.href="javascript:void(0)";
_1e.className="wpthemeHideShow";
_1e.role="button";
this._connections.push(i$.bindDomEvt(_1e,"onclick",i$.scope(this,this.toggleShowDetails)));
var _1f=document.createElement("img");
_1f.className="lotusIcon16";
_1f.src=ibmCfg.themeConfig.modulesWebAppBaseURI+"/themes/html/dynamicSpots/icons/blank.gif";
_1e.appendChild(_1f);
var _20=document.createElement("span");
_20.className="lotusAltText";
_1e.appendChild(_20);
}else{
_17=false;
}
var _21=document.createElement("a");
_21.href="javascript:void(0);";
_21.className="lotusDelete";
_21.role="button";
_21.title=wptheme.statusBar.nls.DELETE_0;
this._connections.push(i$.bindDomEvt(_21,"onclick",i$.scope(this,this.clear)));
var _22=document.createElement("img");
_22.alt=wptheme.statusBar.nls.DELETE_0;
_22.src=ibmCfg.themeConfig.modulesWebAppBaseURI+"/themes/html/dynamicSpots/icons/blank.gif";
_21.appendChild(_22);
var _23=document.createElement("span");
_23.className="lotusAltText";
_23.innerHTML=this._escapeHTML(wptheme.statusBar.nls.DELETE_0);
_21.appendChild(_23);
if(_16._details&&_16._details.length>0||_18<0){
if(_17){
_1e.title=wptheme.statusBar.nls.HIDE_DETAILS_0;
_1f.className+=" lotusIconHide";
_1f.alt=wptheme.statusBar.nls.HIDE_DETAILS_0;
_20.innerHTML=this._escapeHTML(wptheme.statusBar.nls.HIDE_DETAILS_0);
}else{
_1e.title=wptheme.statusBar.nls.SHOW_DETAILS_0;
_1f.className+=" lotusIconShow";
_1f.alt=wptheme.statusBar.nls.SHOW_DETAILS_0;
_20.innerHTML=this._escapeHTML(wptheme.statusBar.nls.SHOW_DETAILS_0);
}
_1a.appendChild(_1e);
if(!this.isBidi){
_1d.style.marginRight="32px";
}else{
_1d.style.marginLeft="32px";
}
}
_1a.appendChild(_21);
}
var _24=document.createElement("div");
_24.className="wpthemeClear";
_1a.appendChild(_24);
if(_16._details&&_16._details.length>0&&_17&&_18>=0){
var _25=document.createElement("div");
_25.className="wpthemeDetails";
_25.appendChild(document.createTextNode(_16._details));
_1a.appendChild(_25);
}
_15.appendChild(_1a);
_15.setAttribute("role","alert");
_15.setAttribute("wairole","alert");
}});
if(typeof wpstatusbar==="undefined"||!wpstatusbar){
wpstatusbar=new com.ibm.widgets.StatusBarV2("ibmStatusBox");
}
var _26=i$.getCookie("ibm.portal.operations.error");
if(_26){
var _27=i$.fromJson(_26);
var _28="error";
if(_27.errorType){
_28=_27.errorType;
}else{
if(_27.errorCode){
if(_27.errorCode=="400"){
_28="error";
}
}
}
i$.fireEvent("/portal/status",[{message:new com.ibm.widgets.StatusMessage(_28,_27.errorMessage?_27.errorMessage:"",_27.errorDetails?_27.errorDetails:""),uid:"ibmStatusBox"}]);
i$.deleteCookie("ibm.portal.operations.error");
}
i$.addOnLoad(function(){
if("localStorage" in window&&window["localStorage"]!==null){
if(localStorage["com.ibm.wp.toolbar.msg.msg"]!=null){
i$.fireEvent("/message/status",[{message:new com.ibm.widgets.StatusMessage(localStorage["com.ibm.wp.toolbar.msg.type"],localStorage["com.ibm.wp.toolbar.msg.msg"],""),uid:"ibmStatusBox"}]);
localStorage.removeItem("com.ibm.wp.toolbar.msg.type");
localStorage.removeItem("com.ibm.wp.toolbar.msg.msg");
}
}
});
})();