
$.BestOfNomination={Redirect:function(relPath){window.location.href=relPath;},Guest:{Init:function(basePath){$.BestOfNomination.BasePath=basePath;$(document).ready(function(){$.BestOfNomination.Guest.WireUpNominationControl();$.BestOfNomination.Guest.WireUpVotingControls();});},WireUpNominationControl:function(){$(".SILNominations .Nominate :button.Button").attr('title','Click to nominate this listing.').click(function(e){var myObj=this;var ddlObj=$(".SILNominations select.RaceList:first");if(ddlObj.val()<=0){$.NotifyError(e,'Please select an award.');}
else{var eid=this.id+"_"+ddlObj.val();if($.SIL.PleaseLogin(e,"to nominate.")){$.getJSON($.SIL.Authority+"/js/sil.ashx/NominateListing?callback=?",{id:eid},function(data,textStatus){if(data.d.Success){$(myObj).unbind('click').attr('title','You have nominated this business.');$.BestOfNomination.Redirect($.BestOfNomination.BasePath+data.d.Url);}
else{$.NotifyError(e,data.d.Error);}});}}});},WireUpVotingControls:function(){$(".SILNominations .EventVote :button.Button").each(function(){var myObj=this;var nid=this.id;$(myObj).attr('title','Click to vote for this nomination.').click(function(e){if($.SIL.PleaseLogin(e,"to vote.")){$.getJSON($.SIL.Authority+"/js/sil.ashx/EventVote?callback=?",{id:nid},function(data,textStatus){if(data.d.Success){$(myObj).unbind('click').attr('title','You have voted.');$.BestOfNomination.Redirect($.BestOfNomination.BasePath+data.d.Url);}
else if(data.d.Error.length>0){$.NotifyError(e,data.d.Error);}});}});});}}};