document.domain="centsports.com";$(function(){$.ajaxSetup({cache:false,async:true});$("#view_bet_opt").change(function(){var a=$("#bet_target").attr("data-id");var b=$("#bet_target");b[0].innerHTML="Loading...";$.get("/interact/bets.php",{"do":"display_bets",opt:$(this).val(),user_id:a},function(c){b.html(c);});});$("#cur_sport").bind("change",function(){var c=$("#new_bet_target");c[0].innerHTML="Loading...";var b=$("#filter_inactive").attr("checked");if(b){b="true";}else{b="false";}var a=$(this).val();$("#pick_sport .each").hide();var d=$("#pick_sport .each .sport_"+a).closest(".each").show().attr("data-id");if(!$("#pick_sport .sports_list li.cat_"+d).hasClass("sel")){$("#pick_sport .sports_list li").removeClass("sel");$("#pick_sport .sports_list li.cat_"+d).addClass("sel");}$("#pick_sport .each a").removeClass("b");$("#pick_sport .each .sport_"+a).addClass("b");$.get("/interact/bets.php",{"do":"display_new_bets",sport_code:a,filter_inactive:b},function(e){c.html(e);$("#bet_listing .subtitle").html($("#sport_code_label").html());});});$("#pick_sport .sports_list li").bind("click",function(){$("#pick_sport .sports_list li").removeClass("sel");this_class=$(this).attr("class");$(this).addClass("sel");$("#pick_sport .each").hide();clickit=$("#pick_sport .each."+this_class).show().find("a:first").trigger("click");return false;});$("#pick_sport .each a").click(function(){var a=$("#cur_sport");a.val($(this).attr("href").replace(/#/,""));a.trigger("change");});$("#filter_inactive").click(function(){$("#cur_sport").trigger("change");});$(".comment_open").live("click",function(){var a=$(this).attr("data-id");var b=$(".comment_block[data-id="+a+"]");if(b.is(":hidden")){b.slideDown();}else{b.slideUp();}return false;});$(".comment_close").live("click",function(){stuff=$(this).closest("table").attr("data-id");$(".comment_block[data-id="+stuff+"]").slideUp();return false;});$(".common_bets_open").live("click",function(){var a=$(this).attr("data-id");var b=$(".common_bets_block[data-id="+a+"]");if(b.is(":hidden")){b.slideDown();}else{b.slideUp();}return false;});$(".common_bets_close").live("click",function(){stuff=$(this).closest("table").attr("data-id");$(".common_bets_block[data-id="+stuff+"]").slideUp();return false;});$("#friend_prev").live("click",function(){var a=$("#news_feed .friend_list");cur_top=parseInt(a.css("top"));diff=parseInt($("#news_feed .friend_list_container").css("height"))+2;if(cur_top+diff+1>0){a.animate({top:"0px"},"slow");}else{if(cur_top<=0){a.animate({top:"+="+diff+"px"},"slow");}}return false;});$("#friend_next").live("click",function(){var a=$("#news_feed .friend_list");cur_top=parseInt(a.css("top"));height=parseInt(a.css("height"));diff=parseInt($("#news_feed .friend_list_container").css("height"))+2;if((0-cur_top+diff*2)>height){go=height-diff;a.animate({top:"-"+go+"px"},"slow","swing");}else{a.animate({top:"-="+diff+"px"},"slow","swing");}return false;});$(".bet_option_trigger").live("mouseover",function(a){bet_data=$(this).closest(".bet_each").find(".bet_data");bet_options=$(".bet_options.skel").clone();bet_options.prependTo(bet_data);$(this).closest(".bet_each").find(".bet_options").removeClass("skel").show();});$().bind("submit",function(d){that=d.target;if($(that).closest("table").hasClass("comment_block")){if($(that).find("[name=comment_text]").val().length>0){postval=$(that).serializeArray();$.post("/interact/bets.php",postval,function(e){new_comment=$(".comment_exist.skel:first").clone();new_comment.find(".comment_name").html(e.name);new_comment.find(".comment_date").html(e.date);new_comment.find(".comment_text").html(e.comment_text);new_comment.attr("data-id",e.comment_id);new_comment.insertBefore(".comment_block[data-id="+e.p_id+"] .comment_exist.skel");z=$(".comment_block[data-id="+e.p_id+"] tr.comment_exist:odd td.comment").addClass("grey");new_comment.slideDown().removeClass("skel");$(that).find("textarea").val("");},"json");}return false;}if($(that).hasClass("edit_profile_popup")){query=$(that).serialize();$.post("/interact/change_profile.php",query,function(e){if(e=="0"){window.location="/profile/";}else{alert("Unknown error occured");}});return false;}if($(that).hasClass("compose_message")){var b=$(".compose_message :submit");b.attr("disabled","disabled");b.val("Sending, Please Wait...");query=$(that).serialize();$.post("/interact/compose_message.php",query,function(e){if(e=="0"){setTimeout(function(){$(document).trigger("close.facebox");},500);return 0;}else{b.attr("disabled","");b.val("Send Message");alert("Unknown error occured while sending message "+e);}});return false;}if($(that).hasClass("img_upload_form")){var a=$(".img_upload_submit");a.attr("disabled","disabled");a.val("Uploading, Please Wait...");var f=1;var c=function(){try{if(document.getElementById("tframe").contentWindow.location.pathname=="/upload.php"){data=document.getElementById("tframe").contentWindow.document.getElementById("uri").innerHTML;error=document.getElementById("tframe").contentWindow.document.getElementById("error").innerHTML;if(error==0){if($("#profile_image").attr("src")!==data){$(document).trigger("close.facebox");$("#profile_image").attr("src",data);return 0;}}else{$("#change_picture_err").html(error);a.attr("disabled","");a.val("Upload File");return 0;}}}catch(e){}setTimeout(c,1000);};setTimeout(c,1000);}if($(that).hasClass("add_friend")){$(".post_message :submit").attr("disabled","disabled");$(".post_message :submit").val("Please Wait...");query=$(that).serialize();$.post("/interact/friends.php",query,function(e){setTimeout(function(){$(document).trigger("close.facebox");},500);});return false;}});$("#compose_reply_submit").bind("click",function(a){that=$("form.compose_reply");query=$(that).serialize();if($.trim($(that).find("textarea").val()).length>1){$("#compose_reply_submit").addClass("disabled");$.post("/interact/compose_reply.php",query,function(b){new_reply=$(".reply.vt.skel:first").clone();new_reply.find(".date").html(b.date);new_reply.find(".body").html(b.body);new_reply.insertBefore(".reply.vt.skel");new_reply.removeClass("skel");$(that).find("textarea").val("");$("#compose_reply_submit").removeClass("disabled");},"json");}else{alert("Don't be a punk, type something. We don't send blank messages here.");}return false;});$(".edit_account").bind("submit",function(){$("#edit_account_submit").trigger("click");return false;});$("#edit_account_submit").bind("click",function(){$("#edit_account_submit").addClass("disabled");old=$(".edit_account").find("[name=current_password]").val();new1=$(".edit_account").find("[name=new_password]").val();new2=$(".edit_account").find("[name=new_password2]").val();if(old.length>0&&(new1!=new2)){alert("Your passwords do not match, please try again.");$("#edit_account_submit").removeClass("disabled");return false;}query=$(".edit_account").serialize();$.post("/interact/change_account.php",query,function(a){if(a=="0"){alert("Changes Saved!");}else{if(a=="-1"){alert("The password you gave doesn't match the password on file. You will now be directed to the login page.");window.location="/account";}else{alert("An unknown error has occurred... try again?");}}});$("#edit_account_submit").removeClass("disabled");return false;});$("#contact_send_submit").bind("click",function(){$("#help_contact_form").trigger("submit");return false;});$("#register_account_submit").bind("click",function(){$(".register_account").trigger("submit");return false;});$("#send_invites_submit").bind("click",function(){$(".send_invites").trigger("submit");return false;});$().bind("mouseover",function(b){var a=b.target;z1=$(a).closest(".bet_options").length;z2=$(a).closest(".bet_header").length;z3=$(a).closest(".cancel").length;if(z1==0&&z2==0&&z3==0){$(".bet_options:not(.skel)").hide();}});$("input.bet_box").live("click",function(){line_type=this.id;line_id=$(this).attr("data-id");if($(this).attr("checked")){action="set";}else{action="unset";}$.get("/interact/bets.php",{"do":"alter_buffer",line_type:line_type,line_id:line_id,action:action},function(a){$("#bet_buffer ul").html(a);});});$("#bet_buffer").bind("refresh",function(){$.get("/interact/bets.php",{"do":"refresh_buffer"},function(a){$("#bet_buffer ul").html(a);});});$("#bet_buffer li img").live("click",function(){var b=$(this);var a=$(this).attr("data-id");line_id=0;action="unset";$.get("/interact/bets.php",{"do":"alter_buffer",line_type:a,line_id:line_id,action:action},function(c){$("#"+a).attr("checked","");this_li=b.closest("li").slideUp(function(){$(this).remove();if($("#bet_buffer ul li").length==0){$("#bet_buffer .btn").addClass("disabled");}});});});$("#bet_buffer li img").live("mouseover",function(){$(this).attr("src","http://cdn.cloudfiles.mosso.com/c42602/images/bet_buffer_del_over.png");});$("#bet_buffer li img").live("mouseout",function(){$(this).attr("src","http://cdn.cloudfiles.mosso.com/c42602/images/bet_buffer_del.png");});$("#reset_buffer").live("click",function(){$.get("/interact/bets.php",{"do":"alter_buffer",action:"reset"},function(b){var a=b;$(".bet_box").attr("checked","");$("#bet_buffer ul li").slideUp(function(){$("#bet_buffer ul").html(a);});});return false;});$("#bet_amount_changer").keyup(function(){mult_val=$("#multiplier_amount").html();amt_val=$("#bet_amount_changer").val();amt_val=amt_val.replace("$","");new_val=amt_val*mult_val;max_val=$("#max_bet").html()*mult_val;new_val=Math.round(new_val*10000)/10000;if(new_val>10){new_val="10.00";}if(new_val>max_val){new_val=max_val;}$("#win_amount").html(new_val.toFixed(2));});$("#home_alert .hide_alert").click(function(){$("#home_alert").fadeOut("slow");return false;});$("#crony_alert .hide_alert").click(function(){$("#crony_alert").fadeOut("slow");return false;});$("#accept_crony_money").click(function(){$.get("/interact/bets.php",{"do":"accept_crony_money"},function(a){$("#notice_focus").remove();setTimeout(function(){$("#notice_focus2").attr("id","notice_focus");},200);});return false;});$(".info").hover(function(){$(".edit_profile").show();},function(){$(".edit_profile").hide();});$(".info").click(function(){return false;});$(".add_friend .cancel").live("click",function(){$(document).trigger("close.facebox");});$("#login_box .box").focus(function(){value=$(this).val();if(value==="email@address.com"||value==="password"){$(this).val("");}});$("#cashout_req_amount").focus(function(){value=$(this).val();if(value[0]==="("){$(this).val("");}});$("#login_box form").submit(function(){$("#login_box h1").html("LOGGING IN....");});$("a.disabled").live("click",function(){return false;});$(".addFriend,.removeFriend").live("click",function(b){btn=$(this);var a="";if($(this).hasClass("addFriend")){a="add_friend";}else{if($(this).hasClass("removeFriend")){a="remove_friend";}else{alert("There has been an error.");return false;}}var c=$(this).attr("data-id");post="do="+a+"&id="+c;$.post("/interact/friends.php",post,function(d){setTimeout(function(){if(a==="remove_friend"){$(".friendListContent div.friendSlot[data-id="+c+"]").fadeOut("slow");}else{btn.fadeOut("medium",function(){$(this).removeClass("addFriend").addClass("pendingFriend").html("Friend Requested");$(this).fadeIn("medium");});}},500);});return false;});$(".acceptFriendRequest,.denyFriendRequest").live("click",function(b){btn=$(this);var a="";if($(this).hasClass("acceptFriendRequest")){opt=1;}else{if($(this).hasClass("denyFriendRequest")){opt=0;}else{alert("There has been an error.");return false;}}var c=$(this).attr("data-id");post="do=confirm_friend&opt="+opt+"&id="+c;$.post("/interact/friends.php",post,function(d){document.location="/friends";});return false;});$(".forfeit_bet").live("click",function(a){cret=confirm("Are you sure you want to forfeit this bet? There is no undo..");if(cret==true){var b=$(this).closest(".bet_each").find(".line_each:first").attr("data-id");post="do=forfeit_bet&b_id="+b;$.post("/interact/bets.php",post,function(c){setTimeout(function(){$("#view_bet_opt").trigger("change");},500);});}return false;});$(".cancel_bet").live("click",function(a){cret=confirm("Are you sure you want to cancel this bet? There is no undo..");if(cret==true){var b=$(this).closest(".bet_each").find(".line_each:first").attr("data-id");post="do=cancel_bet&b_id="+b;$.post("/interact/bets.php",post,function(c){setTimeout(function(){if($("#view_bet_opt").length>0){$("#view_bet_opt").trigger("change");}else{document.location="/profile";}},500);});}return false;});$("#sort_sel").change(function(a){var b=$(this).val();loc=document.location+"";loc_str="friends";if(loc.indexOf("inbox")!=-1){loc_str="inbox/";}else{if(loc.indexOf("friends")==-1){loc_str="cronies";}}document.location="/"+loc_str+"?sort="+b;return false;});$("textarea[name=comment_text]").live("keypress",function(){var a=$(this).val();if(a.length>=255){a=a.substr(0,254);$(this).val(a);}});$(".comment_delete").live("click",function(b){var a=$(this).closest(".comment_exist");var c=$(this).closest(".comment_exist").attr("data-id");post="do=delete_comment&c_id="+c;$.post("/interact/bets.php",post,function(d){if(d=="1"){setTimeout(function(){a.slideUp("medium",function(){$(this).remove();});},100);}});return false;});$(".comment_delete img").live("mouseover",function(){$(this).attr("src","http://cdn.cloudfiles.mosso.com/c42602/images/bet_buffer_del_over.png");});$(".comment_delete img").live("mouseout",function(){$(this).attr("src","http://cdn.cloudfiles.mosso.com/c42602/images/bet_buffer_del.png");});$(".notice_hide").bind("click",function(){$("#notice_overlay, #notice_focus").hide();});if($("#notice_focus").length>0){$().bind("click.notice_focus",function(a){that=a.target;if($(that).closest("#notice_focus").length==0){$().unbind("click.notice_focus");$().unbind("keyup.notice_focus");$("#notice_overlay, #notice_focus").hide();}});$().bind("keyup.notice_focus",function(a){if(a.keyCode==27){$().unbind("click.notice_focus");$().unbind("keyup.notice_focus");$("#notice_overlay, #notice_focus").hide();}});}$("a[rel*=facebox]").facebox({loading_image:"loading.gif",close_image:"closelabel.gif"});});(function(f){f.facebox=function(m,l){f.facebox.loading();if(m.ajax){g(m.ajax);}else{if(m.image){c(m.image);}else{if(m.div){j(m.div);}else{if(f.isFunction(m)){m.call(f);}else{f.facebox.reveal(m,l);}}}}};f.extend(f.facebox,{settings:{opacity:0,overlay:true,loadingImage:"http://cdn.cloudfiles.mosso.com/c42602/images/facebox/loading.gif",closeImage:"http://cdn.cloudfiles.mosso.com/c42602/images/facebox/closelabel.gif",imageTypes:["png","jpg","jpeg","gif"],faceboxHtml:'    <div id="facebox" style="display:none;">       <div class="popup">         <table>           <tbody>             <tr>               <td class="tl"/><td class="b"/><td class="tr"/>             </tr>             <tr>               <td class="b"/>               <td class="body">                 <div class="content">                 </div>                 <div class="footer">                   <a href="#" class="close">                     <img src="http://cdn.cloudfiles.mosso.com/c42602/images/facebox/closelabel.gif" title="close" class="close_image" />                   </a>                 </div>               </td>               <td class="b"/>             </tr>             <tr>               <td class="bl"/><td class="b"/><td class="br"/>             </tr>           </tbody>         </table>       </div>     </div>'},loading:function(){k();if(f("#facebox .loading").length==1){return true;}e();f("#facebox .content").empty();f("#facebox .body").children().hide().end().append('<div class="loading"><img src="'+f.facebox.settings.loadingImage+'"/></div>');f("#facebox").css({top:h()[1]+(i()/4),left:385.5}).show();f(document).bind("keydown.facebox",function(l){if(l.keyCode==27){f.facebox.close();}return true;});f(document).trigger("loading.facebox");},reveal:function(m,l){f(document).trigger("beforeReveal.facebox");if(l){f("#facebox .content").addClass(l);}f("#facebox .content").append(m);f("#facebox .loading").remove();f("#facebox .body").children().fadeIn("normal");f("#facebox").css("left",f(window).width()/2-(f("#facebox table").width()/2));f(document).trigger("reveal.facebox").trigger("afterReveal.facebox");},close:function(){f(document).trigger("close.facebox");return false;}});f.fn.facebox=function(l){k(l);function m(){f.facebox.loading(true);var n=this.rel.match(/facebox\[?\.(\w+)\]?/);if(n){n=n[1];}j(this.href,n);return false;}return this.click(m);};function k(n){if(f.facebox.settings.inited){return true;}else{f.facebox.settings.inited=true;}f(document).trigger("init.facebox");d();var l=f.facebox.settings.imageTypes.join("|");f.facebox.settings.imageTypesRegexp=new RegExp("."+l+"$","i");if(n){f.extend(f.facebox.settings,n);}f("body").append(f.facebox.settings.faceboxHtml);var m=[new Image(),new Image()];m[0].src=f.facebox.settings.closeImage;m[1].src=f.facebox.settings.loadingImage;f("#facebox").find(".b:first, .bl, .br, .tl, .tr").each(function(){m.push(new Image());m.slice(-1).src=f(this).css("background-image").replace(/url\((.+)\)/,"$1");});f("#facebox .close").click(f.facebox.close);f("#facebox .close_image").attr("src",f.facebox.settings.closeImage);}function h(){var m,l;if(self.pageYOffset){l=self.pageYOffset;m=self.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){l=document.documentElement.scrollTop;m=document.documentElement.scrollLeft;}else{if(document.body){l=document.body.scrollTop;m=document.body.scrollLeft;}}}return new Array(m,l);}function i(){var l;if(self.innerHeight){l=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){l=document.documentElement.clientHeight;}else{if(document.body){l=document.body.clientHeight;}}}return l;}function d(){var l=f.facebox.settings;l.loadingImage=l.loading_image||l.loadingImage;l.closeImage=l.close_image||l.closeImage;l.imageTypes=l.image_types||l.imageTypes;l.faceboxHtml=l.facebox_html||l.faceboxHtml;}function j(m,l){if(m.match(/#/)){var n=window.location.href.split("#")[0];var o=m.replace(n,"");f.facebox.reveal(f(o).clone().show(),l);}else{if(m.match(f.facebox.settings.imageTypesRegexp)){c(m,l);}else{g(m,l);}}}function c(m,l){var n=new Image();n.onload=function(){f.facebox.reveal('<div class="image"><img src="'+n.src+'" /></div>',l);};n.src=m;}function g(m,l){f.get(m,function(n){f.facebox.reveal(n,l);});}function b(){return f.facebox.settings.overlay==false||f.facebox.settings.opacity===null;}function e(){if(b()){return;}if(f("facebox_overlay").length==0){f("body").append('<div id="facebox_overlay" class="facebox_hide"></div>');}f("#facebox_overlay").hide().addClass("facebox_overlayBG").css("opacity",f.facebox.settings.opacity).fadeIn(200);return false;}function a(){if(b()){return;}f("#facebox_overlay").fadeOut(200,function(){f("#facebox_overlay").removeClass("facebox_overlayBG");f("#facebox_overlay").addClass("facebox_hide");f("#facebox_overlay").remove();});return false;}f(document).bind("close.facebox",function(){f(document).unbind("keydown.facebox");f("#facebox").fadeOut(function(){f("#facebox .content").removeClass().addClass("content");a();f("#facebox .loading").remove();});});})(jQuery);$(document).ready(function(){var a="";$(".btnGo").val(a);});function clearIt(a){if(a.defaultValue==a.value){a.value="";}}