/*

  Generated by ESN Planet
  www.esn.me

*/

Cufon.replace($("div#menu div.menuitem a"),{fontFamily:"HelveticaNeueCondensedBold",fontSize:"13px",hover:true,textShadow:"#313131 0px 1px"});Cufon.replace($("div#menu div.menuitem_selected a"),{fontFamily:"HelveticaNeueCondensedBold",color:"#57cdea",hover:true,fontSize:"13px",textShadow:"#313131 0px 1px"});Cufon.replace($("div#submenu a"),{fontFamily:"HelveticaNeueCondensedBold",hover:true,fontSize:"12px"});Cufon.replace($("h1"),{fontFamily:"HelveticaNeueLight",fontSize:"40px",letterSpacing:"-1px"});Cufon.replace($("h2"),{fontFamily:"HelveticaNeueLight",fontSize:"22px",letterSpacing:"-1px"});Cufon.replace($("h3"),{fontFamily:"HelveticaNeueCondensedBold",fontSize:"15px"});Cufon.replace($("h4"),{fontFamily:"HelveticaNeueCondensedBold",hover:true,fontSize:"13px",textTransform:"uppercase"});Cufon.replace($("h2.intro"),{fontFamily:"HelveticaNeueLight",fontSize:"35px",lineHeight:"50px",textShadow:"#000000 0px 1px",hover:false});Cufon.now();var soundManager=null;function SoundManager(b,a){this.flashVersion=8;this.debugMode=true;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1000;this.wmode=null;this.allowFullScreen=true;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:5000,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 f=null;var e=this;this.version=null;this.versionNumber="V2.95a.20090717";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(a||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.isFullScreen=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._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemoved=null;this._oRemovedHTML=null;var g=function(h){return document.getElementById(h);};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(e.flashVersion!=8&&e.flashVersion!=9){alert('soundManager.flashVersion must be 8 or 9. "'+e.flashVersion+'" is invalid. Reverting to '+e._defaultFlashVersion+".");e.flashVersion=e._defaultFlashVersion;}e.version=e.versionNumber+(e.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(e.flashVersion>8){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.flash9Options);e.features.buffering=true;}if(e.flashVersion>8&&e.useMovieStar){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.movieStarOptions);e.filePatterns.flash9=new RegExp("\\.(mp3|"+e.netStreamTypes.join("|")+")(\\?.*)?$","i");e.features.movieStar=true;}else{e.useMovieStar=false;e.features.movieStar=false;}e.filePattern=e.filePatterns[(e.flashVersion!=8?"flash9":"flash8")];e.movieURL=(e.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");e.features.peakData=e.features.waveformData=e.features.eqData=(e.flashVersion>8);};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=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;var d="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";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.",localFail:'soundManager: Loading this page from local/network file system (not over HTTP?) Flash security likely restricting JS-Flash access. Consider adding current URL to "trusted locations" in the Flash player security settings manager at '+d+", or simply serve this content over HTTP.",waitFocus:"soundManager: Special case: Waiting for focus-related event..",waitImpatient:"soundManager: Getting impatient, still waiting for Flash.. ;)",waitForever:"soundManager: Waiting indefinitely for Flash...",needFunction:"soundManager.onready(): Function object expected"};this.supported=function(){return(e._didInit&&!e._disabled);};this.getMovie=function(h){return e.isIE?window[h]:(e.isSafari?g(h)||document[h]:g(h));};this.loadFromXML=function(h){try{e.o._loadFromXML(h);}catch(i){e._failSafely();return true;}};this.createSound=function(i){var l="soundManager.createSound(): ";if(!e._didInit){throw e._complain(l+e.strings.notReady,arguments.callee.caller);}if(arguments.length==2){i={id:arguments[0],url:arguments[1]};}var j=e._mergeObjects(i);var h=j;if(h.id.toString().charAt(0).match(/^[0-9]$/)){var k=l+'Warning: Sound ID "'+h.id+'" should be a string, starting with a non-numeric character';}if(e._idCheck(h.id,true)){return e.sounds[h.id];}if(e.flashVersion>8&&e.useMovieStar){if(h.isMovieStar===null){h.isMovieStar=(h.url.match(e.netStreamPattern)?true:false);}if(h.isMovieStar&&(h.usePeakData||h.useWaveformData||h.useEQData)){h.usePeakData=false;h.useWaveformData=false;h.useEQData=false;}}e.sounds[h.id]=new f(h);e.soundIDs[e.soundIDs.length]=h.id;if(e.flashVersion==8){e.o._createSound(h.id,h.onjustbeforefinishtime);}else{e.o._createSound(h.id,h.url,h.onjustbeforefinishtime,h.usePeakData,h.useWaveformData,h.useEQData,h.isMovieStar,(h.isMovieStar?h.useVideo:false),(h.isMovieStar?h.bufferTime:false));}if(h.autoLoad||h.autoPlay){if(e.sounds[h.id]){e.sounds[h.id].load(h);}}if(h.autoPlay){e.sounds[h.id].play();}return e.sounds[h.id];};this.createVideo=function(h){if(arguments.length==2){h={id:arguments[0],url:arguments[1]};}if(e.flashVersion>=9){h.isMovieStar=true;h.useVideo=true;}else{return false;}return e.createSound(h);};this.destroySound=function(j,h){if(!e._idCheck(j)){return false;}for(var k=0;k<e.soundIDs.length;k++){if(e.soundIDs[k]==j){e.soundIDs.splice(k,1);continue;}}e.sounds[j].unload();if(!h){e.sounds[j].destruct();}delete e.sounds[j];};this.destroyVideo=this.destroySound;this.load=function(h,i){if(!e._idCheck(h)){return false;}e.sounds[h].load(i);};this.unload=function(h){if(!e._idCheck(h)){return false;}e.sounds[h].unload();};this.play=function(h,i){if(!e._didInit){throw e._complain("soundManager.play(): "+e.strings.notReady,arguments.callee.caller);}if(!e._idCheck(h)){if(typeof i!="Object"){i={url:i};}if(i&&i.url){i.id=h;e.createSound(i);}else{return false;}}e.sounds[h].play(i);};this.start=this.play;this.setPosition=function(h,i){if(!e._idCheck(h)){return false;}e.sounds[h].setPosition(i);};this.stop=function(h){if(!e._idCheck(h)){return false;}e.sounds[h].stop();};this.stopAll=function(){for(var h in e.sounds){if(e.sounds[h] instanceof f){e.sounds[h].stop();}}};this.pause=function(h){if(!e._idCheck(h)){return false;}e.sounds[h].pause();};this.pauseAll=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].pause();}};this.resume=function(h){if(!e._idCheck(h)){return false;}e.sounds[h].resume();};this.resumeAll=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].resume();}};this.togglePause=function(h){if(!e._idCheck(h)){return false;}e.sounds[h].togglePause();};this.setPan=function(h,i){if(!e._idCheck(h)){return false;}e.sounds[h].setPan(i);};this.setVolume=function(i,h){if(!e._idCheck(i)){return false;}e.sounds[i].setVolume(h);};this.mute=function(h){if(typeof h!="string"){h=null;}if(!h){for(var j=e.soundIDs.length;j--;){e.sounds[e.soundIDs[j]].mute();}e.muted=true;}else{if(!e._idCheck(h)){return false;}e.sounds[h].mute();}};this.muteAll=function(){e.mute();};this.unmute=function(h){if(typeof h!="string"){h=null;}if(!h){for(var j=e.soundIDs.length;j--;){e.sounds[e.soundIDs[j]].unmute();}e.muted=false;}else{if(!e._idCheck(h)){return false;}e.sounds[h].unmute();}};this.unmuteAll=function(){e.unmute();};this.toggleMute=function(h){if(!e._idCheck(h)){return false;}e.sounds[h].toggleMute();};this.getMemoryUse=function(){if(e.flashVersion==8){return 0;}if(e.o){return parseInt(e.o._getMemoryUse(),10);}};this.disable=function(j){if(typeof j=="undefined"){j=false;}if(e._disabled){return false;}e._disabled=true;for(var h=e.soundIDs.length;h--;){e._disableObject(e.sounds[e.soundIDs[h]]);}e.initComplete(j);};this.canPlayURL=function(h){return(h?(h.match(e.filePattern)?true:false):null);};this.getSoundById=function(i,j){if(!i){throw new Error("SoundManager.getSoundById(): sID is null/undefined");}var h=e.sounds[i];return h;};this.onready=function(i,h){if(i&&i instanceof Function){if(!h){h=window;}e._addOnReady(i,h);e._processOnReady();return true;}else{throw e.strings.needFunction;}};this.oninitmovie=function(){};this.onload=function(){soundManager._wD("soundManager.onload()",1);};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(i,k){var j="Error: ";if(!k){return new Error(j+i);}var m=new Error("");var n=null;if(m.stack){try{var o="@";var p=m.stack.split(o);n=p[4];}catch(l){n=m.stack;}}if(typeof console!="undefined"&&typeof console.trace!="undefined"){console.trace();}var h=j+i+". \nCaller: "+k.toString()+(m.stack?" \nTop of stacktrace: "+n:(m.message?" \nMessage: "+m.message:""));return new Error(h);};var c=function(){return false;};c._protected=true;this._disableObject=function(i){for(var h in i){if(typeof i[h]=="function"&&typeof i[h]._protected=="undefined"){i[h]=c;}}h=null;};this._failSafely=function(h){if(typeof h=="undefined"){h=false;}if(!e._disabled||h){e.disable(h);}};this._normalizeMovieURL=function(h){var i=null;if(h){if(h.match(/\.swf(\?.*)?$/i)){i=h.substr(h.toLowerCase().lastIndexOf(".swf?")+4);if(i){return h;}}else{if(h.lastIndexOf("/")!=h.length-1){h=h+"/";}}}return(h&&h.lastIndexOf("/")!=-1?h.substr(0,h.lastIndexOf("/")+1):"./")+e.movieURL;};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]));};this._getDocument._protected=true;this._setPolling=function(h,i){if(!e.o||!e.allowPolling){return false;}e.o._setPolling(h,i);};this._createMovie=function(w,m){var r=null;var v=(m?m:e.url);var q=(e.altURL?e.altURL:v);if(e.debugURLParam.test(window.location.href.toString())){e.debugMode=true;}if(e._didAppend&&e._appendSuccess){return false;}e._didAppend=true;e._setVersionInfo();e.url=e._normalizeMovieURL(e._overHTTP?v:q);m=e.url;if(e.useHighPerformance&&e.useMovieStar&&e.defaultOptions.useVideo===true){r="soundManager note: disabling highPerformance, not applicable with movieStar mode + useVideo";e.useHighPerformance=false;}e.wmode=(!e.wmode&&e.useHighPerformance&&!e.useMovieStar?"transparent":e.wmode);if(e.wmode!==null&&e.flashLoadTimeout!==0&&!e.useHighPerformance&&!e.isIE&&navigator.platform.match(/win32/i)){e.specialWmodeCase=true;e.wmode=null;}if(e.flashVersion==8){e.allowFullScreen=false;}var A={name:w,id:w,src:m,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:e.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:e.wmode,allowfullscreen:(e.allowFullScreen?"true":"false")};if(!e.wmode){delete A.wmode;}var n=null;var z=null;if(e.isIE){n=document.createElement("div");var t='<object id="'+w+'" data="'+m+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+m+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(e.wmode?'<param name="wmode" value="'+e.wmode+'" /> ':"")+'<param name="bgcolor" value="'+e.bgColor+'" /><param name="allowFullScreen" value="'+(e.allowFullScreen?"true":"false")+'" /><!-- --></object>';}else{n=document.createElement("embed");for(z in A){if(A.hasOwnProperty(z)){n.setAttribute(z,A[z]);}}}var i=document.createElement("div");i.id=e.debugID+"-toggle";var j={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};i.appendChild(document.createTextNode("-"));i.onclick=e._toggleDebug;i.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){i.style.position="absolute";i.style.cursor="hand";}for(z in j){if(j.hasOwnProperty(z)){i.style[z]=j[z];}}var u=e._getDocument();if(u){e.oMC=g("sm2-container")?g("sm2-container"):document.createElement("div");if(!e.oMC.id){e.oMC.id="sm2-container";e.oMC.className="movieContainer";var o=null;var p=null;if(e.useHighPerformance){o={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"};}else{o={position:"absolute",width:"8px",height:"8px",top:"-9999px",left:"-9999px"};}var k=null;for(k in o){if(o.hasOwnProperty(k)){e.oMC.style[k]=o[k];}}try{if(!e.isIE){e.oMC.appendChild(n);}u.appendChild(e.oMC);if(e.isIE){p=e.oMC.appendChild(document.createElement("div"));p.className="sm2-object-box";p.innerHTML=t;}e._appendSuccess=true;}catch(y){throw new Error(e.strings.appXHTML);}}else{e.oMC.appendChild(n);if(e.isIE){p=e.oMC.appendChild(document.createElement("div"));p.className="sm2-object-box";p.innerHTML=t;}e._appendSuccess=true;}if(!g(e.debugID)&&((!e._hasConsole||!e.useConsole)||(e.useConsole&&e._hasConsole&&!e.consoleOnly))){var l=document.createElement("div");l.id=e.debugID;l.style.display=(e.debugMode?"block":"none");if(e.debugMode&&!g(i.id)){try{u.appendChild(i);}catch(h){throw new Error(e.strings.appXHTML);}u.appendChild(l);}}u=null;}};this._writeDebug=function(i,p,k){if(!e.debugMode){return false;}if(typeof k!="undefined"&&k){i=i+" | "+new Date().getTime();}if(e._hasConsole&&e.useConsole){var h=e._debugLevels[p];if(typeof console[h]!="undefined"){console[h](i);}else{console.log(i);}if(e.useConsoleOnly){return true;}}var n="soundmanager-debug";try{var m=g(n);if(!m){return false;}var l=document.createElement("div");if(++e._wdCount%2===0){l.className="sm2-alt";}if(typeof p=="undefined"){p=0;}else{p=parseInt(p,10);}l.appendChild(document.createTextNode(i));if(p){if(p>=2){l.style.fontWeight="bold";}if(p==3){l.style.color="#ff3333";}}m.insertBefore(l,m.firstChild);}catch(j){}m=null;};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDAlert=function(h){alert(h);};if(window.location.href.indexOf("debug=alert")+1&&e.debugMode){e._wD=e._wDAlert;}this._toggleDebug=function(){var i=g(e.debugID);var h=g(e.debugID+"-toggle");if(!i){return false;}if(e._debugOpen){h.innerHTML="+";i.style.display="none";}else{h.innerHTML="-";i.style.display="block";}e._debugOpen=!e._debugOpen;};this._toggleDebug._protected=true;this._debug=function(){for(var k=0,h=e.soundIDs.length;k<h;k++){e.sounds[e.soundIDs[k]]._debug();}};this._debugTS=function(k,h,i){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(k,h,i);}catch(j){}}};this._debugTS._protected=true;this._mergeObjects=function(j,h){var m={};for(var k in j){if(j.hasOwnProperty(k)){m[k]=j[k];}}var l=(typeof h=="undefined"?e.defaultOptions:h);for(var n in l){if(l.hasOwnProperty(n)&&typeof m[n]=="undefined"){m[n]=l[n];}}return m;};this.createMovie=function(h){if(h){e.url=h;}e._initMovie();};this.go=this.createMovie;this._initMovie=function(){if(e.o){return false;}e.o=e.getMovie(e.id);if(!e.o){if(!e.oRemoved){e._createMovie(e.id,e.url);}else{if(!e.isIE){e.oMC.appendChild(e.oRemoved);}else{e.oMC.innerHTML=e.oRemovedHTML;}e.oRemoved=null;e._didAppend=true;}e.o=e.getMovie(e.id);}if(typeof e.oninitmovie=="function"){setTimeout(e.oninitmovie,1);}};this.waitForExternalInterface=function(){if(e._waitingForEI){return false;}e._waitingForEI=true;if(e._tryInitOnFocus&&!e._isFocused){return false;}if(e.flashLoadTimeout>0){if(!e._didInit){}setTimeout(function(){if(!e._didInit&&e._okToDisable){e._failSafely(true);}},e.flashLoadTimeout);}};this.handleFocus=function(){if(e._isFocused||!e._tryInitOnFocus){return true;}e._okToDisable=true;e._isFocused=true;if(e._tryInitOnFocus){window.removeEventListener("mousemove",e.handleFocus,false);}e._waitingForEI=false;setTimeout(e.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",e.handleFocus,false);}else{if(window.detachEvent){window.detachEvent("onfocus",e.handleFocus);}}};this.initComplete=function(h){if(e._didInit){return false;}e._didInit=true;if(e._disabled||h){e._processOnReady();e._debugTS("onload",false);e.onerror.apply(window);return false;}else{e._debugTS("onload",true);}if(e.waitForWindowLoad&&!e._windowLoaded){if(window.addEventListener){window.addEventListener("load",e._initUserOnload,false);}else{if(window.attachEvent){window.attachEvent("onload",e._initUserOnload);}}return false;}else{e._initUserOnload();}};this._addOnReady=function(i,h){e._onready.push({method:i,scope:(h||null),fired:false});};this._processOnReady=function(){if(!e._didInit){return false;}var k={success:(!e._disabled)};var h=[];for(var m=0,l=e._onready.length;m<l;m++){if(e._onready[m].fired!==true){h.push(e._onready[m]);}}if(h.length){for(m=0,l=h.length;m<l;m++){if(h[m].scope){h[m].method.apply(h[m].scope,[k]);}else{h[m].method(k);}h[m].fired=true;}}};this._initUserOnload=function(){window.setTimeout(function(){e._processOnReady();e.onload.apply(window);});};this.init=function(){e._initMovie();if(e._didInit){return false;}if(window.removeEventListener){window.removeEventListener("load",e.beginDelayedInit,false);}else{if(window.detachEvent){window.detachEvent("onload",e.beginDelayedInit);}}try{e.o._externalInterfaceTest(false);e._setPolling(true,e.useFastPolling?true:false);if(!e.debugMode){e.o._disableDebug();}e.enabled=true;e._debugTS("jstoflash",true);}catch(h){e._debugTS("jstoflash",false);e._failSafely(true);e.initComplete();return false;}e.initComplete();};this.beginDelayedInit=function(){e._windowLoaded=true;setTimeout(e.waitForExternalInterface,500);setTimeout(e.beginInit,20);};this.beginInit=function(){if(e._initPending){return false;}e.createMovie();e._initMovie();e._initPending=true;return true;};this.domContentLoaded=function(){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",e.domContentLoaded,false);}e.go();};this._externalInterfaceOK=function(){if(e.swfLoaded){return false;}e._debugTS("swf",true);e._debugTS("flashtojs",true);e.swfLoaded=true;e._tryInitOnFocus=false;if(e.isIE){setTimeout(e.init,100);}else{e.init();}};this._setSandboxType=function(h){var i=e.sandbox;i.type=h;i.description=i.types[(typeof i.types[h]!="undefined"?h:"unknown")];if(i.type=="localWithFile"){i.noRemote=true;i.noLocal=false;}else{if(i.type=="localWithNetwork"){i.noRemote=false;i.noLocal=true;}else{if(i.type=="localTrusted"){i.noRemote=false;i.noLocal=false;}}}};this.reboot=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].destruct();}try{if(e.isIE){e.oRemovedHTML=e.o.innerHTML;}e.oRemoved=e.o.parentNode.removeChild(e.o);}catch(j){}e.enabled=false;e._didInit=false;e._waitingForEI=false;e._initPending=false;e._didAppend=false;e._appendSuccess=false;e._disabled=false;e._waitingforEI=true;e.swfLoaded=false;e.soundIDs={};e.sounds=[];e.o=null;for(h=e._onready.length;h--;){e._onready[h].fired=false;}window.setTimeout(soundManager.beginDelayedInit,20);};this.destruct=function(){e.disable(true);};f=function(h){var i=this;this.sID=h.id;this.url=h.url;this.options=e._mergeObjects(h);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(e.debugMode){var l=null;var n=[];var k=null;var m=null;var j=64;for(l in i.options){if(i.options[l]!==null){if(i.options[l] instanceof Function){k=i.options[l].toString();k=k.replace(/\s\s+/g," ");m=k.indexOf("{");n[n.length]=" "+l+": {"+k.substr(m+1,(Math.min(Math.max(k.indexOf("\n")-1,j),j))).replace(/\n/g,"")+"... }";}else{n[n.length]=" "+l+": "+i.options[l];}}}}};this._debug();this.id3={};this.resetProperties=function(j){i.bytesLoaded=null;i.bytesTotal=null;i.position=null;i.duration=null;i.durationEstimate=null;i.loaded=false;i.playState=0;i.paused=false;i.readyState=0;i.muted=false;i.didBeforeFinish=false;i.didJustBeforeFinish=false;i.isBuffering=false;i.instanceOptions={};i.instanceCount=0;i.peakData={left:0,right:0};i.waveformData={left:[],right:[]};i.eqData=[];};i.resetProperties();this.load=function(j){if(typeof j!="undefined"){i._iO=e._mergeObjects(j);i.instanceOptions=i._iO;}else{j=i.options;i._iO=j;i.instanceOptions=i._iO;if(i._lastURL&&i._lastURL!=i.url){i._iO.url=i.url;i.url=null;}}if(typeof i._iO.url=="undefined"){i._iO.url=i.url;}if(i._iO.url==i.url&&i.readyState!==0&&i.readyState!=2){return false;}i.url=i._iO.url;i._lastURL=i._iO.url;i.loaded=false;i.readyState=1;i.playState=0;try{if(e.flashVersion==8){e.o._load(i.sID,i._iO.url,i._iO.stream,i._iO.autoPlay,(i._iO.whileloading?1:0));}else{e.o._load(i.sID,i._iO.url,i._iO.stream?true:false,i._iO.autoPlay?true:false);if(i._iO.isMovieStar&&i._iO.autoLoad&&!i._iO.autoPlay){i.pause();}}}catch(k){e._debugTS("onload",false);e.onerror();e.disable();}};this.unload=function(){if(i.readyState!==0){if(i.readyState!=2){i.setPosition(0,true);}e.o._unload(i.sID,e.nullURL);i.resetProperties();}};this.destruct=function(){e.o._destroySound(i.sID);e.destroySound(i.sID,true);};this.play=function(k){if(!k){k={};}i._iO=e._mergeObjects(k,i._iO);i._iO=e._mergeObjects(i._iO,i.options);i.instanceOptions=i._iO;if(i.playState==1){var j=i._iO.multiShot;if(!j){return false;}}if(!i.loaded){if(i.readyState===0){i._iO.stream=true;i._iO.autoPlay=true;i.load(i._iO);}else{if(i.readyState==2){return false;}}}if(i.paused){i.resume();}else{i.playState=1;if(!i.instanceCount||e.flashVersion>8){i.instanceCount++;}i.position=(typeof i._iO.position!="undefined"&&!isNaN(i._iO.position)?i._iO.position:0);if(i._iO.onplay){i._iO.onplay.apply(i);}i.setVolume(i._iO.volume,true);i.setPan(i._iO.pan,true);e.o._start(i.sID,i._iO.loop||1,(e.flashVersion==9?i.position:i.position/1000));}};this.start=this.play;this.stop=function(j){if(i.playState==1){i.playState=0;i.paused=false;if(i._iO.onstop){i._iO.onstop.apply(i);}e.o._stop(i.sID,j);i.instanceCount=0;i._iO={};}};this.setPosition=function(k,j){if(typeof k=="undefined"){k=0;}var l=Math.min(i.duration,Math.max(k,0));i._iO.position=l;e.o._setPosition(i.sID,(e.flashVersion==9?i._iO.position:i._iO.position/1000),(i.paused||!i.playState));};this.pause=function(){if(i.paused||i.playState===0){return false;}i.paused=true;e.o._pause(i.sID);if(i._iO.onpause){i._iO.onpause.apply(i);}};this.resume=function(){if(!i.paused||i.playState===0){return false;}i.paused=false;e.o._pause(i.sID);if(i._iO.onresume){i._iO.onresume.apply(i);}};this.togglePause=function(){if(i.playState===0){i.play({position:(e.flashVersion==9?i.position:i.position/1000)});return false;}if(i.paused){i.resume();}else{i.pause();}};this.setPan=function(k,j){if(typeof k=="undefined"){k=0;}if(typeof j=="undefined"){j=false;}e.o._setPan(i.sID,k);i._iO.pan=k;if(!j){i.pan=k;}};this.setVolume=function(j,k){if(typeof j=="undefined"){j=100;}if(typeof k=="undefined"){k=false;}e.o._setVolume(i.sID,(e.muted&&!i.muted)||i.muted?0:j);i._iO.volume=j;if(!k){i.volume=j;}};this.mute=function(){i.muted=true;e.o._setVolume(i.sID,0);};this.unmute=function(){i.muted=false;var j=typeof i._iO.volume!="undefined";e.o._setVolume(i.sID,j?i._iO.volume:i.options.volume);};this.toggleMute=function(){if(i.muted){i.unmute();}else{i.mute();}};this._whileloading=function(j,k,l){if(!i._iO.isMovieStar){i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=parseInt((i.bytesTotal/i.bytesLoaded)*i.duration,10);if(i.durationEstimate===undefined){i.durationEstimate=i.duration;}if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i);}}else{i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=i.duration;if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i);}}};this._onid3=function(n,k){var o=[];for(var m=0,l=n.length;m<l;m++){o[n[m]]=k[m];}i.id3=e._mergeObjects(i.id3,o);if(i._iO.onid3){i._iO.onid3.apply(i);}};this._whileplaying=function(k,l,n,j,m){if(isNaN(k)||k===null){return false;}if(i.playState===0&&k>0){k=0;}i.position=k;if(i._iO.usePeakData&&typeof l!="undefined"&&l){i.peakData={left:l.leftPeak,right:l.rightPeak};}if(i._iO.useWaveformData&&typeof n!="undefined"&&n){i.waveformData={left:n.split(","),right:j.split(",")};}if(i._iO.useEQData&&typeof m!="undefined"&&m){i.eqData=m;}if(i.playState==1){if(i.isBuffering){i._onbufferchange(0);}if(i._iO.whileplaying){i._iO.whileplaying.apply(i);}if(i.loaded&&i._iO.onbeforefinish&&i._iO.onbeforefinishtime&&!i.didBeforeFinish&&i.duration-i.position<=i._iO.onbeforefinishtime){i._onbeforefinish();}}};this._onload=function(j){j=(j==1?true:false);i.loaded=j;i.readyState=j?3:2;if(i._iO.onload){i._iO.onload.apply(i);}};this._onbeforefinish=function(){if(!i.didBeforeFinish){i.didBeforeFinish=true;if(i._iO.onbeforefinish){i._iO.onbeforefinish.apply(i);}}};this._onjustbeforefinish=function(j){if(!i.didJustBeforeFinish){i.didJustBeforeFinish=true;if(i._iO.onjustbeforefinish){i._iO.onjustbeforefinish.apply(i);}}};this._onfinish=function(){if(i._iO.onbeforefinishcomplete){i._iO.onbeforefinishcomplete.apply(i);}i.didBeforeFinish=false;i.didJustBeforeFinish=false;if(i.instanceCount){i.instanceCount--;if(!i.instanceCount){i.playState=0;i.paused=false;i.instanceCount=0;i.instanceOptions={};}if(!i.instanceCount||i._iO.multiShotEvents){if(i._iO.onfinish){i._iO.onfinish.apply(i);}}}else{if(i.useVideo){}}};this._onmetadata=function(j){if(!j.width&&!j.height){j.width=320;j.height=240;}i.metadata=j;i.width=j.width;i.height=j.height;if(i._iO.onmetadata){i._iO.onmetadata.apply(i);}};this._onbufferchange=function(j){if(i.playState===0){return false;}if(j==i.isBuffering){return false;}i.isBuffering=(j==1?true:false);if(i._iO.onbufferchange){i._iO.onbufferchange.apply(i);}};this._ondataerror=function(j){if(i.playState>0){if(i._iO.ondataerror){i._iO.ondataerror.apply(i);}}};};this._onfullscreenchange=function(h){e.isFullScreen=(h==1?true:false);if(!e.isFullScreen){try{window.focus();}catch(i){}}};if(window.addEventListener){window.addEventListener("focus",e.handleFocus,false);window.addEventListener("load",e.beginDelayedInit,false);window.addEventListener("unload",e.destruct,false);if(e._tryInitOnFocus){window.addEventListener("mousemove",e.handleFocus,false);}}else{if(window.attachEvent){window.attachEvent("onfocus",e.handleFocus);window.attachEvent("onload",e.beginDelayedInit);window.attachEvent("unload",e.destruct);}else{e._debugTS("onload",false);soundManager.onerror();soundManager.disable();}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",e.domContentLoaded,false);}}if(typeof SM2_DEFER=="undefined"||!SM2_DEFER){soundManager=new SoundManager();}var pi=3.14159265358979;var sm_a=6378137;var sm_b=6356752.314;var sm_EccSquared=0.00669437999013;var UTMScaleFactor=0.9996;function DegToRad(deg){return(deg/180*pi);}function RadToDeg(rad){return(rad/pi*180);}function ArcLengthOfMeridian(phi){var alpha,beta,gamma,delta,epsilon,n;var result;n=(sm_a-sm_b)/(sm_a+sm_b);alpha=((sm_a+sm_b)/2)*(1+(Math.pow(n,2)/4)+(Math.pow(n,4)/64));beta=(-3*n/2)+(9*Math.pow(n,3)/16)+(-3*Math.pow(n,5)/32);gamma=(15*Math.pow(n,2)/16)+(-15*Math.pow(n,4)/32);delta=(-35*Math.pow(n,3)/48)+(105*Math.pow(n,5)/256);epsilon=(315*Math.pow(n,4)/512);result=alpha*(phi+(beta*Math.sin(2*phi))+(gamma*Math.sin(4*phi))+(delta*Math.sin(6*phi))+(epsilon*Math.sin(8*phi)));return result;}function UTMCentralMeridian(zone){var cmeridian;cmeridian=DegToRad(-183+(zone*6));return cmeridian;}function FootpointLatitude(y){var y_,alpha_,beta_,gamma_,delta_,epsilon_,n;var result;n=(sm_a-sm_b)/(sm_a+sm_b);alpha_=((sm_a+sm_b)/2)*(1+(Math.pow(n,2)/4)+(Math.pow(n,4)/64));y_=y/alpha_;beta_=(3*n/2)+(-27*Math.pow(n,3)/32)+(269*Math.pow(n,5)/512);gamma_=(21*Math.pow(n,2)/16)+(-55*Math.pow(n,4)/32);delta_=(151*Math.pow(n,3)/96)+(-417*Math.pow(n,5)/128);epsilon_=(1097*Math.pow(n,4)/512);result=y_+(beta_*Math.sin(2*y_))+(gamma_*Math.sin(4*y_))+(delta_*Math.sin(6*y_))+(epsilon_*Math.sin(8*y_));return result;}function MapLatLonToXY(phi,lambda,lambda0,xy){var N,nu2,ep2,t,t2,l;var l3coef,l4coef,l5coef,l6coef,l7coef,l8coef;var tmp;ep2=(Math.pow(sm_a,2)-Math.pow(sm_b,2))/Math.pow(sm_b,2);nu2=ep2*Math.pow(Math.cos(phi),2);N=Math.pow(sm_a,2)/(sm_b*Math.sqrt(1+nu2));t=Math.tan(phi);t2=t*t;tmp=(t2*t2*t2)-Math.pow(t,6);l=lambda-lambda0;l3coef=1-t2+nu2;l4coef=5-t2+9*nu2+4*(nu2*nu2);l5coef=5-18*t2+(t2*t2)+14*nu2-58*t2*nu2;l6coef=61-58*t2+(t2*t2)+270*nu2-330*t2*nu2;l7coef=61-479*t2+179*(t2*t2)-(t2*t2*t2);l8coef=1385-3111*t2+543*(t2*t2)-(t2*t2*t2);xy[0]=N*Math.cos(phi)*l+(N/6*Math.pow(Math.cos(phi),3)*l3coef*Math.pow(l,3))+(N/120*Math.pow(Math.cos(phi),5)*l5coef*Math.pow(l,5))+(N/5040*Math.pow(Math.cos(phi),7)*l7coef*Math.pow(l,7));xy[1]=ArcLengthOfMeridian(phi)+(t/2*N*Math.pow(Math.cos(phi),2)*Math.pow(l,2))+(t/24*N*Math.pow(Math.cos(phi),4)*l4coef*Math.pow(l,4))+(t/720*N*Math.pow(Math.cos(phi),6)*l6coef*Math.pow(l,6))+(t/40320*N*Math.pow(Math.cos(phi),8)*l8coef*Math.pow(l,8));return;}function MapXYToLatLon(x,y,lambda0,philambda){var phif,Nf,Nfpow,nuf2,ep2,tf,tf2,tf4,cf;var x1frac,x2frac,x3frac,x4frac,x5frac,x6frac,x7frac,x8frac;var x2poly,x3poly,x4poly,x5poly,x6poly,x7poly,x8poly;phif=FootpointLatitude(y);ep2=(Math.pow(sm_a,2)-Math.pow(sm_b,2))/Math.pow(sm_b,2);cf=Math.cos(phif);nuf2=ep2*Math.pow(cf,2);Nf=Math.pow(sm_a,2)/(sm_b*Math.sqrt(1+nuf2));Nfpow=Nf;tf=Math.tan(phif);tf2=tf*tf;tf4=tf2*tf2;x1frac=1/(Nfpow*cf);Nfpow*=Nf;x2frac=tf/(2*Nfpow);Nfpow*=Nf;x3frac=1/(6*Nfpow*cf);Nfpow*=Nf;x4frac=tf/(24*Nfpow);Nfpow*=Nf;x5frac=1/(120*Nfpow*cf);Nfpow*=Nf;x6frac=tf/(720*Nfpow);Nfpow*=Nf;x7frac=1/(5040*Nfpow*cf);Nfpow*=Nf;x8frac=tf/(40320*Nfpow);x2poly=-1-nuf2;x3poly=-1-2*tf2-nuf2;x4poly=5+3*tf2+6*nuf2-6*tf2*nuf2-3*(nuf2*nuf2)-9*tf2*(nuf2*nuf2);x5poly=5+28*tf2+24*tf4+6*nuf2+8*tf2*nuf2;x6poly=-61-90*tf2-45*tf4-107*nuf2+162*tf2*nuf2;x7poly=-61-662*tf2-1320*tf4-720*(tf4*tf2);x8poly=1385+3633*tf2+4095*tf4+1575*(tf4*tf2);philambda[0]=phif+x2frac*x2poly*(x*x)+x4frac*x4poly*Math.pow(x,4)+x6frac*x6poly*Math.pow(x,6)+x8frac*x8poly*Math.pow(x,8);philambda[1]=lambda0+x1frac*x+x3frac*x3poly*Math.pow(x,3)+x5frac*x5poly*Math.pow(x,5)+x7frac*x7poly*Math.pow(x,7);return;}function LatLonToUTMXY(lat,lon,zone,xy){MapLatLonToXY(lat,lon,UTMCentralMeridian(zone),xy);xy[0]=xy[0]*UTMScaleFactor+500000;xy[1]=xy[1]*UTMScaleFactor;if(xy[1]<0){xy[1]=xy[1]+10000000;}return zone;}function UTMXYToLatLon(x,y,zone,southhemi,latlon){var cmeridian;x-=500000;x/=UTMScaleFactor;if(southhemi){y-=10000000;}y/=UTMScaleFactor;cmeridian=UTMCentralMeridian(zone);MapXYToLatLon(x,y,cmeridian,latlon);return;}function WGS84ToUTM(longitude,latitude){var xy=new Array(2);if(isNaN(parseFloat(longitude))){alert("Please enter a valid longitude in the lon field.");return false;}lon=parseFloat(longitude);if((lon<-180)||(180<=lon)){alert("The longitude you entered is out of range.  "+"Please enter a number in the range [-180, 180).");return false;}if(isNaN(parseFloat(latitude))){alert("Please enter a valid latitude in the lat field.");return false;}lat=parseFloat(latitude);if((lat<-90)||(90<lat)){alert("The latitude you entered is out of range.  "+"Please enter a number in the range [-90, 90].");return false;}zone=Math.floor((lon+180)/6)+1;zone=LatLonToUTMXY(DegToRad(lat),DegToRad(lon),zone,xy);obj=new Object;obj.x=xy[0];obj.y=xy[1];obj.zoneLongitude=zone;obj.zoneLatitude=getLatZone(latitude);return obj;}var posLetters=["N","P","Q","R","S","T","U","V","W","X","Z"];var posDegrees=[0,8,16,24,32,40,48,56,64,72,84];var negLetters=["A","C","D","E","F","G","H","J","K","L","M"];var negDegrees=[-90,-84,-72,-64,-56,-48,-40,-32,-24,-16,-8];function getLatZone(latitude){var latIndex=-2;var lat=parseInt(latitude);if(lat>=0){var len=posLetters.length;for(i=0;i<len;i++){if(lat==posDegrees[i]){latIndex=i;break;}if(lat>posDegrees[i]){continue;}else{latIndex=i-1;break;}}}else{var len=negLetters.length;for(i=0;i<len;i++){if(lat==negDegrees[i]){latIndex=i;break;}if(lat<negDegrees[i]){latIndex=i-1;break;}else{continue;}}}if(latIndex==-1){latIndex=0;}if(lat>=0){if(latIndex==-2){latIndex=posLetters.length-1;}return posLetters[latIndex];}else{if(latIndex==-2){latIndex=negLetters.length-1;}return negLetters[latIndex];}}var fakeWidthFactor=[];fakeWidthFactor["X"]=0.55;fakeWidthFactor["W"]=0.6;fakeWidthFactor["V"]=0.65;fakeWidthFactor["U"]=0.7;fakeWidthFactor["T"]=0.75;fakeWidthFactor["S"]=0.8;fakeWidthFactor["R"]=0.85;fakeWidthFactor["Q"]=0.9;fakeWidthFactor["P"]=0.95;fakeWidthFactor["N"]=1;fakeWidthFactor["M"]=1;fakeWidthFactor["L"]=0.95;fakeWidthFactor["K"]=0.9;fakeWidthFactor["J"]=0.85;fakeWidthFactor["H"]=0.8;fakeWidthFactor["G"]=0.75;fakeWidthFactor["F"]=0.7;fakeWidthFactor["E"]=0.65;fakeWidthFactor["D"]=0.6;fakeWidthFactor["C"]=0.55;function getFakeWidthFactor(utmObject){return fakeWidthFactor[utmObject.zoneLatitude];}function isNorthernHemisphere(utmObject){return utmObject.zoneLatitude>="N";}var threeSixtyDegreesMeters=40008285.925794;var eightyDegreesLatitudeMeters=threeSixtyDegreesMeters*80/360;var totalLatitudeMeters=threeSixtyDegreesMeters*164/360;function UTMToXY(utmObject,canvasWitdh,canvasHeight){var gridWidth=canvasWitdh/60;var yMeters=isNorthernHemisphere(utmObject)?eightyDegreesLatitudeMeters+utmObject.y:utmObject.y-(10000000-eightyDegreesLatitudeMeters);var yPixels=Math.round(yMeters/totalLatitudeMeters*canvasHeight);var y=canvasHeight-yPixels;var multiplierLongitude=utmObject.zoneLongitude-1;var baseX=multiplierLongitude*gridWidth;var xWidth=threeSixtyDegreesMeters/60;xWidth*=getFakeWidthFactor(utmObject);var centerOffsetMeters=utmObject.x<500000?-(500000-utmObject.x):utmObject.x-500000;var centerOffset=gridWidth*(centerOffsetMeters/xWidth);var pixelXOffset=(gridWidth/2)+centerOffset;var x=Math.round(baseX+pixelXOffset);obj=new Object;obj.x=parseInt(x);obj.y=parseInt(y);return obj;}function testXY(longitude,latitude){result=WGS84ToUTM(longitude,latitude);result=UTMToXY(result,910,455);alert("result: x="+result.x+" y="+result.y);return;}var Surface={};Surface.Application={};Surface.Modifier={};Surface.components=[];Surface.hasFirebug=typeof console!="undefined";Surface.logger=function(msg,level){if(!level){level="debug";}try{console[level](msg);}catch(e){}};Surface.log=function(s){Surface.logger(s,"log");};Surface.debug=function(s){Surface.logger(s,"debug");};Surface.info=function(s){Surface.logger(s,"info");};Surface.warn=function(s){Surface.logger(s,"warn");};Surface.error=function(s){Surface.logger(s,"error");};Surface.info("Surface logging enabled");Surface.Component=function(name){Surface.components.push(this);this.name=name;this.methodsToHash={};this.methodHashes=[];this.addTemplate=function(template){var templateName="";var template_prefix=template.name.substr(0,template.name.indexOf("_"));var template_postfix=template.name.substr(template.name.indexOf("_")+1);if(typeof(this[template.name])!="undefined"){Surface.error("Member '"+template.name+"' in component '"+this.name+"' collides with a template name.",Surface.ERRORMODE_BREAKING);}if(template_prefix==this.name){templateName=template_postfix;if(typeof(this[template_postfix])!="undefined"){Surface.error("Member '"+template_postfix+" in component "+this.name+"' collides with a template name.",Surface.ERRORMODE_BREAKING);}this[template_postfix]=template;}this[template.name]=template;};this.extend=function(obj){for(var attr in obj){if(typeof this[attr]=="undefined"){this[attr]=obj[attr];if(typeof(this[attr])=="function"){this.methodsToHash[attr]=this[attr];}}else{Surface.error("User created attribute '"+this.name+"."+attr+"' is reserved by Surface. Please rename it.",Surface.ERRORMODE_BREAKING);}}};this.addOrbitListener=function(eventName,callback){Surface.Orbit.numOrbitListeners++;Surface.EventHandler.addListener(new Surface.Event(eventName),callback,this);};};Surface.SingleSurface=function(name){this.name=name;var parts=name.split(".");this.component=parts[0];this.id=parts.pop();this.getId=function(){return this.id;};this.getBlockConfig=function(){if(Surface.Renderer.state.blockConfig[this.id]!==undefined){return Surface.Renderer.state.blockConfig[this.id];}else{Surface.error("Couldn't retrieve blockConfig for surface "+this.name,Surface.ERRORMODE_WARNING);return Surface.BlockConfig("",{});}},this.getState=function(){if(Surface.Renderer.state.surface[this.id]!==undefined){return Surface.Renderer.state.surface[this.id];}else{Surface.error("Couldn't retrieve state for surface "+this.name,Surface.ERRORMODE_WARNING);return{};}};this.setState=function(newState){Surface.Renderer.state.surface[this.id]=newState;};this.clearState=function(){Surface.Renderer.state.surface[this.id]={};};this.createElement=function(itemState){var usage="Usage: "+this.name+".createElement(itemState)";if(arguments.length>0){return Surface.Renderer.createElement(this.createHTML(itemState));}else{Surface.error("In call to "+this.name+".createElement(): No arguments given",Surface.ERRORMODE_BREAKING,usage);}};this.createHTML=function(itemState){var usage="Usage: "+this.name+".createElement(itemState)";if(arguments.length>0){return this.render(itemState,this.getBlockConfig());}else{Surface.error("In call to "+this.name+".createHTML(): No arguments given",Surface.ERRORMODE_BREAKING,usage);}};this.update=function(itemState){if(arguments.length==0){Surface.error("In call to "+this.name+".update(): No arguments given",Surface.ERRORMODE_BREAKING,"Usage: "+this.name+".update(itemState)");return;}return Surface.Renderer.update(this,itemState);};this.refresh=function(){Surface.Renderer.updateElement(document.getElementById(this.id),this.render(this.getState(),this.getBlockConfig()));};};Surface.SurfaceList=function(name,listId,item,uniqueId){this.name=name;var parts=name.split(".");this.component=parts[0];this.id=parts.pop();this.listId=listId;this.item=item;this.uniqueId=uniqueId.replace(item+".","");this.getId=function(itemState){return this.id+"_"+eval("itemState."+this.uniqueId);};this.getBlockConfig=function(){if(Surface.Renderer.state.blockConfig[this.id]!==undefined){return Surface.Renderer.state.blockConfig[this.id];}else{Surface.error("Couldn't retrieve blockConfig for surface list "+this.name,Surface.ERRORMODE_WARNING);return Surface.BlockConfig("",{});}},this.getState=function(){var s;if(Surface.Renderer.state.surface[this.id]!==undefined){s=Surface.Renderer.state.surface[this.id];}else{Surface.error("Couldn't retrieve state for surface list "+this.name,Surface.ERRORMODE_WARNING);s={};}if(!s[this.listId]){s[this.listId]=[];}return s;};this.setState=function(state){Surface.Renderer.state.surface[this.id]=state;};this.clearState=function(){Surface.Renderer.state.surface[this.id]={};};this.getUniqueValue=function(itemState){try{return eval("itemState."+this.uniqueId);}catch(err){Surface.error("Couldn't find unique value from Surface data");}};this.createElement=function(itemState){var usage="Usage: "+this.name+".createElement(itemState)";if(arguments.length>0){return Surface.Renderer.createElement(this.createHTML(itemState));}else{Surface.error("In call to "+this.name+".createElement(): No arguments given",Surface.ERRORMODE_BREAKING,usage);}};this.createHTML=function(itemState){var usage="Usage: "+this.name+".createElement(data)";if(arguments.length>0){return this.render(itemState,this.getBlockConfig());}else{Surface.error("In call to "+this.name+".createHTML(): No arguments given",Surface.ERRORMODE_BREAKING,usage);}};this.remove=function(itemState){var usage="Usage: "+this.name+".remove(itemState)";if(arguments.length>0){if(!this._hasSurfaceId(itemState)){Surface.error("In call to "+this.name+".remove(): Data argument does not contain identifier:'"+this.uniqueId+"'",Surface.ERRORMODE_WARNING,usage);}var el=Surface.Renderer.getElement(this.id);if(el){return Surface.Renderer.loopItemRemove(this,itemState,el);}else{Surface.error("In call to "+this.name+".remove(): Missing containing HTML element. Got '"+container+"'",Surface.ERRORMODE_BREAKING,usage);}}else{Surface.error("In call to "+this.name+".remove(): No arguments given",Surface.ERRORMODE_BREAKING,usage);}};this.update=function(itemState){var usage="Usage: "+this.name+".update(itemState)";if(arguments.length==0){Surface.error("In call to "+this.name+".update(): No arguments given",Surface.ERRORMODE_BREAKING,usage);return;}else{if(!this._hasSurfaceId(itemState)){Surface.error("In call to "+this.name+".update(): Data argument does not contain identifier:'"+this.uniqueId+"'",Surface.ERRORMODE_WARNING,usage);}}var container=document.getElementById(this.id);return Surface.Renderer.loopItemUpdate(this,itemState,container);};this.insert=function(itemState,location){var usage="Usage: "+this.name+".insert(itemState, [location])";if(arguments.length==2&&typeof(location)!="number"){Surface.error("In call to "+this.name+".insert(): invalid location argument. Valid argument is e.g. 'Surface.Location.top'",Surface.ERRORMODE_WARNING,usage);location=Surface.location.top;}if(!this._hasSurfaceId(itemState)){Surface.error("In call to "+this.name+".insert(): Data argument does not contain identifier:'"+this.uniqueId+"'",Surface.ERRORMODE_WARNING,usage);}var container=Surface.Renderer.getElement(this.id);return Surface.Renderer.loopItemInsert(this,itemState,container,location||Surface.Location.top);};this.replace=function(itemState,location){var elementId=this.getId(itemState);if(document.getElementById(elementId)){return this.update(itemState);}else{return this.insert(itemState,location||Surface.Location.top);}};this.count=function(){return this.getState()[this.listId].length;};this.append=function(divId,itemState){document.getElementById(divId).innerHTML+=this.render(itemState,this.getBlockConfig());};this._hasSurfaceId=function(itemState){try{return typeof(eval("itemState."+this.uniqueId))!="undefined";}catch(err){Surface.error(err);return false;}};this.refresh=function(){Surface.Renderer.updateElement(document.getElementById(this.id),this.render(this.getState(),this.getBlockConfig()));};};Surface.Template=function(name){this.name=name;};Surface.Block=function(name){this.name=name;};Surface.error=function(message,mode,usageString){var errorMode;if(usageString!==undefined){message+="\n    "+usageString;}if(Surface.errorMode!==undefined){errorMode=Surface.ERRORMODE_NONE;}if(mode!==undefined){errorMode=mode;}switch(errorMode){case Surface.ERRORMODE_ALERT:alert(message);break;case Surface.ERRORMODE_CONSOLE:if(Surface.hasFirebug){console.info(message);}break;case Surface.ERRORMODE_BREAKING:if(Surface.hasFirebug){console.error(message);}else{throw new Error(message);}break;case Surface.ERRORMODE_WARNING:if(Surface.hasFirebug){console.warn(message);}break;case Surface.ERRORMODE_NONE:default:break;}};Surface.sha1={chrsz:8,hash:function(A){return this.binb2hex(this.core_sha1(this.str2binb(A),A.length*this.chrsz));},core_sha1:function(N,H){N[H>>5]|=128<<(24-H%32);N[((H+64>>9)<<4)+15]=H;var O=Array(80);var M=1732584193;var L=-271733879;var K=-1732584194;var J=271733878;var I=-1009589776;for(var E=0;E<N.length;E+=16){var G=M;var F=L;var D=K;var C=J;var A=I;for(var B=0;B<80;B++){if(B<16){O[B]=N[E+B];}else{O[B]=this.rol(O[B-3]^O[B-8]^O[B-14]^O[B-16],1);}var P=this.safe_add(this.safe_add(this.rol(M,5),this.sha1_ft(B,L,K,J)),this.safe_add(this.safe_add(I,O[B]),this.sha1_kt(B)));I=J;J=K;K=this.rol(L,30);L=M;M=P;}M=this.safe_add(M,G);L=this.safe_add(L,F);K=this.safe_add(K,D);J=this.safe_add(J,C);I=this.safe_add(I,A);}return Array(M,L,K,J,I);},sha1_ft:function(B,A,D,C){if(B<20){return(A&D)|((~A)&C);}if(B<40){return A^D^C;}if(B<60){return(A&D)|(A&C)|(D&C);}return A^D^C;},sha1_kt:function(A){return(A<20)?1518500249:(A<40)?1859775393:(A<60)?-1894007588:-899497514;},safe_add:function(A,D){var C=(A&65535)+(D&65535);var B=(A>>16)+(D>>16)+(C>>16);return(B<<16)|(C&65535);},rol:function(A,B){return(A<<B)|(A>>>(32-B));},str2binb:function(D){var C=Array();var A=(1<<this.chrsz)-1;for(var B=0;B<D.length*this.chrsz;B+=this.chrsz){C[B>>5]|=(D.charCodeAt(B/this.chrsz)&A)<<(32-this.chrsz-B%32);}return C;},binb2hex:function(C){var B="0123456789abcdef";var D="";for(var A=0;A<C.length*4;A++){D+=B.charAt((C[A>>2]>>((3-A%4)*8+4))&15)+B.charAt((C[A>>2]>>((3-A%4)*8))&15);}return D;}};if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var A=YAHOO.lang,C=["toString","valueOf"],B={isArray:function(D){if(D){return A.isNumber(D.length)&&A.isFunction(D.splice);}return false;},isBoolean:function(D){return typeof D==="boolean";},isFunction:function(D){return typeof D==="function";},isNull:function(D){return D===null;},isNumber:function(D){return typeof D==="number"&&isFinite(D);},isObject:function(D){return(D&&(typeof D==="object"||A.isFunction(D)))||false;},isString:function(D){return typeof D==="string";},isUndefined:function(D){return typeof D==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(F,E){for(var D=0;D<C.length;D=D+1){var H=C[D],G=E[H];if(A.isFunction(G)&&G!=Object.prototype[H]){F[H]=G;}}}:function(){},extend:function(H,I,G){if(!I||!H){throw new Error("extend failed, please check that "+"all dependencies are included.");}var E=function(){};E.prototype=I.prototype;H.prototype=new E();H.prototype.constructor=H;H.superclass=I.prototype;if(I.prototype.constructor==Object.prototype.constructor){I.prototype.constructor=I;}if(G){for(var D in G){if(A.hasOwnProperty(G,D)){H.prototype[D]=G[D];}}A._IEEnumFix(H.prototype,G);}},augmentObject:function(H,G){if(!G||!H){throw new Error("Absorb failed, verify dependencies.");}var D=arguments,F,I,E=D[2];if(E&&E!==true){for(F=2;F<D.length;F=F+1){H[D[F]]=G[D[F]];}}else{for(I in G){if(E||!(I in H)){H[I]=G[I];}}A._IEEnumFix(H,G);}},augmentProto:function(G,F){if(!F||!G){throw new Error("Augment failed, verify dependencies.");}var D=[G.prototype,F.prototype];for(var E=2;E<arguments.length;E=E+1){D.push(arguments[E]);}A.augmentObject.apply(this,D);},dump:function(D,I){var F,H,K=[],L="{...}",E="f(){...}",J=", ",G=" => ";if(!A.isObject(D)){return D+"";}else{if(D instanceof Date||("nodeType" in D&&"tagName" in D)){return D;}else{if(A.isFunction(D)){return E;}}}I=(A.isNumber(I))?I:3;if(A.isArray(D)){K.push("[");for(F=0,H=D.length;F<H;F=F+1){if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F<D;F=F+1){A.augmentObject(G,E[F],true);}return G;},later:function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=G,I,D;if(A.isString(L)){F=E[L];}if(!F){throw new TypeError("method undefined");}if(!A.isArray(J)){J=[G];}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};},isValue:function(D){return(A.isObject(D)||A.isString(D)||A.isNumber(D)||A.isBoolean(D));}};A.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(D,E){return D&&D.hasOwnProperty(E);}:function(D,E){return !A.isUndefined(D[E])&&D.constructor.prototype[E]!==D[E];};B.augmentObject(A,B,true);YAHOO.util.Lang=A;A.augment=A.augmentProto;YAHOO.augment=A.augmentProto;YAHOO.extend=A.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.5.2",build:"1076"});YAHOO.namespace("lang");YAHOO.lang.JSON={_ESCAPES:/\\["\\\/bfnrtu]/g,_VALUES:/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS:/(?:^|:|,)(?:\s*\[)+/g,_INVALID:/^[\],:{}\s]*$/,_SPECIAL_CHARS:/["\\\x00-\x1f\x7f-\x9f]/g,_PARSE_DATE:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,_CHARS:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},_applyFilter:function(C,B){var A=function(E,D){var F,G;if(D&&typeof D==="object"){for(F in D){if(YAHOO.lang.hasOwnProperty(D,F)){G=A(F,D[F]);if(G===undefined){delete D[F];}else{D[F]=G;}}}}return B(E,D);};if(YAHOO.lang.isFunction(B)){A("",C);}return C;},isValid:function(A){if(!YAHOO.lang.isString(A)){return false;}return this._INVALID.test(A.replace(this._ESCAPES,"@").replace(this._VALUES,"]").replace(this._BRACKETS,""));},dateToString:function(B){function A(C){return C<10?"0"+C:C;}return'"'+B.getUTCFullYear()+"-"+A(B.getUTCMonth()+1)+"-"+A(B.getUTCDate())+"T"+A(B.getUTCHours())+":"+A(B.getUTCMinutes())+":"+A(B.getUTCSeconds())+'Z"';},stringToDate:function(B){if(this._PARSE_DATE.test(B)){var A=new Date();A.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);A.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return A;}},parse:function(s,filter){if(this.isValid(s)){return this._applyFilter(eval("("+s+")"),filter);}throw new SyntaxError("parseJSON");},stringify:function(C,K,F){var E=YAHOO.lang,H=E.JSON,D=H._CHARS,A=this._SPECIAL_CHARS,B=[];var I=function(N){if(!D[N]){var J=N.charCodeAt();D[N]="\\u00"+Math.floor(J/16).toString(16)+(J%16).toString(16);}return D[N];};var M=function(J){return'"'+J.replace(A,I)+'"';};var L=H.dateToString;var G=function(J,T,R){var W=typeof J,P,Q,O,N,U,V,S;if(W==="string"){return M(J);}if(W==="boolean"||J instanceof Boolean){return String(J);}if(W==="number"||J instanceof Number){return isFinite(J)?String(J):"null";}if(J instanceof Date){return L(J);}if(E.isArray(J)){for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){for(P=J.length-1;P>=0;--P){S[P]=G(J[P],T,R-1)||"null";}}B.pop();return"["+S.join(",")+"]";}if(W==="object"){if(!J){return"null";}for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){if(T){for(P=0,O=0,Q=T.length;P<Q;++P){if(typeof T[P]==="string"){U=G(J[T[P]],T,R-1);if(U){S[O++]=M(T[P])+":"+U;}}}}else{O=0;for(N in J){if(typeof N==="string"&&E.hasOwnProperty(J,N)){U=G(J[N],T,R-1);if(U){S[O++]=M(N)+":"+U;}}}}}B.pop();return"{"+S.join(",")+"}";}return undefined;};F=F>=0?F:1/0;return G(C,K,F);}};YAHOO.register("json",YAHOO.lang.JSON,{version:"2.5.2",build:"1076"});Surface.parseJSON=function(str){return YAHOO.lang.JSON.parse(str);};Surface.encodeJSON=function(data){return YAHOO.lang.JSON.stringify(data);};Surface.valOut=function(obj){if(typeof(obj)=="string"){return Surface.Modifier.htmlspecialchars(obj);}else{if(typeof(obj)=="boolean"){return obj?"True":"False";}else{return obj;}}};Surface.importTemplate=function(template,arg,blocks,kwargs){if(template.search("\\.")<0){template+=".index";}kwargs=kwargs||{};var component_name=template.split(".")[0];var template_name=template.replace(component_name+".","").replace(".","_");var render;try{render=eval(component_name+"."+template_name+".render");}catch(e){}if(render){return render(arg,blocks,kwargs);}else{Surface.error("Could not render "+template+". Verify that you have spelled the template name correctly, and that you have added {exportToJs} to the template.",Surface.ERRORMODE_WARNING);return"";}};Surface.cookieSet=function(name,value,days,path){var expires="";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}if(!path){path="/";}document.cookie=name+"="+encodeURIComponent(value)+expires+"; path="+path;};Surface.cookieGet=function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){return decodeURIComponent(c.substring(nameEQ.length,c.length));}}return"";};Surface.cookieExpire=function(name){Surface.cookieSet(name,"",-1);};Surface.ERRORMODE_NONE=1;Surface.ERRORMODE_BREAKING=2;Surface.ERRORMODE_CONSOLE=3;Surface.ERRORMODE_ALERT=4;Surface.ERRORMODE_WARNING=5;Surface.Event=function(name,data){this.name=name;if(data!=undefined){this.data=data;}else{this.data={};}};Surface.Event.prototype.dispatch=function(data){if(data!=undefined){this.data=data;}Surface.EventHandler.dispatch(this);};Surface.Event.prototype.create=function(name,data){Surface.info("Surface.Event.create(name, data) has been deprecated. Use new Surface.Event(name, data) instead.");return new Surface.Event(name,data);};Surface.EventHandler={Callback:function(func,scope){this.func=func;this.scope=scope;},listeners:{},addListener:function(surfaceEvent,callback,scope){if(typeof(surfaceEvent)=="string"){surfaceEvent=new Surface.Event(surfaceEvent);}if(this.listeners[surfaceEvent.name]==undefined){this.listeners[surfaceEvent.name]=new Array();}if(scope==undefined){scope=this;}this.listeners[surfaceEvent.name].push(new Surface.EventHandler.Callback(callback,scope));},removeListener:function(surfaceEvent,callback){if(typeof(surfaceEvent)=="string"){surfaceEvent=new Surface.Event(surfaceEvent);}var callbacks=this.listeners[surfaceEvent.name];if(callbacks==undefined){return;}var start=-1;try{start=callbacks.indexOf(callback);}catch(e){for(var i=0;i<callbacks.length;i++){if(callbacks[i]==callback){start=i;break;}}}callbacks.splice(start,1);},dispatch:function(surfaceEvent){if(typeof(surfaceEvent)=="string"){surfaceEvent=new Surface.Event(surfaceEvent);}var callbacks=this.listeners[surfaceEvent.name];if(callbacks==undefined){return;}for(var i=0;i<callbacks.length;i++){callbacks[i].func.call(callbacks[i].scope,surfaceEvent);}}};Surface.domReady=function(callback,scope){Surface.EventHandler.addListener("surf_domReady",callback,scope);};(function(){function init(){if(arguments.callee.done){return;}arguments.callee.done=true;if(_timer){clearInterval(_timer);}Surface.EventHandler.dispatch(new Surface.Event("surf_domReady"));}if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,false);
/*@cc_on @*/
/*@if (@_win32)
      document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
      var script = document.getElementById("__ie_onload");
      script.onreadystatechange = function() {
        if (this.readyState == "complete") {
          init(); // call the onload handler
        }
      };
    /*@end @*/
}if(/WebKit/i.test(navigator.userAgent)){var _timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){init();}},10);}window.onload=init;})();Surface.Location={bottom:1,top:2};Surface.isValidLoopItem=function(item){return typeof(item)!="function";};Surface.Renderer={state:{surface:{},blockConfig:{},usedComponents:[],updates:{}},lookupTable:{},surfaces:{},renderTemplate:function(templateName,dto){var template;try{template=eval(templateName+".render");}catch(e){}if(typeof(template)=="undefined"){Surface.error("Could not render "+templateName+". Verify that you have spelled the template name correctly, and that you have added {exportToJs} to the template.",Surface.ERRORMODE_WARNING);return"";}else{return template(dto);}},getSurface:function(id){if(id in Surface.Renderer.surfaces){var surface=Surface.Renderer.surfaces[id];}else{var surface=eval(Surface.Renderer.lookupTable[id]);if(typeof(surface)=="undefined"){Surface.error("Error in Surface.Renderer.getSurface(id) / $S(id). Could not find a surface named '"+id+"'.",Surface.ERRORMODE_BREAKING);}var newSurface={};for(var i in surface){newSurface[i]=surface[i];}newSurface.id=id;Surface.Renderer.surfaces[id]=newSurface;surface=newSurface;}return surface;},addSurfaceState:function(namespace,surfaceid,id,data,blockConfig){Surface.Renderer.lookupTable[id]=namespace+"."+surfaceid;Surface.Renderer.state.updates[id]=(Surface.Renderer.state.updates[id]||0)+1;Surface.Renderer.state.surface[id]=data;Surface.Renderer.state.blockConfig[id]=blockConfig;},warnDuplicateSurfaces:function(){for(var id in Surface.Renderer.state.updates){if(Surface.Renderer.state.updates[id]>1){Surface.error("Duplicate Surface: A Surface with id "+id+" was rendered more than once, old state will be overwritten",Surface.ERRORMODE_WARNING);}}},invokeComponents:function(components){Surface.Renderer.state.usedComponents=components;for(var i=0;i<components.length;i++){var component=components[i];eval("if (typeof "+component+" != 'undefined' && typeof "+component+".onComponentReady != 'undefined') { "+component+".onComponentReady() }");eval("if (typeof "+component+" != 'undefined' && typeof "+component+".onDomReady != 'undefined') { Surface.domReady("+component+".onDomReady, "+component+"); }");}},createElement:function(html){var dummyEl=document.createElement("div");dummyEl.innerHTML=html;return Surface.Renderer.getFirstChildTrimmed(dummyEl);},update:function(surface,o){var elementId=surface.getId(o);var oldElement=surface.getState(o);var mergedElement=Surface.Renderer.mergeElements(oldElement,o);var element=document.getElementById(elementId);if(typeof element=="undefined"){Surface.error(surface.name+".update(): Found no element to update. Continuing",Surface.ERRORMODE_WARNING);}this.updateElement(element,surface.createHTML(mergedElement));return element;},loopItemInsert:function(surface,dto,containerId,location){var elementId=surface.getId(dto);var state=surface.getState();var list=this.getList(state,surface.listId);if(location==Surface.Location.top){list.splice(0,0,dto);}else{list.push(dto);}var container=Surface.Renderer.getElement(containerId);this.updateElement(container,surface.render(state,surface.getBlockConfig()));return document.getElementById(elementId);},loopItemUpdate:function(surface,o,containerId){var elementId=surface.getId(o);var state=surface.getState();var list=this.getList(state,surface.listId);var newList=[];var uniqueVal="";for(var i=0;i<list.length;i++){var element=list[i];if(!Surface.isValidLoopItem(element)){continue;}uniqueVal=eval("element."+surface.uniqueId);if(uniqueVal==surface.getUniqueValue(o)){var mergedElement=Surface.Renderer.mergeElements(element,o);newList.push(mergedElement);}else{newList.push(element);}}list=newList;var container=Surface.Renderer.getElement(containerId);this.updateElement(container,surface.render(state,surface.getBlockConfig()));return document.getElementById(elementId);},loopItemRemove:function(surface,o,container){var elementId=surface.getId(o);var state=surface.getState();var list=this.getList(state,surface.listId);var newList=[];for(var i=0;i<list.length;i++){var element=list[i];if(typeof(element)=="function"){continue;}if(eval("element."+surface.uniqueId)!=surface.getUniqueValue(o)){newList.push(element);}}eval("state."+surface.listId+" = newList");this.updateElement(container,surface.render(state,surface.getBlockConfig()));},getList:function(state,listId){return eval("state."+listId);},getElement:function(el){if(el&&(el.nodeType||el.item)){return el;}if(typeof el==="string"||!el){return document.getElementById(el);}return false;},mergeElements:function(element,newElement){if(newElement!=null&&typeof newElement=="object"){try{if(Object.prototype.toString.call(element)==="[object Array]"||Object.prototype.toString.call(newElement)==="[object Array]"){return newElement;}}catch(err){}if(typeof element=="undefined"||element==null){element={};}for(var field in newElement){if(typeof newElement[field]!="function"){element[field]=this.mergeElements(element[field],newElement[field]);}}}else{element=newElement;}return element;},updateElement:function(replaceEl,html,id){replaceEl.innerHTML=Surface.Renderer.createElement(html).innerHTML;},getFirstChildTrimmed:function(el){function normalizeString(s){var whtSpEnds=new RegExp("^\\s*|\\s*$","g");var whtSpMult=new RegExp("\\s\\s+","g");s=s.replace(whtSpMult," ");s=s.replace(whtSpEnds,"");return s;}var currentEl=el.firstChild;while(currentEl){if(currentEl.nodeType==1){return currentEl;}else{if(currentEl.nodeType==Node.TEXT_NODE){var normalized=normalizeString(currentEl.nodeValue);if(normalized!=""){return currentEl;}}}currentEl=currentEl.nextSibling;}}};Surface.Orbit={clientJSPath:"/client/orbit.client.js",jQueryPath:"/lib/jquery-1.2.3.js",iframeJSPath:"/public/orbit/resource/orbit.js",iframePath:"/_iframe?",iframeLoadTimeout:5000,iframeLoadTimer:null,numOrbitListeners:0,initOrbit:function(){if(Surface.Orbit.host==""){Surface.error("Orbit host is not configured, aborting initialization",Surface.ERRORMODE_WARNING);return;}else{if(Surface.Orbit.getUserId()==""){Surface.error("Orbit user ID not configured, aborting initialization",Surface.ERRORMODE_WARNING);return;}else{var hostparts=window.location.host.split(".");for(var i=hostparts.length-1;i>=0;i--){var domain=window.location.host.split(".");domain.splice(0,i);domain=domain.join(".");try{document.domain=domain;break;}catch(err){if(Surface.hasFirebug){}}}var surfaceHost=window.location.href.split("//")[1].split("/")[0];document.domain=document.domain;var jsSources=[];jsSources.push("http://"+Surface.Orbit.host+Surface.Orbit.clientJSPath);jsSources.push("http://"+Surface.Orbit.host+Surface.Orbit.jQueryPath);jsSources.push("http://"+surfaceHost+Surface.Orbit.iframeJSPath);var iframeUrl=Surface.Orbit.host+Surface.Orbit.iframePath;for(i=0;i<jsSources.length;i++){iframeUrl+="r="+jsSources[i]+"&";}var iframe=document.createElement("iframe");iframe.src="http://"+iframeUrl;iframe.style.display="none";iframe.name="orbitframe";Surface.Orbit.iframeLoadTimer=window.setTimeout(Surface.Orbit.handleIframeTimeout,Surface.Orbit.iframeLoadTimeout);document.body.appendChild(iframe);}}},getCommonDomain:function(myHost,orbitHost){var domain,hostParts=myHost.split(".");for(var i=1;i<hostParts.length;i++){domain=myHost.split(".");domain.splice(0,1);domain=domain.join(".").split(":")[0];var commonDomainIndex=orbitHost.indexOf(domain);if(commonDomainIndex!=-1){return orbitHost.substr(commonDomainIndex);}}},handleIframeReady:function(){if(Surface.Orbit.iframeLoadTimer){clearTimeout(Surface.Orbit.iframeLoadTimer);}},handleIframeTimeout:function(){Surface.error("Timeout initiating Orbit connection. Likely problems: Orbit node down or on other domain",Surface.ERRORMODE_WARNING);},handleMessage:function(msg){try{var message=Surface.parseJSON(msg);}catch(err){Surface.error("Error parsing Orbit message",Surface.ERRORMODE_WARNING);return;}setTimeout(function(){for(var i=0;i<message.messages.length;i++){var m=message.messages[i];new Surface.Event(m.eventName,m.data).dispatch();}},1);},handleAuthError:function(msg){Surface.error("Orbit authentication failed: "+msg,Surface.ERRORMODE_WARNING);},getUserId:function(){if(typeof(Surface.Orbit.user)!="undefined"){return Surface.Orbit.user;}else{Surface.error("Orbit user not configured",Surface.ERRORMODE_WARNING);return"";}},getChannels:function(){if(typeof(Surface.Orbit.channels)!="undefined"){return Surface.Orbit.channels;}else{Surface.error("Orbit channels not configured",Surface.ERRORMODE_WARNING);return[];}},getToken:function(){if(typeof(Surface.Orbit.token)!="undefined"){return Surface.Orbit.token;}else{Surface.error("Orbit token not configured",Surface.ERRORMODE_WARNING);return"";}}};Surface.domReady(function(){Surface.Orbit.initOrbit();});Surface.BlockConfig=function(parent,elements){this.parent=parent;this.content=elements;this.get=function(attr){if(this.content[attr]!=null){return eval(this.content[attr]+".render");}if(parent==""){throw"Could not find a block named '"+attr+"'";}else{try{if(attr==".parent"){return eval(this.parent);}else{if(attr==".parentBlock"){return eval("block_"+this.parent.replace(".","_"));}else{return eval("block_"+this.parent.replace(".","_")).get(attr);}}}catch(e){throw"Could not find extended template '"+parent+"'";}}};};var S=Surface;var $S=Surface.Renderer.getSurface;$S.render=Surface.Renderer.renderTemplate;Surface.Modifier.ago=function(timestamp_in_sec){var difference=new Date().getTime()/1000-timestamp_in_sec;var future=false;difference/=60;if(difference<0){future=true;difference=Math.abs(difference);}if(difference==0){difference=1;}var periods=["minute","hour","day","week","month","year","decade"];var periods2=["minutes","hours","days","weeks","months","years","decades"];var lengths=["60","24","7","4.35","12","10"];for(j=0;j<lengths.length&&difference>=lengths[j];j++){difference/=lengths[j];}if(periods[j]=="day"||periods[j]=="hours"){difference=Math.ceil(difference);}else{difference=Math.floor(difference);}if(difference==1&&periods[j]=="day"){if(future){return"tomorrow";}else{return"yesterday";}}else{if(difference==0){return"1 minute";}return(future?"in ":"")+difference+" "+(difference!=1?periods2[j]:periods[j]);}};Surface.Modifier.append=function(input,element){input.push(element);return input;};Surface.Modifier.capitalize=function(str){return str.replace(/((^.)|( |\n|\r|\t)(.))/g,function(match){return match.toUpperCase();}).replace(/\n/," ");};Surface.Modifier.ceil=function(val){return Math.ceil(val);};Surface.Modifier.concat=function(str1,str2){return""+str1+str2;};Surface.Modifier.contains=function(arr,str){for(var index in arr){if(arr[index]==str&&typeof(arr[index])==typeof(str)){return true;}}return false;};Surface.Modifier.count=function(obj){var i=0;if(obj){i=obj.length;if(typeof obj=="object"||i=="undefined"){i=0;for(var index in obj){if(typeof obj[index]!="function"){i++;}}}}return i;};Surface.Modifier.dateformat=function(timestamp,fmt){timestamp=parseInt(timestamp);var timezoneData=S.timezoneData||[[0,0,"UTC"]];var pad=function(number,n,p){var s=""+number;p=p||"0";while(s.length<n){s=p+s;}return s;};var months=["January","February","March","April","May","June","July","August","September","October","November","December"];var weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var dpm=[31,28,31,30,31,30,31,31,30,31,30,31];var strftime_f={A:function(d){return weekdays[d.getDay()];},a:function(d){return weekdays[d.getDay()].substring(0,3);},B:function(d){return months[d.getMonth()];},b:function(d){return months[d.getMonth()].substring(0,3);},c:function(d){return d.toString();},d:function(d){return pad(d.getDate(),2,"0");},H:function(d){return pad(d.getHours(),2,"0");},I:function(d){return pad(d.getHours()%12||12,2);},j:function(d){var t=d.getDate();var m=d.getMonth()-1;if(m>1){var y=d.getYear();if(((y%100)==0)&&((y%400)==0)){++t;}else{if((y%4)==0){++t;}}}while(m>-1){t+=dpm[m--];}return pad(t,3,"0");},M:function(d){return pad(d.getMinutes(),2,"0");},m:function(d){return pad(d.getMonth()+1,2,"0");},p:function(d){return(d.getHours()>11)?"PM":"AM";},S:function(d){return pad(d.getSeconds(),2,"0");},U:function(d){var month=d.getMonth();var day=d.getDay();var year=d.getYear();month+=1;var a=Math.floor((14-(month))/12);var y=year+4800-a;var m=(month)+(12*a)-3;var jd=day+Math.floor(((153*m)+2)/5)+(365*y)+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400)-32045;var d4=(jd+31741-(jd%7))%146097%36524%1461;var L=Math.floor(d4/1460);var d1=((d4-L)%365)+L;var NumberOfWeek=Math.floor(d1/7)+1;return NumberOfWeek;},w:function(d){return d.getDay();},X:function(d){return d.toTimeString();},x:function(d){return d.toDateString();},Y:function(d){return d.getFullYear();},y:function(d){return pad(d.getYear()%100,2);},z:function(d){return d.toString().match(/\sGMT([+-]\d+)/)[1];},"%":function(d){return"%";}};strftime_f["+"]=strftime_f.c;strftime_f.h=strftime_f.b;var currentTzData=timezoneData[0];for(var i in timezoneData){var tzData=timezoneData[i];if(tzData[0]<=timestamp){currentTzData=tzData;}else{break;}}var localTimestamp=(timestamp+currentTzData[1])*1000;var d=new Date(new Date(localTimestamp).toUTCString().replace(" UTC","").replace(" GMT",""));var r="";var n=0;while(n<fmt.length){var c=fmt.substring(n,n+1);if(c=="%"){c=fmt.substring(++n,n+1);r+=(strftime_f[c])?strftime_f[c](d):c;}else{r+=c;}++n;}return r;};Surface.Modifier.dump=function(obj){if(typeof(obj)=="object"){return Surface.encodeJSON(obj);}else{return obj;}};Surface.Modifier.floor=function(val){return Math.floor(val);};Surface.Modifier.format=function(subject,format){return format.replace(/{(.*?)}/g,function(match,key){return subject[key]||"";});};Surface.Modifier.get=function(obj,key,def){return(obj[key]||def);};Surface.Modifier.htmlspecialchars=function(s){return s.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");};Surface.Modifier.isstring=function(val){return typeof(val)=="string";};Surface.Modifier.join=function(lst,glue){glue=glue||" ";try{return lst.join(glue);}catch(e){var values=[];for(var key in lst){if(Surface.isValidKey(lst[key])){values.push(lst[key]);}}return values.join(glue);}};Surface.Modifier.json=function(subject){return Surface.encodeJSON(subject);};Surface.Modifier.limit=function(obj,limit){if(typeof(obj.slice)=="undefined"){var i=0;var result;for(var key in obj){if(i<limit){result[key]=obj[key];}else{break;}i++;}}else{return obj.slice(0,limit);}};Surface.Modifier.loremipsum=function(val){var loremIpsumStr="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam aliquet suscipit sagittis. Nam viverra, quam et iaculis viverra, dolor enim tincidunt enim, id dapibus nisi dui et tortor. Cras tincidunt adipiscing aliquet. Aliquam ut consequat est. Sed semper risus quis leo mollis quis sollicitudin diam consectetur. Mauris in erat eget dolor ornare ornare. Maecenas aliquet dignissim enim. Duis porttitor condimentum lorem, imperdiet aliquam sem accumsan sit amet. Pellentesque semper, massa eu posuere elementum, libero ipsum gravida nisl, eu consequat tellus nunc at neque. In tincidunt cursus dui eget ornare. Ut nisl dolor, semper fringilla malesuada ac, placerat vel quam. Sed cursus neque eu nibh bibendum et ullamcorper urna consectetur. Integer est orci, aliquet blandit gravida eget, placerat eu ligula. Praesent quis pulvinar nisl. Nulla a tellus id libero dignissim placerat eget vel nisi. ";var loremList=loremIpsumStr.split(" ");var newList=Array();var listPos=0;for(var i=0;i<val;i++){newList.push(loremList[listPos]);if(++listPos>=loremList.length){listPos=0;}}return newList.join(" ");};Surface.Modifier.lower=function(s){return s.toString().toLowerCase();};Surface.Modifier.md5=function(val){return Surface.Modifier.md5Function(val);};Surface.Modifier.md5Function=function(string){function RotateLeft(lValue,iShiftBits){return(lValue<<iShiftBits)|(lValue>>>(32-iShiftBits));}function AddUnsigned(lX,lY){var lX4,lY4,lX8,lY8,lResult;lX8=(lX&2147483648);lY8=(lY&2147483648);lX4=(lX&1073741824);lY4=(lY&1073741824);lResult=(lX&1073741823)+(lY&1073741823);if(lX4&lY4){return(lResult^2147483648^lX8^lY8);}if(lX4|lY4){if(lResult&1073741824){return(lResult^3221225472^lX8^lY8);}else{return(lResult^1073741824^lX8^lY8);}}else{return(lResult^lX8^lY8);}}function F(x,y,z){return(x&y)|((~x)&z);}function G(x,y,z){return(x&z)|(y&(~z));}function H(x,y,z){return(x^y^z);}function I(x,y,z){return(y^(x|(~z)));}function FF(a,b,c,d,x,s,ac){a=AddUnsigned(a,AddUnsigned(AddUnsigned(F(b,c,d),x),ac));return AddUnsigned(RotateLeft(a,s),b);}function GG(a,b,c,d,x,s,ac){a=AddUnsigned(a,AddUnsigned(AddUnsigned(G(b,c,d),x),ac));return AddUnsigned(RotateLeft(a,s),b);}function HH(a,b,c,d,x,s,ac){a=AddUnsigned(a,AddUnsigned(AddUnsigned(H(b,c,d),x),ac));return AddUnsigned(RotateLeft(a,s),b);}function II(a,b,c,d,x,s,ac){a=AddUnsigned(a,AddUnsigned(AddUnsigned(I(b,c,d),x),ac));return AddUnsigned(RotateLeft(a,s),b);}function ConvertToWordArray(string){var lWordCount;var lMessageLength=string.length;var lNumberOfWords_temp1=lMessageLength+8;var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1%64))/64;var lNumberOfWords=(lNumberOfWords_temp2+1)*16;var lWordArray=Array(lNumberOfWords-1);var lBytePosition=0;var lByteCount=0;while(lByteCount<lMessageLength){lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=(lWordArray[lWordCount]|(string.charCodeAt(lByteCount)<<lBytePosition));lByteCount++;}lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=lWordArray[lWordCount]|(128<<lBytePosition);lWordArray[lNumberOfWords-2]=lMessageLength<<3;lWordArray[lNumberOfWords-1]=lMessageLength>>>29;return lWordArray;}function WordToHex(lValue){var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;for(lCount=0;lCount<=3;lCount++){lByte=(lValue>>>(lCount*8))&255;WordToHexValue_temp="0"+lByte.toString(16);WordToHexValue=WordToHexValue+WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);}return WordToHexValue;}function Utf8Encode(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else{if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}}return utftext;}var x=Array();var k,AA,BB,CC,DD,a,b,c,d;var S11=7,S12=12,S13=17,S14=22;var S21=5,S22=9,S23=14,S24=20;var S31=4,S32=11,S33=16,S34=23;var S41=6,S42=10,S43=15,S44=21;string=Utf8Encode(string);x=ConvertToWordArray(string);a=1732584193;b=4023233417;c=2562383102;d=271733878;for(k=0;k<x.length;k+=16){AA=a;BB=b;CC=c;DD=d;a=FF(a,b,c,d,x[k+0],S11,3614090360);d=FF(d,a,b,c,x[k+1],S12,3905402710);c=FF(c,d,a,b,x[k+2],S13,606105819);b=FF(b,c,d,a,x[k+3],S14,3250441966);a=FF(a,b,c,d,x[k+4],S11,4118548399);d=FF(d,a,b,c,x[k+5],S12,1200080426);c=FF(c,d,a,b,x[k+6],S13,2821735955);b=FF(b,c,d,a,x[k+7],S14,4249261313);a=FF(a,b,c,d,x[k+8],S11,1770035416);d=FF(d,a,b,c,x[k+9],S12,2336552879);c=FF(c,d,a,b,x[k+10],S13,4294925233);b=FF(b,c,d,a,x[k+11],S14,2304563134);a=FF(a,b,c,d,x[k+12],S11,1804603682);d=FF(d,a,b,c,x[k+13],S12,4254626195);c=FF(c,d,a,b,x[k+14],S13,2792965006);b=FF(b,c,d,a,x[k+15],S14,1236535329);a=GG(a,b,c,d,x[k+1],S21,4129170786);d=GG(d,a,b,c,x[k+6],S22,3225465664);c=GG(c,d,a,b,x[k+11],S23,643717713);b=GG(b,c,d,a,x[k+0],S24,3921069994);a=GG(a,b,c,d,x[k+5],S21,3593408605);d=GG(d,a,b,c,x[k+10],S22,38016083);c=GG(c,d,a,b,x[k+15],S23,3634488961);b=GG(b,c,d,a,x[k+4],S24,3889429448);a=GG(a,b,c,d,x[k+9],S21,568446438);d=GG(d,a,b,c,x[k+14],S22,3275163606);c=GG(c,d,a,b,x[k+3],S23,4107603335);b=GG(b,c,d,a,x[k+8],S24,1163531501);a=GG(a,b,c,d,x[k+13],S21,2850285829);d=GG(d,a,b,c,x[k+2],S22,4243563512);c=GG(c,d,a,b,x[k+7],S23,1735328473);b=GG(b,c,d,a,x[k+12],S24,2368359562);a=HH(a,b,c,d,x[k+5],S31,4294588738);d=HH(d,a,b,c,x[k+8],S32,2272392833);c=HH(c,d,a,b,x[k+11],S33,1839030562);b=HH(b,c,d,a,x[k+14],S34,4259657740);a=HH(a,b,c,d,x[k+1],S31,2763975236);d=HH(d,a,b,c,x[k+4],S32,1272893353);c=HH(c,d,a,b,x[k+7],S33,4139469664);b=HH(b,c,d,a,x[k+10],S34,3200236656);a=HH(a,b,c,d,x[k+13],S31,681279174);d=HH(d,a,b,c,x[k+0],S32,3936430074);c=HH(c,d,a,b,x[k+3],S33,3572445317);b=HH(b,c,d,a,x[k+6],S34,76029189);a=HH(a,b,c,d,x[k+9],S31,3654602809);d=HH(d,a,b,c,x[k+12],S32,3873151461);c=HH(c,d,a,b,x[k+15],S33,530742520);b=HH(b,c,d,a,x[k+2],S34,3299628645);a=II(a,b,c,d,x[k+0],S41,4096336452);d=II(d,a,b,c,x[k+7],S42,1126891415);c=II(c,d,a,b,x[k+14],S43,2878612391);b=II(b,c,d,a,x[k+5],S44,4237533241);a=II(a,b,c,d,x[k+12],S41,1700485571);d=II(d,a,b,c,x[k+3],S42,2399980690);c=II(c,d,a,b,x[k+10],S43,4293915773);b=II(b,c,d,a,x[k+1],S44,2240044497);a=II(a,b,c,d,x[k+8],S41,1873313359);d=II(d,a,b,c,x[k+15],S42,4264355552);c=II(c,d,a,b,x[k+6],S43,2734768916);b=II(b,c,d,a,x[k+13],S44,1309151649);a=II(a,b,c,d,x[k+4],S41,4149444226);d=II(d,a,b,c,x[k+11],S42,3174756917);c=II(c,d,a,b,x[k+2],S43,718787259);b=II(b,c,d,a,x[k+9],S44,3951481745);a=AddUnsigned(a,AA);b=AddUnsigned(b,BB);c=AddUnsigned(c,CC);d=AddUnsigned(d,DD);}var temp=WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);return temp.toLowerCase();};Surface.Modifier.merge=function(){var result={};for(var i=0;i<arguments.length;i++){var e=arguments[i];if(e!=null&&typeof e=="object"){for(var field in e){result[field]=e[field];}}}return result;};Surface.Modifier.nl2br=function(s){return String(s).replace(/\n/g,"<br />");};Surface.Modifier.numberformat=function(number,decimalPoint,thousandsSep,grouping){var decimal=number.toString().split(".")[0];var fraction=number.toString().split(".")[1];if(fraction.length>3){var n=Math.pow(10,fraction.length-3);fraction=parseInt(Math.round(parseInt(fraction)/n)).toString();}var regExp=new RegExp("(-?[0-9]+)([0-9]{"+grouping+"})");while(regExp.test(decimal)){decimal=decimal.replace(regExp,"$1"+thousandsSep+"$2");}return fraction?decimal+decimalPoint+fraction:decimal;};Surface.Modifier.pluralize=function(value,singular,plural){return(value==1?singular:plural);};Surface.Modifier.range=function(start,offset,step){return Surface.Modifier.to(start,start+offset,step);};Surface.Modifier.replace=function(subject,pattern,replacement){return String(subject).replace(new RegExp(Surface.Modifier.escapeRegexChars(pattern),"g"),replacement);};Surface.Modifier.escapeRegexChars=function(str){str=str.replace("'","");str=str.replace("\\","\\\\");str=str.replace("/","\\/");str=str.replace(".","\\.");str=str.replace(":","\\:");str=str.replace(")","\\)");str=str.replace("(","\\(");str=str.replace("^","\\^");str=str.replace("<","\\<");str=str.replace(">","\\>");return str;};Surface.Modifier.round=function(number,n){var result;if(typeof(n)!="undefined"){n=Math.pow(10,n);result=Math.round(number*n)/n;}else{result=parseInt(Math.round(number));}if(typeof(result)!="number"){return number;}else{return result;}};Surface.Modifier.set=function(obj,key,value){obj[key]=value;return obj;};Surface.Modifier.sort=function(array,sortKey,order){if(Object.prototype.toString.call(array)!=="[object Array]"){Surface.error("Only lists are sortable",Surface.ERRORMODE_WARNING);return array;}array.sort(function(a,b){var x,y;if(typeof(order)!="undefined"&&order=="desc"){y=eval("a."+sortKey);x=eval("b."+sortKey);}else{x=eval("a."+sortKey);y=eval("b."+sortKey);}if(typeof x=="string"&&typeof y=="string"){x=x.toLowerCase();y=y.toLowerCase();}if(y==null||typeof(y)=="undefined"){if(x==null||typeof(x)=="undefined"){return 0;}return 1;}if(x==null||typeof(x)=="undefined"){return -1;}return((x<=y)?-1:((x>y)?1:0));});return array;};Surface.Modifier.substring=function(subject,from,to){if(arguments.length>2){return subject.substring(from,to);}else{return subject.substring(from);}};Surface.Modifier.to=function(start,stop,step){if(typeof(step)=="undefined"){step=1;}var range=[];for(var i=start;i<=stop;i+=step){range.push(i);}return range;};Surface.Modifier.truncate=function(s,amount){return String(s).substring(0,amount);};Surface.Modifier.upper=function(s){return String(s).toUpperCase();};Surface.Modifier.urlencode=function(s){s=encodeURIComponent(s.toString());s=s.split("!").join("%21");s=s.replace(/(\%([a-z0-9]{2}))/g,function(full,m1,m2){return"%"+m2.toUpperCase();});s=s.replace(/~/g,"%7E");s=s.replace(new RegExp("'","g"),"%27");return s;};Surface.Modifier.urlnormalize=function(subject){return subject.replace(/\/+/g,"/");};Surface.Modifier.wordwrap=function(str,m,b,c){if(typeof(b)=="undefined"){b="\n";}if(typeof(c)=="undefined"){c=false;}var i,j,s,r=str.split("\n");if(m>0){for(i in r){for(s=r[i],r[i]="";s.length>m;j=c?m:(j=s.substr(0,m+1).match(/\S*$/)).input.length-j[0].length||m,r[i]+=Surface.Modifier.wordwrap.rtrim1(s.substr(0,j))+((s=s.substr(j)).length?b:"")){}r[i]+=s;}}return r.join("\n");};Surface.Modifier.wordwrap.rtrim1=function(text){if(text[text.length-1]==" "){return text.substr(0,text.length-1);}else{return text;}};S.Modifier.addslashes=function(subject){return String(subject).replace("\\\\","\\\\\\\\");};Surface.asset=function(path){return"/public/"+path.replace("/public/","")+"?1";};var about={onDomReady:function(){$("#techtalksForm").submit(function(){var f=$("#techtalksForm");var action=f.attr("action");var serializedForm=f.serialize();$.post(action,serializedForm,function(){$("#techtalksFormButton").html("Thank you for signing up for a ESN Tech Talk! Will get back to you shortly with a confirmation.");});return false;});$("#hackathonForm").submit(function(){var f=$("#hackathonForm");var action=f.attr("action");var serializedForm=f.serialize();$.post(action,serializedForm,function(){$("#hackathonFormButton").html("Thank you for signing up for a ESN Hackathon! Will get back to you shortly with a confirmation.");});return false;});var geocoder;geocoder=new google.maps.Geocoder();address="Bredgränd 4, Uppsala, Sweden";if(geocoder){geocoder.geocode({"address":address},function(results,status){var myOptions={zoom:13,mapTypeId:google.maps.MapTypeId.ROADMAP};var map=new google.maps.Map(document.getElementById("hackathonMap"),myOptions);map.setCenter(results[0].geometry.location);var marker=new google.maps.Marker({map:map,position:results[0].geometry.location});});}initializeHackathonMap();},renderMember:function(id,photo,name,position,email,phone){$("#member_photo").attr("src",photo);$("#member_name").html(name);if(position){$("#member_position").html(position);}else{$("#member_position").html("&nbsp;");}$("#member_email").html(email+"@esn.me");$("#member_email").attr("href","mailto:"+email+"@esn.me");$("#member_phone").html(phone);about.renderMemberMenu(id);},renderMemberMenu:function(selectedMember){$("#members").find(".link").each(function(i){if(i==selectedMember){$("#members").find(".link:eq("+i+")").find(".photo_overlay").attr("src","/public/about/img/member_overlay_on.png");}else{$("#members").find(".link:eq("+i+")").find(".photo_overlay").attr("src","/public/about/img/member_overlay_off.png");}});}};var base={tickerQueue:new Array(),tickerCurrentTick:null,soundManagerLoaded:false,onComponentReady:function(){this.addOrbitListener("shoutAdded",function(event){if(event.data.byRobot==false){var username=S.Modifier.htmlspecialchars(event.data.username,"ENT_QUOTES");var trimmed=S.Modifier.htmlspecialchars(event.data.content,"ENT_QUOTES");if(event.data.content.length+username.length>44){trimmed=event.data.content.substring(0,38-username.length)+"...";}var content=username+": "+trimmed;base.tickerAddMessage(content);}});this.addOrbitListener("visitorConnected",function(event){base.addMiniDot(event.data.longitude,event.data.latitude);});this.addOrbitListener("shoutRated",function(event){if(event.data.username.substring(0,6)=="guest_"){event.data.username="Guest";}base.tickerAddMessage(S.Modifier.htmlspecialchars(event.data.username,"ENT_QUOTES")+" likes "+S.Modifier.htmlspecialchars(event.data.shoutUsername,"ENT_QUOTES")+"'s shout!");});setInterval(this.tickerCheckQueue,5000);},onDomReady:function(){$("a.email").each(function(){e=this.rel.replace("/","@");this.href="mailto:"+e;$(this).text(e);});$("#nameForm").submit(function(event){event.preventDefault();$.post($(this).attr("action"),$(this).serialize());var newName=base.trim12($("#newName").attr("value"));if(newName.length>0){$("#guestNameLink").text(newName);}$("#guestNameLink").show();$("#guestNameEdit").hide();});$("#guestNameLink").click(function(event){event.preventDefault();$("#newName").val($("#guestNameLink").text());$("#guestNameLink").hide();$("#guestNameEdit").css("display","block");$("#newName").focus();$("#newName").select();});var gaTrackCode="UA-1241517-21";var gaJsHost=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");jQuery.getScript(gaJsHost+"google-analytics.com/ga.js",function(){var pageTracker=_gat._getTracker(gaTrackCode);pageTracker._initData();pageTracker._trackPageview();});},trim12:function(str){var str=str.replace(/^\s\s*/,""),ws=/\s/,i=str.length;while(ws.test(str.charAt(--i))){}return str.slice(0,i+1);},tickerAddMessage:function(message){var tick=$("<div>"+message+"</div>");base.tickerQueue.push(tick);},tickerCheckQueue:function(){var append=function(){$("#ticker").empty();var tick=base.tickerQueue.shift();base.tickerCurrentTick=tick;$("#ticker").append(tick);tick.show("drop",{direction:"right"},1500);};if(base.tickerQueue.length>0){if(base.tickerCurrentTick!=null){base.tickerCurrentTick.fadeOut("slow",append);}else{append();}}},addMiniDot:function(longitude,latitude){var result=WGS84ToUTM(longitude,latitude);result=UTMToXY(result,88,43);$("#miniMap").append($('<div class="miniDot"></div>').css("left",result.x-8).css("top",result.y-1));}};var blog={onDomReady:function(){}};var careers={onComponentReady:function(){},onDomReady:function(){$("#careersForm").submit(function(){var f=$("#careersForm");var action=f.attr("action");var serializedForm=f.serialize();$.post(action,serializedForm,function(){$("#careersFormButton").html("Thank you for contacting ESN! Will get back to you shortly.");});return false;});}};var comingsoon={onDomReady:function(){}};var common={onDomReady:function(){}};var contact={onComponentReady:function(){},onDomReady:function(){$("#contactForm").submit(function(){var f=$("#contactForm");var action=f.attr("action");var serializedForm=f.serialize();$.post(action,serializedForm,function(){$("#contactFormButton").html("Thank you for contacting ESN! Will get back to you shortly.");});return false;});}};var main={numberOfItems:0,currentIndex:0,onDomReady:function(){if($.browser.msie){}$("#trailerPlayButton").hover(function(){$(this).attr("src","/public/main/play_hover.png");},function(){$(this).attr("src","/public/main/play.png");});$("#trailerPlayButton").mousedown(function(){$(this).attr("src","/public/main/play_click.png");}).mousedown(function(){$(this).attr("src","/public/main/play.png");});},playTrailer:function(){$("#trailerPlayButton").css("visibility","hidden");$("#trailerBottomLine").animate({marginTop:"299px"},1500,function(){$("#trailer").css("visibility","visible");$("#trailer").css("width","926px");$("#trailer").css("height","521px");obj=swfobject.getObjectById("SpringPlayer");if(obj&&typeof obj.playMedia!="undefined"){swfobject.getObjectById("SpringPlayer").playMedia();}});$("#introText").animate({opacity:"0.20"},1500);}};var map={onComponentReady:function(){this.addOrbitListener("shoutAdded",function(event){if(base.soundManagerLoaded){soundManager.play("shoutSound","/public/common/sound/drip.mp3");}map.addBubble(S.Modifier.htmlspecialchars(event.data.username,"ENT_QUOTES"),S.Modifier.htmlspecialchars(event.data.content,"ENT_QUOTES"),event.data.longitude,event.data.latitude,event.data.countryCode,0,event.data.id,false);});this.addOrbitListener("visitorConnected",function(event){map.addDot(event.data.longitude,event.data.latitude);$S("mapUsersCount").insert(event.data);});this.addOrbitListener("visitorChangedName",function(event){$S("mapUsersCount").update(event.data);});this.addOrbitListener("shoutRated",function(event){var countContainer=$(".shout_"+event.data.itemId+" .likeCount");countContainer.html(parseInt(countContainer.html())+1);var heart=$(".shout_"+event.data.itemId+" .like img");heart.animate({width:18,height:18},100,function(){$(this).animate({width:9,height:9},100);$(this).effect("bounce",{},200);});});},onDomReady:function(){$("#shoutForm").submit(function(event){event.preventDefault();$.post($(this).attr("action"),$(this).serialize());$(this).children(":text").val("");});},addDot:function(longitude,latitude){result=WGS84ToUTM(longitude,latitude);result=UTMToXY(result,910,455);$("#mapContainer").append($('<div class="dot"></div>').css("left",result.x+3).css("bottom",$("#mapContainer").height()-(result.y+111)));},addShoutDot:function(longitude,latitude,timeout){result=WGS84ToUTM(longitude,latitude);result=UTMToXY(result,910,455);var dot=$('<div class="dot_red"></div>').css("left",result.x+3).css("bottom",$("#mapContainer").height()-(result.y+111));$("#mapContainer").append(dot);setTimeout(function(){dot.remove();},timeout);},addBubble:function(username,text,longitude,latitude,country,rating,id,instant){result=WGS84ToUTM(longitude,latitude);result=UTMToXY(result,910,455);var shout=$('<div class="bubble shout_'+id+'"></div>').append($('<div class="bubble_bouncer"></div>').append('<div class="bubble_top"></div>').append($('<div class="bubble_content"></div>').append($('<div class="padder"></div>').html(text))).append($('<div class="bubble_bottom"></div>').append('<img src="/public/map/flags/'+country+'.gif" class="flag" />').append('<div class="user">'+username+"</div>").append($('<div class="like" title="Like it!"><span class="likeCount">'+rating+'</span> <div class="heart"><img src="/public/map/heart_icon.png" /></div></div>').click(function(){$.post("/map/likeShout/","shoutId="+id);})))).css("left",result.x-87).css("bottom",$("#mapContainer").height()-(result.y+98));if(instant){$("#mapContainer").append(shout);}else{$("#mapContainer").append(shout);shout.children(".bubble_bouncer").effect("bounce",{},200);}map.addShoutDot(longitude,latitude,40000);setTimeout(function(){shout.animate({"opacity":0},5000,function(){shout.remove();});},40000);}};var product={onComponentReady:function(){},onDomReady:function(){$("#signupForm").submit(function(){var f=$("#signupForm");var action=f.attr("action");var serializedForm=f.serialize();$.post(action,serializedForm,function(){$("#signupFormButton").html("Thank you for applying to the ESN Planet Invite Program! Will get back to you shortly.");});return false;});}};var services={onDomReady:function(){}};var showcase={onComponentReady:function(){},onDomReady:function(){}};if(typeof about=="undefined"){var about={};}var surf_about_component=new Surface.Component("about");surf_about_component.extend(about);about=surf_about_component;about.addTemplate(new Surface.Template("base"));about.addTemplate(new Surface.Template("hackathon"));about.addTemplate(new Surface.Template("history"));about.addTemplate(new Surface.Template("index"));about.addTemplate(new Surface.Template("life"));about.addTemplate(new Surface.Template("mission"));about.addTemplate(new Surface.Template("smallhistory"));about.addTemplate(new Surface.Template("smalllife"));about.addTemplate(new Surface.Template("smallteam"));about.addTemplate(new Surface.Template("team"));about.addTemplate(new Surface.Template("techtalks"));about.addTemplate(new Surface.Template("workingwith"));if(typeof base=="undefined"){var base={};}var surf_base_component=new Surface.Component("base");surf_base_component.extend(base);base=surf_base_component;base.addTemplate(new Surface.Template("browsercss"));var block_base_index=new Surface.BlockConfig("",{"title":"base.index.block_title","metadescription":"base.index.block_metadescription","script":"base.index.block_script","submenu":"base.index.block_submenu","head":"base.index.block_head","main":"base.index.block_main"});base.addTemplate(new Surface.Template("index"));base.index.render=function(o,b,kwargs){var c=[];b=b||block_base_index;kwargs=kwargs||{};var l_for_85bca1bb_list;var l_for_85bca1bc_list;var l_for_85bca1bb_iteration;c.push('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml" xmlns:surf="">\r\n    <head>\r\n');c.push(b.get("head")(o,b,kwargs));c.push("    </head>\r\n\r\n");if((o.currentPage=="Home")){o.bodyClass=' class="home"';}else{if((((o.currentPage=="Product")&&(o.currentSubpage!="Overview"))&&(o.currentSubpage!="Games"))){o.bodyClass=' class="prod"';}else{if((o.currentPage=="MapDemo")){o.bodyClass=' class="map"';}else{o.bodyClass="";}}}c.push("\r\n    <body");c.push(o.bodyClass);c.push('>\r\n        <div id="container">\r\n            <a href="/"><img src="');c.push(Surface.valOut(S.Modifier.concat(S.Modifier.replace("/public/base/logo.png","/public/","/public/"),"?1")));c.push('" title="ESN" alt="ESN" class="left logo" /></a>\r\n            <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/gdc/"))));c.push('"><img src="');c.push(Surface.valOut(S.Modifier.concat(S.Modifier.replace("/public/product/games_gdc_header.png","/public/","/public/"),"?1")));c.push('" style="margin-left: 10px; margin-top: 10px;" class="left" /></a>\r\n\r\n            <div id="user_session" style="font-size: 12px; font-weight: bold;">\r\n                <div class="left">Welcome <a id="guestNameLink" href="#">');if((S.Modifier.truncate(o.username,5)=="guest")){c.push("Guest");}else{c.push(Surface.valOut(o.username));}c.push('</a></div>\r\n                <div style="display: none; margin-top: -6px;" id="guestNameEdit" class="left">\r\n                    <form id="nameForm" action="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/map/setUsername/"))));c.push('" method="POST" style="text-align: left;">\r\n                        <div class="left" style="margin-left: 10px; background: url(/public/base/field_161.png) no-repeat; width: 161px; height: 31px;"><div style="padding: 4px;"><input id="newName" name="username" type="text" style="color:#9D9C9C; border: 0; padding: 3px; width: 140px;" value="" /></div></div>\r\n                        <input id="setNameButton" type="image" value="submit" name="submit" src="/public/base/button_set.png" class="left" />\r\n                    </form>\r\n                </div>\r\n                <div class="clear"></div>\r\n            </div>\r\n\r\n            <div class="clear"></div>\r\n\r\n            <div id="menu">\r\n                 <ul>\r\n');o.lastSelected=false;o.menuOptions=[{"menuKey":"home","link":S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/")),"title":"Home"},{"menuKey":"product","link":S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/product/")),"title":"Product"},{"menuKey":"showcase","link":S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/showcase/")),"title":"Showcase"},{"menuKey":"careers","link":S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/careers/")),"title":"Careers"},{"menuKey":"forum","link":S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/news/{page}/")),"title":"News"},{"menuKey":"download","link":S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/about/")),"title":"About"},{"menuKey":"contact","link":S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/contact/")),"title":"Contact"}];c.push("\r\n\r\n");l_for_85bca1bb_list=o.menuOptions;l_for_85bca1bb_iteration=0;if((S.Modifier.count(l_for_85bca1bb_list)>0)){for(var l_menuKey in l_for_85bca1bb_list){if(!Surface.isValidLoopItem(l_for_85bca1bb_list[l_menuKey])){continue;}var l_menu=l_for_85bca1bb_list[l_menuKey];l_for_85bca1bb_iteration=(l_for_85bca1bb_iteration+1);if((l_menu.title==o.currentPage)){o.lastSelected=true;c.push('\r\n                             <li class="split"></li>\r\n                             <li class="left"><img src="/public/base/menu_item_side.png" class="left" /></li>\r\n                             <li class="element_selected"><div class="menuitem_selected"><a class="menu_on" href="');c.push(Surface.valOut(l_menu.link));c.push('">');c.push(Surface.valOut(S.Modifier.upper(l_menu.title)));c.push('</a></div></li>\r\n                             <li class="left" style="margin-right: 6px;"><img src="/public/base/menu_item_side.png" /></li>\r\n');}else{if((o.lastSelected==false)){if((l_for_85bca1bb_iteration==1)){c.push('                                    <li class="split" style="visibility: hidden;"><img src="/public/base/menu_split.png" /></li>\r\n');}else{c.push('                                    <li class="split"><img src="/public/base/menu_split.png" /></li>\r\n');}}c.push('\r\n                            <li class="element"><div class="menuitem"><a href="');c.push(Surface.valOut(l_menu.link));c.push('">');c.push(Surface.valOut(S.Modifier.upper(l_menu.title)));c.push("</a></div></li>\r\n\r\n");o.lastSelected=false;}}}c.push('                 </ul>\r\n\r\n                <div id="miniMap" onClick="document.location=\'/map/\';"></div>\r\n                <div style="position:absolute; left:632px; top:15px;">\r\n                    <div id="ticker" class="ticker">\r\n\r\n                    </div>\r\n                </div>\r\n            </div>\r\n\r\n');c.push(b.get("submenu")(o,b,kwargs));c.push("\r\n");c.push(b.get("main")(o,b,kwargs));c.push('\r\n            <div id="footer">\r\n\r\n\r\n\r\n                <div style="color: #fff; text-align: center; font-family: \'Arial\'; border-bottom: 1px solid #171717; margin-bottom: 20px">\r\n                     <ul class="links">\r\n                        <li class="planet"><a href="http://www.esn.me/product">Social real-time framework</a></li>\r\n                        <li class="split"></li>\r\n                        <li class="beacon"><a href="http://beaconpush.com">Real-time in the cloud</a></li>\r\n                        <li class="split"></li>\r\n                        <li class="sonar"><a href="http://sonar-api.com">VoIP in the cloud</a></li>\r\n                        <li class="split"></li>\r\n                        <li class="pushingweb"><a href="http://pushingtheweb.com">Our thoughts on the web</a></li>\r\n                     </ul>\r\n\r\n                     <div class="clear"></div>\r\n                </div>\r\n\r\n                <div class="clear"></div>\r\n\r\n                <div class="left">Copyright &copy; ESN Social Software AB 2004-2010. All rights reserved. <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/contact/"))));c.push('">Contact us</a></div>\r\n                <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/news/rss/{page}/"))));c.push('" class="right rss"></a>\r\n                <a href="http://twitter.com/esnme" class="right twitter"></a>\r\n                <a href="http://www.facebook.com/pages/ESN/121646643013" class="right facebook"></a>\r\n                <div class="right">Follow us</div>\r\n            </div>\r\n        </div>\r\n\r\n');c.push('<script type="text/javascript" src="');c.push(Surface.valOut(S.Modifier.concat(S.Modifier.replace("/public/generated/en_US/bundle_base_index_4018290281.js","/public/","/public/"),"?1")));c.push('"><\/script>\n');c.push("\r\n");c.push(b.get("script")(o,b,kwargs));c.push("\r\n        ");c.push(Surface.importTemplate(("surfaceframework"+("."+"index")),o,null,kwargs));c.push("\r\n        ");c.push(Surface.importTemplate(("orbit"+("."+"index")),o,null,kwargs));c.push("\r\n\r\n        <script type=\"text/javascript\">\r\n            soundManager.debugMode = false;\r\n            soundManager.url = '/public/common/swf/';\r\n            soundManager.onload = function() ");c.push("{\r\n                base.soundManagerLoaded = true;\r\n            };\r\n\r\n            $(document).ready(function() ");c.push("{\r\n");l_for_85bca1bc_list=o.visitors;if((S.Modifier.count(l_for_85bca1bc_list)>0)){for(var l_for_85bca1bc_key in l_for_85bca1bc_list){if(!Surface.isValidLoopItem(l_for_85bca1bc_list[l_for_85bca1bc_key])){continue;}var l_visitor=l_for_85bca1bc_list[l_for_85bca1bc_key];c.push("                    base.addMiniDot( ");c.push(Surface.valOut(l_visitor.longitude));c.push(", ");c.push(Surface.valOut(l_visitor.latitude));c.push(");\r\n");}}c.push("            });\r\n        <\/script>\r\n    </body>\r\n</html>\r\n\r\n");return c.join("");};base.index.block_title=new Surface.Block("base.index.block_title");base.index.block_title.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};c.push("ESN | ");if((o.title!="")){c.push(Surface.valOut(o.title));}return c.join("");};base.index.block_metadescription=new Surface.Block("base.index.block_metadescription");base.index.block_metadescription.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};c.push("We're ESN. We create ESN Planet, the only development platform for the social real-time web.");return c.join("");};base.index.block_head=new Surface.Block("base.index.block_head");base.index.block_head.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};c.push('        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n        <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.esn.me/blog/rss/" />\r\n');c.push('<script type="text/javascript" src="');c.push(Surface.valOut(S.Modifier.concat(S.Modifier.replace("/public/generated/en_US/bundle_base_index_1081307642.js","/public/","/public/"),"?1")));c.push('"><\/script>\n');c.push('<link type="text/css" rel="stylesheet" href="');c.push(Surface.valOut(S.Modifier.concat(S.Modifier.replace("/public/generated/bundle_base_index_451216344.css","/public/","/public/"),"?1")));c.push('"/>\n');c.push('        <link rel="icon" type="image/png" href="/public/common/img/icon.png"> </link>\r\n        <title>');c.push(b.get("title")(o,b,kwargs));c.push('</title>\r\n        <meta name="description" content="');c.push(b.get("metadescription")(o,b,kwargs));c.push('" />\r\n        <meta name="keywords" content="real-time web framework, social, community, development platform, gaming, sdk, esn, esport, e-sports, e-sport network" />\r\n        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />\r\n        <meta name="robots" content="noarchive" />\r\n        <meta name="google-site-verification" content="gmp1Frv53XOuqpUEDVhHMlxOW9h6dMh310sm9fzE6hg" />\r\n');return c.join("");};base.index.block_submenu=new Surface.Block("base.index.block_submenu");base.index.block_submenu.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};c.push("\r\n");return c.join("");};base.index.block_main=new Surface.Block("base.index.block_main");base.index.block_main.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};c.push("\r\n");return c.join("");};base.index.block_script=new Surface.Block("base.index.block_script");base.index.block_script.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};c.push("\r\n");return c.join("");};base.addTemplate(new Surface.Template("submenu"));if(typeof blog=="undefined"){var blog={};}var surf_blog_component=new Surface.Component("blog");surf_blog_component.extend(blog);blog=surf_blog_component;blog.addTemplate(new Surface.Template("base"));blog.addTemplate(new Surface.Template("index"));blog.addTemplate(new Surface.Template("read"));blog.addTemplate(new Surface.Template("rss"));if(typeof careers=="undefined"){var careers={};}var surf_careers_component=new Surface.Component("careers");surf_careers_component.extend(careers);careers=surf_careers_component;careers.addTemplate(new Surface.Template("benefits"));careers.addTemplate(new Surface.Template("index"));careers.addTemplate(new Surface.Template("openings"));careers.addTemplate(new Surface.Template("smallbenefits"));careers.addTemplate(new Surface.Template("smallopenings"));if(typeof comingsoon=="undefined"){var comingsoon={};}var surf_comingsoon_component=new Surface.Component("comingsoon");surf_comingsoon_component.extend(comingsoon);comingsoon=surf_comingsoon_component;comingsoon.addTemplate(new Surface.Template("index"));if(typeof contact=="undefined"){var contact={};}var surf_contact_component=new Surface.Component("contact");surf_contact_component.extend(contact);contact=surf_contact_component;contact.addTemplate(new Surface.Template("index"));if(typeof dashboard=="undefined"){var dashboard={};}var surf_dashboard_component=new Surface.Component("dashboard");surf_dashboard_component.extend(dashboard);dashboard=surf_dashboard_component;dashboard.addTemplate(new Surface.Template("base"));var block_dashboard_compinput=new Surface.BlockConfig("",{"firstelement":"dashboard.compinput.block_firstelement"});dashboard.addTemplate(new Surface.Template("compinput"));dashboard.compinput.render=function(o,b,kwargs){var c=[];b=b||block_dashboard_compinput;kwargs=kwargs||{};var l_options;var l_for_e9274b38_list;c.push("\r\n<select ");if((typeof(o)!="undefined"&&typeof(o.id)!="undefined"&&o.id!==null)){c.push('id="');c.push(Surface.valOut(o.id));c.push('"');}c.push(' class="comp" name="field">\r\n');c.push(b.get("firstelement")(o,b,kwargs));l_options=["equals","lessthan","greaterthan","like"];l_for_e9274b38_list=l_options;if((S.Modifier.count(l_for_e9274b38_list)>0)){for(var l_for_e9274b38_key in l_for_e9274b38_list){if(!Surface.isValidLoopItem(l_for_e9274b38_list[l_for_e9274b38_key])){continue;}var l_option=l_for_e9274b38_list[l_for_e9274b38_key];c.push("        <option ");if((l_option==((typeof(o)!="undefined"&&typeof(o.selected)!="undefined"&&o.selected!==null)?o.selected:""))){c.push('selected="selected"');}c.push(' value="');c.push(Surface.valOut(l_option));c.push('">');c.push(Surface.valOut(S.Modifier.upper(l_option)));c.push("</option>\r\n");}}c.push("</select>");return c.join("");};dashboard.compinput.block_firstelement=new Surface.Block("dashboard.compinput.block_firstelement");dashboard.compinput.block_firstelement.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};return c.join("");};dashboard.addTemplate(new Surface.Template("create"));dashboard.addTemplate(new Surface.Template("createwidget"));dashboard.addTemplate(new Surface.Template("createwidget_done"));dashboard.addTemplate(new Surface.Template("error"));var block_dashboard_filter=new Surface.BlockConfig("",{});dashboard.addTemplate(new Surface.Template("filter"));dashboard.filter.render=function(o,b,kwargs){var c=[];b=b||block_dashboard_filter;kwargs=kwargs||{};var l_options;var l_for_7636ee3e_list;var l_for_7636ee3f_list;c.push('\r\n<div class="filter" id="filter_');c.push(Surface.valOut(((typeof(o)!="undefined"&&typeof(o.filter)!="undefined"&&typeof(o.filter.id)!="undefined"&&o.filter.id!==null)?o.filter.id:1)));c.push('">\r\n    <div style="float: left;">\r\n        <input class="id" type="hidden" value="');c.push(Surface.valOut(((typeof(o)!="undefined"&&typeof(o.filter)!="undefined"&&typeof(o.filter.id)!="undefined"&&o.filter.id!==null)?o.filter.id:1)));c.push('" />\r\n        <select class="fieldname">\r\n            <option value="">Select field</option>\r\n');l_for_7636ee3e_list=o.fields;if((S.Modifier.count(l_for_7636ee3e_list)>0)){for(var l_for_7636ee3e_key in l_for_7636ee3e_list){if(!Surface.isValidLoopItem(l_for_7636ee3e_list[l_for_7636ee3e_key])){continue;}var l_field=l_for_7636ee3e_list[l_for_7636ee3e_key];c.push('                <option value="');c.push(Surface.valOut(S.Modifier.get(l_field,"name")));c.push('" ');if((((typeof(o)!="undefined"&&typeof(o.filter)!="undefined"&&typeof(o.filter.name)!="undefined"&&o.filter.name!==null)?o.filter.name:"")==S.Modifier.get(l_field,"name"))){c.push("selected");}c.push(">");c.push(Surface.valOut(S.Modifier.get(l_field,"name")));c.push("</option>\r\n");}}c.push('        </select>\r\n\r\n        <select class="comp" name="field">\r\n            <option value="">Select rule</option>\r\n');l_options=["equals","lessthan","greaterthan","like"];l_for_7636ee3f_list=l_options;if((S.Modifier.count(l_for_7636ee3f_list)>0)){for(var l_for_7636ee3f_key in l_for_7636ee3f_list){if(!Surface.isValidLoopItem(l_for_7636ee3f_list[l_for_7636ee3f_key])){continue;}var l_option=l_for_7636ee3f_list[l_for_7636ee3f_key];c.push("                <option ");if((l_option==((typeof(o)!="undefined"&&typeof(o.filter)!="undefined"&&typeof(o.filter.comparison)!="undefined"&&o.filter.comparison!==null)?o.filter.comparison:""))){c.push('selected="selected"');}c.push(' value="');c.push(Surface.valOut(l_option));c.push('">');c.push(Surface.valOut(S.Modifier.upper(l_option)));c.push("</option>\r\n");}}c.push('        </select>\r\n\r\n        <input class="filtervalue" type="text" value="');c.push(Surface.valOut(((typeof(o)!="undefined"&&typeof(o.filter)!="undefined"&&typeof(o.filter.value)!="undefined"&&o.filter.value!==null)?o.filter.value:"")));c.push('" />\r\n    </div>\r\n    <div style="float: left; padding: 3px; padding-left: 5px;">\r\n        <input type="image" src="/public/dashboard/minus.png" onclick="$(\'#filter_');c.push(Surface.valOut(((typeof(o)!="undefined"&&typeof(o.filter)!="undefined"&&typeof(o.filter.id)!="undefined"&&o.filter.id!==null)?o.filter.id:1)));c.push('\').remove(); return false;" title="Remove filter" />\r\n    </div>\r\n    <div style="clear: left;"></div>\r\n</div>');return c.join("");};dashboard.addTemplate(new Surface.Template("htmlbase"));dashboard.addTemplate(new Surface.Template("index"));dashboard.addTemplate(new Surface.Template("list"));dashboard.addTemplate(new Surface.Template("listobjects"));dashboard.addTemplate(new Surface.Template("listwidget"));dashboard.addTemplate(new Surface.Template("login"));dashboard.addTemplate(new Surface.Template("modellist"));dashboard.addTemplate(new Surface.Template("searchform"));dashboard.addTemplate(new Surface.Template("searchwidget"));dashboard.addTemplate(new Surface.Template("status_base"));dashboard.addTemplate(new Surface.Template("status_index"));dashboard.addTemplate(new Surface.Template("status_sharding"));dashboard.addTemplate(new Surface.Template("status_sharding_node"));dashboard.addTemplate(new Surface.Template("status_stats"));dashboard.addTemplate(new Surface.Template("update"));var block_dashboard_update_use_1_0=new Surface.BlockConfig("dashboard.create",{"formurl":"dashboard.update._use_1_0_block_formurl","buttons":"dashboard.update._use_1_0_block_buttons","pagetitle":"dashboard.update._use_1_0_block_pagetitle"});dashboard.addTemplate(new Surface.Template("widgetbase"));if(typeof main=="undefined"){var main={};}var surf_main_component=new Surface.Component("main");surf_main_component.extend(main);main=surf_main_component;main.addTemplate(new Surface.Template("index"));main.addTemplate(new Surface.Template("robots"));main.addTemplate(new Surface.Template("sitemap"));if(typeof map=="undefined"){var map={};}var surf_map_component=new Surface.Component("map");surf_map_component.extend(map);map=surf_map_component;var block_map_index=new Surface.BlockConfig("base.index",{"script":"map.index.block_script","main":"map.index.block_main"});map.addTemplate(new Surface.Template("index"));map.index.render=function(o,b,kwargs){var c=[];b=b||block_map_index;kwargs=kwargs||{};c.push("\r\n");c.push("\r\n");c.push("\r\n");c.push("");return Surface.importTemplate("base.index",o,b,kwargs);};map.index.surface_34_14=new Surface.SurfaceList("map.index.surface_34_14","users","user","user.id");map.index.surface_36_18=new Surface.SingleSurface("map.index.surface_36_18");map.index.surface_36_18.render=function(o,b,kwargs){var c=[];b=b||block_map_index;kwargs=kwargs||{};c.push('<surf:container id="');c.push(S.Modifier.concat("mapUsersCount",S.Modifier.concat("_",o.user.id)));c.push('">');c.push('                    <a href="#">');c.push(Surface.valOut(o.user.name));c.push("</a>");if(o.for_7dd1e22e_hasNext){c.push(",");}c.push("\r\n");c.push("</surf:container>");Surface.Renderer.addSurfaceState("map.index","surface_36_18",S.Modifier.concat("mapUsersCount",S.Modifier.concat("_",o.user.id)),o,b);return c.join("");};map.index.surface_34_14.render=function(o,b,kwargs){var c=[];b=b||block_map_index;kwargs=kwargs||{};c.push('<surf:container id="');c.push("mapUsersCount");c.push('">');var l_for_7dd1e22e_list;var l_for_7dd1e22e_hasNext;var l_for_7dd1e22e_count;var l_for_7dd1e22e_iteration;l_for_7dd1e22e_list=o.users;l_for_7dd1e22e_count=S.Modifier.count(l_for_7dd1e22e_list);l_for_7dd1e22e_iteration=0;if((S.Modifier.count(l_for_7dd1e22e_list)>0)){c.push("                <h4>");c.push(Surface.valOut(S.Modifier.count(o.users)));c.push(" ");c.push(Surface.valOut(S.Modifier.pluralize(S.Modifier.count(o.users),"USER","USERS")));c.push(" VIEWING</h4>\r\n");for(var l_for_7dd1e22e_key in l_for_7dd1e22e_list){if(!Surface.isValidLoopItem(l_for_7dd1e22e_list[l_for_7dd1e22e_key])){continue;}var l_user=l_for_7dd1e22e_list[l_for_7dd1e22e_key];l_for_7dd1e22e_iteration=(l_for_7dd1e22e_iteration+1);l_for_7dd1e22e_hasNext=(l_for_7dd1e22e_iteration<l_for_7dd1e22e_count);c.push(map.index.surface_36_18.render({"for_7dd1e22e_hasNext":((typeof(l_for_7dd1e22e_hasNext)!="undefined"&&l_for_7dd1e22e_hasNext!==null)?l_for_7dd1e22e_hasNext:null),"user":((typeof(l_user)!="undefined"&&l_user!==null)?l_user:null)},b,kwargs));}}c.push("</surf:container>");Surface.Renderer.addSurfaceState("map.index","surface_34_14","mapUsersCount",o,b);return c.join("");};map.index.block_main=new Surface.Block("map.index.block_main");map.index.block_main.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};c.push('\r\n    <img src="/public/base/menu_shadow.png" /><br />\r\n\r\n    <div id="mapContainer">\r\n        <div class="shout">\r\n            <h3>SAY SOMETHING TO THE PLANET</h3>\r\n            <div class="inputContainer">\r\n                <form id="shoutForm" action="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/map/addShout/"))));c.push('" method="POST">\r\n                    <input type="text" name="content" maxlength="');c.push(Surface.valOut(o.SHOUT_MAX_LENGTH));c.push('"/>\r\n                    <input type="image" value="submit" src="/public/map/shout_button.png" />\r\n                </form>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    <div id="mapInfo">\r\n        <div class="description">\r\n            <h1>World of ESN Planet</h1>\r\n            <h2>Say hello to other visitors</h2>\r\n            <p>\r\n                Take a brief moment and look at the mile high view of the ESN Planet.\r\n                The world map shows visitors from around the globe. When someone arrives at ESN.me they will show up on the map.\r\n                Spy on others or send a greeting!\r\n            </p>\r\n            <p>\r\n                The real-time map was implemented entirely using our own tools. Making creative use of all the parts of ESN Planet.\r\n            </p>\r\n        </div>\r\n        <div class="users">\r\n');c.push(map.index.surface_34_14.render({"users":((typeof(o)!="undefined"&&typeof(o.users)!="undefined"&&o.users!==null)?o.users:null)},b,kwargs));c.push('        </div>\r\n        <div class="download">\r\n            <a href="http://dev.esn.me/documentation/bytitle/World%20Map%20Demo/" target="_blank"><img src="/public/map/download_project_button.png" /></a>\r\n            <div class="gravatars">\r\n                <img src="http://www.gravatar.com/avatar/beb8783d5e5a2d33aa2873aaa4a5d2a9?s=25&d=wavatar" width="25" height="25" />\r\n                <img src="http://www.gravatar.com/avatar/c69d1c1b7ffcb9eab7d8296e28c0694e?s=25&d=wavatar" width="25" height="25" />\r\n                <img src="http://www.gravatar.com/avatar/6880deb189d5cf771a7ee2cdb72cba02?s=25&d=wavatar" width="25" height="25" />\r\n                <img src="http://www.gravatar.com/avatar/57e8daf20220dd8953944719452e2f47?s=25&d=wavatar" width="25" height="25" />\r\n            </div>\r\n            <p>\r\n                <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/about/team/{member}/"))));c.push('">Jonatan</a>, <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/about/team/{member}/"))));c.push('">Ronnie</a>, <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/about/team/{member}/"))));c.push('">H&aring;kan</a> and <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/about/team/{member}/"))));c.push('">Carl</a>\r\n                built this demo using <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/product/how-it-works/"))));c.push('#surface">Surface</a>, <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/product/how-it-works/"))));c.push('#impact">Impact</a>, <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/product/how-it-works/"))));c.push('#orbit">Orbit</a> and <a href="');c.push(Surface.valOut(S.Modifier.urlnormalize(S.Modifier.format(Surface.urlContext,"/product/how-it-works/"))));c.push('#core">Core</a>.\r\n            </p>\r\n            <div class="planet_icons">\r\n                <img src="/public/map/surface_icon.png" />\r\n                <img src="/public/map/impact_icon.png" />\r\n                <img src="/public/map/orbit_icon.png" />\r\n                <img src="/public/map/core_icon.png" />\r\n            </div>\r\n        </div>\r\n    </div>\r\n');return c.join("");};map.index.block_script=new Surface.Block("map.index.block_script");map.index.block_script.render=function(o,b,kwargs){var c=[];kwargs=kwargs||{};var l_for_7dd1e230_list;var l_for_7dd1e22f_list;c.push('    <script type="text/javascript">\r\n        $(document).ready(function() ');c.push("{\r\n");l_for_7dd1e22f_list=o.visitors;if((S.Modifier.count(l_for_7dd1e22f_list)>0)){for(var l_for_7dd1e22f_key in l_for_7dd1e22f_list){if(!Surface.isValidLoopItem(l_for_7dd1e22f_list[l_for_7dd1e22f_key])){continue;}var l_visitor=l_for_7dd1e22f_list[l_for_7dd1e22f_key];c.push("                map.addDot( ");c.push(Surface.valOut(l_visitor.longitude));c.push(", ");c.push(Surface.valOut(l_visitor.latitude));c.push(");\r\n");}}l_for_7dd1e230_list=o.shouts;if((S.Modifier.count(l_for_7dd1e230_list)>0)){for(var l_for_7dd1e230_key in l_for_7dd1e230_list){if(!Surface.isValidLoopItem(l_for_7dd1e230_list[l_for_7dd1e230_key])){continue;}var l_shout=l_for_7dd1e230_list[l_for_7dd1e230_key];c.push('                map.addBubble("');c.push(Surface.valOut(S.Modifier.addslashes(l_shout.username)));c.push('", "');c.push(Surface.valOut(S.Modifier.addslashes(l_shout.content)));c.push('", ');c.push(Surface.valOut(l_shout.longitude));c.push(", ");c.push(Surface.valOut(l_shout.latitude));c.push(', "');c.push(Surface.valOut(l_shout.countryCode));c.push('", ');c.push(Surface.valOut(l_shout.shoutRatingCount));c.push(', "');c.push(Surface.valOut(l_shout.id));c.push('", true);\r\n');}}c.push("        });\r\n    <\/script>\r\n");return c.join("");};if(typeof orbit=="undefined"){var orbit={};}var surf_orbit_component=new Surface.Component("orbit");surf_orbit_component.extend(orbit);orbit=surf_orbit_component;var block_orbit_index=new Surface.BlockConfig("",{});orbit.addTemplate(new Surface.Template("index"));orbit.index.render=function(o,b,kwargs){var c=[];b=b||block_orbit_index;kwargs=kwargs||{};c.push('\r\n <script type="text/javascript">\r\n     Surface.Orbit.host = \'');c.push(Surface.valOut(Surface.globalContext.orbit.ip));c.push("';\r\n     Surface.Orbit.user = '");c.push(Surface.valOut(Surface.globalContext.orbit.user));c.push("';\r\n     Surface.Orbit.token = '");c.push(Surface.valOut(Surface.globalContext.orbit.token));c.push("';\r\n     Surface.Orbit.channels = ['");c.push(Surface.valOut(S.Modifier.join(Surface.globalContext.orbit.channels,"', '")));c.push("']\r\n <\/script>\r\n");return c.join("");};if(typeof planetdevbar=="undefined"){var planetdevbar={};}var surf_planetdevbar_component=new Surface.Component("planetdevbar");surf_planetdevbar_component.extend(planetdevbar);planetdevbar=surf_planetdevbar_component;planetdevbar.addTemplate(new Surface.Template("bookmarklet"));planetdevbar.addTemplate(new Surface.Template("stats"));planetdevbar.addTemplate(new Surface.Template("style"));planetdevbar.addTemplate(new Surface.Template("test"));if(typeof preparser=="undefined"){var preparser={};}var surf_preparser_component=new Surface.Component("preparser");surf_preparser_component.extend(preparser);preparser=surf_preparser_component;preparser.addTemplate(new Surface.Template("index"));if(typeof product=="undefined"){var product={};}var surf_product_component=new Surface.Component("product");surf_product_component.extend(product);product=surf_product_component;var block_product_base=new Surface.BlockConfig("base.index",{"product":"product.base.block_product","submenu":"product.base.block_submenu","main":"product.base.block_main"});product.addTemplate(new Surface.Template("base"));product.base.surface_23_2=new Surface.SurfaceList("product.base.surface_23_2","visitors","visitor","visitor.id");product.base.surface_24_6=new Surface.SingleSurface("product.base.surface_24_6");product.base.surface_24_6.render=function(o,b,kwargs){var c=[];b=b||block_product_base;kwargs=kwargs||{};c.push('<surf:container id="');c.push(S.Modifier.concat("visitors",S.Modifier.concat("_",o.visitor.id)));c.push('">');c.push("        Hi ");c.push(Surface.valOut(o.visitor.name));c.push("!\r\n");c.push("</surf:container>");Surface.Renderer.addSurfaceState("product.base","surface_24_6",S.Modifier.concat("visitors",S.Modifier.concat("_",o.visitor.id)),o,b);return c.join("");};product.base.surface_23_2.render=function(o,b,kwargs){var c=[];b=b||block_product_base;kwargs=kwargs||{};c.push('<surf:container id="');c.push("visitors");c.push('">');var l_for_77997532_list;l_for_77997532_list=o.visitors;if((S.Modifier.count(l_for_77997532_list)>0)){for(var l_for_77997532_key in l_for_77997532_list){if(!Surface.isValidLoopItem(l_for_77997532_list[l_for_77997532_key])){continue;}var l_visitor=l_for_77997532_list[l_for_77997532_key];c.push(product.base.surface_24_6.render({"visitor":((typeof(l_visitor)!="undefined"&&l_visitor!==null)?l_visitor:null)},b,kwargs));}c.push("");}c.push("</surf:container>");Surface.Renderer.addSurfaceState("product.base","surface_23_2","visitors",o,b);return c.join("");};product.addTemplate(new Surface.Template("businessfactors"));product.addTemplate(new Surface.Template("businessimpact"));product.addTemplate(new Surface.Template("demos"));product.addTemplate(new Surface.Template("features"));product.addTemplate(new Surface.Template("games"));product.addTemplate(new Surface.Template("howitworks"));product.addTemplate(new Surface.Template("index"));product.addTemplate(new Surface.Template("partners"));product.addTemplate(new Surface.Template("pricing"));product.addTemplate(new Surface.Template("signup"));product.addTemplate(new Surface.Template("support"));if(typeof services=="undefined"){var services={};}var surf_services_component=new Surface.Component("services");surf_services_component.extend(services);services=surf_services_component;services.addTemplate(new Surface.Template("index"));if(typeof showcase=="undefined"){var showcase={};}var surf_showcase_component=new Surface.Component("showcase");surf_showcase_component.extend(showcase);showcase=surf_showcase_component;showcase.addTemplate(new Surface.Template("index"));if(typeof surfaceerror=="undefined"){var surfaceerror={};}var surf_surfaceerror_component=new Surface.Component("surfaceerror");surf_surfaceerror_component.extend(surfaceerror);surfaceerror=surf_surfaceerror_component;surfaceerror.addTemplate(new Surface.Template("ajax"));surfaceerror.addTemplate(new Surface.Template("index"));if(typeof surfaceframework=="undefined"){var surfaceframework={};}var surf_surfaceframework_component=new Surface.Component("surfaceframework");surf_surfaceframework_component.extend(surfaceframework);surfaceframework=surf_surfaceframework_component;var block_surfaceframework_index=new Surface.BlockConfig("",{});surfaceframework.addTemplate(new Surface.Template("index"));surfaceframework.index.render=function(o,b,kwargs){var c=[];b=b||block_surfaceframework_index;kwargs=kwargs||{};c.push("\r\n<!-- #SURFACE_STATE# -->");return c.join("");};if(typeof systemoverview=="undefined"){var systemoverview={};}var surf_systemoverview_component=new Surface.Component("systemoverview");surf_systemoverview_component.extend(systemoverview);systemoverview=surf_systemoverview_component;systemoverview.addTemplate(new Surface.Template("index"));