(function(){var a=this.avpl={};a._context=null;a._contexts=[];a.setContext=function(b){a._context=b};a.getContext=function(b){return(!b)?a._context:(a._contexts[b-1])?a._contexts[b-1]:a._context};a.addContext=function(b){a._contexts.push(b)};a.log=function(b){};a.requiredFlashVersion=10;a.flashVersion=(function(){var b="0 r0";if(navigator.plugins["Shockwave Flash"]){var b=navigator.plugins["Shockwave Flash"].description}try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(c){}return parseInt(b.match(/\d+/g)[0])})();a.loadStylesheet=function(b){a._$.createElement("link",{href:b,type:"text/css",rel:"stylesheet"}).inject(document.getElementsByTagName("head")[0])};a.loadJavaScript=function(b){a._$.createElement("script",{src:b,type:"text/javascript"}).inject(document.getElementsByTagName("head")[0])};a.events={registeredEvents:{},register:function(b,c){this.registeredEvents[b]=c},unregister:function(b){delete this.registeredEvents[b]},invoke:function(c,b){var d=this.registeredEvents[c]||function(){};d.apply(this,b||[])},mediaLoadEvent:function(){this.invoke("load")},progressEvent:function(b,d,c){this.invoke("progress",[b,d,c])},progressFinishedEvent:function(){this.invoke("loaded")},timelineEvent:function(b,d,c){this.invoke("playback",[b,d,c])},timelineFinishedEvent:function(){this.invoke("end")},cuePointEvent:function(b){this.invoke("cuepoint",b)},metaDataEvent:function(b){this.invoke("metadata",b)}};a.api={isCallable:function(c){var b=a.getContext(c);if(b!==undefined&&b.nodeType===1&&b.tagName.toLowerCase()==="object"){return true}return false},load:function(c,e,b,d){var e=e||250;var b=b||350;if(this.isCallable(d)){a.getContext(d).loadMedia(c,e,b);this.setSize(e,b,true);this.play();this.stop()}},unload:function(b){if(this.isCallable(b)){a.getContext(b).unloadMedia()}},setSize:function(e,b,d,c){if(this.isCallable(c)){d=(d)?true:false;if(!d){a.getContext(c).setSize(e,b)}a.getContext(c).setAttribute("width",e);a.getContext(c).setAttribute("height",b)}},getSize:function(b){if(this.isCallable(b)){return a.getContext(b).getSize()}},setVolume:function(c,b){if(this.isCallable(b)){a.getContext(b).setVolume(c)}},getVolume:function(b){if(this.isCallable(b)){return a.getContext(b).getVolume()}},toggleMute:function(b){if(this.isCallable(b)){return a.getContext(b).toggleMute()}},isMuted:function(b){if(this.isCallable(b)){return a.getContext(b).isMediaMuted()}},isPlaying:function(b){if(this.isCallable(b)){return a.getContext(b).isMediaPlaying()}},play:function(b){if(this.isCallable(b)){if(!this.isPlaying()){a.getContext(b).playMedia()}}},togglePlay:function(b){if(this.isCallable(b)){if(this.isPlaying()){this.pause()}else{this.resume()}}},pause:function(b){if(this.isCallable(b)){a.getContext(b).pauseMedia()}},stop:function(b){if(this.isCallable(b)){a.getContext(b).stopMedia()}},seek:function(d,c,b){if(this.isCallable(b)){var c=(c)?true:false;a.getContext(b).seekMedia(d,c)}},resume:function(b){if(this.isCallable(b)){a.getContext(b).resumeMedia()}}};a.dom=function(b){this.$elements=[];this.$eventCache={};this.select(b,true);return this};a.dom.prototype={id:function(b){return document.getElementById(b)},query:function(e,f){var f=(f instanceof Array)?f:[];for(var b=0;b<e.length;b++){var d=e[b];if(typeof d=="object"){var c=d}else{if(typeof d=="string"){var c=document.getElementById(d)}}f.push(c)}return f},select:function(c,b){if(c!==undefined){var c=(typeof c=="string")?c.split(","):c;var b=(b)?this.$elements:[];if(c!==window||c!==document){for(var d=0;d<c.length;d++){if(typeof c[d]=="string"){c[d]=c[d].replace(/^\s+/,"").replace(/\s+$/,"")}}}this.$elements=this.query(c,b)}return this},each:function(b){for(var c=0;c<this.$elements.length;c++){b.call(this,this.$elements[c],c)}return this},set:function(c){var b=this;this.each(function(e){for(var d in c){var h=c[d];switch(d){case"events":for(var g in h){new a.dom([e]).addEvent(g,h[g])}break;case"styles":for(var f in h){new a.dom([e]).setStyle(f,h[f])}break;case"html":e.innerHTML=h;break;default:e.setAttribute(d,h);break}}})},get:function(b){var c={};this.each(function(f){var d={};for(var g=0;g<b.length;g++){var e=b[g];d[e]=f.getAttribute(e)}c[f]=d});return c},injectBefore:function(d,c){var b=c.parentNode;if(b){b.insertBefore(d,c)}return this},injectAfter:function(d,c){var b=c.parentNode;if(b){b.insertBefore(d,c.nextSibling)}return this},injectTop:function(c,b){b.insertBefore(c,b.firstChild);return this},injectBottom:function(c,b){b.appendChild(c);return this},inject:function(d,b){var c=this;this.each(function(f){var e=e||"bottom";e="inject"+e.substr(0,1).toUpperCase()+e.substr(1);c[e](f,d)});return this},addEvent:function(d,e){var c=this;var b=function(f){if(window.addEventListener){f.addEventListener(d,e,false)}else{if(window.attachEvent){f.attachEvent("on"+d,function(){e.call(f,window.event)})}}};this.each(function(f){b(f);if(!c.$eventCache[f]){c.$eventCache[f]={}}c.$eventCache[f][d]=e});return this},removeEvent:function(d){var c=this;var b=function(e){var f=c.$eventCache[e][d];if(window.removeEventListener){e.removeEventListener(d,f,false)}else{if(window.detachEvent){e.detachEvent("on"+d,f)}}};this.each(function(e){b(e);delete c.$eventCache[e][d]});return this},setStyle:function(c,b){this.each(function(d){d.style[c]=b});return this},getStyle:function(){var c={};var b=arguments;this.each(function(d){for(var g=0;g<b.length;g++){var f=b[g];var e=d.style[f];if(typeof e=="string"){c[f]=e}}});return c},hasClass:function(e,d){var b=d||0;var c=this.$elements[b];return c.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))},addClass:function(c){var b=this;this.each(function(d,e){if(!b.hasClass(c,e)){d.className+=" "+c}d.className.replace(/ +/g," ")});return this},removeClass:function(b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");this.each(function(d){d.className=d.className.replace(c,"")});return this},toggleClass:function(c){var b=this;this.each(function(e,d){if(b.hasClass(c,d)){b.removeClass(c)}else{b.addClass(c)}})},createElement:function(b,d){var c=document.createElement(b);this.select([c],false).set(d);return this},removeElement:function(b){this.each(function(c){var d=c.parentNode;if(d){d.removeChild(c)}});if(b){this.$elements=[]}return this}};a.dom.ready=function(b){var c=false;var d=function(h){var f=function(){if(c){return}c=true;return h()};var j=function(){if(c){return}try{document.documentElement.doScroll("left")}catch(k){setTimeout(j,1);return}f()};if(document.readyState==="complete"){return f()}if(window.addEventListener){document.addEventListener("DOMContentLoaded",f,false);window.addEventListener("load",f,false)}else{if(window.attachEvent){document.attachEvent("onreadystatechange",f);window.attachEvent("onload",f);var g=false;try{g=(window.frameElement===null)}catch(i){}if(document.documentElement.doScroll&&g){return j()}}}};return d(b)};a.dom.stopEvent=function(b){if(b===undefined){var b=window.event}if(b.stopPropagation){b.stopPropagation();b.preventDefault()}else{b.cancelBubble=true;b.returnValue=false}return false};a.dom.loaded=function(c){var b=(window.onload)?window.onload:null;try{window.onload=(function(){if(b!==null){b()}setTimeout(c,100)})()}catch(d){}};a.$=function(){return new a.dom(arguments)};a._$=a.$();a.ui={showLoading:function(){a._$.id("avpl_loading").style.display="block"},hideLoading:function(){a._$.id("avpl_loading").style.display="none"},showControls:function(){a._$.id("avpl_controls").style.display="block"},hideControls:function(){a._$.id("avpl_controls").style.display="none"},stateLoading:function(){this.showLoading();this.hideControls()},stateControls:function(){this.hideLoading();this.showControls()},statePlaying:function(){a._$.id("play").setAttribute("class","pause")},statePaused:function(){a._$.id("play").removeAttribute("class")},setFrame:function(b,c){a._$.id(c||"avpl").style.background='transparent url("'+b.substr(0,b.length-3)+'png") no-repeat'},removeFrame:function(b){a._$.id(b||"avpl").style.background="none"},activate:function(){var b=this;a.$("play").addEvent("click",function(c){a.dom.stopEvent(c);a.api.togglePlay();if(a.api.isPlaying()){b.statePlaying()}else{b.statePaused()}});a.$("stop").addEvent("click",function(c){a.dom.stopEvent(c);a.api.stop();b.statePaused()})}};a.embed=function(c,d,e,b){if(swfobject===undefined){a.loadJavaScript("http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js")}var e=e||function(){};a.dom.ready(function(){swfobject.embedSWF(d,c,"1","1","10.0.0","expressInstall.swf",null,{wMode:"transparent",allowScriptAccess:"always"},null,function(f){if(f.success){a.addContext(f.ref);if(b===true){a.setContext(f.ref)}e(f)}})})}})(window);
