$(document).ready(function(){$(".deleteRPL").click(function(){if(confirm("Are you sure you want to delete this reply?")){var a=$(this).attr("rel");$.getJSON(_mainRoot+"ajxdelcr/",{cid:a},function(b){if(b[0].craction=="ok")$("#reply-"+a).remove();else return false})}return false});$(".deleteCMT").click(function(){if(confirm("Are you sure you want to delete this comment?")){var a=$(this).attr("rel");$.getJSON(_mainRoot+"ajxdelcr/",{cid:a},function(b){if(b[0].craction=="ok")$("#comment_data-"+a).remove(); else return false})}return false});$(".cancel_replycomment_link").click(function(){$("#allreply-"+$(this).attr("rel")).show();$("#replyComment-"+$(this).attr("rel")).toggle();return false});$(".cancel_editcomment_link").click(function(){$("#editbox-"+$(this).attr("rel")).toggle();return false});$(".editCMT").click(function(){$("#editbox-"+$(this).attr("rel")).toggle();return false});$(".addreplyCMT").click(function(){$("#allreply-"+$(this).attr("rel")).show();$("#replyComment-"+$(this).attr("rel")).toggle(); $("#replytext-"+$(this).attr("rel")).focus();return false});$("#add-comment").click(function(){$(".addcomment_box .data_error").hide();if($.trim($("#cmttext").val()).length==0){$("#cmttext_error").html("comment is required").show();$("#cmttext").focus()}if($(".addcomment_box .data_error").is(":visible"))return false});$("#add-guest-comment").click(function(){$(".addcomment_box .data_error").hide();var a=false;if($.trim($("#cmtname").val()).length==0){$("#cmtname_error").html("name is required").show(); $("#cmtname").focus();a=true}if($.trim($("#cmtemail").val()).length==0){$("#cmtemail_error").html("email is required").show();if(!a){$("#cmtemail").focus();a=true}}if($.trim($("#cmtemail").val()).length>0)if(!validateEmail($.trim($("#cmtemail").val()))){$("#cmtemail_error").html("email is not valid").show();a||$("#cmtemail").focus()}if($.trim($("#cmttext").val()).length==0){$("#cmttext_error").html("comment is required").show();$("#cmttext").focus()}if($(".addcomment_box .data_error").is(":visible"))return false}); $("div.game_entry").hover(function(){$(this).css("background-color","#eee")},function(){$(this).css("background-color","#fff")});$("#ilike-game").click(function(){$.getJSON(_mainRoot+"ajxilikegame/",{gid:$("#gid").val()},function(a){var b=a[0].gameaction;a=a[0].gamecount;if(b=="fav"){$("#ilike-game").removeClass();$("#ilike-game").addClass("ilike-game-unfav");$("#likedby").text(a)}else if(b=="unfav"){$("#ilike-game").removeClass();$("#ilike-game").addClass("ilike-game-fav");$("#likedby").text(a)}else return false}); return false});$("#cw_link").click(function(){$("#cw_container").toggle();return false});$("#cw_container").length>0&&$("#cw_container a").click(function(){$("#cw_container a").removeClass();$(this).addClass("custw_sel");$(this).attr("href")=="#small"&&$("#embed_code").val($("#embed_code_small").val());$(this).attr("href")=="#large"&&$("#embed_code").val($("#embed_code_large").val());Wildfire.initPost("107171","divWildfirePost1",308,250,pconf);return false})}); function comment_addreply(a){a="replytext-"+a;var b=$("#"+a).val();if($.trim(b).length<10){$("#"+a+"_error").html("Please enter atleast 10 characters").show();$("#"+a).focus();return false}}function comment_editcomment(a){a="edit-text-"+a;var b=$("#"+a).val();if($.trim(b).length<10){$("#"+a+"_error").html("Please enter atleast 10 characters").show();$("#"+a).focus();return false}};
