var GAME={BIG_HANDS:["3-of-a-Kind","Straight Flush","Mini Royal"]};function init(){CORE.domain="3-cardpokeronline.com"}function initUI(){$("#ante").removeAttr("readonly");$("#pair_plus").removeAttr("readonly");$("#pair_plus_bg").attr("class","bet_input");$("#ante_bg").attr("class","bet_input");$("#deal").attr("class","button2")}function loadPlayerStats(a){PLAYER.total_withdrawn=parseInt(a.total_withdrawn);PLAYER.total_games=parseInt(a.total_games);PLAYER.games_played=parseInt(a.games_played);PLAYER.bank_roll=parseInt(a.bank_roll);PLAYER.highest=parseInt(a.highest);PLAYER.lowest=parseInt(a.lowest);PLAYER.pp_win=parseInt(a.pp_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));$("#pair_plus").val(parseInt(a.pair_plus));$("#sound").attr("checked",(a.sound_enabled=="1"))}function setStats(){if(PLAYER.total_games==0){$("#ad_unit").hide();$("#recent_winners").hide();$("#start_here").show();$("#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));$("#most_money").html(formatTotalAmount(PLAYER.highest));$("#least_money").html(formatTotalAmount(PLAYER.lowest));$("#pp_win_percentage").html(showPercentage(PLAYER.pp_win,a,25.6,1,"Pair Plus 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();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();$("#links").show()}if(PLAYER.total_games>2){$("#recent_winners").show()}if(PLAYER.total_games>3&&$("#logo").css("top")=="12px"){$("#logo").delay(700).animate({top:"+=33"},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);$("#most_money").html(formatTotalAmount(PLAYER.bank_roll));$("#least_money").html(formatTotalAmount(PLAYER.bank_roll));$("#pp_win_percentage").html("--");$("#fold_percentage").html("--");$("#lose_percentage").html("--");$("#win_percentage").html("--")}function update_stats(i,a,b,d,g,e,f,h,j){PLAYER.total_games=PLAYER.total_games+1;PLAYER.games_played=PLAYER.games_played+1;PLAYER.highest=Math.max(PLAYER.highest,PLAYER.bank_roll);PLAYER.lowest=Math.min(PLAYER.lowest,PLAYER.bank_roll);PLAYER.pp_win=(j>14?(PLAYER.pp_win+1):PLAYER.pp_win);PLAYER.won=(d=="W"?(PLAYER.won+1):PLAYER.won);PLAYER.lost=(d=="L"?(PLAYER.lost+1):PLAYER.lost);PLAYER.folded=(d=="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(j>17){_gaq.push(["_trackEvent","big_hand",j+""]);setTimeout("poll_recent_winners()",3000)}var c={tg:PLAYER.total_games,gp:PLAYER.games_played,ht:PLAYER.highest,lt:PLAYER.lowest,ppw:PLAYER.pp_win,w:PLAYER.won,l:PLAYER.lost,f:PLAYER.folded,b:PLAYER.bank_roll,a:i,r:a,pp:b,o:d,n:g,p:f,d:h,v:j};$.ajax({url:"index/play-game?"+jQuery.param(c),cache:false,success:function(k){}});if(d=="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"])}}}function show_promo(){_gaq.push(["_trackEvent","show_promo","click"]);$("#promo_dialog").dialog({resizable:false,position:[540,270],height:"auto",width:418,modal:true,buttons:{Go:function(){$(this).dialog("close")},Cancel:function(){$(this).dialog("close")}}})};
