obips.ExceptionDialog=function(){};obips.ExceptionDialog.resourceFile="uicomponents/common/common.xml";obips.ExceptionDialog.checkForException=function(b,a,c){alert("sub-classes should override this method.")};obips.ExceptionDialog.Model=function(b,a,c){obips.ExceptionDialog.Model.baseConstructor.call(this,b,null,c,true);this.aErrMsgs=new Array();this.parseExceptionNodeForErrorMessages(a,this.aErrMsgs);this.titleImage=obips.ResourceManager.getSingleton().getURL(obips.ExceptionDialog.resourceFile,"uicomponents/common/title_error.png").url};extend(obips.ExceptionDialog.Model,obips.Dialog.Model);obips.ExceptionDialog.Model.prototype.getInnerText=function(c){var b="";switch(c.nodeType){case 1:var a=c.childNodes;for(i=0;i!=a.length;++i){b+=this.getInnerText(a[i])}break;case 2:b=c.nodeValue;break;case 3:b=c.nodeValue;break}return b};obips.ExceptionDialog.Model.prototype.parseExceptionNodeForErrorMessages=function(a,b){alert("sub-classes should override this method.")};obips.ExceptionDialog.SimpleModel=function(a,b){obips.ExceptionDialog.SimpleModel.baseConstructor.call(this,a,null,b,true);this.aErrMsgs=new Array();this.titleImage=obips.ResourceManager.getSingleton().getURL(obips.ExceptionDialog.resourceFile,"uicomponents/common/title_error.png").url};extend(obips.ExceptionDialog.SimpleModel,obips.Dialog.Model);obips.ExceptionDialog.Viewer=function(f,b){obips.ExceptionDialog.Viewer.baseConstructor.call(this,f,b);this.cancelButton.style.display="none";var a=this.createTextDiv(f.aErrMsgs[0]+"   ");a.insertBefore(document.createElement("br"),a.firstChild);a.style.fontWeight="bold";a.align="left";this.bodyDiv.appendChild(a);if(f.aErrMsgs.length>1){var e=this.resourceManager.getResource(saw.delivers.resourceFile,"kmsgDeliversExceptionAdditionalDetails").getString();this.showButtonIconSet=new obips.Toolbar.ButtonIconSet(obips.ResourceManager.getSingleton().getURL(obips.ExceptionDialog.resourceFile,"disclosure_collapsed").url);this.hideButtonIconSet=new obips.Toolbar.ButtonIconSet(obips.ResourceManager.getSingleton().getURL(obips.ExceptionDialog.resourceFile,"disclosure_expanded").url);this.showHideDetailsIcon=new obips.DataType.FunctionalIcon(this.showButtonIconSet,e,new obips.Callback(this,this.toggleDisplayExceptionDetails),"idExtraDetailsButton");this.showHideDetailsIcon.getViewer().parentViewer=this;a.appendChild(this.showHideDetailsIcon.getViewer());a.appendChild(document.createElement("p"));var c="";for(var d=1;d<f.aErrMsgs.length;++d){c+=f.aErrMsgs[d];if(d!=f.aErrMsgs.length){c+="\n\n"}}this.extraDetailsText=new obips.FormFields.TextArea("","idExtraDetails","extraDetails",c,true);this.extraDetailsText.field.style.width="100%";this.extraDetailsText.field.style.height="150px";this.extraDetailsText.field.style.display="none";this.bodyDiv.appendChild(this.extraDetailsText.field)}else{a.align="center";a.appendChild(document.createElement("p"))}this.floatingWindowManager.prepareDisplay(this);if(this.bodyDiv.offsetWidth>500){this.bodyDiv.style.width="500px"}else{if(this.extraDetailsText){this.extraDetailsText.field.style.width="500px"}else{if(a.offsetWidth<this.dialogDiv.offsetWidth){a.style.width=this.dialogDiv.offsetWidth}}}this.floatingWindowManager.display(this);this.controller=new obips.ExceptionDialog.Controller(this)};extend(obips.ExceptionDialog.Viewer,obips.Dialog.Viewer);obips.ExceptionDialog.Viewer.prototype.createTextDiv=function(b){var a=document.createElement("div");var c=b.split("\\n");for(var d=0;d<c.length;d++){a.appendChild(document.createTextNode(c[d]));a.appendChild(document.createElement("br"))}return a};obips.ExceptionDialog.Viewer.prototype.updateTitle=function(){obips.HTMLDOM.removeChildNodes(this.titleSpan);var a=document.createElement("img");a.src=this.model.titleImage;a.alt="";a.style.marginRight="6px";this.titleSpan.appendChild(a);this.titleSpan.appendChild(document.createTextNode(this.model.titleText))};obips.ExceptionDialog.Viewer.prototype.toggleDisplayExceptionDetails=function(){if(this.extraDetailsText.field.style.display==""){this.extraDetailsText.field.style.display="none";this.showHideDetailsIcon.iconSet=this.showButtonIconSet}else{this.extraDetailsText.field.style.display="";this.showHideDetailsIcon.iconSet=this.hideButtonIconSet}};obips.ExceptionDialog.Controller=function(a){obips.ExceptionDialog.Controller.baseConstructor.call(this,a)};extend(obips.ExceptionDialog.Controller,obips.Dialog.Controller);obips.ExceptionDialog.Controller.prototype.okDialog=function(){this.closeDialog()};