(function(){var Util=YAHOO.util;var Dom=Util.Dom;var Event=Util.Event;var notify=sym.widget.Notify.message;var inline=sym.widget.Notify.inline;var flash=sym.util.Effects.flash;sym.ui.Review={_deferTimer:null,domainId:-1,init:function(data){this.data=data;Event.addListener('comSubmit','click',sym.ui.Review.onAddCommentClick,sym.ui.Review);},onAddCommentClick:function(e,me){if(!g_captchaVerified){var callback=function(){sym.ui.Review.onAddCommentClick(e,me);};sym.ui.Dialog.show(sym.ui.Dialog.Types.CaptchaVerify,callback);return;}
var commentForm=$('add_comment_form');if(!commentForm){return;}
var comMsg=$('comMsg')
var querystring=[];var trim=YAHOO.lang.trim;for(var i=0;i<commentForm.elements.length;i++){var el=commentForm.elements[i];if(el.name=="comment[comment]"){if(trim(el.value)==""){inline(comMsg,_('BLANK_COMMENT'),sym.widget.Notify.Level.error);return;}else if(el.value.length>2000){inline(comMsg,_('LONG_COMMENT'),sym.widget.Notify.Level.error);return;}}
querystring.push(encodeURIComponent(el.name)+"="+encodeURIComponent(el.value));}
sym.util.Effects.toggleFormState(commentForm);inline(comMsg,_('SAVING'),sym.widget.Notify.Level.loading);var interval=me._deferTimer?1000:100;var callback={success:function(o){sym.util.Effects.toggleFormState(commentForm,true);inline(comMsg,_('SAVE_COMPLETE'));$('userComments').innerHTML=o.responseText;setTimeout(function(){sym.util.Effects.toggleVisible($('addCommentDiv'),{delta:20});$('comment_comment').value='';},500);setTimeout(function(){flash($('userComments').getElementsByTagName('div')[2],{color:'#FFE51E',background:true});},1000);},failure:function(o){inline(comMsg,_('SAVED_FAILED'),sym.widget.Notify.Level.error);sym.util.Effects.toggleFormState(commentForm,true);}};var transaction=YAHOO.util.Connect.asyncRequest('POST',commentForm.action,callback,querystring.join("&"));}}})();