var a,soundManager=null;
function SoundManager(f,g){this.flashVersion=8;this.debugMode=true;this.debugFlash=false;this.useConsole=true;this.waitForWindowLoad=this.consoleOnly=false;this.nullURL="null.mp3";this.allowPolling=true;this.useMovieStar=this.useFastPolling=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1E3;this.wmode=null;this.allowFullScreen=true;this.allowScriptAccess="always";this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,
onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};var j=null,b=this;this.version=
null;this.versionNumber="V2.95b.20100101";this.altURL=this.url=this.movieURL=null;this.enabled=this.swfLoaded=false;this.o=null;this.id=g||"sm2movie";this.oMC=null;this.sounds={};this.soundIDs=[];this.isFullScreen=this.muted=false;this.isIE=navigator.userAgent.match(/MSIE/i);this.isSafari=navigator.userAgent.match(/safari/i);this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.specialWmodeCase=false;this._onready=[];this._debugOpen=true;this._windowLoaded=this._disabled=this._didInit=
this._appendSuccess=this._didAppend=false;this._hasConsole=typeof console!="undefined"&&typeof console.log!="undefined";this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemovedHTML=this._oRemoved=null;var h=function(d){return document.getElementById(d)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+
")(\\?.*)?$","i");this.filePattern=null;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this._setVersionInfo=function(){if(b.flashVersion!=8&&b.flashVersion!=
9){alert(b._str("badFV",b.flashVersion,b._defaultFlashVersion));b.flashVersion=b._defaultFlashVersion}b.version=b.versionNumber+(b.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(b.flashVersion>8){b.defaultOptions=b._mergeObjects(b.defaultOptions,b.flash9Options);b.features.buffering=true}if(b.flashVersion>8&&b.useMovieStar){b.defaultOptions=b._mergeObjects(b.defaultOptions,b.movieStarOptions);b.filePatterns.flash9=new RegExp("\\.(mp3|"+b.netStreamTypes.join("|")+")(\\?.*)?$","i");b.features.movieStar=
true}else{b.useMovieStar=false;b.features.movieStar=false}b.filePattern=b.filePatterns[b.flashVersion!=8?"flash9":"flash8"];b.movieURL=b.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf";b.features.peakData=b.features.waveformData=b.features.eqData=b.flashVersion>8};this._overHTTP=document.location?document.location.protocol.match(/http/i):null;this._initPending=this._waitingforEI=false;this._tryInitOnFocus=this.isSafari&&typeof document.hasFocus=="undefined";this._isFocused=typeof document.hasFocus!=
"undefined"?document.hasFocus():null;this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;this.strings={notReady:"Not loaded yet - wait for soundManager.onload() before calling sound-related methods",appXHTML:"soundManager_createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.",swf404:"soundManager: Verify that %s is a valid path.",tryDebug:"Try soundManager.debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",
localFail:"soundManager: Non-HTTP page ("+document.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:"soundManager: Special case: Waiting for focus-related event..",waitImpatient:"soundManager: Getting impatient, still waiting for Flash%s...",waitForever:"soundManager: Waiting indefinitely for Flash...",
needFunction:"soundManager.onready(): Function object expected",badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',fl9Vid:"flash 9 required for video. Exiting.",noMS:"MovieStar mode not enabled. Exiting.",spcWmode:"soundManager._createMovie(): Removing wmode, preventing win32 below-the-fold SWF loading issue",currentObj:"--- soundManager._debug(): Current sound objects ---",waitEI:"soundManager._initMovie(): Waiting for ExternalInterface call from Flash..",waitOnload:"soundManager: Waiting for window.onload()",
docLoaded:"soundManager: Document already loaded",onload:"soundManager.initComplete(): calling soundManager.onload()",onloadOK:"soundManager.onload() complete",init:"-- soundManager.init() --",didInit:"soundManager.init(): Already called?",flashJS:"soundManager: Attempting to call Flash from JS..",noPolling:"soundManager: Polling (whileloading()/whileplaying() support) is disabled.",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",
badRemove:"Warning: Failed to remove flash movie.",peakWave:"Warning: peak/waveform/eqData features unsupported for non-MP3 formats",shutdown:"soundManager.disable(): Shutting down",queue:"soundManager.onready(): Queueing handler",smFail:"soundManager: Failed to initialise.",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",manURL:"SMSound.load(): Using manually-assigned URL",onURL:"soundManager.load(): current URL already assigned.",badFV:'soundManager.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.'};
this._str=function(){var d=Array.prototype.slice.call(arguments),c=d.shift();if((c=b.strings&&b.strings[c]?b.strings[c]:"")&&d&&d.length)for(var e=0,i=d.length;e<i;e++)c=c.replace("%s",d[e]);return c};this.supported=function(){return b._didInit&&!b._disabled};this.getMovie=function(d){return b.isIE?window[d]:b.isSafari?h(d)||document[d]:h(d)};this.loadFromXML=function(d){try{b.o._loadFromXML(d)}catch(c){b._failSafely();return true}};this.createSound=function(d){if(!b._didInit)throw b._complain("soundManager.createSound(): "+
b._str("notReady"),arguments.callee.caller);if(arguments.length==2)d={id:arguments[0],url:arguments[1]};var c=b._mergeObjects(d);c.id.toString().charAt(0).match(/^[0-9]$/)&&b._wD("soundManager.createSound(): "+b._str("badID",c.id),2);b._wD("soundManager.createSound(): "+c.id+" ("+c.url+")",1);if(b._idCheck(c.id,true)){b._wD("soundManager.createSound(): "+c.id+" exists",1);return b.sounds[c.id]}if(b.flashVersion>8&&b.useMovieStar){if(c.isMovieStar===null)c.isMovieStar=c.url.match(b.netStreamPattern)?
true:false;c.isMovieStar&&b._wD("soundManager.createSound(): using MovieStar handling");if(c.isMovieStar&&(c.usePeakData||c.useWaveformData||c.useEQData)){b._wDS("peakWave");c.usePeakData=false;c.useWaveformData=false;c.useEQData=false}}b.sounds[c.id]=new j(c);b.soundIDs[b.soundIDs.length]=c.id;b.flashVersion==8?b.o._createSound(c.id,c.onjustbeforefinishtime):b.o._createSound(c.id,c.url,c.onjustbeforefinishtime,c.usePeakData,c.useWaveformData,c.useEQData,c.isMovieStar,c.isMovieStar?c.useVideo:false,
c.isMovieStar?c.bufferTime:false);if(c.autoLoad||c.autoPlay)b.sounds[c.id]&&b.sounds[c.id].load(c);c.autoPlay&&b.sounds[c.id].play();return b.sounds[c.id]};this.createVideo=function(d){if(arguments.length==2)d={id:arguments[0],url:arguments[1]};if(b.flashVersion>=9){d.isMovieStar=true;d.useVideo=true}else{b._wD("soundManager.createVideo(): "+b._str("f9Vid"),2);return false}b.useMovieStar||b._wD("soundManager.createVideo(): "+b._str("noMS"),2);return b.createSound(d)};this.destroyVideo=this.destroySound=
function(d,c){if(!b._idCheck(d))return false;for(var e=0;e<b.soundIDs.length;e++)b.soundIDs[e]==d&&b.soundIDs.splice(e,1);b.sounds[d].unload();c||b.sounds[d].destruct();delete b.sounds[d]};this.load=function(d,c){if(!b._idCheck(d))return false;b.sounds[d].load(c)};this.unload=function(d){if(!b._idCheck(d))return false;b.sounds[d].unload()};this.start=this.play=function(d,c){if(!b._didInit)throw b._complain("soundManager.play(): "+b._str("notReady"),arguments.callee.caller);if(!b._idCheck(d)){if(typeof c!=
"Object")c={url:c};if(c&&c.url){b._wD('soundManager.play(): attempting to create "'+d+'"',1);c.id=d;b.createSound(c)}else return false}b.sounds[d].play(c)};this.setPosition=function(d,c){if(!b._idCheck(d))return false;b.sounds[d].setPosition(c)};this.stop=function(d){if(!b._idCheck(d))return false;b._wD("soundManager.stop("+d+")",1);b.sounds[d].stop()};this.stopAll=function(){b._wD("soundManager.stopAll()",1);for(var d in b.sounds)b.sounds[d]instanceof j&&b.sounds[d].stop()};this.pause=function(d){if(!b._idCheck(d))return false;
b.sounds[d].pause()};this.pauseAll=function(){for(var d=b.soundIDs.length;d--;)b.sounds[b.soundIDs[d]].pause()};this.resume=function(d){if(!b._idCheck(d))return false;b.sounds[d].resume()};this.resumeAll=function(){for(var d=b.soundIDs.length;d--;)b.sounds[b.soundIDs[d]].resume()};this.togglePause=function(d){if(!b._idCheck(d))return false;b.sounds[d].togglePause()};this.setPan=function(d,c){if(!b._idCheck(d))return false;b.sounds[d].setPan(c)};this.setVolume=function(d,c){if(!b._idCheck(d))return false;
b.sounds[d].setVolume(c)};this.mute=function(d){if(typeof d!="string")d=null;if(d){if(!b._idCheck(d))return false;b._wD('soundManager.mute(): Muting "'+d+'"');b.sounds[d].mute()}else{b._wD("soundManager.mute(): Muting all sounds");for(d=b.soundIDs.length;d--;)b.sounds[b.soundIDs[d]].mute();b.muted=true}};this.muteAll=function(){b.mute()};this.unmute=function(d){if(typeof d!="string")d=null;if(d){if(!b._idCheck(d))return false;b._wD('soundManager.unmute(): Unmuting "'+d+'"');b.sounds[d].unmute()}else{b._wD("soundManager.unmute(): Unmuting all sounds");
for(d=b.soundIDs.length;d--;)b.sounds[b.soundIDs[d]].unmute();b.muted=false}};this.unmuteAll=function(){b.unmute()};this.toggleMute=function(d){if(!b._idCheck(d))return false;b.sounds[d].toggleMute()};this.getMemoryUse=function(){if(b.flashVersion==8)return 0;if(b.o)return parseInt(b.o._getMemoryUse(),10)};this.disable=function(d){if(typeof d=="undefined")d=false;if(b._disabled)return false;b._disabled=true;b._wDS("shutdown",1);for(var c=b.soundIDs.length;c--;)b._disableObject(b.sounds[b.soundIDs[c]]);
b.initComplete(d)};this.canPlayURL=function(d){return d?d.match(b.filePattern)?true:false:null};this.getSoundById=function(d,c){if(!d)throw new Error("SoundManager.getSoundById(): sID is null/undefined");var e=b.sounds[d];!e&&!c&&b._wD('"'+d+'" is an invalid sound ID.',2);return e};this.onready=function(d,c){if(d&&d instanceof Function){b._didInit&&b._wDS("queue");c||(c=window);b._addOnReady(d,c);b._processOnReady();return true}else throw b._str("needFunction");};this.oninitmovie=function(){};this.onload=
function(){soundManager._wD("soundManager.onload()",1)};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(d,c){if(!c)return new Error("Error: "+d);var e=new Error(""),i=null;if(e.stack)try{i=e.stack.split("@")[4]}catch(k){i=e.stack}typeof console!="undefined"&&typeof console.trace!="undefined"&&console.trace();d="Error: "+d+". \nCaller: "+c.toString()+(e.stack?" \nTop of stacktrace: "+i:e.message?" \nMessage: "+e.message:"");return new Error(d)};var l=function(){return false};
l._protected=true;this._disableObject=function(d){for(var c in d)if(typeof d[c]=="function"&&typeof d[c]._protected=="undefined")d[c]=l};this._failSafely=function(d){if(typeof d=="undefined")d=false;if(!b._disabled||d){b._wDS("smFail",2);b.disable(d)}};this._normalizeMovieURL=function(d){var c=null;if(d)if(d.match(/\.swf(\?.*)?$/i)){if(c=d.substr(d.toLowerCase().lastIndexOf(".swf?")+4))return d}else if(d.lastIndexOf("/")!=d.length-1)d+="/";return(d&&d.lastIndexOf("/")!=-1?d.substr(0,d.lastIndexOf("/")+
1):"./")+b.movieURL};this._getDocument=function(){return document.body?document.body:document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]};this._getDocument._protected=true;this._setPolling=function(d,c){if(!b.o||!b.allowPolling)return false;b.o._setPolling(d,c)};this._createMovie=function(d,c){var e=null;c=c?c:b.url;var i=b.altURL?b.altURL:c;if(b.debugURLParam.test(window.location.href.toString()))b.debugMode=true;if(b._didAppend&&b._appendSuccess)return false;
b._didAppend=true;b._setVersionInfo();b.url=b._normalizeMovieURL(b._overHTTP?c:i);c=b.url;if(b.useHighPerformance&&b.useMovieStar&&b.defaultOptions.useVideo===true){e="soundManager note: disabling highPerformance, not applicable with movieStar mode+useVideo";b.useHighPerformance=false}b.wmode=!b.wmode&&b.useHighPerformance&&!b.useMovieStar?"transparent":b.wmode;if(b.wmode!==null&&b.flashLoadTimeout!==0&&(!b.useHighPerformance||b.debugFlash)&&!b.isIE&&navigator.platform.match(/win32/i)){b.specialWmodeCase=
true;b._wDS("spcWmode");b.wmode=null}if(b.flashVersion==8)b.allowFullScreen=false;var k={name:d,id:d,src:c,width:"100%",height:"100%",quality:"high",allowScriptAccess:b.allowScriptAccess,bgcolor:b.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:b.wmode,allowfullscreen:b.allowFullScreen?"true":"false"};if(b.debugFlash)k.FlashVars="debug=1";b.wmode||delete k.wmode;var m=i=null,o=null,n=null;if(b.isIE){i=document.createElement("div");o='<object id="'+
d+'" data="'+c+'" type="'+k.type+'" width="'+k.width+'" height="'+k.height+'"><param name="movie" value="'+c+'" /><param name="AllowScriptAccess" value="'+b.allowScriptAccess+'" /><param name="quality" value="'+k.quality+'" />'+(b.wmode?'<param name="wmode" value="'+b.wmode+'" /> ':"")+'<param name="bgcolor" value="'+b.bgColor+'" /><param name="allowFullScreen" value="'+k.allowFullScreen+'" />'+(b.debugFlash?'<param name="FlashVars" value="'+k.FlashVars+'" />':"")+"<!-- --\></object>"}else{i=document.createElement("embed");
for(m in k)k.hasOwnProperty(m)&&i.setAttribute(m,k[m])}n=d=null;if(b.debugMode){d=document.createElement("div");d.id=b.debugID+"-toggle";n={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};d.appendChild(document.createTextNode("-"));d.onclick=b._toggleDebug;d.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){d.style.position=
"absolute";d.style.cursor="hand"}for(m in n)if(n.hasOwnProperty(m))d.style[m]=n[m]}if(m=b._getDocument()){b.oMC=h("sm2-container")?h("sm2-container"):document.createElement("div");n=(b.debugMode?" sm2-debug":"")+(b.debugFlash?" flash-debug":"");if(b.oMC.id){if(b.debugMode||b.debugFlash)b.oMC.className+=n;b.oMC.appendChild(i);if(b.isIE){n=b.oMC.appendChild(document.createElement("div"));n.className="sm2-object-box";n.innerHTML=o}b._appendSuccess=true}else{b.oMC.id="sm2-container";b.oMC.className="movieContainer"+
n;n=k=null;k=b.useHighPerformance?{position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:{position:"absolute",width:"8px",height:"8px",top:"-9999px",left:"-9999px"};var p=null;if(!b.debugFlash)for(p in k)if(k.hasOwnProperty(p))b.oMC.style[p]=k[p];try{b.isIE||b.oMC.appendChild(i);m.appendChild(b.oMC);if(b.isIE){n=b.oMC.appendChild(document.createElement("div"));n.className="sm2-object-box";n.innerHTML=o}b._appendSuccess=true}catch(q){throw new Error(b._str("appXHTML"));
}}if(b.debugMode&&!h(b.debugID)&&(!b._hasConsole||!b.useConsole||b.useConsole&&b._hasConsole&&!b.consoleOnly)){i=document.createElement("div");i.id=b.debugID;i.style.display=b.debugMode?"block":"none";if(b.debugMode&&!h(d.id)){try{m.appendChild(d)}catch(r){throw new Error(b._str("appXHTML"));}m.appendChild(i)}}}e&&b._wD(e);b._wD("-- SoundManager 2 "+b.version+(b.useMovieStar?", MovieStar mode":"")+(b.useHighPerformance?", high performance mode, ":", ")+((b.useFastPolling?"fast":"normal")+" polling")+
(b.wmode?", wmode: "+b.wmode:"")+(b.debugFlash?", flash debug mode":"")+" --",1);b._wD("soundManager._createMovie(): Trying to load "+c+(!b._overHTTP&&b.altURL?" (alternate URL)":""),1)};this._writeDebug=function(d,c,e){if(!b.debugMode)return false;if(typeof e!="undefined"&&e)d=d+" | "+(new Date).getTime();if(b._hasConsole&&b.useConsole){e=b._debugLevels[c];typeof console[e]!="undefined"?console[e](d):console.log(d);if(b.useConsoleOnly)return true}e=null;try{e=h("soundmanager-debug");if(!e)return false;
var i=document.createElement("div");if(++b._wdCount%2===0)i.className="sm2-alt";c=typeof c=="undefined"?0:parseInt(c,10);i.appendChild(document.createTextNode(d));if(c){if(c>=2)i.style.fontWeight="bold";if(c==3)i.style.color="#ff3333"}e.insertBefore(i,e.firstChild)}catch(k){}};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDS=function(d,c){return d?b._wD(b._str(d),c):""};this._wDS._protected=true;this._wDAlert=function(d){alert(d)};
if(window.location.href.indexOf("debug=alert")+1&&b.debugMode)b._wD=b._wDAlert;this._toggleDebug=function(){var d=h(b.debugID),c=h(b.debugID+"-toggle");if(!d)return false;if(b._debugOpen){c.innerHTML="+";d.style.display="none"}else{c.innerHTML="-";d.style.display="block"}b._debugOpen=!b._debugOpen};this._toggleDebug._protected=true;this._debug=function(){b._wDS("currentObj",1);for(var d=0,c=b.soundIDs.length;d<c;d++)b.sounds[b.soundIDs[d]]._debug()};this._debugTS=function(d,c,e){if(typeof sm2Debugger!=
"undefined")try{sm2Debugger.handleEvent(d,c,e)}catch(i){}};this._debugTS._protected=true;this._mergeObjects=function(d,c){var e={};for(var i in d)if(d.hasOwnProperty(i))e[i]=d[i];d=typeof c=="undefined"?b.defaultOptions:c;for(var k in d)if(d.hasOwnProperty(k)&&typeof e[k]=="undefined")e[k]=d[k];return e};this.go=this.createMovie=function(d){if(d)b.url=d;b._initMovie()};this._initMovie=function(){if(b.o)return false;b.o=b.getMovie(b.id);if(!b.o){if(b.oRemoved){if(b.isIE)b.oMC.innerHTML=b.oRemovedHTML;
else b.oMC.appendChild(b.oRemoved);b.oRemoved=null;b._didAppend=true}else b._createMovie(b.id,b.url);b.o=b.getMovie(b.id)}b.o&&b.flashLoadTimeout>0&&b._wDS("waitEI");typeof b.oninitmovie=="function"&&setTimeout(b.oninitmovie,1)};this.waitForExternalInterface=function(){if(b._waitingForEI)return false;b._waitingForEI=true;if(b._tryInitOnFocus&&!b._isFocused){b._wDS("waitFocus");return false}if(b.flashLoadTimeout>0){if(!b._didInit){var d=b.getMoviePercent();b._wD(b._str("waitImpatient",d==100?" (SWF loaded)":
d>0?" (SWF "+d+"% loaded)":""))}setTimeout(function(){var c=b.getMoviePercent();if(!b._didInit){b._wD("soundManager: No Flash response within reasonable time after document load.\nLikely causes: "+(c===null||c===0?"Loading "+b.movieURL+" may have failed (and/or Flash "+b.flashVersion+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+(b.debugFlash?" "+b._str("checkSWF"):""),2);if(!b._overHTTP){b._wDS("localFail",2);b.debugFlash||b._wDS("tryDebug",2)}c===0&&b._wD(b._str("swf404",b.url));
b._debugTS("flashtojs",false,": Timed out"+b._overHTTP?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)")}!b._didInit&&b._okToDisable&&b._failSafely(true)},b.flashLoadTimeout)}else b._didInit||b._wDS("waitForever")};this.getMoviePercent=function(){return b.o&&typeof b.o.PercentLoaded!="undefined"?b.o.PercentLoaded():null};this.handleFocus=function(){if(b._isFocused||!b._tryInitOnFocus)return true;b._okToDisable=true;b._isFocused=true;b._wD("soundManager.handleFocus()");b._tryInitOnFocus&&
window.removeEventListener("mousemove",b.handleFocus,false);b._waitingForEI=false;setTimeout(b.waitForExternalInterface,500);if(window.removeEventListener)window.removeEventListener("focus",b.handleFocus,false);else window.detachEvent&&window.detachEvent("onfocus",b.handleFocus)};this.initComplete=function(d){if(b._didInit)return false;b._didInit=true;b._wD("-- SoundManager 2 "+(b._disabled?"failed to load":"loaded")+" ("+(b._disabled?"security/load error":"OK")+") --",1);if(b._disabled||d){b._processOnReady();
b._debugTS("onload",false);b.onerror.apply(window);return false}else b._debugTS("onload",true);if(b.waitForWindowLoad&&!b._windowLoaded){b._wDS("waitOnload");if(window.addEventListener)window.addEventListener("load",b._initUserOnload,false);else window.attachEvent&&window.attachEvent("onload",b._initUserOnload);return false}else{b.waitForWindowLoad&&b._windowLoaded&&b._wDS("docLoaded");b._initUserOnload()}};this._addOnReady=function(d,c){b._onready.push({method:d,scope:c||null,fired:false})};this._processOnReady=
function(){if(!b._didInit)return false;for(var d={success:!b._disabled},c=[],e=0,i=b._onready.length;e<i;e++)b._onready[e].fired!==true&&c.push(b._onready[e]);if(c.length){b._wD("soundManager: Firing "+c.length+" onready() item"+(c.length>1?"s":""));e=0;for(i=c.length;e<i;e++){c[e].scope?c[e].method.apply(c[e].scope,[d]):c[e].method(d);c[e].fired=true}}};this._initUserOnload=function(){window.setTimeout(function(){b._processOnReady();b._wDS("onload",1);b.onload.apply(window);b._wDS("onloadOK",1)})};
this.init=function(){b._wDS("init");b._initMovie();if(b._didInit){b._wDS("didInit");return false}if(window.removeEventListener)window.removeEventListener("load",b.beginDelayedInit,false);else window.detachEvent&&window.detachEvent("onload",b.beginDelayedInit);try{b._wDS("flashJS");b.o._externalInterfaceTest(false);b.allowPolling?b._setPolling(true,b.useFastPolling?true:false):b._wDS("noPolling",1);b.debugMode||b.o._disableDebug();b.enabled=true;b._debugTS("jstoflash",true)}catch(d){b._wD("js/flash exception: "+
d.toString());b._debugTS("jstoflash",false);b._failSafely(true);b.initComplete();return false}b.initComplete()};this.beginDelayedInit=function(){b._windowLoaded=true;setTimeout(b.waitForExternalInterface,500);setTimeout(b.beginInit,20)};this.beginInit=function(){if(b._initPending)return false;b.createMovie();b._initMovie();return b._initPending=true};this.domContentLoaded=function(){document.removeEventListener&&document.removeEventListener("DOMContentLoaded",b.domContentLoaded,false);b.go()};this._externalInterfaceOK=
function(d){if(b.swfLoaded)return false;var c=(new Date).getTime();b._wD("soundManager._externalInterfaceOK()"+(d?" (~"+(c-d)+" ms)":""));b._debugTS("swf",true);b._debugTS("flashtojs",true);b.swfLoaded=true;b._tryInitOnFocus=false;b.isIE?setTimeout(b.init,100):b.init()};this._setSandboxType=function(d){var c=b.sandbox;c.type=d;c.description=c.types[typeof c.types[d]!="undefined"?d:"unknown"];b._wD("Flash security sandbox type: "+c.type);if(c.type=="localWithFile"){c.noRemote=true;c.noLocal=false;
b._wDS("secNote",2)}else if(c.type=="localWithNetwork"){c.noRemote=false;c.noLocal=true}else if(c.type=="localTrusted"){c.noRemote=false;c.noLocal=false}};this.reboot=function(){b._wD("soundManager.reboot()");b.soundIDs.length&&b._wD("Destroying "+b.soundIDs.length+" SMSound objects...");for(var d=b.soundIDs.length;d--;)b.sounds[b.soundIDs[d]].destruct();try{if(b.isIE)b.oRemovedHTML=b.o.innerHTML;b.oRemoved=b.o.parentNode.removeChild(b.o);b._wD("Flash movie removed.")}catch(c){b._wDS("badRemove",
2)}b.oRemovedHTML=null;b.oRemoved=null;b.enabled=false;b._didInit=false;b._waitingForEI=false;b._initPending=false;b._didAppend=false;b._appendSuccess=false;b._disabled=false;b._waitingforEI=true;b.swfLoaded=false;b.soundIDs={};b.sounds=[];b.o=null;for(d=b._onready.length;d--;)b._onready[d].fired=false;b._wD("soundManager: Rebooting...");window.setTimeout(soundManager.beginDelayedInit,20)};this.destruct=function(){b._wD("soundManager.destruct()");b.disable(true)};j=function(d){var c=this;this.sID=
d.id;this.url=d.url;this._iO=this.instanceOptions=this.options=b._mergeObjects(d);this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(b.debugMode){var e=null,i=[],k=null,m=null;for(e in c.options)if(c.options[e]!==null)if(c.options[e]instanceof Function){k=c.options[e].toString();k=k.replace(/\s\s+/g," ");m=k.indexOf("{");i[i.length]=" "+e+": {"+k.substr(m+1,Math.min(Math.max(k.indexOf("\n")-1,64),64)).replace(/\n/g,"")+"... }"}else i[i.length]=" "+
e+": "+c.options[e];b._wD("SMSound() merged options: {\n"+i.join(", \n")+"\n}")}};this._debug();this.id3={};this.resetProperties=function(){c.bytesLoaded=null;c.bytesTotal=null;c.position=null;c.duration=null;c.durationEstimate=null;c.loaded=false;c.playState=0;c.paused=false;c.readyState=0;c.muted=false;c.didBeforeFinish=false;c.didJustBeforeFinish=false;c.isBuffering=false;c.instanceOptions={};c.instanceCount=0;c.peakData={left:0,right:0};c.waveformData={left:[],right:[]};c.eqData=[];c.eqData.left=
[];c.eqData.right=[]};c.resetProperties();this.load=function(e){if(typeof e!="undefined"){c._iO=b._mergeObjects(e);c.instanceOptions=c._iO}else{e=c.options;c._iO=e;c.instanceOptions=c._iO;if(c._lastURL&&c._lastURL!=c.url){b._wDS("manURL");c._iO.url=c.url;c.url=null}}if(typeof c._iO.url=="undefined")c._iO.url=c.url;b._wD("soundManager.load(): "+c._iO.url,1);if(c._iO.url==c.url&&c.readyState!==0&&c.readyState!=2){b._wDS("onURL",1);return false}c.url=c._iO.url;c._lastURL=c._iO.url;c.loaded=false;c.readyState=
1;c.playState=0;try{if(b.flashVersion==8)b.o._load(c.sID,c._iO.url,c._iO.stream,c._iO.autoPlay,c._iO.whileloading?1:0);else{b.o._load(c.sID,c._iO.url,c._iO.stream?true:false,c._iO.autoPlay?true:false);c._iO.isMovieStar&&c._iO.autoLoad&&!c._iO.autoPlay&&c.pause()}}catch(i){b._wDS("smError",2);b._debugTS("onload",false);b.onerror();b.disable()}};this.unload=function(){if(c.readyState!==0){b._wD('SMSound.unload(): "'+c.sID+'"');c.readyState!=2&&c.setPosition(0,true);b.o._unload(c.sID,b.nullURL);c.resetProperties()}};
this.destruct=function(){b._wD('SMSound.destruct(): "'+c.sID+'"');b.o._destroySound(c.sID);b.destroySound(c.sID,true)};this.start=this.play=function(e){e||(e={});c._iO=b._mergeObjects(e,c._iO);c._iO=b._mergeObjects(c._iO,c.options);c.instanceOptions=c._iO;if(c.playState==1)if(c._iO.multiShot)b._wD('SMSound.play(): "'+c.sID+'" already playing (multi-shot)',1);else{b._wD('SMSound.play(): "'+c.sID+'" already playing (one-shot)',1);return false}if(c.loaded)b._wD('SMSound.play(): "'+c.sID+'"');else if(c.readyState===
0){b._wD('SMSound.play(): Attempting to load "'+c.sID+'"',1);c._iO.autoPlay=true;c.load(c._iO)}else if(c.readyState==2){b._wD('SMSound.play(): Could not load "'+c.sID+'" - exiting',2);return false}else b._wD('SMSound.play(): "'+c.sID+'" is loading - attempting to play..',1);if(c.paused)c.resume();else{c.playState=1;if(!c.instanceCount||b.flashVersion>8)c.instanceCount++;c.position=typeof c._iO.position!="undefined"&&!isNaN(c._iO.position)?c._iO.position:0;c._iO.onplay&&c._iO.onplay.apply(c);c.setVolume(c._iO.volume,
true);c.setPan(c._iO.pan,true);b.o._start(c.sID,c._iO.loop||1,b.flashVersion==9?c.position:c.position/1E3)}};this.stop=function(e){if(c.playState==1){c.playState=0;c.paused=false;c._iO.onstop&&c._iO.onstop.apply(c);b.o._stop(c.sID,e);c.instanceCount=0;c._iO={}}};this.setPosition=function(e){if(typeof e=="undefined")e=0;e=Math.min(c.duration,Math.max(e,0));c._iO.position=e;b.o._setPosition(c.sID,b.flashVersion==9?c._iO.position:c._iO.position/1E3,c.paused||!c.playState)};this.pause=function(){if(c.paused||
c.playState===0)return false;b._wD("SMSound.pause()");c.paused=true;b.o._pause(c.sID);c._iO.onpause&&c._iO.onpause.apply(c)};this.resume=function(){if(!c.paused||c.playState===0)return false;b._wD("SMSound.resume()");c.paused=false;b.o._pause(c.sID);c._iO.onresume&&c._iO.onresume.apply(c)};this.togglePause=function(){b._wD("SMSound.togglePause()");if(c.playState===0){c.play({position:b.flashVersion==9?c.position:c.position/1E3});return false}c.paused?c.resume():c.pause()};this.setPan=function(e,i){if(typeof e==
"undefined")e=0;if(typeof i=="undefined")i=false;b.o._setPan(c.sID,e);c._iO.pan=e;if(!i)c.pan=e};this.setVolume=function(e,i){if(typeof e=="undefined")e=100;if(typeof i=="undefined")i=false;b.o._setVolume(c.sID,b.muted&&!c.muted||c.muted?0:e);c._iO.volume=e;if(!i)c.volume=e};this.mute=function(){c.muted=true;b.o._setVolume(c.sID,0)};this.unmute=function(){c.muted=false;b.o._setVolume(c.sID,typeof c._iO.volume!="undefined"?c._iO.volume:c.options.volume)};this.toggleMute=function(){c.muted?c.unmute():
c.mute()};this._whileloading=function(e,i,k){if(c._iO.isMovieStar){c.bytesLoaded=e;c.bytesTotal=i;c.duration=Math.floor(k);c.durationEstimate=c.duration}else{c.bytesLoaded=e;c.bytesTotal=i;c.duration=Math.floor(k);c.durationEstimate=parseInt(c.bytesTotal/c.bytesLoaded*c.duration,10);if(c.durationEstimate===undefined)c.durationEstimate=c.duration}c.readyState!=3&&c._iO.whileloading&&c._iO.whileloading.apply(c)};this._onid3=function(e,i){b._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');
for(var k=[],m=0,o=e.length;m<o;m++)k[e[m]]=i[m];c.id3=b._mergeObjects(c.id3,k);c._iO.onid3&&c._iO.onid3.apply(c)};this._whileplaying=function(e,i,k,m,o){if(isNaN(e)||e===null)return false;if(c.playState===0&&e>0)e=0;c.position=e;if(b.flashVersion>8){if(c._iO.usePeakData&&typeof i!="undefined"&&i)c.peakData={left:i.leftPeak,right:i.rightPeak};if(c._iO.useWaveformData&&typeof k!="undefined"&&k)c.waveformData={left:k.split(","),right:m.split(",")};if(c._iO.useEQData)if(typeof o!="undefined"&&o.leftEQ){e=
o.leftEQ.split(",");c.eqData=e;c.eqData.left=e;if(typeof o.rightEQ!="undefined"&&o.rightEQ)c.eqData.right=o.rightEQ.split(",")}}if(c.playState==1){c.isBuffering&&c._onbufferchange(0);c._iO.whileplaying&&c._iO.whileplaying.apply(c);if(c.loaded&&c._iO.onbeforefinish&&c._iO.onbeforefinishtime&&!c.didBeforeFinish&&c.duration-c.position<=c._iO.onbeforefinishtime){b._wD("duration-position &lt;= onbeforefinishtime: "+c.duration+" - "+c.position+" &lt= "+c._iO.onbeforefinishtime+" ("+(c.duration-c.position)+
")");c._onbeforefinish()}}};this._onload=function(e){e=e==1?true:false;b._wD('SMSound._onload(): "'+c.sID+'"'+(e?" loaded.":" failed to load? - "+c.url),e?1:2);if(!e){b.sandbox.noRemote===true&&b._wD("SMSound._onload(): "+b._str("noNet"),1);b.sandbox.noLocal===true&&b._wD("SMSound._onload(): "+b._str("noLocal"),1)}c.loaded=e;c.readyState=e?3:2;c._iO.onload&&c._iO.onload.apply(c)};this._onbeforefinish=function(){if(!c.didBeforeFinish){c.didBeforeFinish=true;if(c._iO.onbeforefinish){b._wD('SMSound._onbeforefinish(): "'+
c.sID+'"');c._iO.onbeforefinish.apply(c)}}};this._onjustbeforefinish=function(){if(!c.didJustBeforeFinish){c.didJustBeforeFinish=true;if(c._iO.onjustbeforefinish){b._wD('SMSound._onjustbeforefinish(): "'+c.sID+'"');c._iO.onjustbeforefinish.apply(c)}}};this._onfinish=function(){c._iO.onbeforefinishcomplete&&c._iO.onbeforefinishcomplete.apply(c);c.didBeforeFinish=false;c.didJustBeforeFinish=false;if(c.instanceCount){c.instanceCount--;if(!c.instanceCount){c.playState=0;c.paused=false;c.instanceCount=
0;c.instanceOptions={}}if(!c.instanceCount||c._iO.multiShotEvents)if(c._iO.onfinish){b._wD('SMSound._onfinish(): "'+c.sID+'"');c._iO.onfinish.apply(c)}}};this._onmetadata=function(e){b._wD("SMSound.onmetadata()");if(!e.width&&!e.height){b._wDS("noWH");e.width=320;e.height=240}c.metadata=e;c.width=e.width;c.height=e.height;if(c._iO.onmetadata){b._wD('SMSound.onmetadata(): "'+c.sID+'"');c._iO.onmetadata.apply(c)}b._wD("SMSound.onmetadata() complete")};this._onbufferchange=function(e){if(c.playState===
0)return false;if(e==c.isBuffering){b._wD("SMSound._onbufferchange(): ignoring false default / loaded sound");return false}c.isBuffering=e==1?true:false;if(c._iO.onbufferchange){b._wD("SMSound._onbufferchange(): "+e);c._iO.onbufferchange.apply(c)}};this._ondataerror=function(e){if(c.playState>0){b._wD("SMSound._ondataerror(): "+e);c._iO.ondataerror&&c._iO.ondataerror.apply(c)}}};this._onfullscreenchange=function(d){b._wD("onfullscreenchange(): "+d);b.isFullScreen=d==1?true:false;if(!b.isFullScreen)try{window.focus();
b._wD("window.focus()")}catch(c){}};if(window.addEventListener){window.addEventListener("focus",b.handleFocus,false);window.addEventListener("load",b.beginDelayedInit,false);window.addEventListener("unload",b.destruct,false);b._tryInitOnFocus&&window.addEventListener("mousemove",b.handleFocus,false)}else if(window.attachEvent){window.attachEvent("onfocus",b.handleFocus);window.attachEvent("onload",b.beginDelayedInit);window.attachEvent("unload",b.destruct)}else{b._debugTS("onload",false);soundManager.onerror();
soundManager.disable()}document.addEventListener&&document.addEventListener("DOMContentLoaded",b.domContentLoaded,false)}if(typeof SM2_DEFER=="undefined"||!SM2_DEFER)soundManager=new SoundManager;
soundManager._flashBlock=new (function(){var f=this;this.name="soundManager._flashblock";this.didTimeout=false;this.timer=null;this.startTimer=function(g){f.timer=window.setTimeout(f.checkFlashStatus,g)};this.stopTimer=function(){if(f.timer){window.clearTimeout(f.timer);f.timer=null}};this.checkFlashStatus=function(){var g=soundManager,j=g.oMC;if(g.supported()){j.className="swf-loaded";if(f.didTimeout){j="SM2 recovered after block (or timeout), loaded OK.";g._wD(f.name+": "+j)}else{j="SM2 loaded OK (before timeout), fast unblock or no blocker.";
g._writeDebug(f.name+".checkFlashStatus: "+j,1)}f.stopTimer();return false}else{j.className="swf-timedout";f.didTimeout=true;j="No flash response, applying .swf-timedout CSS..";g._wD(f.name+": "+j)}};soundManager.flashLoadTimeout=0;soundManager.oninitmovie=function(){soundManager._flashBlock.startTimer(750)};soundManager.onready(function(g){var j=soundManager._flashBlock;g.success&&j.checkFlashStatus();j.stopTimer()})});soundManager.flashVersion=9;soundManager.useMovieStar=true;
soundManager.debugMode=false;soundManager.movieStarOptions.bufferTime=3;if(typeof XMLHttpRequest=="undefined")XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(f){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(g){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(j){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(b){}throw new Error("This browser does not support XMLHttpRequest.");};
var gmibsgediting=false,gmibsgdebug=false,gmibsgdisplay=false,gmibsghalf=false,gmibsgfixeq=false;if(typeof Array.prototype.contains=="undefined")Array.prototype.contains=function(f){var g;for(g=0;g<this.length;g++)if(this[g]==f)return true;return false};if(typeof Array.prototype.filter=="undefined")Array.prototype.filter=function(f){var g,j=[];for(g=0;g<this.length;g++)f(this[g])&&j.push(this[g]);return j};function isIE(){return!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1)}
function GMIBSG(f){var g=this;this.music=f;this.snd=soundManager.createSound({id:"gmibsg_"+f,url:f+".mp4",whileplaying:function(){g.whileplaying()},onfinish:function(){g.endGame()}});this.score=0;var j=new XMLHttpRequest;j.open("GET",f+".json");j.onreadystatechange=function(){var b;if(j.readyState==4){g.game=eval("("+j.responseText+")");g.act=g.game.act;for(b=0;b<g.act.length;b++)g.act[b].handled=false;if(gmibsghalf)for(b=0;b<g.act.length;b++){var h=g.act[b];h.st=Math.floor(h.st/2)}if(gmibsgfixeq){var l;
for(b=0;b<g.act.length;b++){h=g.act[b];for(l=b+1;l<g.act.length;l++)if(g.act[l].st-h.st>=250)break;l--;if(l!=b){var d=0;for(h=b;h<=l;h++)d+=g.act[h].st;d=Math.floor(d/(l-b+1));for(h=b;h<=l;h++)g.act[h].st=d;b=l}}}g.lastposition=0;g.lasttime=new Date;g.snd.play();g.displayGame()}};j.send(null);this.actposition=0;this.symbols=[];this.downkeys=[];this.buffering=false}a=GMIBSG.prototype;a.whileplaying=function(){this.lastposition=this.snd.position;this.lasttime=new Date};
a.getWindowSize=function(){if(typeof window.innerWidth!="undefined"){this.width=window.innerWidth;this.height=window.innerHeight}else{this.width=document.body.clientWidth;this.height=document.body.clientHeight}};a.getSymbolPositions=function(){this.getWindowSize();var f=this.width,g=this.height,j=Math.floor(this.game.actheight/this.game.screenms*g),b=f*this.game.screenwidth/this.game.actwidth;if(b<j)b=j;var h=Math.floor(f/2-b*this.game.actwidth/2);return{width:f,height:g,left:h,aw:b,ah:j}};
a.createSymbol=function(){var f=document.createElement("div");document.body.appendChild(f);return f};a.placeSymbol=function(f,g,j,b,h,l){f.style.position=isIE()?"absolute":"fixed";f.style.fontSize=g.ah+"px";f.style.fontFamily="monospace";f.style.color=h;f.innerHTML=l;f.style.visibility="visible";f.style.left=g.left+g.aw*j+"px";f.style.top=b+"px"};a.displayPoints=function(){document.getElementById("points").innerHTML="Score: "+this.score};
a.displayGame=function(){var f;window.gmibsgCurGame=this;var g=this;this.actsyms=[];f=this.getSymbolPositions();for(var j in this.game.acts){var b=this.game.acts[j],h=this.createSymbol();this.actsyms.push(h);b.sym=h;h.actd=b;this.placeSymbol(h,f,b.left,0,"red",b.innerHTML)}this.preplay=this.postplay=this.instdiv=false;if(typeof this.game.instructions!="undefined"){this.preplay=true;this.snd.pause();this.instdiv=this.createSymbol();this.instdiv.innerHTML=this.game.instructions+"<br/>Points possible: "+
this.act.length*this.game.actheight+'<br/><input type="button" value="Play!" onclick="gmibsgCurGame.startGame();" />';this.instdiv.style.textAlign="center";this.instdiv.style.position="absolute";this.instdiv.style.width=f.aw*this.game.actwidth+"px";this.instdiv.style.left=f.left+"px";this.instdiv.style.top=Math.floor(f.height/2)-f.ah*2;for(f=0;f<this.actsyms.length;f++)(function(l){var d=g.actsyms[l].actd;g.actsyms[l].onclick=function(){alert("To configure a custom key, press it now.");window.onkeydown=
document.body.onkeydown=function(c){if(typeof window.event!="undefined")c=window.event;d.keyCodes=[c.keyCode];window.onkeydown=document.body.onkeydown=null;alert("Key set.")}}})(f)}else this.startGame()};
a.startGame=function(){var f,g=this;for(f=0;f<this.actsyms.length;f++)this.actsyms[f].onclick=null;this.gametimer=setInterval(function(){g.tick()},30);window.onkeydown=document.body.onkeydown=function(j){if(typeof window.event!="undefined")j=window.event;return g.onkeydown(j)};window.onkeyup=document.body.onkeyup=function(j){if(typeof window.event!="undefined")j=window.event;return g.onkeyup(j)};this.instdiv!==false&&document.body.removeChild(this.instdiv);this.snd.resume()};
a.endGame=function(){var f;this.postplay=true;clearInterval(this.gametimer);var g=this.getSymbolPositions();window.onkeydown=document.body.onkeydown=window.onkeyup=document.body.onkeyup=null;for(f=0;f<this.symbols.length;f++)document.body.removeChild(this.symbols[f]);for(f=0;f<this.actsyms.length;f++)document.body.removeChild(this.actsyms[f]);soundManager.destroySound(this.snd.sID);document.getElementById("points").innerHTML="";this.enddiv=this.createSymbol();this.enddiv.innerHTML="Your score: "+
this.score+"<br/>Points possible: "+this.act.length*this.game.actheight+"<br/>Grade: "+this.grade()+'<br/><input type="button" value="Try again?" onclick="gmibsgCurGame.restart();" />';this.enddiv.style.textAlign="center";this.enddiv.style.position="absolute";this.enddiv.style.width=g.aw*this.game.actwidth+"px";this.enddiv.style.left=g.left+"px";this.enddiv.style.top=Math.floor(g.height/2)-g.ah*2};a.restart=function(){document.body.removeChild(this.enddiv);new GMIBSG(this.music)};
a.grade=function(){var f=Math.floor(this.score/(this.act.length*this.game.actheight)*100),g="F";if(f>=93)g="A";else if(f>=90)g="A-";else if(f>=83)g="B";else if(f>=80)g="B-";else if(f>=73)g="C";else if(f>=70)g="C-";else if(f>=63)g="D";else if(f>=60)g="D-";return f+"% ("+g+")"};
a.getPosition=function(){var f=(new Date).getTime()-this.lasttime.getTime();if(f>500){this.buffering=true;document.getElementById("buffering").innerHTML="Buffering...";f=500}else if(this.buffering){this.buffering=false;document.getElementById("buffering").innerHTML=""}return this.lastposition+f};
a.tick=function(){var f=this.getPosition()-this.game.actheight,g;if(gmibsgdebug)if(this.downkeys.contains(37)){this.snd.setPosition(this.snd.position-1E3);this.actposition=0}else if(this.downkeys.contains(38))this.snd.pause();else if(this.downkeys.contains(39))this.snd.setPosition(this.snd.position+1E3);else this.downkeys.contains(40)&&this.snd.resume();var j=this.getSymbolPositions(),b=this.actposition;for(g=b;g<this.act.length;g++){var h=this.act[g];if(h.st>=f)break;else this.tooLate(h)}this.actposition=
b=g;var l;for(g=0;b+g<this.act.length;g++){h=this.act[b+g];var d=this.game.acts[h.act];if(h.st>=f+this.game.screenms+this.game.actheight)break;if(this.symbols.length<=g){l=this.createSymbol();this.symbols.push(l)}else l=this.symbols[g];if(gmibsgdebug){l.mygmibsg=this;l.myact=h;l.onclick=function(){this.mygmibsg.snd.pause();var e=prompt(this.myact.st,"this.st = "+this.myact.st+";");(function(){eval(e)}).call(this.myact);this.mygmibsg.act.sort(this.mygmibsg.actCmp);this.mygmibsg.game.act=this.mygmibsg.act=
this.mygmibsg.act.filter(function(i){return i.st>=0});this.mygmibsg.actposition=0;this.mygmibsg.snd.resume()}}var c=Math.floor((h.st-f)/this.game.screenms*j.height-j.ah);this.placeSymbol(l,j,d.left,c,h.handled?"blue":"black",d.innerHTML)}for(;g<this.symbols.length;g++)this.symbols[g].style.visibility="hidden"};a.tooLate=function(f){if(!f.handled){f.handled=true;this.displayPoints()}};a.actCmp=function(f,g){return f.st-g.st};
a.onkeydown=function(f){if(this.downkeys.contains(f.keyCode))return false;this.downkeys.push(f.keyCode);var g=false,j=this.getPosition();if(gmibsgediting){var b=false,h;for(h in this.game.acts){g=this.game.acts[h];if(g.keyCodes.contains(f.keyCode)){b=g;break}}if(b===false)return true;g=true;f={st:j,act:h};this.act.push(f);this.act.sort(this.actCmp)}else{j=this.getPosition();b=false;for(h in this.game.acts){g=this.game.acts[h];if(g.keyCodes.contains(f.keyCode)){b=g;break}}if(b===false)return true;
g=true;b.sym.style.color="crimson";f=false;var l=this.game.actheight+1;for(b=this.actposition;b<this.act.length;b++){var d=this.act[b];if(!(d.act!=h||d.handled)){var c=Math.abs(d.st-j);if(c<l){f=d;l=c}}}if(f===false){this.score-=Math.floor(this.game.actheight/2);if(this.score<0)this.score=0}else{f.handled=true;this.score+=this.game.actheight-l}this.displayPoints()}if(gmibsgdisplay){h="[";for(b=0;b<this.act.length;b++){f=this.act[b];h+="{";for(var e in f)if(e!="handled"){h+=e+":";h+=typeof f[e]=="string"?
'"'+f[e]+'"':f[e];h+=","}h=h.slice(0,-1);h+="},"}h=h.slice(0,-1);h+="]";document.getElementById("debugOut").innerHTML="<textarea rows='25' cols='80'>"+h+"</textarea>"}return!g};a.onkeyup=function(f){this.downkeys=this.downkeys.filter(function(h){return h!=f.keyCode});var g,j=false;for(g in this.game.acts){var b=this.game.acts[g];if(b.keyCodes.contains(f.keyCode)){j=b;break}}if(j===false)return true;j.sym.style.color="red"};GMIBSG.onreadyMusic=function(f){soundManager.onready(function(){new GMIBSG(f)})};
