Type.registerNamespace("Comment");Comment.Form=function(b,a,d,c,e){this._userId=d;this._subjectId=b;this._commentId=a;this._emailId=c;this._url=e};Comment.Form.prototype={getUserId:function(){return this._userId},getSubjectId:function(){return this._subjectId},getCommentId:function(){return this._commentId},getEmailId:function(){return this._emailId},getUrl:function(){return this._url},CleanNotifications:function(){var c=document.getElementById("textOk");if(c!=null)c.style.display="none";var a=document.getElementById("textError");if(a!=null)a.style.display="none";var b=document.getElementById("textEnviar");if(b!=null)b.style.display="none"},InsertComment:function(q,k,i,l,m){var o=document.getElementById("textOk");o.style.display="none";var n=document.getElementById("textError");n.style.display="none";var h=document.getElementById("textEnviar");h.style.display="none";var c="",b="",a="",d="",e=document.getElementById(this.getSubjectId()),j=document.getElementById(this.getCommentId()),g=document.getElementById(this.getUserId()),f=document.getElementById(this.getEmailId()),p=this.getUrl();if(g!=null)a=g.value;else a=l;if(e!=null)c=e.value;b=j.value;if(f!=null)d=f.value;var h=document.getElementById("textEnviar");h.style.display="";GSI.CRM.Comments.CommentServices.InsertComment(k,b,c,i,a,m,d,p,SucceededCallback,errorCallback,[this.getSubjectId(),this.getCommentId(),this.getUserId(),this.getEmailId()])},ClientValidate:function(){var a=true,c=new RegExp("<((?:.|\x0a)*?)>|</((?:.|\x0a)*?)>|</((?:.|\x0a)*?)>"),d=document.getElementById(this.getUserId());if(d!=null){var b=c.exec(d.value);if(b==null)a=true;else a=false}if(a==true){var e=document.getElementById(this.getSubjectId());if(e!=null){var b=c.exec(e.value);if(b==null)a=true;else a=false}}if(a==true){var f=document.getElementById(this.getCommentId()).value,b=c.exec(f);if(b==null)a=true;else a=false}return a}};function SucceededCallback(f,b){var e=document.getElementById("textOk");e.style.display="";var d=document.getElementById("textEnviar");d.style.display="none";for(var a=0;a<b.length;a++){var c=document.getElementById(b[a]);if(c!=null)c.value=""}}function errorCallback(){var a=document.getElementById("textError");a.style.display="";var b=document.getElementById("textEnviar");b.style.display="none"}Comment.Form.registerClass("Comment.Form",null,Sys.IDisposable);function Check_NewComment(e,b){var a=$("#"+e.filterID),d=$("select[id$=listContent]",a).val(),c=$("select[id$=listEntity]",a).val();DisableGroup(b,d!=="-1"||c==="0"?"":"disabled")}function Check_EditComment(e,a,d){var c=$("#"+e.filterID),b=$("select[id$=listEntity]",c).val();DisableGroup(a,d.get_num_rows()==1&&b!=="-1"?"":"disabled")}function CommentDblClick(j,a,f){var b=$("#"+f),h=$("select[id$=listContent]",b).val(),e=$("select[id$=listEntity]",b).val(),i=a.getSelectedClient(),c=[];c=a.SplitParam(j);var k=c[1],g=String.format(a.redirect_edit,k,i),d=String.format(a.edit_querystring,h,e);window.location=g+d}function NewCommentClick(a,e){var b=$("#"+e),f=$("select[id$=listContent]",b).val(),d=$("select[id$=listEntity]",b).val(),h=a.getSelectedClient(),g=String.format(a.redirect_new,"",h),c=String.format(a.new_querystring,f,d);window.location=g+c}function EditCommentClick(a,e){var b=$("#"+e),g=$("select[id$=listContent]",b).val(),d=$("select[id$=listEntity]",b).val(),h=a.getSelectedClient(),f=String.format(a.redirect_edit,a.GetSelectedIds(),h),c=String.format(a.edit_querystring,g,d);window.location=f+c};