/**
 * Autobahn JavaScript Library
 *
 * @version 0.3.1.169
 * @author Joe Gornick <joe@swarmcast.com>
 * @copyright 2009 Swarmcast
 */
(function(o){var t=document,br=t.documentElement,bs=navigator.userAgent,bt=t.createElement('div'),N=Array.prototype.slice;if(typeof o.console==='undefined'){var S=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];o.console={};var Z=(o.opera)?opera.postError:function(){};for(var O=0;O<S.length;++O)o.console[S[O]]=Z}var d={Version:'0.3.1.169',emptyFunction:function(){}};d.Object={isArray:function(a){return Object.prototype.toString.call(a)==='[object Array]'},extend:function(a,b){for(var c in b)a[c]=b[c];return a},keys:function(a){var b=[];for(var c in a)b.push(c);return b},toQueryString:function(a){var b=[];for(var c in a){var f=encodeURIComponent(c),g=a[c];var h=f+'=';if(d.Object.isArray(g)){for(var l=0,j=g.length;l<j;l++){var k=g[l];k=encodeURIComponent((k==null)?'':String(k));b.push(h+k)}}else{g=encodeURIComponent((g==null)?'':String(g));b.push(h+g)}}return b.join('&')}};d.Array={indexOf:(function(){if(Array.prototype.indexOf){return function(a,b,c){return a.indexOf(b,c)}}return function(a,b,c){c=c||0;var f=a.length;if(c<0)c=f+c;for(;c<f;c++)if(a[c]===b)return c;return-1}})()};d.Function={bind:function(a,b){if(arguments.length<3){if(typeof b==='undefined')return a;return function(){return arguments.length?a.apply(b,arguments):a.call(b)}}var c=N.call(arguments,2);return function(){return a.apply(b,arguments.length?mergeList(c,arguments):c)}}};d.String={trim:function(a){var b=new RegExp('^\\s+'),c=new RegExp('\\s+$');return a.replace(b,'').replace(c,'')},toQueryParams:function(a,b){a=String(a);var c=d.String.trim(a).match(/([^?#]*)(#.*)?$/);if(!c||c[0]===a)return{};var f={};var g=c[1].split(b||'&');for(var h=0,l=g.length;h<l;h++){var j;if((j=g[h].split('='))[0]){var k=decodeURIComponent(j.shift());var m=j.length>1?j.join('='):j[0];if(m!=undefined)m=decodeURIComponent(m);if(k in f){if(!d.Object.isArray(f[k]))f[k]=[f[k]];f[k].push(m)}else f[k]=m}}return f}};d.Element={firstDescendant:function(a){a=a.firstChild;while(a&&a.nodeType!==1)a=a.nextSibling;return a}};(function(){var l,j,k,m,q,s;var C=[{string:navigator.userAgent,subString:'Chrome',versionSearch:'Chrome',engineSearch:'AppleWebKit',identity:'Chrome'},{string:navigator.vendor,subString:'Apple',versionSearch:'Version',versionSearchAlt:'Safari',engineSearch:'AppleWebKit',identity:'Safari'},{prop:window.opera,identity:'Opera'},{string:navigator.userAgent,subString:'Camino',versionSearch:'Camino',engineSearch:'Gecko',identity:'Camino'},{string:navigator.userAgent,subString:'Navigator',versionSearch:'Navigator',engineSearch:'Gecko',identity:'Netscape'},{string:navigator.userAgent,subString:'Netscape',versionSearch:'Netscape',engineSearch:'Gecko',identity:'Netscape'},{string:navigator.userAgent,subString:'Netscape6',versionSearch:'Netscape6',engineSearch:'Gecko',identity:'Netscape'},{string:navigator.userAgent,subString:'Firefox',versionSearch:'Firefox',engineSearch:'Gecko',identity:'Firefox'},{string:navigator.userAgent,subString:'MSIE',identity:'IE',versionSearch:'MSIE'},{string:navigator.userAgent,subString:'Gecko',identity:'Mozilla',versionSearch:'rv',engineSearch:'Gecko'},{string:navigator.userAgent,subString:'Mozilla',identity:'Netscape',versionSearch:'Mozilla'}],D=[{string:navigator.userAgent,subString:'Win',identity:'Windows NT',versionSearch:'Windows NT'},{string:navigator.userAgent,subString:'Win',identity:'Windows',versionSearch:'Windows'},{string:navigator.userAgent,subString:'Mac OS X',identity:'Mac OS X',versionSearch:'Mac OS X'},{string:navigator.userAgent,subString:'Mac',identity:'Mac'},{string:navigator.userAgent,subString:'iPhone',identity:'iPhone',versionSearch:'iPhone OS'},{string:navigator.userAgent,subString:'Linux',identity:'Linux'}];var E={'5.0':'2000','5.1':'XP','5.2':'Server 2003','6.0':'Vista','7.0':'7'},F={'10.0':'Cheetah','10.1':'Puma','10.2':'Jaguar','10.3':'Panther','10.4':'Tiger','10.5':'Leopard','10.6':'Snow Leopard'};function x(a){for(var b=0,c=a.length;b<c;b++){var f=a[b],g=f.string,h=f.prop;if(typeof g!=='undefined'){if(g.indexOf(f.subString)!==-1)return f}else if(typeof h!=='undefined'){return f}}}function v(a,b){if(typeof b==='undefined')return;a=a.toLowerCase().split(' ');b=b.toLowerCase();var c=-1;for(var f=0,g=a.length;f<g;f++){if(a[f].indexOf(b)!==-1){c=f;break}}if(c===-1)return;if(b.indexOf('msie')!==-1)return a[c+1].replace(';','')||0;return a[c].split('/')[1]||0}function n(a,b){if(typeof b==='undefined')return;a=a.toLowerCase();b=b.toLowerCase();var c=a.indexOf(b);if(c===-1)return;var f=a.substring(c,a.indexOf(';',c)).replace(b,'');f=f.replace(/^\s+/,'').replace(/\s+$/,'').replace(/_/g,'.');return f}s=x(C);if(s){l=s.identity;j=v(navigator.userAgent,s.versionSearch);if(!j&&s.versionSearchAlt)j=v(navigator.userAgent,s.versionSearchAlt);k=v(navigator.userAgent,s.engineSearch)}var r=x(D);if(r){m=r.identity;q=n(navigator.userAgent,r.versionSearch)}d.Browser={name:l,version:j,engineVersion:k,os:m,osVersion:q,windowsVersionNames:E,macOSXVersionNames:F}})();d.Class=(function(){function m(){var a=null,b=N.call(arguments,0);if(typeof b[0]==='function')a=b.shift();function c(){this.initialize.apply(this,arguments)}d.Object.extend(c,d.Class.Methods);c.superclass=a;c.subclasses=[];if(a){var f=function(){};f.prototype=a.prototype;c.prototype=new f;a.subclasses.push(c)}for(var g=0;g<b.length;g++)c.addMethods(b[g]);if(!c.prototype.initialize)c.prototype.initialize=d.emptyFunction;c.prototype.constructor=c;return c}function q(b){var c=this.superclass&&this.superclass.prototype;var f=d.Object.keys(b);if(!d.Object.keys({toString:true}).length)f.push('toString','valueOf');for(var g=0,h=f.length;g<h;g++){var l=f[g],j=b[l];if(c&&typeof j==='function'&&j.argumentNames()[0]==='$super'){var k=j,j=(function(a){return function(){return c[a].apply(this,arguments)}})(l).wrap(k);j.valueOf=d.Function.bind(k.valueOf,k);j.toString=d.Function.bind(k.toString,k)}this.prototype[l]=j}return this}return{'create':m,'Methods':{'addMethods':q}}})();d.Timer=d.Class.create((function(){function c(a,b){this.callback=a;this.interval=b;this.executing=false;this.onTimerEvent=d.Function.bind(f,this)}function f(){if(!this.executing){this.executing=true;try{this.execute()}catch(e){}if(this.timerID!==null)this.start();this.executing=false}}function g(){this.callback(this)}function h(){this.timerID=o.setTimeout(this.onTimerEvent,this.interval);return this}function l(){if(this.timerID===null)return;o.clearTimeout(this.timerID);this.timerID=null;return this}return{'initialize':c,'execute':g,'start':h,'stop':l}})());d.Utils={};d.Utils.loadScript=function(b,c){c=d.Object.extend({onComplete:d.emptyFunction,onTimeout:d.emptyFunction,id:String(+new Date+Math.random()),timeout:1000},c||{});if(typeof d._3==='undefined')d._3=[];var f=false;var g=false;var h=t.createElement('script');h.id=c.id;h.type='text/javascript';var l=function(){if(d._3[b]){o.clearTimeout(d._3[b]);d._3[b]=null;delete d._3[b]}h.onload=h.onreadystatechange=null;h.src=null;if(h&&h.parentNode!==null)h.parentNode.removeChild(h)};var j=function(){l();c.onComplete.apply(this,arguments)};var k=function(){l();c.onTimeout.apply(this,arguments)};h.onload=function(){g=true;if(!f){f=true;j();return}};h.onreadystatechange=function(){g=true;if(/loaded|complete/.test(h.readyState)){if(!f){f=true;j();return}}};h.src=b;t.getElementsByTagName('HEAD')[0].appendChild(h);var m=function(){if(g)return;if(/loaded|complete/.test(t.readyState)){o.clearTimeout(d._3[b]);d._3[b]=null;if(!f){f=true;j();return}}var a=+new Date;if((a-s)>=c.timeout){k();return}q()};var q=function(a){if(g)return;d._3[a]=o.setTimeout(m,500)};var s=+new Date;q(b);return h};d.Autobahn={requiredVersion:'4.3.1.36'};d.Autobahn.Detection={};(function(){var l=['KITE','LOON','MALLARD','NENE','OSPREY','PUFFIN'];function j(a,b){if(Object.prototype.toString.call(a)!=='[object String]')throw new Error('Required version requires a string.');if(Object.prototype.toString.call(b)!=='[object String]')throw new Error('Autobahn version requires a string.');var c=0;if(/development snapshot/i.test(b))return c;a=a.split('.');b=b.split('.');while(a.length<4)a.push('0');var f='0';var g=b.pop().split('_');if(g.length>1)f=g.pop();b.push(g.join('_'));b.push(f);f='0';g=a.pop().split('_');if(g.length>1)f=g.pop();a.push(g.join('_'));a.push(f);while((b.length>0)&&((c=k(a.shift(),b.shift()))==0)){}return c}function k(a,b){var c=parseInt(a);var f=parseInt(b);if(String(a)===String(b))return 0;if((!isNaN(c))&&(!isNaN(f)))return f-c;var g=d.Array.indexOf(l,a);var h=d.Array.indexOf(l,b);return h-g}function m(a){a=String(a);if(a.indexOf('(development snapshot)')>-1)return'Development Snapshot';a=a.replace(/\"|\n|\r/g,'');if(a.indexOf('Autobahn')>-1)a=a.split(' ')[1];return a}function q(a){a=m(a);if(/development snapshot/i.test(a))return{major:-1,minor:-1,release:-1,build:-1,developmentSnapshot:true};a=a.split('.');while(a.length<4)a.push('0');var b={};for(var c=0,f=a.length;c<f;c++){var g=a[c];if(c==0)b['major']=g;else if(c==1)b['minor']=g;else if(c==2)b['release']=g;else if(c==3)b['build']=g}return b}d.Autobahn.Detection.Version={validate:j,parse:m,parseAsObject:q}})();(function(){var g='/protected/api/img/',h='/protected/api/js/',l='ping.gif',j='ping.js';var k,m;function q(){this._0=t.createElement('img');this._0.onload=d.Function.bind(C,this);this._0.onerror=d.Function.bind(D,this);this._0.style.cssText='position: absolute; display: block; visibility: hidden';t.body.appendChild(this._0)}function s(a,b,c){var f="http://";f+=a;f+=":"+b;f+=c;f+="?unique="+String(+new Date+Math.random());return f}function C(){if(this._0.width>=1&&this._0.height>=1){this._4.stop();x.call(this)}}function D(){this._4.stop();v.call(this)}function E(){if(typeof o.swarmcastVersion!=='undefined'){this._4.stop();this._9=m.parse(o.swarmcastVersion);x.call(this)}}function F(a){this._4.stop();this.stop();if(this._5===k.Status.ACTIVE)return;if(this.options.type===k.Type.JS){if(typeof o.swarmcastVersion!=='undefined'){this._9=m.parse(o.swarmcastVersion);x.call(this);return}}v.call(this)}function x(){this._5=k.Status.ACTIVE;this.options.onActive(this,this._9)}function v(){this._5=k.Status.ERROR;this.options.onError(this)}function n(a){this.options=d.Object.extend({type:d.Autobahn.Detection.Observer.Type.IMAGE,timeout:1000,host:'local.swarmcast.net',port:8001,assetName:l,onActive:d.emptyFunction,onError:d.emptyFunction},a||{});m=d.Autobahn.Detection.Version;this._i,this._0,this._2,this._9;this._4=new d.Timer(d.Function.bind(F,this),this.options.timeout);this._5=k.Status.ERROR}function r(){this.stop();this._9=null;this._5=k.Status.ERROR;if(this.options.type===k.Type.IMAGE){q.call(this);this._0.src=s(this.options.host,this.options.port,g+this.options.assetName)}else{var a=s(this.options.host,this.options.port,h+this.options.assetName);this._2=d.Utils.loadScript(a,{onComplete:d.Function.bind(E,this),timeout:this.options.timeout})}this._4.interval=this.options.timeout;this._4.start()}function p(){return this._5}function z(){if(this._4)this._4.stop();if(this._0){this._0.onload=this._0.onerror=null;this._0.src='data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw%3D%3D';if(this._0.parentNode!==null)this._0.parentNode.removeChild(this._0);this._0=null}if(this._2){this._2.onload=this._2.onreadystatechange=null;this._2.src=null;if(this._2.parentNode!==null)this._2.parentNode.removeChild(this._2);this._2=null}}k=d.Autobahn.Detection.Observer=d.Class.create({'initialize':n,'start':r,'stop':z,'getStatus':p})})();d.Autobahn.Detection.Observer.Status={ACTIVE:'ACTIVE',ERROR:'ERROR'};d.Autobahn.Detection.Observer.Type={IMAGE:'IMAGE',JS:'JS'};(function(){var h='local.swarmcast.net',l='127.0.0.1',j='ping.gif',k='version.gif',m='ping.js',q='version.js',s=500,C=1000,D=500,E=5000,F=5;var x,v,n,r,p,z=0,u=[],y=[],A=true,G,w,i=false,I=false,J=false,L,P=0;var H,B,T;function ba(a){this.options=d.Object.extend({requiredVersion:d.Autobahn.requiredVersion,timeout:-1,requestTimeout:1000,checkProxy:true,enablePortRangeDetection:true,minPort:8001,maxPort:8005,startPort:8001,onMissing:d.emptyFunction,onUpdateRequired:d.emptyFunction,onVersionCurrent:d.emptyFunction,onTimeout:d.emptyFunction},a||{});B=d.Autobahn.Detection.Observer;T=d.Autobahn.Detection.Version;r=new B({onActive:d.Function.bind(U,this),onError:d.Function.bind(V,this)});v=new d.Timer(d.Function.bind(bb,this),-1);n=new d.Timer(d.Function.bind(bc,this),s);G=H.Status.AUTOBAHN_MISSING;L=this.options.requestTimeout}function K(a,b,c,f,g){a.options.type=b;a.options.host=c;a.options.port=f;a.options.assetName=g;a.options.timeout=L;a.finished=false;I=true;a.start()}function U(a,b){if(A)return;w=b;if(a.options.type===B.Type.IMAGE&&a.options.assetName===j){Q.apply(this,[a]);if(a.options.host===l&&this.options.checkProxy&&!i){i=true;K.apply(this,[a,a.options.type,h,a.options.port,a.options.assetName]);return}if(a.options.host===h&&i)i=false;p=a;L=E;K.apply(this,[a,B.Type.JS,a.options.host,a.options.port,m]);return}if(p&&p===a)z=0;R.call(this)}function V(a){if(A)return;a.stop();if(a.options.type===B.Type.IMAGE&&a.options.assetName===j){if(a.options.host===h&&this.options.checkProxy){if(i){Q.call(this);p=a;K.apply(this,[a,B.Type.JS,l,a.options.port,m]);return}K.apply(this,[a,B.Type.IMAGE,l,a.options.port,j]);return}if(r===a&&this.options.enablePortRangeDetection&&!J&&!p){var b,c;if(u.length===0){for(b=this.options.minPort;b<=this.options.maxPort;b++){if(b===r.options.port)continue;u.push(new B({port:b,onActive:d.Function.bind(U,this),onError:d.Function.bind(V,this)}))}}J=true;for(b=0,c=u.length;b<c;b++)K.apply(this,[u[b],B.Type.IMAGE,h,u[b].options.port,j]);return}if(J){a.finished=true}}if(a.options.type===B.Type.JS){R.call(this);return}if(p&&p===a){a.finished=true;if(z===F){z=0;p=null;i=false}else z++;if(!i)a.options.host=h}if(bd.call(this))R.call(this)}function bd(){if(u.length===0)return true;for(var a=0,b=u.length;a<b;a++)if(!u[a].finished)return false;return true}function Q(a){for(var b=0,c=u.length;b<c;b++){if(u[b]===a)continue;u[b].stop();u[b].finished=true}if(r&&r!==a){r.stop();r.finished=true}}function bb(a){be.call(this)}function bc(){if(A){n.stop();I=false;return}if(!I){if(+new Date-P<=C)return;if(d.Browser.name==='IE')window.location.href='javascript:void(0)';L=D;P=+new Date;if(p)K.apply(this,[p,B.Type.IMAGE,p.options.host,p.options.port,j]);else K.apply(this,[r,B.Type.IMAGE,h,this.options.startPort,j])}}function R(){var a;if(w&&this.options.requiredVersion)a=T.validate(this.options.requiredVersion,w);if(isNaN(a))bf.call(this);else if(a<0)W.call(this);else if(a>=0)bg.call(this)}function bf(){if(G===H.Status.AUTOBAHN_UPDATE_REQUIRED){W();return}G=H.Status.AUTOBAHN_MISSING;this.options.onMissing(this);M.apply(this,[H.Event.AUTOBAHN_MISSING,{detector:this,version:w}]);I=false;J=false}function W(){G=H.Status.AUTOBAHN_UPDATE_REQUIRED;this.options.onUpdateRequired(this,w);M.apply(this,[H.Event.AUTOBAHN_UPDATE_REQUIRED,{detector:this,version:w}]);I=false;J=false}function bg(){this.stop();G=H.Status.AUTOBAHN_VERSION_CURRENT;this.options.onVersionCurrent(this,w);M.apply(this,[H.Event.AUTOBAHN_VERSION_CURRENT,{detector:this,version:w}]);I=false;J=false}function be(){this.stop();this.options.onTimeout(this,w);M.apply(this,[H.Event.AUTOBAHN_DETECTOR_TIMEOUT,{detector:this,version:w}]);I=false;J=false}function bh(a){if(!A)return;d.Object.extend(this.options,a||{});L=this.options.requestTimeout;A=false;i=false;G=H.Status.AUTOBAHN_MISSING;p=null;z=0;w=null;P=+new Date;K.apply(this,[r,B.Type.IMAGE,h,this.options.startPort,j]);n.start();if(this.options.timeout>-1){v.interval=this.options.timeout;v.start()}}function bi(){if(A)return;A=true;Q.call(this);n.stop();v.stop();if(d.Browser.name==='IE')window.location.href='javascript:void(0)'}function bj(){return G}function bk(){return A}function bl(){return w}function X(){if(!p)return null;return p.options.host}function Y(){if(!p)return-1;return p.options.port}function bm(){if(!p)return null;return'http://'+X.call(this)+':'+Y.call(this)}function bn(){return i}function bo(a,b){if(typeof a==='undefined'||typeof a!=='string')return;if(typeof b==='undefined'||typeof b!=='function')return;if(typeof y[a]==='undefined')y[a]=[];if(d.Array.indexOf(y[a],b)===-1)y[a].push(b)}function bp(a,b){if(typeof a==='undefined'||typeof a!=='string')return;if(typeof b!=='undefined'&&typeof b!=='function')return;if(typeof y[a]==='undefined')return;if(typeof b==='undefined'){y[a]=[]}else{var c=d.Array.indexOf(y[a],b);if(c===-1)return;y[a]=y[a].splice(c,1)}}function M(a,b){if(typeof a==='undefined'||typeof a!=='string')return;if(typeof y[a]==='undefined')return;for(var c=0,f=y[a].length;c<f;c++){var g=y[a][c];g(b)}}function bq(){if(typeof x==='undefined'){x=new function(){ba.apply(this,arguments);this.start=bh;this.stop=bi;this.getStatus=bj;this.getStopped=bk;this.getAutobahnVersion=bl;this.getAutobahnHost=X;this.getAutobahnPort=Y;this.getAutobahnBaseUrl=bm;this.getProxyExists=bn;this.addEventListener=bo;this.removeEventListener=bp}}return x}H=d.Autobahn.Detection.Detector={getInstance:bq}})();d.Autobahn.Detection.Detector.Status={AUTOBAHN_DETECTOR_TIMEOUT:'AUTOBAHN_DETECTOR_TIMEOUT',AUTOBAHN_MISSING:'AUTOBAHN_MISSING',AUTOBAHN_UPDATE_REQUIRED:'AUTOBAHN_UPDATE_REQUIRED',AUTOBAHN_VERSION_CURRENT:'AUTOBAHN_VERSION_CURRENT'};d.Autobahn.Detection.Detector.Event={AUTOBAHN_DETECTOR_TIMEOUT:'AUTOBAHN_DETECTOR_TIMEOUT',AUTOBAHN_MISSING:'AUTOBAHN_MISSING',AUTOBAHN_UPDATE_REQUIRED:'AUTOBAHN_UPDATE_REQUIRED',AUTOBAHN_VERSION_CURRENT:'AUTOBAHN_VERSION_CURRENT'};d.Autobahn.Installation={};(function(){var l=true,j,k=null,m=null,q=null;function s(a){this.options=d.Object.extend({appletUrl:'http://www.getautobahn.com/jar/autobahn-bootstrap.jar',environment:'prod',installationAssetPath:null,debug:'false',requiredVersion:d.Autobahn.requiredVersion,appletInitTimeout:3000,autobahnStartTimeout:15000,onReady:d.emptyFunction,onError:d.emptyFunction,onDownloadProgress:d.emptyFunction,onDownloadComplete:d.emptyFunction,onComplete:d.emptyFunction},a||{})}function C(a){var b=[];b.push('<applet');b.push('width="10"');b.push('height="10"');b.push('id="ab_installer_applet"');b.push('code="com.swarmcast.bootstrap.AutobahnBootstrapApplet"');b.push('archive="'+a.appletUrl+'"');b.push('style="width: 1px; height: 1px; float: left;"');b.push('mayscript>');var c=[];c.push('<param name="autobahn.deployment_environment" value="'+a.environment+'" />');if(a.installationAssetPath)c.push('<param name="autobahn.installation.asset.path" value="'+a.installationAssetPath+'" />');c.push('<param name="autobahn.debug.mode" value="'+a.debug+'" />');c.push('<param name="autobahn.version.datum" value="'+a.requiredVersion+'" />');c.push('<param name="autobahn.pong.wait_time.applet_init" value="'+a.appletInitTimeout+'" />');c.push('<param name="autobahn.pong.wait_time.autobahn_startup" value="'+a.autobahnStartTimeout+'" />');var f='Swarmcast.Autobahn.Installation.AppletInstaller';c.push('<param name="autobahn.progress.download.graphical.component" value="'+f+'.getInstance().updateDownloadStatus" />');c.push('<param name="autobahn.progress.error.event.consumer" value="'+f+'.getInstance().showErrorMessage" />');c.push('<param name="autobahn.progress.download.complete.event.consumer" value="'+f+'.getInstance().setDownloadComplete" />');c.push('<param name="autobahn.progress.start.event.consumer" value="'+f+'.getInstance().setAutobahnStarted" />');c.push('<param name="autobahn.applet.start.event.consumer" value="'+f+'.getInstance().setAppletReady" />');c.push('<param name="autobahn.js.started.provider" value="'+f+'.getInstance().isJsReady" />');b.push(c.join(''));b.push('</applet>');var g=t.createElement('DIV');g.innerHTML=b.join(' ');var h=g.firstChild;g=null;return h}function D(){if(q===null)q=+new Date;k=new d.Timer(d.Function.bind(E),1000);k.start()}function E(){var a=Math.abs(q- +new Date)/1000;if((a>=60)&&(m===null)){n.apply(this,['Timed out while waiting for authorization. Please reload the page to try again.']);q=null;k.stop();return}if(m!==null){q=null;k.stop();return}}function F(a){d.Object.extend(this.options,a||{});var b=t.getElementById('ab_installer_applet');if(b)b.parentNode.removeChild(b);D.call(this);t.body.appendChild(C.apply(this,[this.options]))}function x(){return l}function v(){m=+new Date;this.options.onReady()}function n(a){this.options.onError(a)}function r(a){this.options.onDownloadProgress(a)}function p(){this.options.onDownloadComplete()}function z(){this.options.onComplete()}function u(){if(typeof j==='undefined'){j=new function(){s.apply(this,arguments);this.start=F;this.updateDownloadStatus=r;this.showErrorMessage=n;this.setDownloadComplete=p;this.setAutobahnStarted=z;this.setAppletReady=v;this.isJsReady=x}}return j}d.Autobahn.Installation.AppletInstaller={getInstance:u}})();d.Autobahn.Players={};(function(){var j='9.0.115',k='10.0.12.36',m='2.0.31005',q='2.0.31005',s='http://www.swarmcast.com/swf/AutobahnHDPlayer.swf',C='http://www.swarmcast.com/swf/expressInstall.swf',D='http://www.swarmcast.com/xap/Swarmcast.Autobahn.HDPlayer.xap',E=14,F=42,x=16,v=44;var n;function r(){swfobject.expressInstallCallback();w.call(this)}function p(){d.Array.indexOf(n.instances,this)}function z(a){var b={env:this.options.environment,vidWidth:this.options.videoWidth,vidHeight:this.options.videoHeight,defaultVideoURL:this.options.videoUrl||'',autobahnVideoURL:this.options.autobahnVideoUrl||'',imageURL:this.options.thumbnailImageUrl||'',captionText:this.options.caption||'',autoplay:this.options.autoplay,bgColor:this.options.bgColor.replace('#',''),bufferSeconds:this.options.bufferTime,bufferTime:this.options.bufferTime,throttleKbps:this.options.throttleKbps,allowSmoothing:this.options.allowSmoothing};var c={allowFullScreen:'true',allowScriptAccess:'always'};var f={id:this.options.id,name:this.options.id,bgcolor:this.options.bgColor};var g='';if(a){g=this.options.expressInstallerUrl;d.Object.extend(b,{onDeclineCallback:'Swarmcast.Autobahn.Players.HDPlayer.instances['+p.call(this)+']._d()'});d.Object.extend(f,{xiRedirectUrl:location.href})}var h=d.Element.firstDescendant(this._1);if(h)swfobject.removeSWF(h.id);this._1.innerHTML='';var l=t.createElement('div');l.id=this.options.id;this._1.appendChild(l);swfobject.embedSWF(this.options.playerUrl,l.id,this.options.videoWidth+E,this.options.videoHeight+F,j,g,b,c,f);this._b=t.getElementById(l.id)}function u(){var a={videoWidth:this.options.videoWidth,videoHeight:this.options.videoHeight,videoSource:this.options.videoUrl||'',autobahnVideoSource:this.options.autobahnVideoUrl||'',playlistSource:this.options.playlistUrl||'',thumbnailImageSource:this.options.thumbnailImageUrl||'',caption:this.options.caption||'',bgColor:this.options.bgColor,autoplay:this.options.autoplay,bufferTime:this.options.bufferTime};var b='';for(var c in a)b+=c+'='+a[c]+',';b=b.substr(0,b.length-1);Silverlight.createObjectEx({source:this.options.playerUrl,parentElement:this._1,id:this.options.id,properties:{width:this.options.videoWidth+x,height:this.options.videoHeight+v,inplaceInstallPrompt:false,background:this.options.bgColor,isWindowless:false,framerate:'24',version:m,enableHtmlAccess:'true'},events:{},initParams:b,context:null});this._b=t.getElementById(this.options.id)}function y(){this.options.videoWidth=Number(this.options.videoWidth);this.options.videoHeight=Number(this.options.videoHeight)}function A(a){var b='Please upgrade to the latest {0} plug-in by <a href="{1}">clicking here</a>.';if(a===n.Platform.FLASH){b=b.replace('{0}','Flash');b=b.replace('{1}','http://www.adobe.com/go/getflashplayer?redirect='+location.href)}else if(a===n.Platform.SILVERLIGHT){b=b.replace('{0}','Silverlight');b=b.replace('{1}','http://go.microsoft.com/fwlink/?LinkID=124807')}this._1.innerHTML='<p class="hdplayer-plugin-update">'+b+'</p>'}function G(a,b,c){this._1=a;if(typeof this._1==='string')this._1=t.getElementById(a);if(!this._1)throw new Error('Error initializing HDPlayer: Specified container element not found!');this._6=b||n.Platform.FLASH;this.options=d.Object.extend({id:'hdplayer_'+String(+new Date+Math.random()),playerUrl:s,expressInstallerUrl:C,videoWidth:320,videoHeight:180,videoUrl:null,autobahnVideoUrl:null,playlistUrl:null,thumbnailImageUrl:null,caption:null,bgColor:'#FFFFFF',autoplay:false,bufferTime:5,throttleKbps:1500,allowSmoothing:false},c||{});if(this._6===n.Platform.FLASH){if(typeof swfobject==='undefined')throw new Error('Error initializing HDPlayer: SWFObject 2.0+ is required!');}else if(this._6===n.Platform.SILVERLIGHT){if(typeof Silverlight==='undefined')throw new Error('Error initializing HDPlayer: Silverlight.js required!');}if(typeof n.instances==='undefined')n.instances=[];n.instances.push(this)}function w(a,b){d.Object.extend(this.options,a||{});y.call(this);if(this._6===n.Platform.FLASH){var c=d.Element.firstDescendant(this._1);if(c)swfobject.removeSWF(c.id);if(!swfobject.hasFlashPlayerVersion(j))return A.apply(this,[n.Platform.FLASH]);if(!/\.swf/i.test(this.options.playerUrl))this.options.playerUrl=s;z.call(this)}else if(this._6===n.Platform.SILVERLIGHT){if(!Silverlight.isInstalled(m))return A.apply(this,[n.Platform.SILVERLIGHT]);if(!/\.xap/i.test(this.options.playerUrl))this.options.playerUrl=D;u.call(this)}}function i(){var a=N.call(arguments,0),b=a.shift();var c=this._b.CallFunction('<invoke name="'+b+'" returntype="javascript">'+__flash__argumentsToXML(a,0)+'</invoke>');if(typeof c!=='undefined')return eval(c)}function I(){return this._1}function J(){return this._6}function L(){return this._b}n=d.Autobahn.Players.HDPlayer=d.Class.create({'initialize':G,'build':w,'getContainer':I,'getPlatform':J,'getPlayer':L,'remote':i,'_j':r})})();d.Autobahn.Players.HDPlayer.Platform={SILVERLIGHT:'SILVERLIGHT',FLASH:'FLASH'};(function(){if(typeof Prototype==='undefined')return;var i={version:'0.3.1.169'};o.BrowserDetect={'browser':d.Browser.name,'version':d.Browser.version,'OS':d.Browser.os,'OSVersion':d.Browser.osVersion,'altVersion':d.Browser.version};i.Utils={isBrowserSupported:function(){if(!i.Utils._e()){var a='<h1>'+BrowserDetect.browser+' version '+BrowserDetect.altVersion+' is not currently supported.</h1>';a+='<p>Please use one of the following supported browsers:</p>';a+='<ul>';if(i.Utils.isWindows()){a+='<li>Internet Explorer 6.0+</li><li>Firefox 2.0+</li>'}else if(i.Utils.isMac()){a+='<li>Safari 2.0+</li><li>Firefox 2.0+</li>'}else if(i.Utils.isLinux()){a+='<li>Firefox 2.0+</li>'}a+='</ul>';return'<div class="autobahnSupportedBrowsers">'+a+'</div>'}return true},_e:function(){if(this.isWindows()){switch(BrowserDetect.browser){case'Firefox':if(parseFloat(BrowserDetect.version)>=2)return true;break;case'Mozilla':return true;break;case'IE':if(parseFloat(BrowserDetect.version)>=6)return true;break}}else if(this.isMac()){switch(BrowserDetect.browser){case'Firefox':if(parseFloat(BrowserDetect.version)>=2)return true;break;case'Mozilla':return true;break;case'Safari':if(parseFloat(BrowserDetect.version)>400)return true;break}}else if(this.isLinux()){switch(BrowserDetect.browser){case'Firefox':if(parseFloat(BrowserDetect.version)>=2)return true;break;case'Mozilla':return true;break}}return false},isWindows:function(){return(BrowserDetect.OS.indexOf('Windows')>-1)},isMac:function(){return(BrowserDetect.OS.indexOf('Mac')>-1)},isLinux:function(){return(BrowserDetect.OS.indexOf('Linux')>-1)},isSilverlightInstalled:function(a){if(typeof Silverlight=='undefined'){alert('Silverlight.js is required to use AutobahnUtils.isSilverlightInstalled!');return}if(typeof a=='undefined')a='1.0';return Silverlight.isInstalled(a)}};i.Observer=Class.create({initialize:function(){throw new Error('Autobahn.Observer is no longer supported.  Please use the Detector directly.');}});i.TimedObserver=Class.create({initialize:function(){throw new Error('Autobahn.TimedObserver is no longer supported.  Please use the Detector directly.');}});(function(){var f=d.Autobahn.Detection.Detector,g=d.Autobahn.Detection.Version;function h(){if(this._7)return;s.call(this);if(this._a)return;r.call(this)}function l(){if(this._7)return;C.call(this);if(this._a)return;r.call(this)}function j(){if(this._7)return;D.call(this)}function k(){this.options.onTimeout(this)}function m(a){this.options.onError(a)}function q(a,b){if(typeof b=='undefined')b='';if(this.options.image){this.options.image=$(this.options.image);this.options.image.setAttribute('src',this.options.imagePath+a);this.options.image.setAttribute('alt',b)}}function s(){this.status='N';q.apply(this,[this.options.failImage,this.options.failCaption]);this.options.onNotFound(this)}function C(){this.status='U';this.peerVersion=g.parseAsObject(f.getInstance().getAutobahnVersion());q.apply(this,[this.options.upgradeImage,this.options.upgradeCaption]);this.options.onNeedsUpgrade(this)}function D(){this.status='P';this.peerVersion=g.parseAsObject(f.getInstance().getAutobahnVersion());this.stop();q.apply(this,[this.options.passImage,this.options.passCaption]);this.options.onPassed(this);E.bind(this).delay(1)}function E(){if((this.options.redirectAfterPass!=false)&&(!this.options.redirectAfterPass.empty()))t.location=this.options.redirectAfterPass}function F(a){this.options={requiredVersion:'4.3.1.36',autoDownload:false,macInstallerURL:'http://updates.swarmcast.net/swarmcast/current/autobahn.dmg',windowsInstallerURL:'http://updates.swarmcast.net/swarmcast/current/AutobahnAcceleratorInstall.exe',redirectAfterPass:false,timeout:-1,requestTimeout:1000,checkProxy:true,enablePortRangeDetection:true,minPort:8001,maxPort:8005,startPort:8001,onError:Prototype.emptyFunction,onNotFound:Prototype.emptyFunction,onNeedsUpgrade:Prototype.emptyFunction,onPassed:Prototype.emptyFunction,onTimeout:Prototype.emptyFunction,image:null,imagePath:'',failImage:'autobahnDetectorFail.jpg',upgradeImage:'autobahnDetectorUpgrade.jpg',restartImage:'autobahnDetectorRestart.jpg',passImage:'autobahnDetectorPass.jpg',failCaption:'Autobahn Not Found',upgradeCaption:'Autobahn Needs Upgrade',passCaption:'Autobahn Detected',showDownload:false,installerURL:'',showInstaller:false,installerContainer:null,installerOptions:{},useInstallerOverride:false,interval:1,onRestartRequired:Prototype.emptyFunction,restartCaption:'Autobahn Requires Browser Restart',peerJSUrl:'http://local.swarmcast.net:8001/protected/api/js/ping.js',peerImgUrl:'http://local.swarmcast.net:8001/protected/api/img/ping.gif',proxyJSUrl:'http://proxyapi.swarmcast.net/api/js/ping.js',proxyImgUrl:'http://proxyapi.swarmcast.net/api/img/ping.gif',proxyRequired:false};Object.extend(this.options,a||{});var b=f.getInstance();b.addEventListener(f.Event.AUTOBAHN_MISSING,h.bind(this));b.addEventListener(f.Event.AUTOBAHN_UPDATE_REQUIRED,l.bind(this));b.addEventListener(f.Event.AUTOBAHN_VERSION_CURRENT,j.bind(this));b.addEventListener(f.Event.AUTOBAHN_DETECTOR_TIMEOUT,k.bind(this));this.status='N';this.peerVersion=null;this._7=true;this._a=false;i.Detections.push(this);o.AutobahnDetectionHandle=this}function x(){return i.Detections.indexOf(this)}function v(a){Object.extend(this.options,a||{});this._7=false;this._a=false;f.getInstance().start({requiredVersion:this.options.requiredVersion,timeout:this.options.timeout,requestTimeout:this.options.requestTimeout,checkProxy:this.options.checkProxy,enablePortRangeDetection:this.options.enablePortRangeDetection,minPort:this.options.minPort,maxPort:this.options.maxPort,startPort:this.options.startPort});return this}function n(){this._7=true;f.getInstance().stop();return this}function r(a){Object.extend(this.options,a||{});if(this.options.autoDownload||this.options.showDownload){this.startDownload();this._a=true;return this}}function p(){return i.Detection.getAutobahnInstallUrl.apply(this,arguments)}function z(){return i.Detection.loadAutobahnInstall.apply(this,arguments)}function u(){return f.getInstance().getAutobahnVersion()}function y(){if(!this._8){this._8=new Element('iframe').setStyle({position:'absolute',top:'-5px',left:'-5px',width:0,height:0,border:0});$(t.body).insert(this._8)}if(d.Browser.os.indexOf('Windows')>-1){if(!this.options.installerURL.empty())this.options.windowsInstallerURL=this.options.installerURL;this._8.src=this.options.windowsInstallerURL}else if(d.Browser.os.indexOf('Mac')>-1){if(!this.options.installerURL.empty())this.options.macInstallerURL=this.options.installerURL;this._8.src=this.options.macInstallerURL}if(Prototype.Browser.Opera)this._8.location=this.downloadIframe.src}function A(){return f.getInstance().getAutobahnHost()}function G(){return f.getInstance().getAutobahnPort()}function w(){return f.getInstance().getAutobahnBaseUrl()}if(typeof i.Detections=='undefined')i.Detections=[];o.AutobahnDetectionHandle=null;i.Detection=Class.create({'initialize':F,'getDetectionIndex':x,'start':v,'stop':n,'startInstallationProcess':r,'getAutobahnInstallUrl':p,'loadAutobahnInstall':z,'getAutobahnVersion':u,'startDownload':y,'getAutobahnHost':A,'getAutobahnPort':G,'getAutobahnBaseUrl':w});Object.extend(i.Detection,{getAutobahnInstallUrl:function(a,b){if(typeof a=='undefined')a=true;var c='http://www.getautobahn.com/install';if(b)c+='/'+b;if(a)c+='?redirecturl='+t.location;return c},loadAutobahnInstall:function(){if(typeof arguments[0]=='undefined')arguments[0]=true;t.location=this.getAutobahnInstallUrl.apply(this,arguments)},ready:function(){return(i.Detections[0]!=null)}});o.AutobahnDetectionReady=i.Detection.ready})();i.Installer=Class.create({initialize:function(){throw new Error('Autobahn.Installer is no longer supported.  Please use an alternate way to install Autobahn.');}});i.Installer.Page=Class.create({initialize:function(){throw new Error('Autobahn.Installer.Page is no longer supported.');}});i.PlayerBase={};(function(){var c=d.Autobahn.Players.HDPlayer;function f(a){if(typeof a==='undefined')return;if(a.platform==='flash'){a.platform=c.Platform.FLASH;if(a.mediaGroupFilename)a.autobahnVideoUrl='http://local.swarmcast.net:8001/?swarm:mediagroup_uri='+a.mediaGroupFilename}else if(a.platform==='silverlight'){a.platform=c.Platform.SILVERLIGHT;if(a.autobahnVideoFilename)a.autobahnVideoUrl='mms://local.swarmcast.net:8001/protected/content/live?streambase='+a.autobahnVideoFilename}a.playerUrl=a.playerFilename;a.expressInstallerUrl=a.expressInstallFilename;if(a.videoFilename)a.videoUrl=a.videoFilename;if(a.playlistFilename)a.playlistUrl=a.playlistFilename;if(a.imageFilename)a.thumbnailImageUrl=a.imageFilename;if(!/#/.test(a.bgColor))a.bgColor='#'+a.bgColor;if(a.useCustomSwfDimensions)a.useCustomPluginDimensions=a.useCustomSwfDimensions;if(a.swfWidth)a.pluginWidth=a.swfWidth;if(a.swfHeight)a.pluginHeight=a.swfHeight;return a}function g(a,b){this.options=Object.extend({platform:'flash',id:'hdplayer_'+String(+new Date+Math.random()),environment:'production',playerFilename:'http://www.swarmcast.com/swf/AutobahnHDPlayer.swf',expressInstallFilename:'http://www.swarmcast.com/swf/expressInstall.swf',videoWidth:320,videoHeight:180,videoFilename:null,autobahnVideoFilename:null,playlistFilename:null,imageFilename:null,caption:null,bgColor:'FFFFFF',autoplay:false,bufferTime:5,throttleKbps:1500,allowSmoothing:false,requiredFlashVersion:'9.0.115',recommendedFlashVersion:'9.0.124',requiredSilverlightVersion:'2.0.31005',recommendedSilverlightVersion:'2.0.31005',autobahnRequired:false,autobahnDetectionOptions:{},autobahnInstallerOptions:{},useCustomPluginDimensions:false,pluginWidth:0,pluginHeight:0},b||{});this.options=f(this.options);this.element=$(a);this._c=new c(this.element,this.options.platform,this.options);i.HDPlayers.push(this)}function h(){return i.HDPlayers.indexOf(this)}function l(a){Object.extend(this.options,a||{});this.options=f(this.options);this._c.build(this.options);this.player=this._c.getPlayer();return this}function j(){return this._c.remote.apply(this,arguments)}if(typeof i.HDPlayers==='undefined')i.HDPlayers=$A();i.HDPlayer=Class.create({'initialize':g,'build':l,'remote':j,'getHDPlayerIndex':h})})();i.LivePlayer=Class.create({initialize:function(){throw new Error('Autobahn.LivePlayer is no longer supported.  Please refer to the HDPlayer.');}});if(typeof i.SimplePlayers==='undefined')i.SimplePlayers=$A();i.SimplePlayer=Class.create({initialize:function(a,b){if(typeof swfobj!=='undefined')swfobj.replaceSwfObject();if(typeof swfobject==='undefined')throw new Error('SWFObject 2.0 is required!  Please add a reference to this file.');this.options=Object.extend({id:'simpleplayer_'+String(+new Date+Math.random()),environment:'production',requiredFlashVersion:'9.0.115',playerFilename:'http://andylemay.com/dev/sc/simpleplayer/AutobahnSimplePlayer.swf',expressInstallFilename:'http://www.swarmcast.com/swf/expressInstall.swf',videoWidth:320,videoHeight:180,bgColor:'FFFFFF',autoplay:false,bufferTime:5,throttleKbps:1500,allowHardwareAcceleration:true,allowSmoothing:false,allowEventBroadcasting:true,onReady:Prototype.emptyFunction,onStatus:Prototype.emptyFunction,onMetaData:Prototype.emptyFunction,recommendedFlashVersion:'9.0.124',autobahnRequired:false,autobahnDetectionOptions:{},autobahnInstallerOptions:{}},b||{});this.element=$(a);if(!this.element)throw new Error('Specified container element not found!');i.SimplePlayers.push(this)},getSimplePlayersIndex:function(){return i.SimplePlayers.indexOf(this)},build:function(a){Object.extend(this.options,a||{});if(typeof this.element.down(0)!=='undefined')swfobject.removeSWF(this.element.down(0).id);this.element.update();if(!swfobject.hasFlashPlayerVersion(this.options.requiredFlashVersion)){this.element.update('<p class="hdplayer-plugin-update">Please upgrade to the latest Flash plug-in by <a href="http://www.adobe.com/go/getflashplayer?redirect='+location.href+'">clicking here</a>.</p>');return this}this._f();return this},remote:function(){var a=$A(arguments),b=a.shift();var c=this.player.CallFunction('<invoke name="'+b+'" returntype="javascript">'+__flash__argumentsToXML(a,0)+'</invoke>');if(typeof c!=='undefined')return eval(c)},playMediaDescriptor:function(a){return this.playAutobahnURL('http://local.swarmcast.net:8001/?swarm:mediagroup_uri='+a)},_f:function(a){var b=this.getSimplePlayersIndex();var c={env:this.options.environment,autoplay:this.options.autoplay,bgColorHex:this.options.bgColor,bufferSize:this.options.bufferTime,throttleKbps:this.options.throttleKbps,allowHardwareAcceleration:this.options.allowHardwareAcceleration,allowSmoothing:this.options.allowSmoothing,allowEventBroadcasting:this.options.allowEventBroadcasting,cbReady:'Autobahn.SimplePlayers['+b+']._g',cbStatus:'Autobahn.SimplePlayers['+b+']._h',cbMetaData:'Autobahn.SimplePlayers['+b+']._k'};var f={allowFullScreen:'true',allowScriptAccess:'always'};var g={id:this.options.id,bgcolor:'#'+this.options.bgColor};var h='';if(a){h=this.options.expressInstallFilename;Object.extend(c,{onDeclineCallback:'Autobahn.SimplePlayers['+b+']._d()'});Object.extend(g,{xiRedirectUrl:location.href})}if(typeof this.element.down(0)!=='undefined')swfobject.removeSWF(this.element.down(0).id);var l=new Element('div');this.element.insert({top:l});swfobject.embedSWF(this.options.playerFilename,l.identify(),this.options.videoWidth,this.options.videoHeight,this.options.requiredFlashVersion,h,c,f,g);this.player=this.element.down()},_g:function(){var c=this;$A(this.player.getMethodList())._l(function(b){this[b]=(function(){return function(){var a=$([b]).concat($A(arguments));c.remote.apply(c,a)}})()}.bind(this));this.options.onReady(arguments)},_h:function(){this.options.onStatus(arguments)},_m:function(){this.options.onMetaData(arguments)},_d:function(){swfobject.expressInstallCallback();this.build()}});o.AutobahnUtils=i.Utils;o.AutobahnObserver=Class.create(i.Observer,{initialize:function($super){var a=$A(arguments);$super=a.shift();console.log('Depreciation Warning: AutobahnObserver has been depreciated! Please use Autobahn.Observer instead.');$super.apply(this,a)}});o.AutobahnTimedObserver=Class.create(i.TimedObserver,{initialize:function($super){var a=$A(arguments);$super=a.shift();console.log('Depreciation Warning: AutobahnTimedObserver has been depreciated! Please use Autobahn.TimedObserver instead.');$super.apply(this,a)}});o.AutobahnDetection=Class.create(i.Detection,{initialize:function($super){var a=$A(arguments);$super=a.shift();console.log('Depreciation Warning: AutobahnDetection has been depreciated! Please use Autobahn.Detection instead.');$super.apply(this,a)}});o.AutobahnInstaller=Class.create(i.Installer,{initialize:function($super){var a=$A(arguments);$super=a.shift();console.log('Depreciation Warning: AutobahnInstaller has been depreciated! Please use Autobahn.Installer instead.');$super.apply(this,a)}});o.AutobahnHDPlayer=Class.create(i.HDPlayer,{initialize:function($super){var a=$A(arguments);$super=a.shift();console.log('Depreciation Warning: AutobahnHDPlayer has been depreciated! Please use Autobahn.HDPlayer instead.');$super.apply(this,a)}});o.AutobahnLivePlayer=Class.create(i.LivePlayer,{initialize:function($super){var a=$A(arguments);$super=a.shift();console.log('Depreciation Warning: AutobahnLivePlayer has been depreciated! Please use Autobahn.LivePlayer instead.');$super.apply(this,a)}});o.AutobahnSimplePlayer=Class.create(i.SimplePlayer,{initialize:function($super){var a=$A(arguments);$super=a.shift();console.log('Depreciation Warning: AutobahnSimplePlayer has been depreciated! Please use Autobahn.SimplePlayer instead.');$super.apply(this,a)}});o.Autobahn=i})();o.Swarmcast=d})(this);
