if(!window.VITECH.msg){VITECH.msg=new Object()}Object.extend(VITECH.msg,{errorCache:new $A(),messageCache:new $A(),confirmMsgCache:new $A(),actionButtonId:""}); VITECH.msg.msgCenter=Class.create();VITECH.msg.msgCenter.prototype={el:"",errorList:"",errorListSize:"",msgList:"",msgListSize:"",exceptionPage:"",initialize:function(){this.el=$("messageContainer"); this.errorList=$("errorList");this.msgList=$("messageList"); this.errorListSize=this.getErrors().length;this.msgListSize=this.getMessages().length },addError:function(b){if(b==null||b==""){return}var a=document.createElement("li"); Element.addClassName(a,"error");this.errorList.appendChild(a); a.innerHTML=b;this.errorListSize++;this.updateErrorTitle() },addErrors:function(b){if(b==null||b.length==undefined||b.length==0){return }for(var a=0;a0){return true }else{return false}},isMessages:function(){if(this.msgListSize>0){return true }else{return false}},getErrors:function(){return $$("#messageContainer li.error")||$A() },getMessages:function(){return $$("#messageContainer li.message")||$A() },getErrorsAndMessages:function(){var a=$A();this.getErrors().each(function(b){a.push(b) }.bind(a));this.getMessages().each(function(b){a.push(b) }.bind(a));return a},updateErrorTitle:function(){var a=$$("#errorList li.title")[0]; if(a!=null){a.innerHTML="Errors("+this.errorListSize+")" }},updateMsgTitle:function(){var a=$$("#messageList li.title")[0]; if(a!=null){a.innerHTML="Messages("+this.msgListSize+")" }},visible:function(){return this.el.visible()},setExceptionPageUrl:function(a){this.exceptionPage=a }};VITECH.msg.GWTmsgCenter=Class.create();VITECH.msg.GWTmsgCenter.prototype={initialize:function(){},addError:function(a){if(window.parent.VITECH&&window.parent.VITECH.TapestryApi&&window.parent.VITECH.TapestryApi.NotificationCenter&&window.parent.VITECH.TapestryApi.NotificationCenter.addError){window.parent.VITECH.TapestryApi.NotificationCenter.addError(a) }},addErrors:function(a){if(window.parent.VITECH&&window.parent.VITECH.TapestryApi&&window.parent.VITECH.TapestryApi.NotificationCenter&&window.parent.VITECH.TapestryApi.NotificationCenter.addErrors){window.parent.VITECH.TapestryApi.NotificationCenter.addErrors(a) }},removeError:function(a){if(window.parent.VITECH&&window.parent.VITECH.TapestryApi&&window.parent.VITECH.TapestryApi.NotificationCenter&&window.parent.VITECH.TapestryApi.NotificationCenter.removeError){window.parent.VITECH.TapestryApi.NotificationCenter.removeError(a) }},addMessage:function(a){if(window.parent.VITECH&&window.parent.VITECH.TapestryApi&&window.parent.VITECH.TapestryApi.NotificationCenter&&window.parent.VITECH.TapestryApi.NotificationCenter.addMessage){window.parent.VITECH.TapestryApi.NotificationCenter.addMessage(a) }},addMessages:function(a){if(window.parent.VITECH&&window.parent.VITECH.TapestryApi&&window.parent.VITECH.TapestryApi.NotificationCenter&&window.parent.VITECH.TapestryApi.NotificationCenter.addMessages){window.parent.VITECH.TapestryApi.NotificationCenter.addMessages(a) }},removeMessage:function(a){if(window.parent.VITECH&&window.parent.VITECH.TapestryApi&&window.parent.VITECH.TapestryApi.NotificationCenter&&window.parent.VITECH.TapestryApi.NotificationCenter.removeMessage){window.parent.VITECH.TapestryApi.NotificationCenter.removeMessage(a) }},clear:function(){if(window.parent.VITECH&&window.parent.VITECH.TapestryApi&&window.parent.VITECH.TapestryApi.NotificationCenter&&window.parent.VITECH.TapestryApi.NotificationCenter.clear){window.parent.VITECH.TapestryApi.NotificationCenter.clear() }},visible:function(){return true},setExceptionPageUrl:function(a){},show:function(){}}; Object.extend(VITECH.msg,{center:"",addCachedErrorItems:function(){VITECH.msg.errorCache=VITECH.msg.errorCache.uniq(); VITECH.msg.messageCache=VITECH.msg.messageCache.uniq(); this.clear();if(VITECH.msg.errorCache.length>1){this.addErrors(VITECH.msg.errorCache); return}else{if(VITECH.msg.errorCache.length==1){this.addError(VITECH.msg.errorCache[0]); return}}},addCachedMessageItems:function(){if(VITECH.msg.errorCache.length==0){if(VITECH.msg.messageCache.length>1){this.addMessages(VITECH.msg.messageCache); return}else{if(VITECH.msg.messageCache.length==1){this.addMessage(VITECH.msg.messageCache[0]); return}}}},addError:function(a){this.center.addError(a); this.center.show()},addErrors:function(a){this.center.addErrors(a); this.center.show()},removeError:function(a){this.center.removeError(a); this.center.show()},addMessage:function(a){this.center.addMessage(a); this.center.show()},addMessages:function(a){this.center.addMessages(a); this.center.show()},removeMessage:function(a){this.center.removeMessage(a); this.center.show()},clear:function(){this.center.clear() },hide:function(){this.center.hide()},activateExceptionPage:function(a){var c="menubar=no,resizable=yes,scrollbars=yes,height=600,width=800"; c+=",top="+((window.screen.availHeight-350)/4);c+=",left="+((window.screen.availWidth-800)/2); var b=window.open(this.center.exceptionPage+"&sp=l"+a+"&sp=true","ExceptionDetails",c) },showAccessibleErrors:function(){if(this.center==null||this.center==""||(window.parent&&window.parent.VITECH.testing&&window.parent.VITECH.testing.isVRunner)){return }var c=this.center.getErrors();var d="";if(c.length!=null&&c.length==0){return }if(c.length>0){d="Errors:\n";for(var b=0;bthis.viewMaxHeight)?this.viewMaxHeight:a.height) },onClose:function(){this.viewActive=false;WindowUtilities.enableScreen("overlay_modal"); return true},onOK:function(){$("skipValidation").value="T"; if(VITECH.msg.confirmMsgCache){$("ignoreMessages").value=Object.toJSON(VITECH.msg.confirmMsgCache) }if(VITECH.msg.actionButtonId){this.performAction() }else{this.saveModule()}this.contentWindow.close(); return true},onCancel:function(){$("skipValidation").value="F"; this.contentWindow.close();return true},getConfirmMessages:function(){return $$("#messageContainer li.confirm")||$A() },addConfirmMessage:function(b){if(b==null||b==""){return }var a=document.createElement("li");Element.addClassName(a,"confirm"); this.confirmMsgList.appendChild(a);a.innerHTML=b;this.confirmMsgListSize++ },addConfirmMessages:function(){VITECH.msg.confirmMsgCache=VITECH.msg.confirmMsgCache.uniq(); this.clear();for(var a=0;a