var MsgWindowIcons={CloseWindow:"http://cdn.3rdl.com/module/webwindow/images/close.gif",Default:"http://cdn.3rdl.com/module/webwindow/images/info.png",Info:"http://cdn.3rdl.com/module/webwindow/images/info.png",HourGlass:"http://cdn.3rdl.com/module/webwindow/images/hourglass.gif",Loading:"http://cdn.3rdl.com/module/webwindow/images/loading.gif",Loading2:"http://cdn.3rdl.com/module/webwindow/images/loading2.gif",Loader:"http://cdn.3rdl.com/module/webwindow/images/loader.gif",Critical:"http://cdn.3rdl.com/module/webwindow/images/critical.png",Error:"http://cdn.3rdl.com/module/webwindow/images/error.png",Help:"http://cdn.3rdl.com/module/webwindow/images/help.gif",Print:"http://cdn.3rdl.com/module/webwindow/images/print.gif",Success:"http://cdn.3rdl.com/module/webwindow/images/success.png",Resize:"http://cdn.3rdl.com/module/webwindow/images/resize.gif",Maximize:"http://cdn.3rdl.com/module/webwindow/images/expand.gif",Minimize:"http://cdn.3rdl.com/module/webwindow/images/minimize.gif",Dimmer:"http://cdn.3rdl.com/module/webwindow/images/ModalDimmer.png",PreloadImages:function(){function _1(_2){if(document.images){var _3=new Image();_3.src=_2;return _3;}};for(prop in MsgWindowIcons){if(typeof (MsgWindowIcons[prop])=="string"){_1(MsgWindowIcons[prop]);}}}};MsgWindowIcons.PreloadImages();var MsgWindowButtons={Ok:"ok",Cancel:"cancel",OkCancel:"okcancel",None:null};function createButton(_4){var b=document.createElement("button");b.appendChild(document.createTextNode(_4));return b;};function OkCancel(p){p.window.close();return false;};function MsgWindowOptions(o){this.height=(o&&o.height)?o.height:0;this.width=(o&&o.width)?o.width:0;this.left=(o&&o.left)?o.left:null;this.top=(o&&o.top)?o.top:null;this.center=(o&&o.center)?o.center:"middle";this.resize=(o&&o.resize)?o.resize:0;this.scrolling=(o&&o.scrolling)?o.scrolling:1;this.modal=(o&&typeof o.modal!="undefined")?o.modal:false;this.dragenabled=(o&&typeof o.dragenabled!="undefined")?o.dragenabled:false;this.oncommand=(o&&o.oncommand)?o.oncommand:null;this.buttons=(o&&o.buttons)?o.buttons:null;this.icon=(o&&o.icon)?o.icon:null;this.showhandle=(o&&typeof o.showhandle!="undefined")?o.showhandle:true;this.showcontrols=(o&&typeof o.showcontrols!="undefined")?o.showcontrols:true;this.title=(o&&typeof o.title!="undefined")?o.title:"";};var MsgWindow={minimizeorder:0,zIndexvalue:20000,tobjects:[],lastactivet:{},GetMsgWindowCore:function(t){return {MsgWindow:MsgWindow,WebWindow:t,MsgWindowIcons:MsgWindowIcons,MsgWindowButtons:MsgWindowButtons,MsgWindowOptions:MsgWindowOptions,ControlWindow:ControlWindow};},init:function(id){var _5=document.createElement("div");_5.id=id;_5.className="MsgWindow";var _6="";_6="<div class=\"drag-handle\">";_6+="{Title} <div class=\"drag-controls\"><img src=\""+MsgWindowIcons.Minimize+"\" title=\"Minimize\" /><img src=\""+MsgWindowIcons.CloseWindow+"\" title=\"Close\" /></div>";_6+="</div>";_6+="<div class=\"drag-icon\"></div>";_6+="<div class=\"drag-contentarea\"></div>";_6+="<div class=\"drag-buttons\"></div>";_6+="<div class=\"drag-statusarea\"><div class=\"drag-resizearea\" style=\"background: transparent url("+MsgWindowIcons.Resize+") top right no-repeat;\">&nbsp;</div></div>";_6+="</div>";_5.innerHTML=_6;EL.get("MsgWindowContainer").appendChild(_5);var t=EL.get(id);var _7=t.getElementsByTagName("div");for(var i=0;i<_7.length;i++){if(/drag-/.test(_7[i].className)){t[_7[i].className.replace(/drag-/,"")]=_7[i];}}t.handle._parent=t;t.resizearea._parent=t;t.controls._parent=t;t.iframe=null;t.onclose=function(){return true;};t.raiseoncommand=function(_8,_9){if(t.oncommand){return t.oncommand({"command":_8,"window":this,"args":_9});}return false;};t.onmousedown=function(){MsgWindow.setfocus(this);};t.handle.onmousedown=MsgWindow.setupdrag;t.resizearea.onmousedown=MsgWindow.setupdrag;t.controls.onclick=MsgWindow.enablecontrols;t.show=function(){MsgWindow.show(this);};t.hide=function(){MsgWindow.hide(this);};t.close=function(){MsgWindow.close(this);};t.setSize=function(w,h){MsgWindow.setSize(this,w,h);};t.moveTo=function(x,y){MsgWindow.moveTo(this,x,y);};t.isResize=function(_a){MsgWindow.isResize(this,_a);};t.isScrolling=function(_b){MsgWindow.isScrolling(this,_b);};t.addButton=function(_c){MsgWindow.addButton(this,_c);};t.autoResize=function(){MsgWindow.autoResize(this);};t.load=function(_d,_e,_f){MsgWindow.load(this,_d,_e,_f);};this.tobjects[this.tobjects.length]=t;return t;},open:function(t,_10,_11,_12,_13,_14){var d=MsgWindow;if(EL.get(t)==null){t=this.init(t);}else{t=EL.get(t);}this.setfocus(t);var _15=new MsgWindowOptions(_13);t.msgwindowoptions=_15;t.setSize(_15.width,_15.height);var _16=_15.left?_15.left:"middle";var _17=_15.top?_15.top:"middle";if(typeof _14!="undefined"&&_14=="recal"&&this.scroll_top==0){if(window.attachEvent&&!window.opera){this.addEvent(window,function(){setTimeout(function(){t.moveTo(_16,_17);},400);},"load");}else{this.addEvent(window,function(){t.moveTo(_16,_17);},"load");}}t.isResize(_15.resize);t.isScrolling(_15.scrolling);t.style.visibility="visible";t.style.display="block";t.contentarea.style.display="block";t.buttons.style.display=(_15.buttons)?"block":"none";t.icon.style.display=(_15.icon)?"block":"none";t.moveTo(_16,_17);if(_15.modal){ModalDimmer.Show(t);}t.handle.style.cursor=(_15.dragenabled==false)?"default":"move";t.oncommand=_15.oncommand;t.load(_10,_11,_12);if(t.state=="minimized"&&t.controls.firstChild.title=="Restore"){t.controls.firstChild.setAttribute("src",MsgWindowIcons.Minimize);t.controls.firstChild.setAttribute("title","Minimize");t.state="fullview";}t.handle.style.display=(_15.showhandle)?"block":"none";t.controls.style.display=(_15.showhandle&&_15.showcontrols)?"block":"none";if(_15.buttons){MsgWindow.addButtons(t);}if(_15.icon){MsgWindow.addIcon(t);}return t;},alert:function(msg,_18,_19,cb){_18=(_18)?_18:"Application Message";_19=(_19)?_19:MsgWindowIcons.Info;var _1a=(cb)?cb:OkCancel;var _1b=new MsgWindowOptions({modal:true,width:350,height:50,buttons:MsgWindowButtons.Ok,icon:_19,title:_18,oncommand:_1a,showcontrols:false});return Dialogs.show(msg,_1b);},requestLoader:function(id,_1c){var div=EL.get(id);_1c=(_1c)?_1c:MsgWindowIcons.Loader;if(div){var _1d="<div id=\"Loader\" style=\"margin:0 auto;width:100%;padding-top:50px;text-align:center;\"><img src=\"{0}\" alt=\"Loading\" border=\"0\"/></div>";div.innerHTML=String.format(_1d,_1c);}},requestStart:function(msg,_1e){_1e=(_1e)?_1e:MsgWindowIcons.Loading;msg=(msg)?msg:"Processing your request, please wait...";return Dialogs.show(msg,new MsgWindowOptions({icon:_1e,modal:true,showhandle:false,height:75,width:350}));},requestEnd:function(){Dialogs.hide();},addIcon:function(t){t.icon.innerHTML="";var img=document.createElement("img");img.setAttribute("src",t.msgwindowoptions.icon);t.icon.appendChild(img);},addButtons:function(t){t.buttons.innerHTML="";switch(t.msgwindowoptions.buttons){case MsgWindowButtons.Ok:t.addButton("Ok");break;case MsgWindowButtons.Cancel:t.addButton("Cancel");break;case MsgWindowButtons.OkCancel:t.addButton("Ok");t.addButton("Cancel");break;}},addButton:function(t,_1f){var b=createButton(_1f);b.win=t;b.onclick=function(){return this.win.raiseoncommand(_1f);};t.buttons.appendChild(b);if(_1f=="Ok"&&b.focus){b.focus();}},setSize:function(t,w,h){t.style.width=Math.max(parseInt(w),150)+"px";t.contentarea.style.height=Math.max(parseInt(h),100)+"px";},moveTo:function(t,x,y){this.getviewpoint();t.style.left=(x=="middle")?this.scroll_left+(this.docwidth-t.offsetWidth)/2+"px":this.scroll_left+parseInt(x)+"px";var _20=(y=="middle")?this.scroll_top+(this.docheight-t.offsetHeight)/2+"px":this.scroll_top+parseInt(y)+"px";var _21=parseInt(_20);t.style.top=(_21<0)?"50px":_20;},isResize:function(t,bol){t.statusarea.style.display=(bol)?"block":"none";t.resizeBool=(bol)?1:0;},isScrolling:function(t,bol){t.contentarea.style.overflow=(bol)?"auto":"hidden";},load:function(t,_22,_23,_24){if(t.isClosed){alert("This window has been closed and needs to be open or recreated.");return;}var _25=_22.toLowerCase();if(typeof _24!="undefined"){t.handle.firstChild.nodeValue=_24;}if(_25=="inline"){t.contentarea.innerHTML=_23;}else{if(_25=="div"){var _26=EL.get(_23);t.contentarea.innerHTML=(_26.defaultHTML||_26.innerHTML);if(!_26.defaultHTML){_26.defaultHTML=_26.innerHTML;}_26.innerHTML="";_26.style.display="none";}else{if(_25=="iframe"){t.contentarea.style.overflow="hidden";if(!t.contentarea.firstChild||t.contentarea.firstChild.tagName!="IFRAME"){t.contentarea.innerHTML="<iframe src=\"\" MsgWindowId=\""+t.id+"\" style=\"margin:0;padding:0;width:100%;height:100%\" frameborder=\"0\" name=\"_iframe-"+t.id+"\"></iframe>";}window.frames["_iframe-"+t.id].location.replace(_23);}}}t.contentarea.datatype=_25;},setupdrag:function(e){var d=MsgWindow;var t=this._parent;d.etarget=this;var e2=window.event||e;d.initmousex=e2.clientX;d.initmousey=e2.clientY;d.initx=parseInt(t.offsetLeft);d.inity=parseInt(t.offsetTop);d.width=parseInt(t.offsetWidth);d.contentheight=parseInt(t.contentarea.offsetHeight);if(t.contentarea.datatype=="iframe"){t.style.backgroundColor="#F8F8F8";t.contentarea.style.visibility="hidden";}document.onmousemove=d.getdistance;document.onmouseup=function(){if(t.contentarea.datatype=="iframe"){t.contentarea.style.backgroundColor="white";t.contentarea.style.visibility="visible";}d.stop();};return false;},getdistance:function(e){var d=MsgWindow;var _27=d.etarget;var e2=window.event||e;d.distancex=e2.clientX-d.initmousex;d.distancey=e2.clientY-d.initmousey;if(_27.className=="drag-handle"){if(_27._parent.msgwindowoptions.dragenabled==false){return false;}d.move(_27._parent,e2);}else{if(_27.className=="drag-resizearea"){d.resize(_27._parent,e2);}}return false;},getviewpoint:function(){var ie=document.all&&!window.opera;var _28=document.documentElement&&parseInt(document.documentElement.clientWidth)||100000;this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;this.scroll_top=(ie)?this.standardbody.scrollTop:window.pageYOffset;this.scroll_left=(ie)?this.standardbody.scrollLeft:window.pageXOffset;this.docwidth=(ie)?this.standardbody.clientWidth:(/Safari/i.test(navigator.userAgent))?window.innerWidth:Math.min(_28,window.innerWidth-16);this.docheight=(ie)?this.standardbody.clientHeight:window.innerHeight;},rememberattrs:function(t){this.getviewpoint();t.lastx=parseInt((t.style.left||t.offsetLeft))-MsgWindow.scroll_left;t.lasty=parseInt((t.style.top||t.offsetTop))-MsgWindow.scroll_top;t.lastwidth=parseInt(t.style.width);},move:function(t,e){t.style.left=MsgWindow.distancex+MsgWindow.initx+"px";t.style.top=MsgWindow.distancey+MsgWindow.inity+"px";},autoResize:function(t){function _29(_2a){var _2b=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];var _2c=parseFloat(_2b)>=0.1?50:0;if(_2a&&!window.opera){_2a.style.display="block";if(_2a.contentDocument&&_2a.contentDocument.body.offsetHeight){_2a.height=_2a.contentDocument.body.offsetHeight+_2c;}else{if(_2a.Document&&_2a.Document.body.scrollHeight){_2a.height=parseInt(_2a.Document.body.scrollHeight);}}}};var _2d=window.frames["_iframe-"+t.id];if(_2d){_29(_2d);}},resize:function(t,e){t.style.width=Math.max(MsgWindow.width+MsgWindow.distancex,150)+"px";t.contentarea.style.height=Math.max(MsgWindow.contentheight+MsgWindow.distancey,100)+"px";},enablecontrols:function(e){var d=MsgWindow;var _2e=window.event?window.event.srcElement:e.target;if(/Minimize/i.test(_2e.getAttribute("title"))){d.minimize(_2e,this._parent);}else{if(/Restore/i.test(_2e.getAttribute("title"))){d.restore(_2e,this._parent);}else{if(/Close/i.test(_2e.getAttribute("title"))){d.close(this._parent);}}}return false;},minimize:function(_2f,t){MsgWindow.rememberattrs(t);_2f.setAttribute("src",MsgWindowIcons.Maximize);_2f.setAttribute("title","Restore");t.state="minimized";t.icon.style.display=t.statusarea.style.display=t.buttons.style.display=t.contentarea.style.display="none";if(typeof t.minimizeorder=="undefined"){MsgWindow.minimizeorder++;t.minimizeorder=MsgWindow.minimizeorder;}t.style.left="10px";t.style.width="200px";var _30=t.minimizeorder*10;t.style.top=MsgWindow.scroll_top+MsgWindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-_30+"px";t.raiseoncommand("minimize");},restore:function(_31,t){MsgWindow.getviewpoint();_31.setAttribute("src",MsgWindowIcons.Minimize);_31.setAttribute("title","Minimize");t.state="fullview";t.contentarea.style.display=t.style.display="block";t.buttons.style.display=(t.msgwindowoptions.buttons)?"block":"none";t.icon.style.display=(t.msgwindowoptions.icon)?"block":"none";if(t.resizeBool){t.statusarea.style.display="block";}t.style.left=parseInt(t.lastx)+MsgWindow.scroll_left+"px";t.style.top=parseInt(t.lasty)+MsgWindow.scroll_top+"px";t.style.width=parseInt(t.lastwidth)+"px";t.raiseoncommand("restore");},close:function(t){if(t.isClosed){return true;}var _32=false;try{_32=t.onclose();}catch(err){_32=true;}finally{if(typeof _32=="undefined"){alert("An error has occured somwhere inside your \"onclose\" event handler");_32=true;}}if(_32){if(t.state!="minimized"){MsgWindow.rememberattrs(t);}if(window.frames["_iframe-"+t.id]){window.frames["_iframe-"+t.id].location.replace("about:blank");}else{t.contentarea.innerHTML="";}ModalDimmer.Hide(t);t.style.display="none";t.isClosed=true;t.raiseoncommand("close");}return _32;},setopacity:function(_33,_34){if(!_33){return;}if(_33.filters&&_33.filters[0]){if(typeof _33.filters[0].opacity=="number"){_33.filters[0].opacity=_34*100;}else{_33.style.filter="alpha(opacity="+_34*100+")";}}else{if(typeof _33.style.MozOpacity!="undefined"){_33.style.MozOpacity=_34;}else{if(typeof _33.style.opacity!="undefined"){_33.style.opacity=_34;}}}},setfocus:function(t){this.zIndexvalue++;t.style.zIndex=this.zIndexvalue;t.isClosed=false;this.setopacity(this.lastactivet.handle,0.5);this.setopacity(t.handle,1);this.lastactivet=t;},show:function(t){if(t.isClosed){alert("Window has been closed, so nothing to show. Open/Create the window again.");return;}if(t.lastx){MsgWindow.restore(t.controls.firstChild,t);}else{t.style.display="block";}this.setfocus(t);t.state="fullview";},hide:function(t){if(t.msgwindowoptions.modal==true){alert("You cannot hide a modal window.  Please use the close() method to remove modal windows.");return false;}t.style.display="none";},stop:function(){MsgWindow.etarget=null;document.onmousemove=null;document.onmouseup=null;},addEvent:function(_35,_36,_37){var _38=(window.addEventListener)?_37:"on"+_37;if(_35.addEventListener){_35.addEventListener(_38,_36,false);}else{if(_35.attachEvent){_35.attachEvent(_38,_36);}}},destroy:function(){for(var i=0;i<MsgWindow.tobjects.length;i++){MsgWindow.tobjects[i].handle._parent=MsgWindow.tobjects[i].resizearea._parent=MsgWindow.tobjects[i].controls._parent=null;}window.onunload=null;}};window.onunload=MsgWindow.destroy;function getMsgWindow(_39){var id=_39.getAttribute("MsgWindowId");var obj=MsgWindow.GetMsgWindowCore(null);for(var i=0;i<MsgWindow.tobjects.length;i++){if(MsgWindow.tobjects[i].id==id){obj.WebWindow=MsgWindow.tobjects[i];return obj;}}return obj;};var Dialogs={Count:0,dwindows:[],show:function(msg,_3a){var num=++this.Count;var _3b=_3a&&_3a.title?_3a.title:"";var win=MsgWindow.open("Dialog_"+num,"inline",msg,_3b,_3a,"recal");this.dwindows.push(win);return win;},hide:function(){var _3c=this.dwindows.pop();if(_3c==null){return;}_3c.close();},destroy:function(){MsgWindow.destroy();}};function ControlWindows(){this.Url="";this.Open=function(id,p,t,o){if(this.Url==null){alert("ControlWindow.Url is Null.  Please define Control window.");return false;}var url=this.Url+"?c="+p;return MsgWindow.open(id,"iframe",url,t,o);};this.OpenView=function(id,p,t,o){if(this.Url==null){alert("ControlWindow.Url is Null.  Please define Control window.");return false;}var url=this.Url+"?url="+p;return MsgWindow.open(id,"iframe",url,t,o);};};var ControlWindow=new ControlWindows();
