(function(){var a=this;a.XMLData=[];a.VideoState;a.index=0;var f=Moxi.SiteRoot,b=null,c=null,i=Moxi.XMLRoot+"player_config.xml",d=0,j=0,h="video/{0}/timeviewed/{1}",m,n,o;function e(d){var c={},a=d.attributes;if(a)for(var b=0;b<a.length;b++)c[a[b].name]=a[b].value;return c}function k(b){$.ajax({url:b,type:"GET",dataType:"xml",timeout:1000,success:function(c){var b,d,f;$(c).find("track").each(function(){b={};b.attr=e(this);$(this).children().each(function(){NodeName=l(this.nodeName);b[NodeName]=e(this);b[NodeName].text=$(this).text()?$(this).text().ParseHTML():$(this).text()});a.XMLData.push(b)});if(isDefined(window.onPlaylistLoad))window.onPlaylistLoad(a.XMLData)}})}function l(b){var a={};a.creator="author";a.annotation="description";a.duration="duration";a.location="file";a.info="link";if(a[b])return a[b];return b}function g(){if(d&&a.XMLData[a.index].attr.gatrack){var b=Math.round(d),c=a.XMLData[a.index].attr.gatrack;Moxi.TrackEvent(h.format(c,b))}}a.Load=function(l,g,b,e,d){c=l;var h=$("#"+c);e=e?e:h.width();d=d?d:h.height();a_Options={};a_Options.wmode=a_Options.wmode?a_Options.wmode:"transparent";a_Options.allowScriptAccess=a_Options.allowScriptAccess?a_Options.allowScriptAccess:"sameDomain";a_Options.allowFullScreen=a_Options.allowFullScreen?a_Options.allowFullScreen:"true";b.file=g;b.config=i;b.id=c;var j={id:c,name:c};if(g.match(/\.xml$/gi))k(g);swfobject.embedSWF(f+"flash/player.swf",c,e,d,"9",f+"flash/expressInstall.swf",b,a_Options,j,a.onSWFLoad)};a.onSWFLoad=function(a){if(!a.success){$("#"+a.id).css("background-color","#000000");$("#"+a.id).html('<p>This website requires Flash Player 9 or higher and JavaScript enabled in your browser.</p><p>Visit <a href="http://get.adobe.com/flashplayer/">http://get.adobe.com/flashplayer/</a> to download the latest version.</p>')}if(isDefined(window.onSWFLoad)&&Function.Is(window.onSWFLoad))window.onSWFLoad(a)};a.Play=function(a){if(String.Is(a))b.sendEvent("LOAD",a);else if(Number.Is(a))b.sendEvent("ITEM",a);else b.sendEvent("PLAY")};a.onVideoItem=function(b){g();a.index=b.index;d=0;if(isDefined(window.onVideoItem)&&Function.Is(window.onVideoItem))window.onVideoItem(b)};a.onVideoStop=function(){g();if(isDefined(window.onVideoStop)&&Function.Is(window.onVideoStop))window.onVideoStop()};a.onVideoStateChange=function(b){a.VideoState=b;if(isDefined(window.onVideoStateChange)&&Function.Is(window.onVideoStateChange))window.onVideoStateChange(b)};a.onVideoTimer=function(b){if(a.VideoState.newstate.Eq("PLAYING"))if(b.position){j=b.duration;d=b.position}if(isDefined(window.onVideoTimer)&&Function.Is(window.onVideoTimer))window.onVideoTimer(b)};a.onVideoLoad=function(){if(isDefined(window.onVideoLoad)&&Function.Is(window.onVideoLoad))window.onVideoLoad()};window.playerReady=function(a){b=document.getElementById(a.id);b.addControllerListener("ITEM","Moxi.Video.onVideoItem");b.addControllerListener("PLAY","Moxi.Video.onVideoPlay");b.addControllerListener("STOP","Moxi.Video.onVideoStop");b.addModelListener("STATE","Moxi.Video.onVideoStateChange");b.addModelListener("TIME","Moxi.Video.onVideoTimer");b.addViewListener("NEXT","Moxi.Video.onVideoNext");if(isDefined(window.onPlayerLoaded)&&Function.Is(window.onPlayerLoaded))window.onPlayerLoaded(a)};window.onunload=function(){swfobject.removeSWF(c)}}).add("Moxi.Video")