var ratings=new sack(ratings_ajax_url);var ratings_delete=new sack(ratings_delete_ajax_url);var comments=new sack(comments_ajax_url);var post_id=0;var post_rating=0;var rate_fadein_opacity=0;var rate_fadeout_opacity=100;var is_ie=(document.all&&document.getElementById);var is_moz=(!document.all&&document.getElementById);var is_opera=(navigator.userAgent.indexOf("Opera")>-1);var is_being_rated=false;var rated_score=0;var reset_timer;function rade_fadein_text(){if(rate_fadein_opacity<100){rate_fadein_opacity+=10;if(is_opera){rate_fadein_opacity=100;}else{if(is_ie){document.getElementById("post-ratings-"+post_id).filters.alpha.opacity=rate_fadein_opacity;}else{if(is_moz){document.getElementById("post-ratings-"+post_id).style.MozOpacity=(rate_fadein_opacity/100);}}}setTimeout("rade_fadein_text()",100);}else{rate_fadein_opacity=100;rate_unloading_text();is_being_rated=false;}}function current_rating(id,_2,_3){clearResetTimer();post_id=id;post_rating=_2;for(i=1;i<=_2;i++){document.images["rating_"+post_id+"_"+i].src=eval("ratings_mouseover_image.src");}if(document.getElementById("ratings_"+post_id+"_text")){document.getElementById("ratings_"+post_id+"_text").style.display="inline";document.getElementById("ratings_"+post_id+"_text").innerHTML=_3;}}function show_current_rating(_4,_5){for(i=1;i<=5;i++){if(i<=_4){document.images["show_ratings_"+i].src=site_url+"/wp-content/plugins/postratings/images/"+ratings_image+"/rating_on.gif";document.images["show_ratings_"+i].title="Rating: "+_4+" out of 5";document.images["show_ratings_"+i].alt="Rating: "+_4+" out of 5";}else{if(i==_5){document.images["show_ratings_"+i].src=site_url+"/wp-content/plugins/postratings/images/"+ratings_image+"/rating_half.gif";document.images["show_ratings_"+i].title="Rating: "+_4+" out of 5";document.images["show_ratings_"+i].alt="Rating: "+_4+" out of 5";}else{document.images["show_ratings_"+i].src=site_url+"/wp-content/plugins/postratings/images/"+ratings_image+"/rating_off.gif";document.images["show_ratings_"+i].title="Rating: "+_4+" out of 5";document.images["show_ratings_"+i].alt="Rating: "+_4+" out of 5";}}}}function ratings_off(_6,_7){for(i=1;i<=ratings_max;i++){if(i<=_6){document.images["rating_"+post_id+"_"+i].src=site_url+"/wp-content/plugins/postratings/images/"+ratings_image+"/rating_on.gif";}else{document.images["rating_"+post_id+"_"+i].src=site_url+"/wp-content/plugins/postratings/images/"+ratings_image+"/rating_off.gif";}}if(document.getElementById("ratings_"+post_id+"_text")){document.getElementById("ratings_"+post_id+"_text").style.display="none";document.getElementById("ratings_"+post_id+"_text").innerHTML="";}reset_timer=setTimeout("reset_stars()",1);}function rate_loading_text(){document.getElementById("post-ratings-"+post_id+"-loading").style.display="block";}function rate_unloading_text(){document.getElementById("post-ratings-"+post_id+"-loading").style.display="none";}function rate_post(){clearResetTimer();is_being_rated=true;rated_score=post_rating;}function check_form(_8,_9,_a){var _b=document.getElementById("agreetos");if(_b){if(_b.checked){if(post_rating>0){if($("nocomment")){Element.hide("nocomment");}$("submit").disabled=true;$("comment").disabled=true;Element.show("loading");comment_process(_8,_9,_a);}else{alert("Please click on the stars to give the business a rating.");}}else{alert("You must agree with Yebber.com's Terms of Use by checking the box to proceed with the registration.");}}else{if(post_rating>0){if($("nocomment")){Element.hide("nocomment");}$("submit").disabled=true;$("comment").disabled=true;Element.show("loading");comment_process(_8,_9,_a);}else{alert("Please click on the stars to give the business a rating.");}}return false;}function rate_process(_c,_d,_e){ratings.setVar("pid",post_id);ratings.setVar("rate",post_rating);ratings.method="GET";ratings.runAJAX();return false;}function rate_delete(_f){ratings_delete.setVar("postid",_f);ratings_delete.method="GET";ratings_delete.runAJAX();}function comment_process(_10,_11,_12){if($("jal_edit_this").value>0){new Ajax.Updater({success:"commentlist"},_11+"/comments-ajax-edit.php",{asynchronous:true,evalScripts:true,insertion:Insertion.Bottom,onComplete:function(_13){rade_fadein_text();complete(_13,"edit",_10,_11,_12);},onFailure:function(_14){failure(_14,"edit");},onLoading:function(_15){loading();},parameters:_10+"&post_rating="+post_rating});}else{new Ajax.Updater({success:"commentlist"},_11+"/comments-ajax.php",{asynchronous:true,evalScripts:true,insertion:Insertion.Bottom,onComplete:function(_16){rade_fadein_text();complete(_16,"write",_10,_11,_12);},onFailure:function(_17){failure(_17,"write");},onLoading:function(_18){loading();},parameters:_10+"&post_rating="+post_rating});}}function commentAdded2(){Element.hide("loading");Element.show("commentform");document.body.style.cursor="auto";if($("errors")){Element.remove("errors");}new Insertion.After(document.getElementById("commentlist"),"test");alert(document.getElementById("commentlist").lastChild);$("comment").value="";$("comment").disabled=true;$("submit").disabled=true;if($("nocomment")){Element.remove("nocomment");}if($("hidelist")){Element.remove("hidelist");}}function clearResetTimer(){if(reset_timer){clearTimeout(reset_timer);reset_timer=null;}}function reset_stars(){clearResetTimer();current_rating(post_id,rated_score,"");}