/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/Projects/Packer/
*/


function checkCountry(sCountry){var sCookieCountry="";sCookieCountry=checkCountryCookie();if(sCookieCountry!=""){checkCountryGoTo(sCookieCountry);}else{if(!getCookie("GeoPopup_dontShowCountrySelector"))
displayCountrySelector(sCountry);}}
function checkCountryCookie(){var sCookieCountry=getCookie("GeoPopup_goto");if(sCookieCountry!=null&&sCookieCountry!=""){return sCookieCountry;}else{return"";}}
function checkCountryGoTo(sCountry){if(sCountry=="AU")
document.location.href="http://www.canbet.com.au/";else
document.location.href="http://www.canbet.com/";}
function displayCountrySelector(sCountry){PartFadeOut("boxin",500)
var div=document.createElement('div');var divContent="";var sSuggestedSite="";if(sCountry=='AU')
sSuggestedSite="canbet.com";else
sSuggestedSite="canbet.com.au";divContent=divContent+('<p class="GeoPopup_Close"><a href="#" id="GeoPopup_Close" onclick="closeCountrySelector();">X</a></p>');divContent=divContent+('<p class="heading">'+CLIENT_ResourceString.GeoPopup_Intro+' '+sSuggestedSite+'?</p>');if(CLIENT_ResourceString.GeoPopup_Intro1!=null&&CLIENT_ResourceString.GeoPopup_Intro1!='')
divContent=divContent+('<p>'+CLIENT_ResourceString.GeoPopup_Intro1+'</p>');if(CLIENT_ResourceString.GeoPopup_Intro2!=null&&CLIENT_ResourceString.GeoPopup_Intro2!='')
divContent=divContent+('<p>'+CLIENT_ResourceString.GeoPopup_Intro2+'</p>');if(sCountry=='AU')
{divContent=divContent+('<table><tr><td class="radio"><input type="radio" name="inputCountry" id="GeoPopup_OptionROW" value="true" checked=\"checked\" /></td><td class="option">'+CLIENT_ResourceString.GeoPopup_OptionROW+'</td></tr>');divContent=divContent+('<tr><td class="radio"><input type="radio" name="inputCountry"  id="GeoPopup_OptionAU" value="true" /></td><td class="option">'+CLIENT_ResourceString.GeoPopup_OptionAU+'</td></tr>');}
else
{divContent=divContent+('<table><tr><td class="radio"><input type="radio" name="inputCountry" id="GeoPopup_OptionAU" value="true" checked=\"checked\" /></td><td class="option">'+CLIENT_ResourceString.GeoPopup_OptionAU+'</td></tr>');divContent=divContent+('<tr><td class="radio"><input type="radio" name="inputCountry"  id="GeoPopup_OptionROW" value="true" /></td><td class="option">'+CLIENT_ResourceString.GeoPopup_OptionROW+'</td></tr>');}
divContent=divContent+('<tr><td class="radio"><input type="checkbox" name="inputCountryAlways" id="GeoPopup_AlwaysDirect" value="true" /></td><td class="option" style="font-size:12px;">'+CLIENT_ResourceString.GeoPopup_AlwaysDirect+'</td></tr>');divContent=divContent+('<tr><td colspan="2"><p><input type="button" name="GeoPopup_BtnContinue" value="'+CLIENT_ResourceString.GeoPopup_BtnContinue+'" id="countryContinue" onclick="doCountrySelect(\''+sCountry+'\');"/></p></td></tr>');divContent=divContent+('<tr><td colspan="2"><p><a href="#" id="countryCancel" onclick="cancelCountrySelector();">'+CLIENT_ResourceString.GeoPopup_Cancel+'</a></p></td></tr></table><br>');div.innerHTML=(divContent);div.id="GeoPopup_CountrySelector";document.getElementById("container").appendChild(div);}
function doCountrySelect(sCountry){var countryLinkAU=document.getElementById("GeoPopup_OptionAU");var countryLinkROW=document.getElementById("GeoPopup_OptionROW");var countryAlways=document.getElementById("GeoPopup_AlwaysDirect");if(sCountry!='AU')
{if(countryLinkAU.checked){if(countryAlways.checked){setCookie("GeoPopup_goto","AU","July 4, 2080");}
checkCountryGoTo('AU');}
if(countryLinkROW.checked){if(countryAlways.checked){setCookie("GeoPopup_dontShowCountrySelector",true,"July 4, 2080");setCookie("GeoPopup_goto","","July 4, 2080");}
closeCountrySelector();}}
else
{if(countryLinkROW.checked){if(countryAlways.checked){setCookie("GeoPopup_goto","ROW","July 4, 2080");}
checkCountryGoTo('ROW');}
if(countryLinkAU.checked){if(countryAlways.checked){setCookie("GeoPopup_dontShowCountrySelector",true,"July 4, 2080");}
closeCountrySelector();}}}
function closeCountrySelector(){div=document.getElementById("container");div.removeChild(div.lastChild);PartFadeIn("boxin",1000)}
function cancelCountrySelector(){closeCountrySelector();setCookie("GeoPopup_dontShowCountrySelector",true,"July 4, 2080");}
function checkGeoPopup(){if(CLIENT_ResourceString.GeoPopup_CurrentSite.toLowerCase().indexOf('canbet.com.au')>0)
{if(CLIENT_ResourceString.GeoPopup_UserOrigin.toUpperCase()!='AU')
checkCountry('AU');}
else
{if(CLIENT_ResourceString.GeoPopup_CurrentSite.toLowerCase().indexOf('canbet.com')>0)
{if(CLIENT_ResourceString.GeoPopup_UserOrigin.toUpperCase()=='AU')
checkCountry('ROW');}}}

function setCookie(name,value,expires){var theCookie=name+"="+value;if(isDate(expires)){var date=new Date(expires);var cookieDate=date.toGMTString();theCookie+=";expires="+cookieDate;}
document.cookie=theCookie;}
function getCookie(name)
{var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++)
{var cookieCrumbs=cookies[i].split("=");var cookieName=cookieCrumbs[0];var cookieValue=cookieCrumbs[1];if(trim(cookieName)==name)
{return cookieValue;}}
return false;}
function removeCookie(name){if(Get_Cookie(getCookie))document.cookie=name+"="+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}
function isDate(date){if(Date.parse(date)!=Date.parse(date))
return false;else
return true;}
function trim(str){str=this!=window?this:str;return str.replace(/^\s+/g,'').replace(/\s+$/g,'');}

function FadeOut(id,time){opacity(id,100,0,time);}
function FadeIn(id,time){opacity(id,0,100,time);}
function PartFadeOut(id,time){opacity(id,100,30,time);}
function PartFadeIn(id,time){opacity(id,60,100,time);}
function opacity(id,opacStart,opacEnd,millisec){var speed=Math.round(millisec/100);var timer=0;if(opacStart>opacEnd){for(i=opacStart;i>=opacEnd;i--){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}else if(opacStart<opacEnd){for(i=opacStart;i<=opacEnd;i++)
{setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}}
function changeOpac(opacity,id){var object=document.getElementById(id).style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";object.backgroundColor="#fff";}

var IncrementVal=1;var InitialAmount=0;var Name="BadBeats";function badbeat(initial,increment){InitialAmount=initial;IncremenVal=increment;if(InitialAmount!=0)
{scrollAmount();return true;}
else
{return false;}}
function scrollAmount()
{if(InitialAmount!=0){InitialAmount=InitialAmount+IncrementVal;var eleJackpotAmount=$("#JackpotAmount");if(eleJackpotAmount.length!=0){eleJackpotAmount[0].innerHTML=num2currency1(InitialAmount);}
setTimeout("scrollAmount()",1000);}}
function num2currency1(field)
{var tmp1=cents=dollars="";var dec=-1;var num,i;num=""+(Math.round(field)/100);dec=num.indexOf(".");cents=((dec>0)?num.substring(dec,num.length):".00");if(cents.length==2)cents+="0";dollars=""+parseInt(num);tmp1=insComma(dollars);num="";for(i=tmp1.length-1;i>=0;i--)
num+=tmp1.charAt(i);num+=cents+"";return num;}
function insComma(data)
{var count=i=0;var tmpStr="";var comma=",";for(i=data.length-1;i>=0;i--)
{if(count==3)
{tmpStr+=comma;count=1;}
else
{count++;}
tmpStr+=data.charAt(i);}
return(tmpStr);}
function openFlashPoker(){var poker_link='https://mppv2flash3.valueactive.eu/canbetpoker/lobby/index.aspx';openFlashPokerPopup('poker_lobby',poker_link,790,571)}
function openFlashPokerPopup(name,url,width,height){var new_win=window.open(url,name,'width='+width+',height='+height+',directories=no,toolbar=no,resizable=no,location=no,menubar=no,status=no,scrollbars=no');}

$(document).ready(function(){AdjustJackpotInfo();});function AdjustJackpotInfo(){$("#sports-stats #jackpot #upperbox").removeAttr("style").css("display","none");$("#sports-stats #jackpot #bottombox").removeAttr("style")
$("#sports-stats #jackpot #bottombox input").removeAttr("style")
$("#sports-stats #jackpot").css("display","block");}
function RefreshBetFinder(){document.location.href=document.all("template_ctlRHS_BetFinder_dlBetFinder").value+'&index='+document.all("template_ctlRHS_BetFinder_dlBetFinder").selectedIndex;}
function RefreshCouponBuilder(){document.location.href=document.all("template_ctlLogedIn_CouponBuilder_dlCouponBuilder").value;}
