
if((!(typeof window.console==='object'&&window.console!==null)||!(typeof console==='object'&&console!==null&&typeof console.firebug==='string'))&&typeof window.console==='undefined'){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;i+=1){window.console[names[i]]=function(){return function(){};}();}}
else if(window.location.href.indexOf('iwin.com')>-1&&(typeof window.console==='object'&&typeof window.console.debug!=='string')){window.console.debug=function(){};}
function i$(id){if($(id))return $(id);console.debug('There is no such element with id = \'%s\'',id);var emptyElement={style:{},src:{},href:{},absolutize:function(){},addClassName:function(){},addMethods:function(){},adjacent:function(){},ancestors:function(){},childElements:function(){},classNames:function(){},cleanWhitespace:function(){},clonePosition:function(){},cumulativeOffset:function(){},cumulativeScrollOffset:function(){},descendantOf:function(){},descendants:function(){},down:function(){},empty:function(){},extend:function(){},fire:function(){},firstDescendant:function(){},getDimensions:function(){},getElementsByClassName:function(){},getElementsBySelector:function(){},getHeight:function(){},getOffsetParent:function(){},getStyle:function(){},getWidth:function(){},hasClassName:function(){},hide:function(){},identify:function(){},immediateDescendants:function(){},insert:function(){},inspect:function(){},makeClipping:function(){},makePositioned:function(){},match:function(){},next:function(){},nextSiblings:function(){},observe:function(){},positionedOffset:function(){},previous:function(){},previousSiblings:function(){},readAttribute:function(){},recursivelyCollect:function(){},relativize:function(){},remove:function(){},removeClassName:function(){},replace:function(){},scrollTo:function(){},select:function(){},setOpacity:function(){},setStyle:function(){},show:function(){},siblings:function(){},stopObserving:function(){},toggle:function(){},toggleClassName:function(){},undoClipping:function(){},undoPositioned:function(){},up:function(){},update:function(){},viewportOffset:function(){},visible:function(){},wrap:function(){},writeAttribute:function(){}};return emptyElement;}
if(!window.iwin){var iwin={};}else{console.debug('iwin object already exists.');}
if(!iwin.Util){iwin.Util={};}else{console.debug('iwin Util already exists.');}
iwin.Util.OS={name:window.navigator.platform,isWin:window.navigator.platform.indexOf('Win')!==-1,isMac:window.navigator.platform.indexOf('Mac')!==-1,isLinux:window.navigator.platform.indexOf('Linux')!==-1,isiPhone:window.navigator.platform.indexOf('iPhone')!==-1,isOther:false};iwin.Util.OS.isOther=!(iwin.Util.OS.isWin||iwin.Util.OS.isMac||iwin.Util.OS.isLinux||iwin.Util.OS.isiPhone);iwin.Util.isInArcade=function(){try{return window.external.IsInArcade();}catch(err){return false;}};iwin.Util.isSoundEnabled=function(){if(iwin.Util.isInArcade()){return window.external.IsSoundEnabled();}else{return true;}};iwin.Util.isInGameLauncher=function(){try{return window.external.IsInGameLauncher();}catch(err){return false;}};iwin.Util.isInEUS=function(){try{return window.external.IsInEUS();}catch(err){return false;}};iwin.Util.isGameRegistered=function(){try{return window.external.IsGameRegistered();}catch(err){return false;}};iwin.Util.hasSession=function(){return(iwin.Util.readCookie('JSESSIONID')!=null);};iwin.Util.createCookie=function(name,value,days){var expires="";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}else{expires="";}
document.cookie=name+"="+value+expires+"; path=/";}
iwin.Util.readCookie=function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)===' '){c=c.substring(1,c.length);}
if(c.indexOf(nameEQ)===0){return c.substring(nameEQ.length,c.length);}}
return null;};iwin.Util.destroyCookie=function(name){iwin.Util.createCookie(name,"",-1);};iwin.Util.addCommas=function(nStr){nStr+='';nStr=nStr.replace(/,/g,'');var x=nStr.split('.');var x1=x[0];var x2=x.length>1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');}
return x1+x2;};iwin.Util.gbrowser=function(){if(Prototype.Browser.Opera){if(/(\d+\.\d+) /.test(navigator.appVersion))
return{name:'Opera',version:new Number(RegExp.$1)};return{name:'Opera',version:'undefined'};}
if(Prototype.Browser.Gecko){return{name:'FF',version:RegExp.$1};}
if(Prototype.Browser.IE){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent))
return{name:'IE',version:new Number(RegExp.$1)};return{name:'IE',version:'undefined'};}
return{name:'undefined',version:'undefined'};};iwin.Util.cacheWrap=function(impl,maxage){var result=null;var since=0;if(!impl||!maxage){throw"Both implementation function and max age are required parameters";}
function checker(force){var now=new Date().getTime();if(force||now-since>maxage){result=impl();since=now;}
return result;};return checker;};iwin.Util.windowOpen=function(url,name,width,height){width+=32;height+=96;if(iwin.Util.isInGameLauncher()){url=iwin.Util.addSessionToUrl(url);}
var win=window.open(url,name,'width='+width+', height='+height+', '+'location=no, menubar=no, '+'status=no, toolbar=no, scrollbars=yes, resizable=yes');try{win.resizeTo(width,height);win.focus();}
catch(e){console.debug('resizing error: %s',e);}};iwin.Util.windowClose=function(){window.close();};iwin.Util.addSessionToUrl=function(url){if(url.indexOf(';jsessionid')>=0){console.debug('Util.addSessionToUrl - URL already contains jsessionid: %s',url);return url;}
var session=readCookie('JSESSIONID');if(!session){return url;}
session=';jsessionid='+session;var idx=url.indexOf('?');if(idx===-1){idx=url.indexOf('#');}
if(idx===-1){return url+session;}else{return url.substring(0,idx)+session+url.substring(idx);}};iwin.Util.getUrlParameter=function(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url?url:window.location.href);if(results===null){return null;}else{return results[1];}};iwin.Util.arcadeCheckFF=function(){try{var ver=GetArcadeExtensionVersion();if(ver!=="")return true;}
catch(err){}
return false;};iwin.Util.arcadeCheckIE=function(){try{var oArcade=new ActiveXObject("iWinInformer.iWinInformer");if(typeof(oArcade)==="object"){return true;};}
catch(err){}
return false;};iwin.Util.arcadeDownload=function(elem){if(iwin.Util.isInArcade()||iwin.Util.arcadeCheckFF()||iwin.Util.arcadeCheckIE()){var location_array=elem.href.split('ACDCMD=');window.location.href='iwin://ACDCMD='+location_array[1];}
else{window.location.href=elem.href;}
return false;};iwin.Util.problemHandler=function(req,e){if(e){console.error("Exception[%s]:  %s ",this,e);}else{console.error("Failure[%s]:  %s ",this,req.status);}};iwin.Util.showObj=function(elem){i$(elem).removeClassName('hideObj');};iwin.Util.hideObj=function(elem){i$(elem).addClassName('hideObj');};iwin.Util.togglePopup=function(elem){if($(elem).hasClassName('hideObj')){iwin.Util.showObj(elem);}else{iwin.Util.hideObj(elem);}};iwin.Util.isEmailValid=function(str){str=str.toLowerCase();if(str.search(/^[A-Za-z0-9]+[_A-Za-z0-9+-]*(\.[_A-Za-z0-9+-]+)*@[A-Za-z0-9][A-Za-z0-9-]*(\.[A-Za-z0-9-]+)*(\.[A-Za-z0-9-]{2,})+$/)===-1)
return false;return true;};iwin.Util.initStaticPages=function(){if(iwin.Util.isInArcade()){$('header_frame').setStyle({display:'none'});$('footer_frame').setStyle({display:'none'});}};iwin.Util.isOverElement=function(x,y,elem){var position=elem.cumulativeOffset();var dimensions=elem.getDimensions();var left=position.left;var right=left+dimensions.width;var top=position.top;var bottom=top+dimensions.height;return!(x<left||x>right||y<top||y>bottom);};if(!iwin.Util.String){iwin.Util.String={};}else{console.debug('iwin String already exists.');}
iwin.Util.String.decode=function(str){if(typeof(str)==='string'){return unescape(str.replace(/\+/g,' '));}else{console.debug('iwin.Util.String.decode without valid str input: %s',str);return'';}};iwin.Util.String.encode=function(str){if(typeof(str)==='string'){return escape(str.replace(/\s/g,'+'));}else{console.debug('iwin.Util.String.encode without valid str input: %s',str);return'';}};if(!window.Util){var Util={};}else{console.error('Util object already exists.');}
Util.windowOpen=iwin.Util.windowOpen;Util.cacheWrap=iwin.Util.cacheWrap;Util.isInArcade=iwin.Util.isInArcade;Util.isSoundEnabled=iwin.Util.isSoundEnabled;Util.isInGameLauncher=iwin.Util.isInGameLauncher;Util.isInEUS=iwin.Util.isInEUS;Util.addCommas=iwin.Util.addCommas;Util.windowClose=iwin.Util.windowClose;Util.addSessionToUrl=iwin.Util.addSessionToUrl;Util.getUrlParameter=iwin.Util.getUrlParameter;Util.arcadeCheckFF=iwin.Util.arcadeCheckFF;Util.arcadeCheckIE=iwin.Util.arcadeCheckIE;Util.isEmailValid=iwin.Util.isEmailValid;Util.OS=iwin.Util.OS;Util.isOverElement=iwin.Util.isOverElement;is_valid_email=iwin.Util.isEmailValid;showObj=iwin.Util.showObj;hideObj=iwin.Util.hideObj;togglePopup=iwin.Util.togglePopup;problemHandler=iwin.Util.problemHandler;arcadeDownload=iwin.Util.arcadeDownload;addCommas=iwin.Util.addCommas;createCookie=iwin.Util.createCookie;readCookie=iwin.Util.readCookie;destroyCookie=iwin.Util.destroyCookie;gbrowser=iwin.Util.gbrowser;init_static_pages=iwin.Util.initStaticPages;var browser=gbrowser();