function isAlien(a){
return isObject(a)&&typeof a.constructor!="function";
}
function isArray(a){
return isObject(a)&&a.constructor==Array;
}
function isBoolean(a){
return typeof a=="boolean";
}
function isEmpty(o){
var i,v;
if(isObject(o)){
for(i in o){
v=o[i];
if(isUndefined(v)&&isFunction(v)){
return false;
}
}
}
return true;
}
function isFunction(a){
return typeof a=="function";
}
function isNull(a){
return typeof a=="object"&&!a;
}
function isNumber(a){
return typeof a=="number"&&isFinite(a);
}
function isObject(a){
return (a&&typeof a=="object")||isFunction(a);
}
function isString(a){
return typeof a=="string";
}
function isUndefined(a){
return typeof a=="undefined";
}
Function.prototype.method=function(_d,_e){
this.prototype[_d]=_e;
return this;
};
String.method("entityify",function(){
return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
}).method("quote",function(){
var c,i,l=this.length,o="\"";
for(i=0;i<l;i+=1){
c=this.charAt(i);
if(c>=" "){
if(c=="\\"||c=="\""){
o+="\\";
}
o+=c;
}else{
switch(c){
case "\b":
o+="\\b";
break;
case "\f":
o+="\\f";
break;
case "\n":
o+="\\n";
break;
case "\r":
o+="\\r";
break;
case "\t":
o+="\\t";
break;
default:
c=c.charCodeAt();
o+="\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
}
}
}
return o+"\"";
}).method("supplant",function(o){
var i,j,s=this,v;
for(;;){
i=s.lastIndexOf("{");
if(i<0){
break;
}
j=s.indexOf("}",i);
if(i+1>=j){
break;
}
v=o[s.substring(i+1,j)];
if(!isString(v)&&!isNumber(v)){
break;
}
s=s.substring(0,i)+v+s.substring(j+1);
}
return s;
}).method("trim",function(){
return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");
});
if(!isFunction(Function.apply)){
Function.method("apply",function(o,a){
var r,x="____apply";
if(!isObject(o)){
o={};
}
o[x]=this;
switch((a&&a.length)||0){
case 0:
r=o[x]();
break;
case 1:
r=o[x](a[0]);
break;
case 2:
r=o[x](a[0],a[1]);
break;
case 3:
r=o[x](a[0],a[1],a[2]);
break;
case 4:
r=o[x](a[0],a[1],a[2],a[3]);
break;
case 5:
r=o[x](a[0],a[1],a[2],a[3],a[4]);
break;
case 6:
r=o[x](a[0],a[1],a[2],a[3],a[4],a[5]);
break;
default:
alert("Too many arguments to apply.");
}
o[x]=null;
return r;
});
}
if(!isFunction(Array.prototype.pop)){
Array.method("pop",function(){
return this.splice(this.length-1,1)[0];
});
}
if(!isFunction(Array.prototype.push)){
Array.method("push",function(){
this.splice.apply(this,[this.length,0].concat(Array.prototype.slice.apply(arguments)));
return this.length;
});
}
if(!isFunction(Array.prototype.shift)){
Array.method("shift",function(){
return this.splice(0,1)[0];
});
}
if(!isFunction(Array.prototype.splice)){
Array.method("splice",function(s,d){
var max=Math.max,min=Math.min,a=[],e,i=max(arguments.length-2,0),k=0,l=this.length,n,v,x;
s=s||0;
if(s<0){
s+=l;
}
s=max(min(s,l),0);
d=max(min(isNumber(d)?d:l,l-s),0);
v=i-d;
n=l+v;
while(k<d){
e=this[s+k];
if(!isUndefined(e)){
a[k]=e;
}
k+=1;
}
x=l-s-d;
if(v<0){
k=s+i;
while(x){
this[k]=this[k-v];
k+=1;
x-=1;
}
this.length=n;
}else{
if(v>0){
k=1;
while(x){
this[n-k]=this[l-k];
k+=1;
x-=1;
}
}
}
for(k=0;k<i;++k){
this[s+k]=arguments[k+2];
}
return a;
});
}
if(!isFunction(Array.prototype.unshift)){
Array.method("unshift",function(){
this.splice.apply(this,[0,0].concat(Array.prototype.slice.apply(arguments)));
return this.length;
});
}
fs_an=navigator.appName;
fs_av=navigator.appVersion;
fs_ua=navigator.userAgent;
FSoundMan.winIE=((fs_an.indexOf("Microsoft")!=-1)&&(fs_av.indexOf("Windows")!=-1)&&(parseFloat(fs_av)>=4)&&(fs_ua.indexOf("Opera")==-1));
FSoundMan.Mozilla=((fs_an=="Netscape")&&(fs_ua.indexOf("Mozilla")!=-1)&&(parseFloat(fs_av)>=5));
FSoundMan.Opera=((fs_ua.indexOf("Opera")!=-1)&&(parseFloat(fs_av)>=4));
FSoundMan.NN4=((fs_an=="Netscape")&&(fs_ua.indexOf("Mozilla")!=-1)&&(parseFloat(fs_av)>=4)&&(parseFloat(fs_av)<5));
FSoundMan.oldNN=((fs_an=="Netscape")&&(fs_ua.indexOf("Mozilla")!=-1)&&(parseFloat(fs_av)<4));
FSoundMan.unsupportedPluginBrowser=(FSoundMan.oldNN);
FSoundMan.Plugin=(navigator.mimeTypes&&navigator.mimeTypes.length>0&&!FSoundMan.unsupportedPluginBrowser);
FSoundMan.ActiveX=FSoundMan.winIE;
FSoundMan.LiveConnect=(FSoundMan.NN4||FSoundMan.Opera);
FSoundMan.XPConnect=FSoundMan.Mozilla;
FSoundMan.XPConnectInstallError=false;
if(FSoundMan.ActiveX){
document.write("<scr"+"ipt language=VBScript>"+"\n"+"On error resume next"+"\n"+"activeXEnabled = false"+"\n"+"activeXEnabled = IsObject(CreateObject(\"Microsoft.ActiveXPlugin.1\"))"+"\n"+"</scr"+"ipt>");
FSoundMan.ActiveXEnabled=activeXEnabled;
}else{
FSoundMan.ActiveXEnabled=false;
}
FSoundMan.ActiveXEnabled_Browser_Reports=FSoundMan.ActiveXEnabled;
FSoundMan.ActiveXEnabled=true;
FSoundMan.supportsPlayerDetection=((FSoundMan.ActiveX&&FSoundMan.ActiveXEnabled)||FSoundMan.Plugin);
if(FSoundMan.supportsPlayerDetection){
FSoundMan.supportsInteraction=(FSoundMan.ActiveX||(FSoundMan.LiveConnect&&navigator.javaEnabled())||FSoundMan.XPConnect);
}else{
FSoundMan.supportsInteraction=false;
}
fs_mt="application/x-shockwave-flash";
function fs_checkForPlugIn(){
if(FSoundMan.Plugin&&navigator.mimeTypes[fs_mt]){
return (navigator.mimeTypes[fs_mt].enabledPlugin);
}else{
return false;
}
}
function fs_getPlugInVers(){
if(fs_checkForPlugIn()){
p=navigator.mimeTypes[fs_mt].enabledPlugin;
var _28=parseInt(p.description.substring(p.description.indexOf(".")-1));
return _28;
}else{
return 0;
}
}
function fs_getPlugInReleaseVers(){
if(fs_checkForPlugIn()){
p=navigator.mimeTypes[fs_mt].enabledPlugin;
if(p.description.indexOf("r")!=-1){
var _29=parseInt(p.description.substring(p.description.indexOf("r")+1,p.description.length));
}else{
_29=0;
}
return _29;
}else{
return 0;
}
}
if(FSoundMan.ActiveX){
document.write("<scr"+"ipt language=VBScript>"+"\n"+"Function fs_getActiveXVersion()"+"\n"+"On Error Resume Next"+"\n"+"Dim hasPlayer, playerversion"+"\n"+"hasPlayer = false"+"\n"+"playerversion = 15"+"\n"+"Do While playerversion > 0"+"\n"+"hasPlayer = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & playerversion)))"+"\n"+"If hasPlayer Then Exit Do"+"\n"+"playerversion = playerversion - 1"+"\n"+"Loop"+"\n"+"fs_getActiveXVersion = playerversion"+"\n"+"End Function"+"\n"+"</scr"+"ipt>");
}
FSoundMan.playerVersion=0;
function fs_hasMinPlayer(){
if(!FSoundMan.supportsPlayerDetection){
return false;
}
if(FSoundMan.Plugin){
FSoundMan.playerVersion=fs_getPlugInVers();
}
if(FSoundMan.ActiveX){
FSoundMan.playerVersion=fs_getActiveXVersion();
}
if(FSoundMan.playerVersion>=FSoundMan.minPlayer){
return true;
}else{
return false;
}
}
function fs_hasMinInteractivePlayer(){
if(!FSoundMan.hasMinPlayer()||!FSoundMan.supportsInteraction){
return false;
}
if(FSoundMan.ActiveX||FSoundMan.LiveConnect){
return true;
}
if(FSoundMan.XPConnect){
FSoundMan.playerVersion=fs_getPlugInVers();
releaseVers=fs_getPlugInReleaseVers();
if(FSoundMan.playerVersion>6){
return true;
}else{
if(FSoundMan.playerVersion==6&&releaseVers>=40){
return true;
}else{
return false;
}
}
}
}
function fs_configuredForInteraction(){
return (FSoundMan.supportsInteraction&&!FSoundMan.XPConnectInstallError&&FSoundMan.hasMinInteractivePlayer());
}
function fs_setMinPlayer(_2a){
if(FSoundMan.supportsPlayerDetection){
FSoundMan.minPlayer=(_2a!=null&&_2a>=4)?_2a:4;
}
}
FSoundMan.configuredForInteraction=fs_configuredForInteraction;
FSoundMan.hasMinPlayer=fs_hasMinPlayer;
FSoundMan.hasMinInteractivePlayer=fs_hasMinInteractivePlayer;
FSoundMan.setMinPlayer=fs_setMinPlayer;
FSoundMan.setMinPlayer();
FSoundMan.requiredVersion="4,0,0,0";
function fs_initiateAutoInstall(_2b){
FSoundMan.requiredVersion=_2b;
var _2c=false;
if(FSoundMan.Plugin){
var _2d=_2b.split(",");
var _2e=_2d[0]+"."+_2d[1];
var _2f=_2d[2]+"."+_2d[3];
var _30=fs_getPlugInVers();
var _31=fs_getPlugInReleaseVers();
if(_2e>_30){
var _2c=true;
}else{
if(_2e==_30&&_2f>_30){
var _2c=true;
}else{
var _2c=false;
}
}
}
return _2c;
}
FSoundMan.initiateAutoInstall=fs_initiateAutoInstall;
function FSoundManAttributes(){
}
function fs_setAttributeDefaultValues(){
this.attributes=new FSoundManAttributes();
this.attributes["SRC"]=this.attributes["MOVIE"]=null;
this.attributes["CLASSID"]="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
if(this.playerID!=null){
this.attributes["NAME"]=this.attributes["ID"]=this.playerID;
}
this.attributes["TYPE"]=fs_mt;
this.attributes["HEIGHT"]="2";
this.attributes["WIDTH"]="1";
this.attributes["PLAY"]="true";
this.attributes["LOOP"]="true";
this.attributes["QUALITY"]="low";
this.attributes["BGCOLOR"]=(document.bgColor!=null)?document.bgColor:"#ffffff";
this.attributes["WMODE"]="Transparent";
this.attributes["SWLIVECONNECT"]=(this.playerID!=null)?"true":null;
var _32=(window.location.href.indexOf("https://")>-1)?"https":"http";
this.attributes["CODEBASE"]=_32+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+FSoundMan.requiredVersion;
this.attributes["PLUGINSPAGE"]="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
}
function fs_parseAttributes(_33){
if(typeof RegExp=="undefined"){
return;
}
var _34=new RegExp("'","gi");
_33=_33.replace(_34,"");
var _35=new RegExp("\"","gi");
_33=_33.replace(_35,"");
var _36=new RegExp("\\s+","gi");
_33=_33.replace(_36," ");
var _37=new RegExp("\\s*=\\s*","gi");
_33=_33.replace(_37,"=");
var i=0;
while(_33.charAt(i)==" "){
i++;
}
startpos=i;
var j=_33.length-1;
while(_33.charAt(j)==" "){
j--;
}
endpos=j+1;
_33=_33.substring(startpos,endpos);
var _3a=_33.split(" ");
var _3b=new Array("CLASSID","CODEBASE","ID","NAME","PLUGINSPAGE","SWLIVECONNECT");
for(k=0;k<_3a.length;k++){
var _3c=_3a[k].indexOf("=");
if(_3c>-1&&_3c!=_3a[k].length-1){
var _3d=_3a[k].substring(0,_3c).toUpperCase();
var _3e=_3a[k].substring(_3c+1,_3a[k].length);
for(l=0;l<_3b.length;l++){
var _3f=(_3d==_3b[l]);
if(_3f){
break;
}
}
if(!_3f&&_3e!=null){
this.attributes[_3d]=_3e;
}
}
}
return;
}
function fs_getAttributeValue(_40){
if(FSoundMan.configuredForInteraction()&&this.attributes!=null&&this.attributes[_40]!=null){
return this.attributes[_40.toUpperCase()];
}else{
return null;
}
}
function fs_createEmbedHTML(){
if(arguments[0]!=null&&typeof (arguments[0])!="undefined"){
var src=arguments[0];
this.attributes["SRC"]=src;
}
if(this.attributes["SRC"].charAt(0)=="/"&&location.href.indexOf("http://")!=-1){
this.attributes["SRC"]="http://"+location.host+this.attributes["SRC"];
}
this.attributes["MOVIE"]=this.attributes["SRC"];
var _42=new Array("CLASSID","ID","HEIGHT","WIDTH","CODEBASE");
var _43=new Array("MOVIE","WMODE");
var _44=new Array("SRC","TYPE","NAME","SWLIVECONNECT","PLUGINSPAGE");
var _45="";
for(var i=0;i<_42.length;i++){
if(typeof this.attributes[_42[i]]!="undefined"){
if(this.attributes[_42[i]]!=null){
_45+=_42[i]+"=\""+this.attributes[_42[i]]+"\" ";
}
}
}
_45=_45.substring(0,_45.length-1);
var _47=_44.join(" ")+" "+_42.join(" ");
var _48="";
for(attname in this.attributes){
if(attname=="BASE"||_47.indexOf(attname)==-1){
if(this.attributes[attname]!=null){
_48+="<PARAM NAME=\""+attname+"\" VALUE=\""+this.attributes[attname]+"\" />\n";
}
}
}
var _49=_43.join(" ")+" "+_42.join(" ");
var _4a="";
for(attname in this.attributes){
if(attname=="WIDTH"||attname=="HEIGHT"||attname=="BASE"||_49.indexOf(attname)==-1){
if(this.attributes[attname]!=null){
_4a+="\t"+attname+"=\""+this.attributes[attname]+"\"\n";
}
}
}
_4a=_4a.substring(0,_4a.length-1);
HTML="<OBJECT "+_45+">\n"+_48+"<EMBED\n"+_4a+">\n</EMBED>\n</OBJECT>";
return HTML;
}
function fs_embedSWF(_4b){
if(!FSoundMan.configuredForInteraction()){
return "";
}
this.setAttributeDefaultValues();
if(arguments[1]==false){
return this.createEmbedHTML(_4b);
}else{
document.write(this.createEmbedHTML(_4b));
}
return "";
}
function fs_no_js_embedSWF(_4c){
if(!FSoundMan.hasMinPlayer()){
return "";
}
this.setAttributeDefaultValues();
if(arguments[1]==false){
return this.createEmbedHTML(_4c);
}else{
document.write(this.createEmbedHTML(_4c));
}
return "";
}
function fs_customEmbedSWF(_4d){
if(!FSoundMan.configuredForInteraction()){
return "";
}
this.setAttributeDefaultValues();
this.parseAttributes(_4d);
if(arguments[1]==false){
return this.createEmbedHTML();
}else{
document.write(this.createEmbedHTML());
}
return "";
}
function fs_no_js_customEmbedSWF(_4e){
if(!FSoundMan.hasMinPlayer()){
return "";
}
this.setAttributeDefaultValues();
this.parseAttributes(_4e);
if(arguments[1]==false){
return this.createEmbedHTML();
}else{
document.write(this.createEmbedHTML());
}
return "";
}
function fs_checkForInstance(){
if(window.document[this.playerID]==null){
return false;
}
return true;
}
function fs_recognizeMethod(_4f){
if(!this.checkForInstance()){
return false;
}else{
if(typeof window.document[this.playerID][_4f]=="undefined"){
FSoundMan.XPConnectInstallError=true;
return false;
}else{
return true;
}
}
}
function fs_isPlayerReady(){
if(!FSoundMan.configuredForInteraction()){
return false;
}
if(!this.engageInteraction){
return false;
}
if(!this.checkForInstance()){
return false;
}
if(!this.recognizeMethod("PercentLoaded")){
return false;
}
if(window.document[this.playerID].PercentLoaded()>0){
return true;
}
return false;
}
function fs_gotoAndPlay(_50,_51){
if(!this.isPlayerReady()){
return;
}
if(typeof (_51)=="number"){
window.document[this.playerID].TGotoFrame(_50,_51-1);
window.document[this.playerID].TPlay(_50);
}
if(typeof (_51)=="string"){
window.document[this.playerID].TGotoLabel(_50,_51);
window.document[this.playerID].TPlay(_50);
}
return true;
}
function fs_gotoAndStop(_52,_53){
if(!this.isPlayerReady()){
return;
}
if(typeof (_53)=="number"){
window.document[this.playerID].TGotoFrame(_52,_53-1);
}
if(typeof (_53)=="string"){
window.document[this.playerID].TGotoLabel(_52,_53);
}
}
function fs_api_PercentLoaded(){
if(this.recognizeMethod("PercentLoaded")){
return parseInt(window.document[this.playerID].PercentLoaded());
}else{
return 0;
}
}
function fs_api_TPlay(_54){
if(!this.isPlayerReady()){
return;
}
window.document[this.playerID].TPlay(_54);
}
function fs_api_TStopPlay(_55){
if(!this.isPlayerReady()){
return;
}
window.document[this.playerID].TStopPlay(_55);
}
function fs_api_IsPlaying(){
if(!this.isPlayerReady()){
return false;
}
return window.document[this.playerID].IsPlaying();
}
function fs_api_LoadMovie(_56,url){
if(!this.isPlayerReady()){
return;
}
window.document[this.playerID].LoadMovie(_56,url);
}
function fs_LoadMovieNum(url,_59){
if(!this.isPlayerReady()){
return;
}
window.document[this.playerID].LoadMovie(_59,url);
}
function fs_checkPercent(){
if(!this.isPlayerReady()){
return;
}
this.currentPercent=this.PercentLoaded();
if(this.currentPercent>=100){
if(this.onLoadChange){
this.onLoadChange(100);
}
clearInterval(this.monitorLoadLoop);
if(this.onLoadComplete){
this.onLoadComplete();
}
}else{
if(this.onLoadChange&&(this.currentPercent>this.prevPercent)){
this.onLoadChange(this.PercentLoaded());
}
}
this.prevPercent=this.currentPercent;
}
function fs_monitorLoadProgress(){
if(window.setInterval){
var _5a="FSoundMan.players["+this.playersIndex+"].checkPercent()";
this.monitorLoadLoop=setInterval(_5a,100);
}
}
FSoundMan.playerCount=0;
FSoundMan.IDstringPrefix="FSoundMan_swf";
FSoundMan.players=new Array();
function fs_engageInteraction(_5b){
if(FSoundMan.supportsPlayerDetection){
_5b=(_5b==null)?true:_5b;
for(var i=0;i<FSoundMan.players.length;i++){
FSoundMan.players[i].engageInteraction=_5b;
}
}
}
FSoundMan.embedSWF=fs_no_js_embedSWF;
FSoundMan.engageInteraction=fs_engageInteraction;
FSoundMan.customEmbedSWF=fs_no_js_customEmbedSWF;
FSoundMan.createEmbedHTML=fs_createEmbedHTML;
FSoundMan.parseAttributes=fs_parseAttributes;
FSoundMan.setAttributeDefaultValues=fs_setAttributeDefaultValues;
function FSoundMan(){
this.engageInteraction=true;
this.playerID=FSoundMan.IDstringPrefix+FSoundMan.playerCount;
this.playersIndex=FSoundMan.playerCount;
FSoundMan.players[FSoundMan.playerCount]=this;
FSoundMan.playerCount++;
this.setAttributeDefaultValues=fs_setAttributeDefaultValues;
this.parseAttributes=fs_parseAttributes;
this.getAttributeValue=fs_getAttributeValue;
this.createEmbedHTML=fs_createEmbedHTML;
this.embedSWF=fs_embedSWF;
this.customEmbedSWF=fs_customEmbedSWF;
this.checkForInstance=fs_checkForInstance;
this.recognizeMethod=fs_recognizeMethod;
this.isPlayerReady=fs_isPlayerReady;
this.gotoAndPlay=this.TGotoAndPlay=fs_gotoAndPlay;
this.gotoAndStop=this.TGotoAndStop=fs_gotoAndStop;
this.loadMovieNum=this.LoadMovieNum=fs_LoadMovieNum;
this.checkPercent=fs_checkPercent;
this.monitorLoadProgress=fs_monitorLoadProgress;
this.PercentLoaded=fs_api_PercentLoaded;
this.play=this.TPlay=fs_api_TPlay;
this.stop=this.TStopPlay=fs_api_TStopPlay;
this.IsPlaying=fs_api_IsPlaying;
this.LoadMovie=fs_api_LoadMovie;
}
function psySendBrowserTo(_5d){
setTimeout("window.location.href = '"+_5d+"'; ",10);
}
Object.prototype.psyExtends=function(_5e){
for(sProperty in _5e){
this[sProperty]=_5e[sProperty];
}
};
function PsyClassWithProperties(){
}
PsyClassWithProperties.prototype.psyAddProperty=function(_5f,_60,_61){
if(typeof _61!=_5f){
psyErrorMessage("Property "+_60+" must be of type "+_5f+" (is "+typeof _61+" instead)");
return;
}
this[_60]=_61;
var _62=_60.charAt(0).toUpperCase()+_60.substring(1,_60.length);
this["get"+_62]=function(){
return this[_60];
};
this["set"+_62]=function(_63){
if(typeof _63!=_5f){
psyErrorMessage("Property "+_60+" must be of type "+_5f+" (is "+typeof _63+" instead)");
return;
}
var _64=this["get"+_62]();
var _65={propertyName:_60,propertyOldValue:_64,propertyNewValue:_63,returnValue:true};
this.psyOnpropertychange(_65);
if(_65.returnValue){
this[_60]=_65.propertyNewValue;
}
};
};
PsyClassWithProperties.prototype.psyOnpropertychange=function(_66){
};
function psyLToSparseArr(val){
var i=0;
var _69=new Array();
for(i=0;i<25;i++){
if(val&(1<<i)){
_69.push(i);
}
}
return _69;
}
function psyLToArr(val){
var i;
var _6c=new Array(25);
for(i=0;i<25;i++){
if(val&(1<<i)){
_6c[i]=1;
}else{
_6c[i]=0;
}
}
return _6c;
}
function psyEmptyDOMNode(_6d){
if(!(_6d&&_6d.hasChildNodes)){
return;
}
while(_6d.hasChildNodes()==true){
_6d.removeChild(_6d.childNodes[0]);
}
return;
}
function psyDOMGetNodeClass(_6e){
if(!(_6e&&_6e.getAttribute)){
return;
}
var cl=_6e.getAttribute("class");
if(cl){
return cl;
}
return _6e.className;
}
function psyDOMSetNodeClass(_70,_71){
_70.className=_71;
if(!_70.setAttribute){
return;
}
_70.setAttribute("class",_71);
}
function psyDOMUnSetNodeClass(_72){
_72.className="";
_72.removeAttribute("class");
}
function psyDOMGetNodeID(_73){
if("id" in _73){
return _73.id;
}
return _73.getAttribute("id");
}
function psyMoveDOMNodeChildren(_74,_75){
while(_74.hasChildNodes()==true){
var _76=_74.childNodes[0];
_74.removeChild(_76);
_75.appendChild(_76);
}
return;
}
function psyDOMCreateTextNode(_77){
return document.createTextNode(_77);
}
function psyDOMCreateAndAppendTextNode(_78,_79){
if(!(_79&&("appendChild" in _79))){
return;
}
var _7a=document.createTextNode(_78);
if(!_7a){
return false;
}
_79.appendChild(_7a);
return true;
}
function psyIsNumeric(_7b){
var _7c="0123456789.";
var _7d=true;
var _7e;
for(i=0;i<_7b.length&&_7d==true;i++){
_7e=_7b.charAt(i);
if(_7c.indexOf(_7e)==-1){
_7d=false;
}
}
return _7d;
}
function psyIsStatusMessage(_7f){
return (_7f&&("statusmsg" in _7f));
}
function psyIsError(_80){
if(!psyIsStatusMessage(_80)){
return false;
}
if("resp" in _80){
if(_80.resp.bool){
return false;
}
if(_80.resp.stat){
psyErrorMessage(_80.resp.stat);
return _80.resp.stat;
}
return true;
}
return false;
}
var PsyDebugInit=false;
var PsyDebugState;
function psyErrorMessage(_81){
if(!PsyDebugInit){
PsyDebugInit=true;
PsyDebugState=dojo.byId("psydebug");
}
if(PsyDebugState){
var pEl=document.createElement("p");
psyDOMCreateAndAppendTextNode(_81,pEl);
PsyDebugState.appendChild(pEl);
}
}
function PsyBingoConfigClass(){
this.ChatPollInterval=5500;
this.ChatUserRefreshInterval=12000;
this.ChatMessageListDivName="chatmsglist";
this.ChatUserListDivName="usersingamelist";
this.ChatSubmitFormName="chatsend";
this.ChatTextFieldID="chatsendtxt";
this.ChatEmoticonImgsDivID="smilies";
this.ChatSystemUserName="SYSTEM";
this.PregameCountdownDivName="countdowntime";
this.PregamePartStatsPrefixes=new Array("ui_","gs_");
this.CalledHistoryDivPrefix="bcalledh";
this.CellDaubedClass="daub";
this.CellFreeClass="free";
this.SingleCardClassName="scard";
this.CardRankNotifClassNamePrefix="cardRank";
this.CardRankNotifDivIdPrefix="caway";
this.CryBingoButtonDivName="crybingobutton";
this.NumWildToDateDivName="numwildtodate";
this.NumFromWinDivName="numfromwin";
this.CardSwapSpaceDivName="hiddencards";
this.ApproachingWinTxtDivName="approachingwin";
this.CardsDivName="cards";
this.SysMsgDivName="latestsystemmsg";
this.BlCheckInterval=5500;
this.BingoInterfaceCGIName="bingogameinterface.fcgi";
this.SysMsgDuration=20000;
this.PostGameCompleteDelay=10000;
this.SecondsBetweenPregamePartChecks=12;
this.WildCellClassPrefix="tmpwild";
this.WildCellClassPrefixLen=this.WildCellClassPrefix.length;
this.UITabsChatDivName="";
this.BingoCardSideSize=5;
this.BingoCardMatrixSize=this.BingoCardSideSize*this.BingoCardSideSize;
this.UITabsChatButtonDivName="uichattab";
this.UITabsOptionsButtonDivName="uioptiontab";
this.UITabsChatPanelDivName="shCHAT";
this.UITabsOptionsPanelDivName="shOPTIONS";
this.UITabsVisibleClass="sectionON";
this.UITabsHiddenClass="section";
this.SoundStackForChat="/sounds/chat.swf";
this.SoundStackForGen="/sounds/general.swf";
this.AutodaubStateDivName="autodaubstate";
this.AutowinStateDivName="crybingoreq";
this.ChatEmoticonSearchRegex="(.*?)(B\\)|:-?\\(|:\\*|:D|\\(l\\)|>:\\(|:o|:-?\\)|\\(c\\)|:[pP]|;-?\\))";
this.ChatEmoticonHomeDir="/images/smilies/";
this.ChatEmoticonReplaceVals={"B)":"cool.gif",":(":"frown.gif",":-(":"frown.gif",":*":"kissing.gif",":D":"laugh.gif","(l)":"loveface.gif",">:(":"mad.gif",":o":"shock.gif",":)":"smile3.gif",":-)":"smile3.gif","(c)":"spineyes.gif",":p":"tongue2.gif",":P":"tongue2.gif",";)":"wink.gif",";-)":"wink.gif"};
}
function PsyUserStrings(_83){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("string","lang",_83);
this.userString=function(_84){
return _84;
};
}
FSoundMan.prototype.psyExtends=null;
FSoundManAttributes.prototype.psyExtends=null;
function PsySoundMan(_85){
this.soundStacks=_85;
this.chatsnd=0;
this.gensnd=0;
this.initStack=function(_86){
if(!this.soundStacks[_86]){
psyErrorMessage("unknown sound stack "+_86);
return false;
}
if(!this.soundStacks[_86].file){
psyErrorMessage("No file set for sound stack "+_86);
return false;
}
var _87=new FSoundMan();
if(!_87){
psyErrorMessage("Could not create new sond manager for "+_86);
return false;
}
_87.embedSWF(this.soundStacks[_86].file);
return _87;
};
this.useGeneralSounds=function(){
if(!this.gensnd){
this.gensnd=this.initStack("gen");
}
};
this.useGameSounds=function(){
this.useGeneralSounds();
};
this.useChatSounds=function(){
if(!this.chatsnd){
this.chatsnd=this.initStack("chat");
}
};
this.genPlay=function(_88){
if(BingoGameState&&(!BingoGameState.getSound())){
return;
}
this.useGeneralSounds();
this.doPlay(this.gensnd,_88);
};
this.genStop=function(_89){
if(BingoGameState&&(!BingoGameState.getSound())){
return;
}
this.useGeneralSounds();
this.doStop(this.gensnd,_89);
};
this.gamePlay=function(_8a){
if(BingoGameState&&(!BingoGameState.getSound())){
return;
}
return this.genPlay(_8a);
};
this.gameStop=function(_8b){
return this.genStop(_8b);
};
this.chatPlay=function(_8c){
if(BingoGameState&&(!BingoGameState.getChat().getState().getSoundNotif())){
return;
}
this.useChatSounds();
this.doPlay(this.chatsnd,_8c);
};
this.chatStop=function(_8d){
if(BingoGameState&&(!BingoGameState.getChat().getState().getSoundNotif())){
return;
}
this.useChatSounds();
this.doStop(this.chatsnd,_8d);
};
this.isReady=function(){
if(this.chatsnd){
if(!this.chatsnd.isPlayerReady()){
return false;
}
}
if(this.gensnd){
if(!this.gensnd.isPlayerReady()){
return false;
}
}
return true;
};
this.isPlaying=function(){
if(this.chatsnd){
if(this.chatsnd.IsPlaying()){
return true;
}
}
if(this.gensnd){
if(this.gensnd.IsPlaying()){
return true;
}
}
return false;
};
this.doPlay=function(_8e,_8f){
if(!_8e){
return;
}
return _8e.gotoAndPlay("/"+_8f,"start");
};
this.doStop=function(_90,_91){
if(!_90){
return;
}
return _90.gotoAndPlay("/"+_91,"stop");
};
}
function PsyChatState(){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("boolean","enabled",true);
this.psyAddProperty("boolean","available",false);
this.psyAddProperty("number","numMessages",0);
this.psyAddProperty("boolean","soundNotif",true);
this.psyAddProperty("number","userRefCount",0);
this.psyAddProperty("boolean","autoMessageRefresh",true);
this.psyAddProperty("boolean","userFetchSuccess",false);
this.psyAddProperty("object","lastSysMsgDate",new Date());
this.psyAddProperty("string","lastSeenMsg","");
this.psyAddProperty("number","numRefreshes",0);
this.psyAddProperty("boolean","hasPendingMessages",false);
this.psyAddProperty("boolean","undocked",false);
}
function PsyChatMessage(_92,_93,_94){
this.type=_92;
this.from=_93;
this.content=_94;
}
function PsyChat(){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("object","state",new PsyChatState());
var _95=new RegExp(PsyBingoConfig.ChatEmoticonSearchRegex,"gm");
this.psyAddProperty("function","emoticonRegExp",RegExp);
this.psyAddProperty("string","formID","");
this.callIfNewMessages=function(_96,_97){
var _98=this.getState().getNumMessages();
if(_96!=_98){
return _97(_96);
}
return;
};
this.checkAndCallIfNewMessages=function(_99){
var _9a=this;
var _9b=BingoUrlConstructor.chatNumMessages();
dojo.io.bind({url:_9b,mimetype:"text/plain",sync:false,preventCache:true,load:function(_9c,_9d,evt){
if(_9d){
_9a.callIfNewMessages(_9d,_99);
}
return;
},error:function(_9f,_a0){
psyErrorMessage(0);
}});
return;
};
this.handleNewMessages=function(_a1){
var _a2=BingoUrlConstructor.chatGetNewMsgs();
return this.handleIncomingMessages(_a2,_a1);
};
this.handleAllMessages=function(_a3){
var _a4=BingoUrlConstructor.chatGetAllMsgs();
return this.handleIncomingMessages(_a4,_a3);
};
this.handleIncomingMessages=function(_a5,_a6){
var _a7=this;
dojo.io.bind({url:_a5,sync:false,preventCache:true,mimetype:"text/javascript",load:function(_a8,_a9){
if(!_a9){
return;
}
if(psyIsError(_a9)){
return;
}
_a7.getState().setHasPendingMessages(false);
if(!(_a9.num&&_a9.msgs&&(_a9.msgs.length>1))){
return;
}
var i=0;
var _ab=new Array();
while(i<_a9.msgs.length&&!("end" in _a9.msgs[i])){
_ab.push(new PsyChatMessage(_a9.msgs[i].type,_a9.msgs[i].from,_a9.msgs[i].content));
i++;
}
if(i){
_a6(_ab);
}
},error:function(_ac,_ad){
psyErrorMessage(1);
}});
return;
};
this.postMessage=function(evt){
var _af="";
var arr=new Array();
var _b1=this.getPostFormNode();
if(!_b1){
psyErrorMessage(2);
return;
}
var _b2=_b1.getElementsByTagName("textarea");
for(i=0;i<_b2.length;i++){
_af+=_b2[i].value;
_b2[i].value="";
if(_b2[i].blur){
_b2[i].blur();
}
_b2[i].focus();
}
if(_af){
var _b3=this.extractPrivateRcpt(_af);
if(_b3.length){
var uid=BingoGameState.getUserID(_b3);
if(uid){
urlToFetch=BingoUrlConstructor.chatPostPrivate();
arr["rcpt"]=uid;
_af=this.removePrivateRcpt(_af);
}else{
psyErrorMessage(3);
return false;
}
}else{
urlToFetch=BingoUrlConstructor.chatPost();
}
arr["msg"]=_af;
var _b5=this;
dojo.io.bind({url:urlToFetch,sync:false,preventCache:true,mimetype:"text/javascript",method:"post",content:arr,load:function(_b6,_b7,e){
_b5.getState().setHasPendingMessages(true);
dojo.lang.setTimeout(_b5,"handleNewMessages",500,psyChatUpdateMessages);
return false;
},error:function(_b9,_ba){
psyErrorMessage(4);
var _bb;
for(sProperty in _ba){
_bb+=sProperty+": "+_ba[sProperty]+"\n";
}
psyErrorMessage(_bb);
return false;
}});
}
return true;
};
this.getChatTextInput=function(){
return dojo.byId(PsyBingoConfig.ChatTextFieldID);
};
this.connectMessagePoster=function(_bc){
this.setFormID(_bc);
var _bd=dojo.byId(_bc);
if(_bd){
dojo.event.connect(_bd,"onsubmit",this,"postMessage");
var _be=this.getChatTextInput();
if(_be){
dojo.event.connect(_be,"onkeyup",this,"checkChatInput");
}
}else{
psyErrorMessage(5);
}
};
this.checkChatInput=function(evt){
if(evt.keyCode==evt["KEY_ENTER"]){
this.postMessage(evt);
var _c0=this.getChatTextInput();
if(_c0){
_c0.value="";
}
}
};
this.setPrivateRcpt=function(_c1,_c2){
if(_c2==null){
_c2="";
}
var _c3=this.extractPrivateRcpt(_c2);
if(_c3.length){
_c2=this.removePrivateRcpt(_c2);
}
_c2=_c1+": "+_c2;
return _c2;
};
this.extractPrivateRcpt=function(_c4){
var _c5=/^[\w\d]+:\s*/;
m=_c5.exec(_c4);
if(m==null){
return "";
}
var _c6=_c4.indexOf(":");
var _c7=_c4.substr(m.index,_c6);
return _c7;
};
this.removePrivateRcpt=function(_c8){
var _c9=/^[\w\d]+:\s*/;
return _c8.replace(_c9,"");
};
this.getPostFormNode=function(){
var fid=this.getFormID();
if(!fid){
psyErrorMessage("ERROR: chat::postMessage called without connect first");
return false;
}
var _cb=dojo.byId(fid);
if(!_cb){
psyErrorMessage(6);
return false;
}
return _cb;
};
this.setUndocked=function(_cc){
if(_cc==this.getState().getUndocked()){
return;
}
var _cd=BingoUrlConstructor.chatSetUndocked();
var arr=new Array();
if(_cc){
arr["status"]="1";
}else{
arr["status"]="0";
}
this.getState().setUndocked(_cc);
dojo.io.bind({url:_cd,sync:false,preventCache:true,mimetype:"text/javascript",method:"post",content:arr,load:function(_cf,_d0,e){
if(_d0&&_d0.resp){
var _d2=_d0.resp.bool;
if(!_d2){
if(_d0.resp.stat){
psyErrorMessage(_d0.resp.stat);
}
}
}
return;
},error:function(_d3,_d4){
psyErrorMessage(7);
}});
};
this.setAvailability=function(_d5,_d6){
if(_d5==this.getState().getAvailable()){
return;
}
var _d7=BingoUrlConstructor.chatSetAvailability();
var arr=new Array();
if(_d5){
arr["status"]="1";
}else{
arr["status"]="0";
}
this.getState().setAvailable(_d5);
this.getState().setAutoMessageRefresh(_d5);
dojo.io.bind({url:_d7,sync:false,preventCache:true,mimetype:"text/javascript",method:"post",content:arr,load:function(_d9,_da,e){
if(_da&&_da.resp){
var _dc=_da.resp.bool;
if(!_dc){
if(_da.resp.stat){
psyErrorMessage(_da.resp.stat);
}
}
if(_d6){
_d6(_dc);
}
}
return;
},error:function(_dd,_de){
psyErrorMessage(8);
if(_d6){
_d6(false);
}
}});
};
this.setSound=function(_df){
if(_df==this.getState().getSoundNotif()){
return;
}
this.getState().setSoundNotif(_df);
var _e0=BingoUrlConstructor.chatSetSound();
var arr=new Array();
if(_df){
arr["status"]="1";
}else{
arr["status"]="0";
}
dojo.io.bind({url:_e0,sync:false,preventCache:true,mimetype:"text/javascript",method:"post",content:arr,load:function(_e2,_e3,e){
if(_e3&&_e3.resp){
var _e5=_e3.resp.bool;
if(!_e5){
if(_e3.resp.stat){
psyErrorMessage(_e3.resp.stat);
}
}
}
return;
},error:function(_e6,_e7){
psyErrorMessage(9);
}});
};
this.lastSysMessageTimeNow=function(){
this.getState().setLastSysMsgDate(new Date());
};
this.lastSysMessageIsOlderThan=function(_e8){
if(!_e8){
return true;
}
var _e9=new Date();
var _ea=this.getState().getLastSysMsgDate();
if((_e9.getTime()-_ea.getTime())>_e8){
return true;
}
return false;
};
this.totalNumMessagesNotificationHint=function(_eb){
var _ec=this.getState().getNumMessages();
if(_ec<_eb){
this.getState().setHasPendingMessages(true);
}
};
this.appendMessage=function(_ed,_ee){
var _ef="msg";
var _f0=document.createElement("p");
psyDOMSetNodeClass(_f0,_ef+_ed.type);
psyChatAppendFormatedUname(_ed.from,_f0,true);
var _f1=this.generateMessageDisplayElement(_ed.content);
_f0.appendChild(_f1);
_ee.appendChild(_f0);
return;
};
this.generateMessageDisplayElement=function(_f2){
var str="(.*?)(B\\)|:-?\\(|:\\*|:D|\\(l\\)|>:\\(|:o|:-?\\)|\\(c\\)|:[pP]|;-?\\))";
var _f4=new RegExp(str);
var _f5=document.createElement("div");
var _f6;
var _f7=0;
while((_f6=_f2.match(_f4))&&_f7<15){
_f7++;
var _f8,_f9;
var _fa=new String(_f6[1]);
if(_fa&&_fa.length){
var _fb=document.createTextNode(" "+_fa);
_f5.appendChild(_fb);
_f8=_fa.length;
}else{
_f8=0;
}
var _fc=new String(_f6[2]);
if(_fc){
if(_fc in PsyBingoConfig.ChatEmoticonReplaceVals){
var _fd=document.createElement("img");
_fd.setAttribute("src",PsyBingoConfig.ChatEmoticonHomeDir+PsyBingoConfig.ChatEmoticonReplaceVals[_fc]);
_f5.appendChild(_fd);
}else{
psyErrorMessage(10);
}
_f9=_fc.length;
}else{
_f9=0;
}
_f2=_f2.substr(_f8+_f9);
}
var _fe=document.createTextNode(" "+_f2);
if(_f7){
if(_f2.length){
_f5.appendChild(_fe);
}
return _f5;
}
return _fe;
};
}
function PsyBingoGameState(_ff){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("number","hallID",999);
this.psyAddProperty("number","gameID",0);
this.psyAddProperty("number","startsIn",0);
this.psyAddProperty("boolean","autoCheckForGameStart",false);
this.psyAddProperty("boolean","autoCheckInGame",false);
this.psyAddProperty("boolean","autoUserRefresh",false);
this.psyAddProperty("number","patSet",0);
this.psyAddProperty("string","patSetName","");
this.psyAddProperty("number","numPlayers",0);
this.psyAddProperty("number","numCards",0);
this.psyAddProperty("number","pot",0);
this.psyAddProperty("boolean","sound",true);
this.psyAddProperty("object","startDate",new Date());
this.psyAddProperty("object","lastParticipantCheck",new Date());
this.psyAddProperty("boolean","canAutoDaub",false);
this.psyAddProperty("boolean","isAutoWin",false);
this.psyAddProperty("boolean","autoDaub",true);
this.psyAddProperty("string","gameStatus","");
this.psyAddProperty("object","gameCompletedFirstSeen",new Date());
this.psyAddProperty("string","step","unknown");
this.psyAddProperty("number","ballSequence",0);
this.psyAddProperty("object","chat",new PsyChat());
this.psyAddProperty("number","freeSpotField",0);
this.psyAddProperty("object","freeSpotPositions",new Array());
this.psyAddProperty("object","usernameCache",new Array());
this.psyAddProperty("object","usernameToIDMap",new Array());
this.psyAddProperty("object","strings",new PsyUserStrings(_ff));
this.psyAddProperty("object","game",new PsyGame());
this.psyAddProperty("number","wildFieldsSet",0);
this.psyAddProperty("object","wildFieldCache",new Array());
this.psyAddProperty("object","cellsMarkedWild",new Array());
this.psyAddProperty("boolean","haveCriedBingo",false);
this.getUserID=function(_100){
var _101=this.getUsernameToIDMap();
if(_101[_100]){
return _101[_100];
}
return false;
};
this.getUsername=function(_102){
var _103=this.getUsernameCache();
if(_103[_102]){
return _103[_102];
}
this.refreshChatUsernameList(false);
var _104=this.getUsernameCache();
return _104[_102];
};
this.getAllUsernames=function(){
var _105=this.getUsernameToIDMap();
var _106=new Array();
for(name in _105){
_106.push(name);
}
return _106;
};
this.getAllUserIDs=function(){
var _107=this.getUsernameCache();
var _108=new Array();
for(anID in _107){
_108.push(anID);
}
return _108;
};
this.secondsSinceLastParticipantCheck=function(){
var _109=new Date();
var _10a=this.getLastParticipantCheck();
if(!_10a){
psyErrorMessage(11);
return 1000;
}
var _10b=(_109.getTime()-_10a.getTime())/1000;
return _10b;
};
this.doParticipantCheck=function(_10c){
var _10d=BingoUrlConstructor.gamePartStats();
var _10e=this;
dojo.io.bind({url:_10d,sync:false,preventCache:true,mimetype:"text/javascript",load:function(type,_110){
if(psyIsError(_110)){
return;
}
_10e.setLastParticipantCheck(new Date());
if(!(_110&&_110.nplayers)){
return;
}
_10c(_110);
return;
},error:function(type,_112){
psyErrorMessage(12);
}});
return;
};
this.secondsLeftToStart=function(){
var _113=new Date();
var _114=this.getStartDate();
if(!_114){
psyErrorMessage(13);
return;
}
var _115=(_114.getTime()-_113.getTime())/1000;
return _115;
};
this.freeSpots=function(_116,_117){
this.setFreeSpotField(_116);
this.setFreeSpotPositions(psyLToArr(_116));
if(_117){
_117();
}
};
this.refreshChatUsernameList=function(_118){
var _119=BingoUrlConstructor.listChatParticipants();
var _11a=this.getUsernameCache();
var _11b=this.getUsernameToIDMap();
var _11c=false;
if(_118){
_11c=true;
}
dojo.io.bind({url:_119,sync:_11c,preventCache:true,mimetype:"text/javascript",load:function(type,_11e){
if(psyIsError(_11e)){
return;
}
if(!(_11e&&_11e.num)){
return;
}
if(_11e.participants&&_11e.participants.length>1){
var i=0;
while(i<_11e.participants.length&&!("end" in _11e.participants[i])){
var pid=_11e.participants[i].pid;
var _121=_11e.participants[i].uname;
if(pid.length&&_121.length){
_11a[pid]=_121;
_11b[_121]=pid;
}
i++;
}
}
},error:function(type,_123){
psyErrorMessage(14);
}});
return;
};
this.setGameSound=function(_124){
if(_124==this.getSound()){
return;
}
this.setSound(_124);
var _125=BingoUrlConstructor.gameSetSound();
var arr=new Array();
if(_124){
arr["status"]="1";
}else{
arr["status"]="0";
}
dojo.io.bind({url:_125,sync:false,preventCache:true,mimetype:"text/javascript",method:"post",content:arr,load:function(type,_128,e){
if(_128&&_128.resp){
var _12a=_128.resp.bool;
if(!_12a){
if(_128.resp.stat){
psyErrorMessage(_128.resp.stat);
}
}
}
return;
},error:function(type,_12c){
psyErrorMessage(15);
}});
};
this.gameIsOpen=function(){
var gs=this.getGameStatus();
return (gs=="open");
};
this.gameIsPending=function(){
var gs=this.getGameStatus();
return (gs=="pending");
};
this.gameIsClosed=function(){
var gs=this.getGameStatus();
return (gs=="closed"||gs=="deleted"||gs=="aborted");
};
this.gameIsCompleted=function(){
var gs=this.getGameStatus();
return (gs=="completed");
};
this.psyOnpropertychange=function(_131){
if(_131.propertyName=="startsIn"){
if(_131.propertyNewValue){
var _132=new Date();
var _133=_131.propertyNewValue*1000;
var _134=new Date(_132.getTime()+_133);
this["startDate"]=_134;
}
}else{
if(_131.propertyName=="gameStatus"){
if(!_131.propertyNewValue){
return;
}
if(_131.propertyNewValue==_131.propertyOldValue){
return;
}
if(_131.propertyNewValue=="pending"){
this.setAutoUserRefresh(true);
this.setAutoCheckForGameStart(true);
this.setAutoCheckInGame(false);
}else{
if(_131.propertyNewValue=="open"){
this.setAutoUserRefresh(true);
this.setAutoCheckForGameStart(false);
this.setAutoCheckInGame(true);
BingoGameState.getChat().getState().setAutoMessageRefresh(false);
}else{
if((_131.propertyNewValue=="closed")||(_131.propertyNewValue=="completed")){
this.setAutoUserRefresh(true);
this.setAutoCheckForGameStart(false);
this.setAutoCheckInGame(true);
}
}
}
}
}
};
}
function PsyURLBuilder(fqdn,_136,hid){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("string","componentSeparator","/");
this.psyAddProperty("string","domain",fqdn);
this.psyAddProperty("string","baseHref",_136);
this.psyAddProperty("number","hallID",hid);
this.psyAddProperty("boolean","secureConn",false);
this.interfaces=new Array();
this.interfaces["chat"]=PsyBingoConfig.BingoInterfaceCGIName;
this.interfaces["bgo"]=PsyBingoConfig.BingoInterfaceCGIName;
this.baseURL=function(){
var _138;
if(this.getSecureConn()){
_138="https://";
}else{
_138="http://";
}
_138+=this.getDomain()+this.getBaseHref();
return _138;
};
this.stepURL=function(_139,_13a){
var _13b=this.getComponentSeparator();
var _13c=this.baseURL()+_139+_13b+_13a+_13b+this.getHallID();
return _13c;
};
this.gameParam=function(){
var _13d=BingoGameState.getGameID();
var _13e="";
if(_13d){
_13e+="/"+_13d;
}
return _13e;
};
this.chatListParticipants=function(){
return this.stepURL(this.interfaces["chat"],"chatlistparts");
};
this.chatNumMessages=function(){
return this.stepURL(this.interfaces["chat"],"chatnummsg");
};
this.chatGetAllMsgs=function(){
return this.stepURL(this.interfaces["chat"],"chatgetall");
};
this.chatGetNewMsgs=function(){
return this.stepURL(this.interfaces["chat"],"chatgetnew");
};
this.chatPost=function(){
return this.stepURL(this.interfaces["chat"],"chatpost");
};
this.chatPostPrivate=function(){
return this.stepURL(this.interfaces["chat"],"chatpostpriv");
};
this.listChatParticipants=function(){
return this.stepURL(this.interfaces["chat"],"chatlistparts");
};
this.chatSetAvailability=function(){
return this.stepURL(this.interfaces["chat"],"chatsetavail");
};
this.chatSetUndocked=function(){
return this.stepURL(this.interfaces["chat"],"chatsetundock");
};
this.chatSetSound=function(){
return this.stepURL(this.interfaces["chat"],"chatsetsound");
};
this.gameStart=function(){
return this.stepURL(this.interfaces["bgo"],"gamestart")+this.gameParam();
};
this.gameHome=function(){
return this.stepURL(this.interfaces["bgo"],"game");
};
this.gameDone=function(){
return this.stepURL(this.interfaces["bgo"],"gamedone")+this.gameParam();
};
this.gameNumBalls=function(){
return this.stepURL(this.interfaces["bgo"],"gmnb")+this.gameParam();
};
this.gameAllDrawn=function(){
return this.stepURL(this.interfaces["bgo"],"gmallballs")+this.gameParam();
};
this.gameLastDrawn=function(){
return this.stepURL(this.interfaces["bgo"],"gmbl")+this.gameParam();
};
this.gameAllDaubs=function(){
return this.stepURL(this.interfaces["bgo"],"gmalldaubs")+this.gameParam();
};
this.gameDaubs=function(){
return this.stepURL(this.interfaces["bgo"],"gmdaubs")+this.gameParam();
};
this.gameDetails=function(){
return this.stepURL(this.interfaces["bgo"],"gmdets")+this.gameParam();
};
this.gamePartStats=function(){
return this.stepURL(this.interfaces["bgo"],"gmpstats")+this.gameParam();
};
this.gamePlayers=function(){
return this.stepURL(this.interfaces["bgo"],"gmplayers")+this.gameParam();
};
this.gameAutoWin=function(){
return this.stepURL(this.interfaces["bgo"],"gmatwin")+this.gameParam();
};
this.gameAutoDaub=function(){
return this.stepURL(this.interfaces["bgo"],"gmatdaub")+this.gameParam();
};
this.gameStatus=function(){
return this.stepURL(this.interfaces["bgo"],"gmstat")+this.gameParam();
};
this.gameWildBalls=function(){
return this.stepURL(this.interfaces["bgo"],"gmallwild")+this.gameParam();
};
this.gameWinners=function(){
return this.stepURL(this.interfaces["bgo"],"gmwinners")+this.gameParam();
};
this.gameSetSound=function(){
return this.stepURL(this.interfaces["bgo"],"gmsetsound");
};
}
function PsyGameBall(val,_140){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("number","value",val);
this.psyAddProperty("boolean","wild",false);
if(_140){
this.setWild(true);
}else{
this.setWild(false);
}
}
function PsyGameDaubFields(cid,_142){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("number","cid",cid);
this.psyAddProperty("object","daub",_142);
}
function PsyGame(){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("number","numBalls",0);
this.psyAddProperty("number","numWild",0);
this.psyAddProperty("number","badDrawCount",0);
this.psyAddProperty("object","drawnBalls",new Array());
this.checkForNewDraws=function(_143){
return this.handleNewDraws(BingoUrlConstructor.gameLastDrawn(),_143);
};
this.parseSingleBallDrawn=function(_144){
var _145=new Array(1);
if(_144.numchat){
this.handleChatNumMsgPiggyback(_144.numchat);
}
if(!(_144.seqnum||_144.val||_144.iswild)){
return _145;
}
this.setNumBalls(_144.seqnum);
if(_144.iswild){
this.setNumWild(this.getNumWild()+1);
}
_145[0]=new PsyGameBall(_144.val,_144.iswild);
return _145;
};
this.handleChatNumMsgPiggyback=function(_146){
var _147=BingoGameState.getChat();
_147.totalNumMessagesNotificationHint(_146);
};
this.parseAllBallsDrawn=function(_148){
if(_148.numchat){
this.handleChatNumMsgPiggyback(_148.numchat);
}
if(!_148.numballs){
return;
}
var _149=new Array(_148.numballs);
this.setNumBalls(_148.numballs);
this.setNumWild(_148.numwild);
if(!_148.balls&&(_148.balls.length>1)){
return _149;
}
var _14a=this.getDrawnBalls();
var bidx=0;
while(bidx<_148.balls.length&&!("end" in _148.balls[bidx])){
var _14c=_148.balls[bidx].val;
var _14d=_148.balls[bidx].iswild;
_149[bidx]=new PsyGameBall(_14c,_14d);
if(!_14d){
_14a[_14c]=_14c;
}
bidx++;
}
return _149;
};
this.handleNewDraws=function(_14e,_14f){
var _150=this;
dojo.io.bind({url:_14e,sync:false,preventCache:true,mimetype:"text/javascript",load:function(type,_152){
if(!_152){
psyErrorMessage(16);
var _153=_150.getBadDrawCount();
if(_153>5){
return psySendBrowserTo(BingoUrlConstructor.gameHome());
}
_150.setBadDrawCount(_153+1);
return;
}
_150.setBadDrawCount(0);
if(psyIsError(_152)){
return;
}
if(_152.numchat){
_150.handleChatNumMsgPiggyback(_152.numchat);
}
if(_152.gmstatus){
_150.statusIsNow(_152.gmstatus);
}
var _154=null;
if(_152.numballs){
_154=_150.parseAllBallsDrawn(_152);
}else{
if(_152.seqnum){
var _155=_150.getNumBalls();
if((_155+1)<_152.seqnum){
return _150.handleNewDraws(BingoUrlConstructor.gameAllDrawn(),_14f);
}
if(_152.seqnum==_155){
_154=new Array();
}else{
_154=_150.parseSingleBallDrawn(_152);
}
}else{
psyErrorMessage(17);
}
}
if(_154){
_14f(_154);
}
},error:function(type,_157){
psyErrorMessage(18);
var _158=_150.getBadDrawCount();
_150.setBadDrawCount(_158++);
}});
return;
};
this.checkAllAutoDaub=function(_159,_15a){
return this.checkAutoDaubs(BingoUrlConstructor.gameAllDaubs(),_159,_15a);
};
this.checkNewWildBalls=function(_15b){
var _15c=this;
var _15d=BingoUrlConstructor.gameWildBalls();
dojo.io.bind({url:_15d,sync:false,preventCache:true,mimetype:"text/javascript",load:function(type,_15f){
if(!_15f){
return;
}
if(psyIsError(_15f)){
return;
}
if(_15f.numchat){
_15c.handleChatNumMsgPiggyback(_15f.numchat);
}
if(_15f.numwild&&_15f.sortord){
var _160=_15f.numwild;
var _161=new Array();
if(_15f.sortord&&(_15f.sortord.length>1)){
var sidx=0;
while(sidx<_15f.sortord.length&&!("end" in _15f.sortord[sidx])){
_161[sidx]=_15f.sortord[sidx];
sidx++;
}
}
_15b(_160,_161);
}
},error:function(type,_164){
psyErrorMessage(19);
}});
return;
};
this.checkNewAutoDaub=function(_165,_166){
return this.checkAutoDaubs(BingoUrlConstructor.gameDaubs(),_165,_166);
};
this.checkAutoDaubs=function(_167,_168,_169){
var _16a=this;
dojo.io.bind({url:_167,sync:false,preventCache:true,mimetype:"text/javascript",load:function(type,_16c){
if(!_16c){
return;
}
if(psyIsError(_16c)){
return;
}
if(_16c.numchat){
_16a.handleChatNumMsgPiggyback(_16c.numchat);
}
if(_16c.num){
if(!_16c.daubs&&(_16c.daubs.length>1)){
return;
}
var _16d=_16a.parseDaubFieldList(_16c.daubs);
if(_16d&&_16d.length){
_168(_16d);
}
}
if(_16c.fromwin||_16c.sortord){
var _16e=0;
if(_16c.fromwin){
_16e=_16c.fromwin;
}
var _16f=new Array();
if(_16c.sortord&&(_16c.sortord.length>1)){
var sidx=0;
while(sidx<_16c.sortord.length&&!("end" in _16c.sortord[sidx])){
_16f[sidx]=_16c.sortord[sidx];
sidx++;
}
}
_169(_16e,_16f);
}
},error:function(type,_172){
psyErrorMessage(20);
}});
return;
};
this.parseDaubFieldList=function(_173){
if(!(_173&&_173.length)){
return;
}
var _174=new Array();
var _175=~(BingoGameState.getFreeSpotField());
var i=0;
while(i<_173.length&&!("end" in _173[i])){
if(_173[i].cid&&_173[i].daub){
var _177=_173[i].daub&_175;
var _178=psyLToArr(_173[i].daub);
_174.push(new PsyGameDaubFields(_173[i].cid,_178));
}
i++;
}
return _174;
};
this.statusIsNow=function(_179,_17a){
if(!_179){
return;
}
if(BingoGameState.getGameStatus()!=_179){
if(_179=="completed"||_179=="closed"||_179=="deleted"||_179=="aborted"){
BingoGameState.setGameCompletedFirstSeen(new Date());
}
BingoGameState.setGameStatus(_179);
if(_17a){
_17a(_179);
}
}
return;
};
this.fetchGameStatus=function(_17b){
var _17c=BingoUrlConstructor.gameStatus();
var _17d=this;
dojo.io.bind({url:_17c,sync:false,preventCache:true,mimetype:"text/plain",load:function(type,_17f,evt){
_17d.statusIsNow(_17f,_17b);
return;
},error:function(type,_182){
psyErrorMessage(21);
}});
return;
};
this.extractWinnerList=function(_183){
var _184=BingoUrlConstructor.gameWinners();
dojo.io.bind({url:_184,sync:false,preventCache:true,mimetype:"text/javascript",load:function(type,_186){
if(psyIsError(_186)){
return;
}
if(!(_186&&_186.num)){
return;
}
if(!(_186.players&&_186.players.length)){
return;
}
return _183(_186.players);
},error:function(type,_188){
psyErrorMessage(22);
}});
return;
};
this.fetchCard=function(cid){
var _18a=dojo.byId("card"+cid);
return _18a;
};
this.getAllCards=function(){
var _18b=new Array();
var _18c=dojo.byId(PsyBingoConfig.CardsDivName);
if(!(_18c&&_18c.hasChildNodes())){
return _18b;
}
var _18d;
for(_18d=0;_18d<_18c.childNodes.length;_18d++){
var _18e=_18c.childNodes[_18d];
if(dojo.dom.isNode(_18e)&&psyDOMGetNodeClass(_18e)==PsyBingoConfig.SingleCardClassName){
_18b.push(_18e);
}
}
return _18b;
};
this.fetchCardCellsFromCard=function(card){
if(!card){
psyErrorMessage(23);
return;
}
var _190=card.getElementsByTagName("table");
if(!(_190&&_190.length)){
psyErrorMessage(24);
return;
}
var _191=_190[0];
return _191.getElementsByTagName("div");
};
this.fetchCardCells=function(cid){
var card=this.fetchCard(cid);
return this.fetchCardCellsFromCard(card);
};
this.inGameCheck=function(_194,_195,_196){
this.checkForNewDraws(_194);
var _197=BingoGameState.getChat().getState();
if((!_197.getAutoMessageRefresh())&&_197.getHasPendingMessages()){
_196();
}
if(BingoGameState.gameIsCompleted()||BingoGameState.gameIsClosed()){
_195();
}
};
}
var PsyBingoConfig=new PsyBingoConfigClass();
var BingoGameState;
var BingoUrlConstructor;
var BingoSoundPlayer;
function psyGetSoundInitializedSoundPlayer(){
var _198=new Array();
_198["chat"]={file:PsyBingoConfig.SoundStackForChat};
_198["gen"]={file:PsyBingoConfig.SoundStackForGen};
return new PsySoundMan(_198);
}
function psyBingoSetup(_199,_19a,dn){
BingoGameState=new PsyBingoGameState("en");
BingoGameState.setHallID(_199);
BingoGameState.setGameID(_19a);
BingoUrlConstructor=new PsyURLBuilder(dn,"/",_199);
BingoSoundPlayer=psyGetSoundInitializedSoundPlayer();
}
function psyActivateChat(){
BingoSoundPlayer.useChatSounds();
BingoGameState.getChat().connectMessagePoster(PsyBingoConfig.ChatSubmitFormName);
psyChatStartPollingForNewUsers();
psyBingoChatSetup();
psyChatStartPollingForNewMessages();
}
function psyChatRefreshUserList(_19c,_19d){
if(_19d){
BingoGameState.refreshChatUsernameList(false);
}
var _19e=BingoGameState.getAllUserIDs();
var _19f=document.createElement("div");
if(_19e.length){
BingoGameState.getChat().getState().setUserFetchSuccess(true);
var i;
for(i=0;i<_19e.length;i++){
var _1a1=document.createElement("div");
psyDOMSetNodeClass(_1a1,"user");
psyChatAppendFormatedUname(_19e[i],_1a1,false);
_19f.appendChild(_1a1);
}
}
if(_19c.hasChildNodes&&_19c.hasChildNodes()){
_19c.removeChild(_19c.firstChild);
}
_19c.appendChild(_19f);
return;
}
function psyChatStartPollingForNewUsers(){
var _1a2=false;
var _1a3=BingoGameState.getChat().getState();
var _1a4=_1a3.getUserRefCount();
_1a4++;
if(_1a4==1){
_1a2=true;
}else{
if(_1a4>5){
_1a4=0;
}
}
_1a3.setUserRefCount(_1a4);
var _1a5=dojo.byId(PsyBingoConfig.ChatUserListDivName);
if(!_1a5){
psyErrorMessage(25);
return;
}
psyChatRefreshUserList(_1a5,_1a2);
if(BingoGameState.getAutoUserRefresh()){
dojo.lang.setTimeout(this,"psyChatStartPollingForNewUsers",PsyBingoConfig.ChatUserRefreshInterval);
}
}
function psyClearOldSysMessages(_1a6){
if(_1a6.lastSysMessageIsOlderThan(PsyBingoConfig.SysMsgDuration)){
var _1a7=dojo.byId(PsyBingoConfig.SysMsgDivName);
if(_1a7){
psyEmptyDOMNode(_1a7);
}
}
}
function psyChatFetchNewMessages(){
var _1a8=BingoGameState.getChat();
var _1a9=_1a8.getState();
psyClearOldSysMessages(_1a8);
if(_1a9.getUserFetchSuccess()){
_1a9.setNumRefreshes(_1a9.getNumRefreshes()+1);
BingoGameState.getChat().handleNewMessages(psyChatUpdateMessages);
}
return;
}
function psyChatStartPollingForNewMessages(){
psyChatFetchNewMessages();
if(BingoGameState.getChat().getState().getAutoMessageRefresh()){
dojo.lang.setTimeout(this,"psyChatStartPollingForNewMessages",PsyBingoConfig.ChatPollInterval);
}
}
function psyChatAppendFormatedUname(_1aa,_1ab,_1ac){
var _1ad="<";
var _1ae=">";
if(!psyIsNumeric(_1aa)){
return;
}
if(_1aa>0){
uname=BingoGameState.getUsername(_1aa);
if(uname&&uname.length){
var _1af=document.createElement("a");
_1af.setAttribute("href","javascript:psyChatAddrPrivMsgTo('"+uname+"');");
var _1b0=document.createTextNode(uname);
_1af.appendChild(_1b0);
if(_1ac){
var open=document.createTextNode(_1ad);
_1ab.appendChild(open);
}
_1ab.appendChild(_1af);
if(_1ac){
var _1b2=document.createTextNode(_1ae);
_1ab.appendChild(_1b2);
}
}else{
var _1b3;
_1b3=document.createTextNode("-");
_1ab.appendChild(_1b3);
}
}else{
var _1b4;
if(_1ac){
_1b4=document.createTextNode(_1ad+PsyBingoConfig.ChatSystemUserName+_1ae);
}else{
_1b4=document.createTextNode(PsyBingoConfig.ChatSystemUserName);
}
_1ab.appendChild(_1b4);
}
return;
}
function psyChatReplaceMessages(_1b5){
if(!_1b5.length){
return;
}
var _1b6=dojo.byId(PsyBingoConfig.ChatMessageListDivName);
if(!_1b6){
psyErrorMessage(26);
return;
}
psyEmptyDOMNode(_1b6);
BingoGameState.getChat().getState().setNumMessages(0);
return psyChatUpdateMessages(_1b5);
}
function psyChatUpdateMessages(_1b7){
var _1b8=dojo.byId(PsyBingoConfig.ChatMessageListDivName);
if(!_1b8){
psyErrorMessage(27);
return;
}
var _1b9=BingoGameState.getChat();
var _1ba=_1b9.getState();
var _1bb=dojo.byId(PsyBingoConfig.SysMsgDivName);
var _1bc=_1ba.getNumMessages();
if(!_1bc){
psyEmptyDOMNode(_1b8);
}
var _1bd=false;
if(_1ba.getNumRefreshes()<2){
_1bd=true;
}
if(_1b7&&_1b7.length){
var i;
var _1bf;
var _1c0=false;
for(i=0;i<_1b7.length;i++){
_1b9.appendMessage(_1b7[i],_1b8);
if(_1b7[i].type=="sys"){
if(_1bb){
var _1c1=document.createTextNode(_1b7[i].content);
psyEmptyDOMNode(_1bb);
_1bb.appendChild(_1c1);
_1c0=true;
}
}
}
_1b8.scrollTop=_1b8.scrollHeight;
if(_1b7.length){
var _1c2=_1b7.length-1;
if(_1ba.getLastSeenMsg()!=_1b7[_1c2].content){
_1ba.setLastSeenMsg(_1b7[_1c2].content);
if(!_1bd){
var _1c3=_1b7[_1c2].type+"msg";
BingoSoundPlayer.chatPlay(_1c3);
}
}
_1ba.setNumMessages(_1b7.length+_1bc);
}
}
return;
}
function psyChatAddrPrivMsgTo(_1c4){
var i;
if(!_1c4.length){
return false;
}
var _1c6=BingoGameState.getChat();
var _1c7=_1c6.getPostFormNode();
if(!_1c7){
return false;
}
var _1c8=_1c7.getElementsByTagName("textarea");
for(i=0;i<_1c8.length;i++){
var _1c9=_1c6.setPrivateRcpt(_1c4,_1c8[i].value);
_1c8[i].value=_1c9;
_1c8[i].focus();
}
}
function psyChatSubmitCanceller(){
return false;
}
function psyBingoChatSetup(){
BingoGameState.getChat().setAvailability(true,psyBingoChatSetAvailabilityResult);
BingoGameState.refreshChatUsernameList(true);
BingoGameState.getChat().handleAllMessages(psyChatReplaceMessages);
}
function psyBingoChatEnable(){
BingoGameState.getChat().setAvailability(true,psyBingoChatSetAvailabilityResult);
BingoGameState.refreshChatUsernameList(true);
psyChatStartPollingForNewMessages();
}
function psyBingoChatDisable(){
BingoGameState.getChat().setAvailability(false,psyBingoChatSetAvailabilityResult);
BingoGameState.refreshChatUsernameList(true);
psyBingoChatSetAvailabilityResult(false);
}
function psyBingoChatUndock(){
if(!BingoGameState.getChat().getState().getAvailable()){
psyBingoChatEnable();
}
BingoGameState.getChat().setUndocked(true);
}
function psyBingoChatDock(){
if(!BingoGameState.getChat().getState().getAvailable()){
psyBingoChatEnable();
}
BingoGameState.getChat().setUndocked(false);
}
function psyBingoChatSoundEnable(){
BingoGameState.getChat().setSound(true);
}
function psyBingoChatSoundDisable(){
BingoGameState.getChat().setSound(false);
}
function psyBingoGameSoundEnable(){
BingoGameState.setGameSound(true);
}
function psyBingoGameSoundDisable(){
BingoGameState.setGameSound(false);
}
function psyBingoChatSetAvailabilityResult(res){
var _1cb=BingoGameState.getChat().getChatTextInput();
if(_1cb){
if(res){
_1cb.value="";
_1cb.removeAttribute("disabled");
}else{
_1cb.value=BingoGameState.getStrings().userString("<Unavailable>");
_1cb.setAttribute("disabled","disabled");
}
}
}
function psyCountdownTime(_1cc){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("number","inSeconds",_1cc);
var _1cd=Math.floor(_1cc/3600);
var _1ce=_1cc-(_1cd*3600);
var mins=Math.floor(_1ce/60);
_1ce-=(mins*60);
var secs=Math.floor(_1ce);
this.psyAddProperty("number","seconds",secs);
this.psyAddProperty("number","minutes",mins);
this.psyAddProperty("number","hours",_1cd);
this.hoursString=function(){
return this.asString(this.getHours());
};
this.minutesString=function(){
return this.asString(this.getMinutes());
};
this.secondsString=function(){
return this.asString(this.getSeconds());
};
this.asString=function(_1d1){
if(_1d1>9){
return ""+_1d1;
}
return "0"+_1d1;
};
}
function psyGoToGameHome(){
psySendBrowserTo(BingoUrlConstructor.gameHome());
return;
}
function psyPendingCheckForGameStartLoop(){
var _1d2=5;
var _1d3=BingoGameState.secondsLeftToStart();
if(!typeof (_1d3)=="number"){
psyErrorMessage(28);
return;
}
var _1d4=PsyBingoConfig.SecondsBetweenPregamePartChecks;
var _1d5;
if(_1d3<51){
_1d5=1;
_1d4=_1d4/2;
}else{
if(_1d3<86){
_1d5=2;
}else{
_1d5=3;
}
}
if(_1d3<-2){
if(BingoGameState.getStep()!="ingame"){
psyGoToGameHome();
}
}else{
if(_1d3<2){
if(BingoGameState.getStep()!="gamestart"){
if(BingoGameState.getNumCards()>0){
psySendBrowserTo(BingoUrlConstructor.gameStart());
return;
}
}
}
}
var _1d6=new psyCountdownTime(_1d3-_1d2);
var _1d7="SETTIME";
if((_1d3-_1d2)<0.9){
if(BingoGameState.getNumCards()){
_1d7=BingoGameState.getStrings().userString("0 seconds!");
}else{
_1d7=BingoGameState.getStrings().userString("canceled");
}
}else{
if((_1d3-_1d2)<60){
_1d7=_1d6.secondsString()+BingoGameState.getStrings().userString("seconds");
}else{
_1d7=_1d6.hoursString()+":"+_1d6.minutesString()+":"+_1d6.secondsString();
}
}
var _1d8=dojo.byId(PsyBingoConfig.PregameCountdownDivName);
if(_1d8){
var _1d9=document.createTextNode(_1d7);
_1d8.replaceChild(_1d9,_1d8.childNodes[0]);
}
if(BingoGameState.secondsSinceLastParticipantCheck()>=_1d4){
BingoGameState.doParticipantCheck(PsyPreGameUpdateParticipants);
}
if(BingoGameState.getAutoCheckForGameStart()){
dojo.lang.setTimeout(this,"psyPendingCheckForGameStartLoop",_1d5*1000);
}
}
function PsyPreGameUpdateParticipants(_1da){
var i;
for(i=0;i<PsyBingoConfig.PregamePartStatsPrefixes.length;i++){
for(var pd in _1da){
var _1dd=dojo.byId(PsyBingoConfig.PregamePartStatsPrefixes[i]+pd);
if(_1dd){
psyErrorMessage(29);
psyEmptyDOMNode(_1dd);
psyDOMCreateAndAppendTextNode(new String(_1da[pd]),_1dd);
}
}
}
return;
}
function psyInGameCheckLoop(){
BingoGameState.getGame().inGameCheck(psyInGameBallsDrawn,psyInGameNowCompleted,psyChatFetchNewMessages);
psyClearOldSysMessages(BingoGameState.getChat());
if(BingoGameState.getAutoCheckInGame()){
dojo.lang.setTimeout(this,"psyInGameAddCachedWilds",PsyBingoConfig.BlCheckInterval/2);
dojo.lang.setTimeout(this,"psyInGameCheckLoop",PsyBingoConfig.BlCheckInterval);
}
}
function psyInGameNowCompleted(){
var _1de=BingoGameState.gameIsCompleted();
if(_1de||BingoGameState.gameIsClosed()){
var _1df=new Date();
var _1e0=BingoGameState.getGameCompletedFirstSeen();
if(_1de&&(!BingoGameState.getHaveCriedBingo())){
BingoGameState.setHaveCriedBingo(true);
dojo.lang.setTimeout(BingoSoundPlayer,"gamePlay",900,"crybingo");
}
if((_1df.getTime()-_1e0.getTime())>=PsyBingoConfig.PostGameCompleteDelay){
psySendBrowserTo(BingoUrlConstructor.gameDone());
}
}
return;
}
function psyInGameSortOrder(_1e1,_1e2){
var _1e3=BingoGameState.getGame();
var _1e4=_1e3.getNumWild();
var _1e5=_1e1-_1e4;
if(_1e1&&_1e1<75){
var _1e6=dojo.byId(PsyBingoConfig.NumFromWinDivName);
if(_1e6){
var _1e7=document.createTextNode(""+_1e5);
psyEmptyDOMNode(_1e6);
_1e6.appendChild(_1e7);
}
}
if(!(_1e2&&_1e2.length)){
return;
}
var _1e8=dojo.byId(PsyBingoConfig.CardSwapSpaceDivName);
var _1e9=dojo.byId(PsyBingoConfig.CardsDivName);
if(!(_1e8&&_1e9)){
psyErrorMessage(30);
return;
}
var _1ea=new Array();
var _1eb=new Array();
var cidx;
for(cidx=0;cidx<_1e2.length;cidx++){
var card=_1e3.fetchCard(_1e2[cidx].cid);
if(!card){
continue;
}
_1eb.push(card);
var _1ee=_1e2[cidx].nmis-_1e4;
if((_1ee<=3)){
psySetCardRankNotification(_1e2[cidx].cid,_1ee);
}
if(_1e4&&(cidx<12)){
psyAddWildToCard(_1e4,_1e2[cidx].cid,card,_1e2[cidx].misfld);
}
var _1ef=new String(_1e2[cidx].cid);
_1ea[_1ef]=_1e2[cidx].misfld;
}
BingoGameState.setWildFieldsSet(_1e4);
BingoGameState.setWildFieldCache(_1ea);
psyMoveDOMNodeChildren(_1e9,_1e8);
for(cidx=0;cidx<_1eb.length;cidx++){
_1e9.appendChild(_1eb[cidx]);
}
psyEmptyDOMNode(_1e8);
return;
}
function psyInGameAddNewWilds(_1f0,_1f1){
if(!(_1f0&&_1f1&&_1f1.length)){
return;
}
var _1f2=BingoGameState.getGame();
var cidx;
var _1f4=new Array();
for(cidx=0;cidx<_1f1.length;cidx++){
var card=_1f2.fetchCard(_1f1[cidx].cid);
if(!card){
continue;
}
psyAddWildToCard(_1f0,_1f1[cidx].cid,card,_1f1[cidx].misfld);
var _1f6=new String(_1f1[cidx].cid);
_1f4[_1f6]=_1f1[cidx].misfld;
}
BingoGameState.setWildFieldsSet(_1f0);
BingoGameState.setWildFieldCache(_1f4);
return;
}
function psyInGameAddCachedWilds(_1f7){
var _1f8=BingoGameState.getGame();
var _1f9=_1f8.getNumWild();
var _1fa=BingoGameState.getWildFieldCache();
if(!(_1f9&&_1fa&&_1fa.length)){
return;
}
var toDo;
if(_1f7){
toDo=_1fa;
}else{
toDo=new Array();
var keys=new Array();
var i;
for(var c in _1fa){
keys.push(c);
}
var max=Math.floor(keys.length/2);
for(i=0;i<max;i++){
var _200=Math.round(Math.random()*(keys.length-1));
toDo[keys[_200]]=_1fa[keys[_200]];
}
}
for(var cid in toDo){
var card=_1f8.fetchCard(cid);
if(!card){
continue;
}
psyAddWildToCard(_1f9,cid,card,_1fa[cid]);
}
return;
}
function psyAddWildToCard(_203,cid,card,_206){
var _207=BingoGameState.getCellsMarkedWild();
var _208;
var _209=new String(cid);
var _20a=_207[_209];
if(_20a&&_20a.length){
_208=BingoGameState.getGame().fetchCardCellsFromCard(card);
if(!(_208&&_208.length)){
return psyErrorMessage(31);
}
var _20b;
for(_20b=0;_20b<_20a.length;_20b++){
psyDOMUnSetNodeClass(_208[_20a[_20b]]);
}
}
delete _207[_209];
_207[_209]=new Array();
BingoGameState.setCellsMarkedWild(_207);
var _20c=psyLToSparseArr(_206);
if(!_20c.length){
return;
}
if(!_208){
_208=BingoGameState.getGame().fetchCardCellsFromCard(card);
if(!(_208&&_208.length)){
return psyErrorMessage(32);
}
}
var _20d=new Array();
var _20e;
var _20f;
for(_20f=0;_20f<_203;_20f++){
var _210=Math.round(Math.random()*(_20c.length-1));
var _211=_20c[_210];
var _212=Math.floor(_211/PsyBingoConfig.BingoCardSideSize);
var _213=_211%PsyBingoConfig.BingoCardSideSize;
var _214=(_213*PsyBingoConfig.BingoCardSideSize)+_212;
_20c.splice(_210,1);
_20d.push(_214);
}
var j;
for(j=0;j<_20d.length;j++){
var _216=_20d[j];
if(_216<25){
var _217=Math.round(Math.random()*(3))+1;
psyDOMSetNodeClass(_208[_216],PsyBingoConfig.WildCellClassPrefix+_217);
_207[_209].push(_216);
}
}
BingoGameState.setCellsMarkedWild(_207);
return;
}
function psySetCardRankNotification(_218,_219){
if(_219<0){
_219=0;
}
var _21a=PsyBingoConfig.CardRankNotifClassNamePrefix+_219;
var _21b=dojo.byId(PsyBingoConfig.CardRankNotifDivIdPrefix+_218);
if(_21b){
psyDOMSetNodeClass(_21b,_21a);
}
return;
}
function psyInGameBallsDrawn(_21c){
if(!(_21c&&_21c.length)){
psyInGameAddCachedWilds();
return;
}
var i;
var _21e=false;
for(i=0;i<_21c.length;i++){
if(_21c[i].getWild()){
_21e=true;
var _21f=dojo.byId(PsyBingoConfig.NumWildToDateDivName);
if(_21f){
var _220=BingoGameState.getGame().getNumWild();
psyEmptyDOMNode(_21f);
var _221=document.createTextNode(""+_220);
_21f.appendChild(_221);
}
}else{
var val=_21c[i].getValue();
if(val){
var _223=dojo.byId("bd"+val);
if(_223){
psyDOMSetNodeClass(_223,"drawn");
}
}
}
}
var _224=new Array();
var _225=true;
i=_21c.length-1;
while(i>=0&&_225){
if(_224.length>3){
_225=false;
}else{
if(!_21c[i].getWild()){
_224.push(_21c[i].getValue());
}else{
_224.push("W");
}
}
i--;
}
for(i=3;i>0;i--){
var _226=dojo.byId(PsyBingoConfig.CalledHistoryDivPrefix+i);
var _227=dojo.byId(PsyBingoConfig.CalledHistoryDivPrefix+(i-1));
psyEmptyDOMNode(_226);
if(_227&&_227.childNodes&&_227.childNodes[0]){
_226.appendChild(_227.childNodes[0]);
}
}
for(i=0;i<_224.length;i++){
var _226=dojo.byId(PsyBingoConfig.CalledHistoryDivPrefix+i);
psyEmptyDOMNode(_226);
var _228=document.createTextNode(""+_224[i]);
_226.appendChild(_228);
}
if(_21c.length&&_21c.length<3){
if(_21e){
BingoSoundPlayer.gamePlay("wildball");
}else{
BingoSoundPlayer.gamePlay("ball");
}
}
psyCardsAccountForBalls(_21c);
}
function psyCardsAccountForBalls(_229){
var _22a=BingoGameState.getGame();
if(BingoGameState.getCanAutoDaub()&&BingoGameState.getAutoDaub()){
_22a.checkNewAutoDaub(psyCardsDaubCard,psyInGameSortOrder);
}else{
if(_22a.getNumWild()){
if(_229.length){
_22a.checkNewWildBalls(psyInGameAddNewWilds);
}else{
psyInGameAddCachedWilds();
}
}
}
return;
}
function psyCardsDaubCard(_22b){
if(!(_22b&&_22b.length)){
return;
}
var _22c=BingoGameState.getFreeSpotPositions();
var i;
for(i=0;i<_22b.length;i++){
var da=_22b[i].getDaub();
var _22f=BingoGameState.getGame().fetchCardCells(_22b[i].getCid());
var row;
var col;
for(row=0;row<5;row++){
for(col=0;col<5;col++){
var pos=row+(col*5);
if(pos<da.length){
if(da[pos]&&(!_22c[pos])){
psyDOMSetNodeClass(_22f[(row*5)+col],PsyBingoConfig.CellDaubedClass);
}
}
}
}
}
}
function psySetupFreeCells(){
var _233=dojo.byId(PsyBingoConfig.CardsDivName);
if(!(_233&&_233.hasChildNodes())){
return;
}
var _234=BingoGameState.getFreeSpotPositions();
var _235=new Array();
var row;
var col;
for(row=0;row<5;row++){
for(col=0;col<5;col++){
var pos=row+(col*5);
if((pos<_234.length)&&_234[pos]){
_235.push(pos);
}
}
}
if(!(_235&&_235.length)){
return;
}
var _239=BingoGameState.getGame();
var _23a;
for(_23a=0;_23a<_233.childNodes.length;_23a++){
var _23b=_233.childNodes[_23a];
if(dojo.dom.isNode(_23b)&&psyDOMGetNodeClass(_23b)==PsyBingoConfig.SingleCardClassName){
var _23c=_239.fetchCardCellsFromCard(_23b);
if(_23c&&_23c.length){
var _23d;
for(_23d=0;_23d<_235.length;_23d++){
psyEmptyDOMNode(_23c[_235[_23d]]);
psyDOMSetNodeClass(_23c[_235[_23d]],PsyBingoConfig.CellFreeClass);
}
}
}
}
return;
}
function psyUISetup(){
psyUISetupManualDaub();
psyPopulateAutoInfoFields();
psyUICryBingoSetup();
}
function psyUICryBingoSetup(){
var _23e=dojo.byId(PsyBingoConfig.CryBingoButtonDivName);
if(!(_23e&&dojo.dom.isNode(_23e))){
return;
}
if(BingoGameState.getIsAutoWin()){
dojo.html.hide(_23e);
}else{
dojo.html.show(_23e);
}
return;
}
function psyPopulateAutoInfoFields(){
var _23f=dojo.byId(PsyBingoConfig.AutodaubStateDivName);
if(BingoGameState.getCanAutoDaub()&&dojo.dom.isNode(_23f)&&_23f.appendChild){
psyDOMCreateAndAppendTextNode(BingoGameState.getStrings().userString("Enabled"),_23f);
}else{
psyDOMCreateAndAppendTextNode(BingoGameState.getStrings().userString("Disabled"),_23f);
}
var _240=dojo.byId(PsyBingoConfig.AutowinStateDivName);
if(BingoGameState.getIsAutoWin()&&dojo.dom.isNode(_240)&&_240.appendChild){
psyDOMCreateAndAppendTextNode(BingoGameState.getStrings().userString("Not Required"),_240);
}else{
psyDOMCreateAndAppendTextNode(BingoGameState.getStrings().userString("Required"),_240);
}
}
function psyUISetupManualDaub(){
if(BingoGameState.getCanAutoDaub()&&BingoGameState.getAutoDaub()){
return;
}
var _241=BingoGameState.getGame();
var _242=_241.getAllCards();
if(!(_242&&_242.length)){
return;
}
var cidx;
for(cidx=0;cidx<_242.length;cidx++){
var _244=_241.fetchCardCellsFromCard(_242[cidx]);
if(!(_244&&_244.length)){
continue;
}
var _245;
for(_245=0;_245<_244.length;_245++){
dojo.event.connect(_244[_245],"onclick","psyUIToggleCellDaub");
}
}
return;
}
function psyUIToggleCellDaub(evt){
if(!(evt&&("target" in evt))){
psyErrorMessage(33);
}
var cell=evt.target;
var _248=psyDOMGetNodeClass(cell);
if(_248){
if(_248.indexOf(PsyBingoConfig.WildCellClassPrefix)>=0){
return;
}
if(_248==PsyBingoConfig.CellFreeClass){
return;
}
if(_248==PsyBingoConfig.CellDaubedClass){
psyDOMUnSetNodeClass(cell);
return;
}
return psyErrorMessage(34);
}
psyDOMSetNodeClass(cell,PsyBingoConfig.CellDaubedClass);
return;
}
function psyUIMessageCenterTab(_249,_24a){
this.tabbutton=dojo.byId(_249);
this.managedpanel=dojo.byId(_24a);
}
function psyUIMessageCenterTabSet(){
this.psyExtends(new PsyClassWithProperties());
this.psyAddProperty("number","gameSoundOpt",1);
this.psyAddProperty("number","chatSoundOpt",1);
this.psyAddProperty("number","chatAvailOpt",1);
var _24b=new Array(PsyBingoConfig.UITabsChatButtonDivName,PsyBingoConfig.UITabsOptionsButtonDivName);
var _24c=new Array();
_24c[_24b[0]]=new psyUIMessageCenterTab(_24b[0],PsyBingoConfig.UITabsChatPanelDivName);
_24c[_24b[1]]=new psyUIMessageCenterTab(_24b[1],PsyBingoConfig.UITabsOptionsPanelDivName);
this.psyAddProperty("object","tabNames",_24b);
this.psyAddProperty("object","tabElements",_24c);
this.psyAddProperty("string","currentlyVisible",_24b[0]);
this.tabClicked=function(evt){
if(!(evt&&("target" in evt))){
return psyErrorMessage(35);
}
var _24e=psyDOMGetNodeID(evt.target);
if(!_24e){
return;
}
var _24f=this.getTabElements();
if(!_24f[_24e]){
return psyErrorMessage(36);
}
var _250=this.getCurrentlyVisible();
if(_24e==_250){
return;
}
if(_24f[_250]){
psyDOMSetNodeClass(_24f[_250].tabbutton,PsyBingoConfig.UITabsHiddenClass);
dojo.html.hide(_24f[_250].managedpanel);
}
psyDOMSetNodeClass(_24f[_24e].tabbutton,PsyBingoConfig.UITabsVisibleClass);
dojo.html.show(_24f[_24e].managedpanel);
this.setCurrentlyVisible(_24e);
return;
};
this.connectTabHandlers=function(){
var _251=this.getTabElements();
var _252=this.getTabNames();
var i;
for(i=0;i<_252.length;i++){
dojo.event.connect(_251[_252[i]].tabbutton,"onclick",this,"tabClicked");
}
return;
};
this.connectEmoticonHandlers=function(){
var _254=dojo.byId(PsyBingoConfig.ChatEmoticonImgsDivID);
if(!_254){
return psyErrorMessage(37);
}
var _255=_254.getElementsByTagName("img");
var i;
for(i=0;i<_255.length;i++){
dojo.event.connect(_255[i],"onclick",this,"chatEmoticonClicked");
}
};
this.setup=function(){
this.connectTabHandlers();
this.connectEmoticonHandlers();
};
this.chatEmoticonClicked=function(evt){
if(!(evt&&("target" in evt))){
return psyErrorMessage(38);
}
var _258=BingoGameState.getChat().getChatTextInput();
if(!_258){
return;
}
var _259=new String((evt.target).getAttribute("alt"));
var _25a=_258.value;
_258.value=_25a+" "+_259;
_258.focus();
return;
};
}

