var RatingManager={RATING_SUBMITTING_MESSAGE:"Submitting rating...",RATING_SUBMIT_SUCCEED_MESSAGE:"Your rating has been saved!",RATING_SUBMIT_FAILED_MESSAGE:"Rating submission failed. Please try again later.",submitRating:function(service,msgDivId,callbackOnSave){var msgDiv=$(msgDivId);
if(!service){return;}var responseSuccessful=function(id,response){try{var result=$Y.JSON.parse(response.responseText);
if(!result.hasErrors){if(callbackOnSave){var cb=(typeof callbackOnSave=="string")?eval(callbackOnSave):callbackOnSave;
if(result.imageId){cb.apply(cb,[result.uniqueName,"_"+result.vote,result.imageId,result.thumbnailerId]);
}else{cb.apply(cb,[result.uniqueName,"_"+result.vote]);}}}RatingManager.displayMessage(msgDiv,RatingManager.RATING_SUBMIT_SUCCEED_MESSAGE);
}catch(e){log(e);RatingManager.displayMessage(msgDiv,RatingManager.RATING_SUBMIT_FAILED_MESSAGE);}};var responseFailure=function(id,response){log(response);
RatingManager.displayMessage(msgDiv,RatingManager.RATING_SUBMIT_FAILED_MESSAGE);};$Y.io(service,{method:"GET",on:{success:responseSuccessful,failure:responseFailure}});
},submitForm:function(a){$Y.one(a).ancestor("form").submit();},displayMessage:function(a,b){$Y.one(a).set("text",b).addClass("active");
},adjustAdminYesNoCounts:function(c,a){var b=$(c+a);b.innerHTML=(b.innerHTML-0)+1;$(c+"_yes_btn").disabled=false;
},adjustYesNoCounts:function(e,a){var d=$(e+"_curr");if(d.value==a){return;}if(d.value){var b=$(e+d.value);
b.innerHTML=(b.innerHTML-0)-1;}var c=$(e+a);c.innerHTML=(c.innerHTML-0)+1;Element.hide(e+a+"_btn");d.value=a;
}};
