var GAME={BIG_HANDS:["Straight Flush","4-of-a-Kind","Four Aces"]};function init(){CORE.domain="crazy4pokeronline.com"}function initUI(){$("#ante").removeAttr("readonly");$("#bonus").removeAttr("readonly");$("#queens_up").removeAttr("readonly");$("#queens_up_bg").attr("class","bet_input");$("#ante_bg").attr("class","bet_input");$("#super_bonus_bg").attr("class","bet_input");$("#deal").attr("class","button2")}function loadPlayerStats(a){PLAYER.total_games=parseInt(a.total_games);PLAYER.total_withdrawn=parseInt(a.total_withdrawn);PLAYER.games_played=parseInt(a.games_played);PLAYER.bank_roll=parseInt(a.bank_roll);PLAYER.triples=parseInt(a.triples);PLAYER.highest=parseInt(a.highest);PLAYER.lowest=parseInt(a.lowest);PLAYER.queens_win=parseInt(a.queens_win);PLAYER.won=parseInt(a.won);PLAYER.lost=parseInt(a.lost);PLAYER.folded=parseInt(a.folded);PLAYER.username=a.username}function setBankAndBets(a){$("#m").html(formatTotalAmount(PLAYER.bank_roll));$("#ante").val(parseInt(a.ante));$("#bonus").val(parseInt(a.ante));$("#queens_up").val(parseInt(a.queens_up));$("#sound").attr("checked",(a.sound_enabled=="1"))}function setStats(){if(PLAYER.total_games==0){$("#ad_unit").hide();$("#recent_winners").hide();$("#start_here").show();$("#super_bonus_chart").show().css("left","8px");$("#stats_header").html('[ <a href=# onclick="login(); return false;">Login</a> ]');return}var a=(PLAYER.won+PLAYER.lost+PLAYER.folded);$("#hands_played").html(formatTotalNumber(PLAYER.games_played));$("#triples").html(formatTotalNumber(PLAYER.triples));$("#most_money").html(formatTotalAmount(PLAYER.highest));$("#least_money").html(formatTotalAmount(PLAYER.lowest));$("#queens_win_percentage").html(showPercentage(PLAYER.queens_win,a,25.6,1,"Queens Up Win"));$("#fold_percentage").html(showPercentage(PLAYER.folded,a,-30,-1,"Fold"));$("#lose_percentage").html(showPercentage(PLAYER.lost,a,-25,-1,"Lose"));$("#win_percentage").html(showPercentage(PLAYER.won,a,45,1,"Win"));if(SESSION.game_count>4){return}if(PLAYER.total_games>0){$("#account_panel").show();$("#super_bonus_chart").show().css("left","365px");if(SOUND.ready==true){$("#sound_setting").show()}$("#stats_header").html('[ <a href=# onclick="reset_stats(); return false;">reset</a> ]')}if(PLAYER.total_games>1){$("#ad_unit").show();$("#contact_area").show();$("#links").css("left","550px")}if(PLAYER.total_games>2){$("#recent_winners").show()}if(PLAYER.total_games>3&&$("#logo").css("top")=="12px"){$("#logo").delay(700).animate({top:"+=20"},500,function(){$("#promo").show()})}if(PLAYER.username){$("#account_panel").css("color","#000");$("#account_panel").html("Welcome, "+PLAYER.username+' [ <a href=# onclick="logout(); return false;">Logout</a> ]')}}function resetStats(){$("#hands_played").html(0);$("#triples").html(0);$("#most_money").html(formatTotalAmount(PLAYER.bank_roll));$("#least_money").html(formatTotalAmount(PLAYER.bank_roll));$("#queens_win_percentage").html("--");$("#fold_percentage").html("--");$("#lose_percentage").html("--");$("#win_percentage").html("--")}function update_stats(k,b,a,h,c,e,i,g,f,j,l){PLAYER.total_games=PLAYER.total_games+1;PLAYER.games_played=PLAYER.games_played+1;PLAYER.triples=(h==true?(PLAYER.triples+1):PLAYER.triples);PLAYER.highest=Math.max(PLAYER.highest,g);PLAYER.lowest=Math.min(PLAYER.lowest,g);PLAYER.queens_win=(c?(PLAYER.queens_win+1):PLAYER.queens_win);PLAYER.won=(e=="W"?(PLAYER.won+1):PLAYER.won);PLAYER.lost=(e=="L"?(PLAYER.lost+1):PLAYER.lost);PLAYER.folded=(e=="F"?(PLAYER.folded+1):PLAYER.folded);setStats();if(PLAYER.total_games%10==0){new_ad(true)}else{if(PLAYER.total_games%3==0){new_ad(false)}}if(l>19){_gaq.push(["_trackEvent","big_hand",l+""]);setTimeout("poll_recent_winners()",3000)}var d={tg:PLAYER.total_games,gp:PLAYER.games_played,ht:PLAYER.highest,lt:PLAYER.lowest,t:PLAYER.triples,qw:PLAYER.queens_win,w:PLAYER.won,l:PLAYER.lost,f:PLAYER.folded,b:PLAYER.bank_roll,a:k,r:b,qu:a,o:e,n:i,p:f,d:j,v:l};$.ajax({url:"index/play-game?"+jQuery.param(d),cache:false,success:function(m){}});if(e=="W"){play_sound("win")}SESSION.game_count+=1;if(SESSION.game_count==1){_gaq.push(["_trackPageview","/game_one"]);_gaq.push(["_trackEvent","session_type",(PLAYER.total_games==1?"new_user":"returning_user")])}else{if(SESSION.game_count==50){_gaq.push(["_trackPageview","/game_fifty"])}}};
