var FeedbackInterface=Class.create();
FeedbackInterface.prototype=Object.extend(new CCnfDialog("fdb-container"),{initialize:function(){this.body=this.ajaxLoadingEffect=null;this.winContainer="win-form";this.popupObject=null;Event.observe(document,"dom:loaded",this.init.bindAsEventListener(this))},init:function(){initializeWindow()},initFeedbackForm:function(a){a=$(a);a.onsubmit=function(){return false};Event.observe(a,"submit",this.saveFeedback.bindAsEventListener(this));if(a=a.getElementsBySelector('a[rel="save"]')){a.each(function(b){b.onclick=function(){return false}});
a.invoke("observe","click",this.saveFeedback.bindAsEventListener(this))}},saveFeedback:function(a){a=Event.findElement(a,"form");var b=a.serialize();this.setLoadingEffect(this.winContainer);if(a.method=="post")new Ajax.Request(a.action,{onSuccess:this.successLoading.bind(this),postBody:b});else new Ajax.Request(a.action+"?"+b,{onSuccess:this.successLoading.bind(this)});return false},successLoading:function(a){this.removeLoadingEffect();popupWindow.successLoading(a);popupWindow.actions();return false},
removeLoadingEffect:function(){this.ajaxLoadingEffect!=null&&this.ajaxLoadingEffect.removeLoadingEffect()},setLoadingEffect:function(a){if(this.ajaxLoadingEffect==null)this.ajaxLoadingEffect=new AjaxLoadingEffect({containerId:a});this.ajaxLoadingEffect.setLoadingEffect()},hideInfo:function(){this.hideCnf()}});var objFeedback=new FeedbackInterface({});
