function RefreshParentFromCookie(parentWindow){var url=GetCookieValue("ParentUrl");if(parentWindow&&url!=null){sUrl=new String(url);sUrl=sUrl.replace(/&amp;/g,"&");parentWindow.location.href=sUrl}}function RefreshParentFromCookieClearBet(parentWindow){var url=GetCookieValue("ParentUrl");if(parentWindow&&url!=null){sUrl=new String(url);sUrl=sUrl.replace(/&amp;/g,"&");var betIdStartIndex=sUrl.indexOf("&BetId");if(betIdStartIndex>0){var betIdEndIndex=sUrl.indexOf("&",betIdStartIndex+1);if(betIdEndIndex<1)betIdEndIndex=sUrl.length;var betIdParameter=sUrl.substring(betIdStartIndex,betIdEndIndex);sUrl=sUrl.replace(betIdParameter,"")}parentWindow.location.href=sUrl}}function WriteParentUrl(url){var now=new Date;now.setTime(now.getTime()+365*24*60*60*1e3);SetCookieValue("ParentUrl",url,now,"/")}function SetCookieValue(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+(expires?"; expires="+expires.toGMTString():"")+(path?"; path="+path:"")+(domain?"; domain="+domain:"")+(secure?"; secure":"")}function GetCookieValue(name){var dc=document.cookie,prefix=name+"=",begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end))};