/* Viocorp Enhanced Media Player
 * Created by: Sugendran Ganess, Kelly Brennan
 * Additions by: Mandy Scott
 */
var Vio=(function(){var A="undefined",B=window,g=document;function l(C){return C.constructor==String?g.getElementById(C):C}function d(G,D,E){var F=g.createElement(G);if(typeof(D)!=A){if(D!=null&&D!=""){F.className=D}if(typeof(E)!=A){for(var C in E){if(typeof(F.style[C])!=A){F.style[C]=E[C]}}}}return F}function e(C){return g.createTextNode(C)}function j(C){while(C.hasChildNodes()){C.removeChild(C.firstChild)}}function m(D){var C=D.getElementsByTagName("object");if(C.length>0){return C[0]}return null}function u(C){if(typeof(window.console)!=A&&typeof(window.console.log)!=A){console.log(C)}}var c=(function(){var C=navigator.userAgent.toLowerCase();return{usesAttachEvent:(typeof(g.attachEvent)!=A),usesEventListener:(typeof(g.addEventListener)!=A),webkit:(/webkit/.test(C)),firefox:((/firefox/i).test(C)),iPhone:((/iPhone/i).test(C)),iPad:((/iPad/i).test(C)),msie:(function(){var F,G=3,E=document.createElement("div"),D=E.getElementsByTagName("i");while(E.innerHTML="<!--[if gt IE "+(++G)+"]><i></i><![endif]-->",D[0]){}return(G>4)}())}})();var f=(function(){var C=navigator.userAgent.toLowerCase();return{iPhone:((/iPhone/i).test(C)),iPad:((/iPad/i).test(C))}})();function o(){var C=document.getElementsByTagName("script");return C[C.length-1]}function r(){}var s=false,x=new Array();function h(){if(typeof(Vio)==A){setTimeout(arguments.callee,10)}else{if(!s){s=true;r();for(var D=0;D<x.length;D++){try{x[D]()}catch(C){u(C)}}Vio.Event.Trigger("Render")}}}function w(D){if(s){try{D()}catch(C){u(C)}}else{x.push(D)}}function b(C){if(B.addEventListener){B.addEventListener("load",C,false)}else{if(B.attachEvent){B.attachEvent("onload",C)}else{if(typeof B.onload=="function"){var D=B.onload;B.onload=function(){D();C()}}else{B.onload=C}}}}(function(){if(typeof(g.readyState)!=A&&g.readyState=="complete"){h()}else{if(!s){if(g.addEventListener){g.addEventListener("DOMContentLoaded",function(){g.removeEventListener("DOMContentLoaded",arguments.callee,false);h()},false)}else{if(document.attachEvent){g.attachEvent("onreadystatechange",function(){if(g.readyState==="complete"){g.detachEvent("onreadystatechange",arguments.callee);h()}});if(document.documentElement.doScroll&&B==top){(function(){if(!s){try{g.documentElement.doScroll("left")}catch(C){return setTimeout(arguments.callee,20)}h()}})()}}}b(h)}}})();function v(){this.length=0}(function(){var D=["push","pop","shift","unshift","slice","splice","join","sort"];for(var C=0;C<D.length;C++){(function(E){v.prototype[E]=function(){return Array.prototype[E].apply(this,arguments)}})(D[C])}})();function q(D,C){return D.className.match(new RegExp("(\\s|^)"+C+"(\\s|$)"))}function a(D,C){if(!Vio.HasClass(D,C)){D.className+=" "+C}}function y(D,C){if(Vio.HasClass(D,C)){var E=new RegExp("(\\s|^)"+C+"(\\s|$)");D.className=D.className.replace(E," ")}}function p(C,D){var E=C;if(typeof(E)=="string"){E=document.getElementById(C)}var F;if(E.currentStyle){F=E.currentStyle[D]}else{if(window.getComputedStyle){F=document.defaultView.getComputedStyle(E,null).getPropertyValue(D)}}return F}function n(E){var F=parseInt(E.substr(1,2),16);var D=parseInt(E.substr(3,2),16);var C=parseInt(E.substr(5,2),16);return({r:F,g:D,b:C})}function z(D){D=D.replace(/^\s+/,"");for(var C=D.length-1;C>=0;C--){if(/\S/.test(D.charAt(C))){D=D.substring(0,C+1);break}}return D}return{$ge:l,$go:m,$ce:d,$ct:e,$ee:j,ObjArray:v,HasClass:q,AddClass:a,RemoveClass:y,Trim:z,GetStyle:p,GetRgbValue:n,Extend:function k(F,E,D){if(typeof(E)==A){E=F;F=Vio}if(typeof(D)==A){D=false}for(var C in E){if(D===true&&typeof(F[C])!=A&&F[C].constructor==Object){k(F[C],E[C],true)}else{F[C]=E[C]}}return F},OnReady:w,Log:u,Rand:function(){return Math.floor(Math.random()*10000)+Math.floor(Math.random()*100)},Browser:c,Device:f,GetScriptTag:o,Config:{}}})();Vio.OnReady(function(){VioLoader.Run()});Vio.Extend(Vio,{Event:(function(){var UNDEF="undefined",eventStack=new Array();function EvtCallback(target,fn,data){this.target=target;this.callback=fn;this.data=data}function Evt(evtName){this.Name=evtName;this.callbacks=new Array()}function findEvent(evtName){for(var i=0;i<eventStack.length;i++){if(eventStack[i].Name==evtName){return eventStack[i]}}}function removeCallbacks(evt,target,fn){var i=0;var callbacks=[];while(i<evt.callbacks.length){if(evt.callbacks[i].target==target&&((fn==true)||(evt.callbacks[i].callback==fn))){var evtCallback=evt.callbacks.splice(i,1);callbacks.push(evtCallback.callback)}else{i++}}return callbacks}return{Bind:function(target,evtName,callback,data){var evt=findEvent(evtName);if(evt==null){evt=new Evt(evtName);eventStack.push(evt)}evt.callbacks.push(new EvtCallback(target,callback,data||{}));if(target!=null){if(target.addEventListener){target.addEventListener(evtName,function(evt){evt=evt||window.event;return !!Vio.Event.Trigger(evtName,null,target,evt)},false)}else{if(target.attachEvent){target.attachEvent("on"+evtName,function(evt){evt=evt||window.event;return !!Vio.Event.Trigger(evtName,null,target,evt)})}else{return false}}}},Unbind:function(target,evtName,callback){var evt=findEvent(evtName);if(evt!=null){var callbacks=removeCallbacks(evt,target,typeof(callback)==UNDEF?true:callback);var i=callbacks.length;while(--i>-1){if(target.removeEventListener){target.removeEventListener(evtName,callbacks[i],false)}else{if(target.detachEvent){target.detachEvent("on"+evtName,callbacks[i])}else{return false}}}}},Trigger:function(evtName,val,evtTarget,evtData){var evt=findEvent(evtName);if(evt!=null){for(var i=0;i<evt.callbacks.length;i++){with(evt.callbacks[i]){try{if((typeof(evtTarget)!=UNDEF)&&(target!=evtTarget)){continue}var callbackData=evtData||{};Vio.Extend(callbackData,{value:val||"",data:data});var r=callback.call(target,callbackData);if(typeof(r)!=UNDEF&&r==false){return(false)}}catch(ex){Vio.Log(ex)}}}}}}})()});Vio.Extend((function(){function f(n){return n<10?"0"+n:n}function nativeVal(o){if(o.constructor==Date){return isFinite(o.valueOf())?o.getUTCFullYear()+"-"+f(o.getUTCMonth()+1)+"-"+f(o.getUTCDate())+"T"+f(o.getUTCHours())+":"+f(o.getUTCMinutes())+":"+f(o.getUTCSeconds())+"Z":null}else{return o.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,partial,value=holder[key];if(value&&typeof value==="object"){value=nativeVal(value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){for(i=0;i<value.length;i++){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":"["+partial.join(",")+"]";return v}for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+":"+v)}}}v=partial.length===0?"{}":"{"+partial.join(",")+"}";return v}}function parse(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}return{toJSON:function(value){return str("",{"":value})},parse:parse}})());Vio.Extend((function(){function a(b,d){var g=["January","February","March","April","May","June","July","August","September","October","November","December"],h=b.getMonth()+1,l=b.getFullYear(),e=b.getHours();function c(f){return f<10?"0"+f:f}function j(f,m){d=d.replace(f,m)}function k(f){return f.toString()}j(/y{4}/,l);j(/yy/,k(l).substr(2,2));j(/dd/,c(b.getDate()));if(d.indexOf("HH")>-1){j(/HH/,c(e))}if(d.indexOf("hh")>-1){j(/hh/,c(e>12?e-12:e==0?12:e))}j(/mm/,c(b.getMinutes()));j(/ss/,c(b.getSeconds()));if(d.indexOf("t")>-1){j(/t/,(e>11)?"pm":"am")}j(/M{4}/,g[h-1]);j(/MMM/,g[h-1].substr(0,3));j(/MM/,c(h));return d}return{FormatDate:a}})());Vio.Extend(Vio,{TimeSpan:(function(){function a(c){return((c<10)?"0":"")+c.toString()}var b=function(c){this.seconds=c};b.prototype.toString=function(c){if(typeof(c)=="undefined"){c="hh:mm:ss"}var d=Math.floor(this.seconds/3600);var e=Math.floor((this.seconds/60)-(d*60));var f=Math.round(this.seconds-(e*60));return c.replace(/ss/,a(f)).replace(/mm/,a(e)).replace(/hh/,d)};return b})()});Vio.Extend((function(){var UNDEF="undefined",log=Vio.Log;function getReq(url,data,fn,err){var xhr=(window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest());var params="";for(var a in data){if(params.length>0){params+="&"}params+=(a+"="+Vio.toJSON(data[a]))}xhr.open("GET",url+(url.match(/\?/)?"&":"?")+params,true);xhr.onreadystatechange=function(evt){if(xhr.readyState==4){if(xhr.status==200){try{var resp=eval("("+xhr.responseText+")");if(resp&&resp.d){if(resp.d.Error.length>0){err(resp.d.Error[0].Message)}else{fn(resp.d.Item,resp.d.ItemInfo)}}else{err("An invalid response was recieved")}}catch(e){log(e);err("An error occured parsing the result")}}else{err("Error loading URL")}}};xhr.setRequestHeader("Content-Type","application/json; charset=utf-8");xhr.send(null)}return{Ajax:function(url,data,callback,err){getReq(url,data||{},callback||log,err||log)}}})());Vio.Extend((function(){var UNDEF="undefined";function setParams(target,params){for(var a in params){if(typeof(target[a])!=UNDEF&&(target[a]==null||target[a].constructor!=Array)){target[a]=params[a]}}}function Thumbnail(o){if(typeof(o)!=UNDEF){setParams(this,o)}}Vio.Extend(Thumbnail.prototype,{Width:0,Height:0,Path:""});function Transcription(o){if(typeof(o)!=UNDEF){setParams(this,o)}}Vio.Extend(Transcription.prototype,{Id:0,Text:"",StartTime:0,Duration:0});function MediaUrl(o){if(typeof(o)!=UNDEF){setParams(this,o);var extRegex=(/^.*\.(\w{3}).*$/gi);var match=extRegex.exec(this.Url)||extRegex(this.Url);this.Extension=match[1].toLowerCase();this.Quality=this.Quality.toLowerCase();switch(this.Extension){case"ogg":this.MimeType="video/ogg";break;case"mp4":this.MimeType="video/mp4";break}}}Vio.Extend(MediaUrl.prototype,{Url:null,Quality:null,Duration:0,MediaType:null,Extension:null,MimeType:null});function MediaBase(o){if(typeof(o)!=UNDEF){setParams(this,o);this.Thumbnails=new Array();this.Keywords=new Array();this.Urls=new Array();this.Transcriptions=new Array();var dateRegex=new RegExp("/","g");if(dateRegex.test(this.DisplayTime)){this.DisplayTime=eval("(new "+this.DisplayTime.replace(dateRegex,"")+")")}this.LoadUrls(o.MediaUrls);for(var i=0;i<o.KeyWords.length;i++){this.Keywords.push(o.KeyWords[i])}for(var i=0;i<o.Thumbnails.length;i++){this.Thumbnails.push(new Thumbnail(o.Thumbnails[i]))}for(var i=0;i<o.Transcriptions.length;i++){this.Transcriptions.push(new Transcription(o.Transcriptions[i]))}function sortByStartTime(a,b){var x=a.StartTime;var y=b.StartTime;return((x<y)?-1:((x>y)?1:0))}this.Transcriptions.sort(sortByStartTime)}}Vio.Extend(MediaBase.prototype,{MediaId:null,DisplayTime:"",MediaTitle:"",MediaDescription:"",MediaType:"",AuthorName:"",Urls:[],Thumbnails:[],Keywords:[],Transcriptions:[],IsMatch:function(regEx){if(regEx.constructor==String){regEx=new RegExp(regEx,"igm")}if((regEx.test(this.MediaTitle))||(regEx.test(this.MediaDescription))){return true}else{for(var i=0;i<this.Keywords.length;i++){if(regEx.test(this.Keywords[i])){return true}}}return false},LoadUrls:function(mediaUrls){if(mediaUrls.length>0){for(var i=0;i<mediaUrls.length;i++){this.Urls.push(new MediaUrl(mediaUrls[i]))}}},HasUrl:function(extension){for(var i=0;i<this.Urls.length;i++){if(this.Urls[i].Extension==extension){return true}}return false},FindUrl:function(extension,quality){extension=extension.toLowerCase();quality=quality.toLowerCase();var j=-1;for(var i=0;i<this.Urls.length;i++){if(this.Urls[i].Extension==extension){if(this.Urls[i].Quality==quality){return this.Urls[i]}else{j=Math.max(j,i)}}}if(j>-1){return this.Urls[j]}return null},FindThumbnail:function(width){if(this.Thumbnails.length==0){return null}var tlist=[];for(var i=0;i<this.Thumbnails.length;i++){if(this.Thumbnails[i].Width==width){return this.Thumbnails[i]}if(this.Thumbnails[i].Width>width){tlist.push(this.Thumbnails[i])}}if(tlist.length==0){tlist=this.Thumbnails}var mi=0;var minx=tlist[0].Width;for(var i=0;i<tlist.length;i++){if(tlist[0].Width<minx){minx=tlist[0].Width;mi=i}}return tlist[mi]}});function Media(){}Media.prototype=new Vio.ObjArray();Vio.Extend(Media.prototype,{Find:function(mediaId){for(var i=0;i<this.length;i++){if(this[i].MediaId==mediaId){return this[i]}}return null},Add:function(mediaBaseObject){var mb=this.Find(mediaBaseObject.MediaId);if(mb==null){mb=new MediaBase(mediaBaseObject);this.push(mb)}else{mb.LoadUrls(mediaBaseObject.MediaUrls)}return mb},AddRange:function(mediaBaseObjects){for(var i=0;i<mediaBaseObjects.length;i++){this.Add(mediaBaseObjects[i])}},Load:function(mediaId,callback){Vio.Ajax(Vio.BaseURL+"content.asmx/MediaInfoByMethod",{mediaId:mediaId,streamingMethod:"AkamaiTrueStream"},function(respItem,respItemInfo){Vio.Media.Add(respItem[0]);if(typeof(callback)=="function"){callback()}})},LoadP:function(mediaId,callback){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",Vio.BaseURL+"JSONP.axd?a=media&id="+mediaId);head.appendChild(script);if(typeof(callback)=="function"){var timedout=false,timeout=setTimeout(function(){timedout=true},30000);(function(){var mb=Vio.Media.Find(mediaId);if(mb!=null&&mb.Urls.length>0){clearTimeout(timeout);timedout=true;callback()}else{if(!timedout){setTimeout(arguments.callee,10)}}})()}}});return{Media:new Media()}})());Vio.Extend((function(){var d="undefined";function c(g,f){for(var e in f){if(typeof(g[e])!=d&&(g[e]==null||g[e].constructor!=Array)){g[e]=f[e]}}}function a(g){if(typeof(g)!=d){c(this,g);this.SubGroups=new Array();this.MediaBases=new Array();if(g.MediaBases&&g.MediaBases.length>0){for(var e=0;e<g.MediaBases.length;e++){this.MediaBases.push(Vio.Media.Add(g.MediaBases[e]))}}if(g.SubGroups&&g.SubGroups.length>0){for(var e=0;e<g.SubGroups.length;e++){var f=new a(g.SubGroups[e]);this.SubGroups.push(f);Vio.Groups.push(f)}}}}Vio.Extend(a.prototype,{Id:"",Name:"",Description:"",SortName:"",SortDirection:"",SubGroups:new Array(),MediaBases:new Array(),Filter:function(f){if(f.constructor==String){f=new RegExp(f,"igm")}if(f.source==""){return this.MediaBases}else{var g=[];for(var e=0;e<this.MediaBases.length;e++){if(this.MediaBases[e].IsMatch(f)){g.push(this.MediaBases[e])}}return g}},Sort:function(j,g){if(this.SortName!=j||this.SortDirection!=g){var e=(j=="date"?"DisplayTime":"MediaTitle");var f=(g=="asc"?1:-1);function h(k,l){return(k[e]<l[e])?(-1*f):((k[e]>l[e])?(1*f):0)}this.MediaBases.sort(h);this.SortName=j;this.SortDirection=g}},LoadMedia:function(){}});function b(){}b.prototype=new Vio.ObjArray();Vio.Extend(b.prototype,{Find:function(e){for(var f=0;f<this.length;f++){if(this[f].Id==e){return this[f]}}return null},Load:function(f,e){Vio.Ajax(Vio.BaseURL+"content.asmx/MediaByGroup",{groupId:f},function(g,h){Vio.Groups.Add(g);if(typeof(e)=="function"){e()}})},LoadP:function(f,e,h){this.Remove(f);var g=document.getElementsByTagName("head")[0];var j=document.createElement("script");j.setAttribute("type","text/javascript");j.setAttribute("src",Vio.BaseURL+"JSONP.axd?a=group&id="+f+"&children="+h);g.appendChild(j);if(typeof(e)=="function"){var k=false,l=setTimeout(function(){k=true},30000);(function(){if(Vio.Groups.Find(f)==null){if(!k){setTimeout(arguments.callee,10)}}else{clearTimeout(l);k=true;e()}})()}},Remove:function(e){for(var f=0;f<this.length;f++){if(this[f].Id==e){this.splice(f,1);return}}},Add:function(e){this.Remove(e.Id);this.push(new a(e))}});return{Groups:new b()}})());Vio.Extend((function(){var f="undefined";function c(l,k){for(var j in k){if(typeof(l[j])!=f&&(l[j]==null||l[j].constructor!=Array)){l[j]=k[j]}}}function g(j){if(typeof(j)!=f){c(this,j);this.Created=new Date(j.Created);this.StartDate=new Date(j.StartDate);this.Media=new Object();if(j.Media.MediaId!=null){this.Media=Vio.Media.Add(j.Media)}function k(l,m){var n=l.Time;var o=m.Time;return((n<o)?-1:((n>o)?1:0))}this.Transitions.sort(k)}}function b(B){var E=B.value,l=E.Options.embedPlayer,D=E.Options.player,y=E.ViocastNavElement,j=E.ViocastContainer,H=Vio.Viocasts.Find(l.viocastId);if(typeof(j)!=f&&typeof(y)!=f){var n="#"+E.Options.skin.icon_colour.split("x")[1];var G=document.createElement("h1");G.innerHTML=H.Title;E.ViocastHeader.appendChild(G);if(H.Description!=""){var m=document.createElement("p");m.innerHTML=H.Description;E.ViocastHeader.appendChild(m)}var s=document.createElement("li");var q=document.createElement("a");q.setAttribute("data-container","viooverview-container");q.setAttribute("href","javascript:void(0);");q.innerHTML="Overview";s.appendChild(q);var r=document.createElement("div");Vio.AddClass(r,"viooverview-container");var u=document.createElement("table");a(u,"Title",H.Title,"");var F="hh:mm:ss";if(H.Duration<3600){F="mm:ss"}a(u,"Duration",new Vio.TimeSpan(H.Duration).toString(F),"alt");a(u,"Start Date",H.StartDate.toLocaleString(),"");a(u,"Description",H.Description,"alt");r.appendChild(u);y.appendChild(s);j.appendChild(r);var A=document.createElement("li");var z=document.createElement("a");z.setAttribute("data-container","viodownloads-container");z.setAttribute("href","javascript:void(0);");z.innerHTML="Downloads";A.appendChild(z);var w=document.createElement("div");Vio.AddClass(w,"viodownloads-container");for(p=0;p<H.SlideDecks.length;p++){var x=document.createElement("h2");x.innerHTML=H.SlideDecks[p].Title;w.appendChild(x);if(H.SlideDecks[p].Pdf!=""){var C=document.createElement("a");C.innerHTML="PDF";C.setAttribute("target","_blank");C.setAttribute("class","pdf");C.setAttribute("href",H.SlideDecks[p].Pdf);w.appendChild(C)}if(H.SlideDecks[p].Url!=""){var k=document.createElement("a");k.innerHTML="PowerPoint";k.setAttribute("target","_blank");k.setAttribute("class","ppt");k.setAttribute("href",H.SlideDecks[p].Url);w.appendChild(k)}}y.appendChild(A);j.appendChild(w);for(var p=0;p<y.childNodes.length;p++){(function(o){o.onclick=function(){if(H.CurrentTab!=null){Vio.RemoveClass(H.CurrentTab.nav,"current");Vio.RemoveClass(H.CurrentTab.container,"current");H.CurrentTab.nav.style.backgroundColor=null}Vio.AddClass(o,"current");o.style.backgroundColor=n;var v=o.getAttribute("data-container");for(var I=0;I<j.childNodes.length;I++){(function(J){if(Vio.Trim(J.className)==v){Vio.AddClass(J,"current");H.CurrentTab={nav:o,container:J}}})(j.childNodes[I])}}})(y.childNodes[p].childNodes[0])}}}function a(p,n,l,j){var o=document.createElement("tr");Vio.AddClass(o,j);var m=document.createElement("td");m.innerHTML=n;var k=document.createElement("td");k.innerHTML=l;o.appendChild(m);o.appendChild(k);p.appendChild(o)}Vio.Event.Bind(window,"RenderViocast",b);function d(j){if(typeof(j)!=f){c(this,j)}}function e(j){if(typeof(j)!=f){c(this,j)}}Vio.Extend(g.prototype,{Id:0,ChapterId:"",Title:"",Description:"",Presenters:"",Duration:0,StartDate:new Date(),Created:new Date(),SlideDecks:new Vio.ObjArray(),Transitions:new Vio.ObjArray(),Media:new Object(),CurrentTab:null});Vio.Extend(d.prototype,{Title:"",Url:"",Pdf:""});Vio.Extend(e.prototype,{Id:0,Time:0,ImageUrl:""});function h(){}h.prototype=new Vio.ObjArray();Vio.Extend(h.prototype,{Find:function(k){for(var j=0;j<this.length;j++){if(this[j].Id==k){return this[j]}}return null},Load:function(l,k,j){this.Remove(l);Vio.Ajax(Vio.BaseURL+"content.asmx/ViocastInfo",{viocastId:l,streamingMethod:k},function(m,n){Vio.Viocasts.Add(m);if(typeof(j)=="function"){j()}})},LoadP:function(q,n,l,j){this.Remove(q);var k=document.getElementsByTagName("head")[0];var m=document.createElement("script");m.setAttribute("type","text/javascript");m.setAttribute("src",Vio.BaseURL+"JSONP.axd?a=viocast&id="+q+"&thumbWidth="+n+"&imageHeight="+l);k.appendChild(m);if(typeof(j)=="function"){var o=false,p=setTimeout(function(){o=true},30000);(function(){if(Vio.Groups.Find(groupId)==null){if(!o){setTimeout(arguments.callee,10)}}else{clearTimeout(p);o=true;j()}})()}},Remove:function(k){for(var j=0;j<this.length;j++){if(this[j].Id==k){this.splice(j,1);return}}},Add:function(j){this.Remove(j.Id);this.push(new g(j))}});return{Viocasts:new h()}})());Vio.Extend({SlideList:(function(){var e="undefined",b="px",a=null;function d(j,h,g){return(typeof(j[h])==e)?g:j[h]}function f(l,m){m=Math.round(m);var k=l.SlideListElement.childNodes;var h=k.length-1;var g="#"+l.Options.skin.icon_colour.split("x")[1];var j=Vio.GetRgbValue(g);while(h>-1){if(k[h].getAttribute("data-seconds")==m){if(a!=null){Vio.RemoveClass(a,"current");a.style.backgroundColor="transparent"}Vio.AddClass(k[h],"current");k[h].style.backgroundColor="rgba("+j.r+","+j.g+","+j.b+",0.3)";l.SlideElement.getElementsByTagName("img")[0].setAttribute("src",k[h].getAttribute("data-image"));a=k[h]}h--}}function c(j){var m=j.value,g=m.Options.embedPlayer,k=m.Options.player,l=m.SlideListElement,n=Vio.Viocasts.Find(g.viocastId);Vio.Event.Bind(m,"mediaTimeUpdate",function(o){f(o.value.target,o.value.currentTime)});if(n!=null){if(n.Transitions.length>0){m.SlideElement.getElementsByTagName("img")[0].setAttribute("src",n.Transitions[0].ImageUrl)}for(var h=0;h<n.Transitions.length;h++){(function(q){var p=document.createElement("div");p.setAttribute("class","slide");p.setAttribute("data-seconds",q.Time);p.setAttribute("data-image",q.ImageUrl);var o=document.createElement("img");o.setAttribute("src",q.ThumbnailUrl);o.style.width=m.Options.viocast.thumbnail_width+"px";o.style.height=m.Options.viocast.thumbnail_height+"px";p.appendChild(o);m.SlideListElement.appendChild(p);o.onclick=function(){f(m,q.Time);Vio.Event.Trigger("slideSeekEvent",{time:q.Time},m,null)}})(n.Transitions[h])}}}Vio.Event.Bind(window,"RenderSlideList",c);return{UpdateMedia:function(h,j){var g=Vio.Player.FindTarget(h);if(g!=null){}return true}}})()});Vio.Extend(Vio,{Transcription:(function(){var c="undefined";function b(m,h){var l=m.Element.getAttribute("id")+"_transcriptions_toggle";var e=m.Element.getAttribute("id")+"_transcriptions";var j=document.getElementById(l);var d=document.getElementById(e);if(typeof(d)==c||d==null){d=document.createElement("div");d.setAttribute("id",e);d.setAttribute("class","transcriptions");d.style.display="none";m.Element.appendChild(d)}else{Vio.$ee(d)}for(var f=0;f<h.Transcriptions.length;f++){var g=document.createElement("div");g.setAttribute("id",e+"_"+h.Transcriptions[f].StartTime);g.setAttribute("data-seconds",h.Transcriptions[f].StartTime);g.innerHTML=h.Transcriptions[f].Text;d.appendChild(g)}if(typeof(j)==c||j==null){j=document.createElement("div");j.setAttribute("id",l);j.setAttribute("class","transcriptions-toggle");var k=document.createElement("img");k.setAttribute("src",Vio.BaseURL+"images/comment.png");k.setAttribute("alt","Transcription List");if(typeof(m.Options.skin)!=c&&typeof(m.Options.skin.theme_colour)!=c){j.style.backgroundColor="#"+m.Options.skin.theme_colour.split("x")[1]}j.appendChild(k);m.Element.appendChild(j);j.onclick=function(){var q=document.getElementById(e);if(q.style.display=="block"){q.style.display="none"}else{q.style.display="block";var o=null;if(q.getElementsByClassName){var p=q.getElementsByClassName("current");if(p.length>0){o=p[0]}}else{var p=q.childNodes;var n=q.childNodes.length;while(n>-1){if(p[n].getAttribute("class")==current){o=p[n];break}n--}}if(typeof(o)!=c&&o!=null){if(o.offsetParent==q){q.scrollTop=o.offsetTop}else{}}}}}if(h.Transcriptions.length==0){j.style.display="none";d.style.display="none"}else{j.style.display="block"}}function a(j,g){var f=j.Element.getAttribute("id")+"_transcriptions_download";var e=document.getElementById(f);if(typeof(e)==c||e==null){e=document.createElement("div");e.setAttribute("id",f);e.setAttribute("class","transcriptions-download")}else{Vio.$ee(e)}var h=Vio.BaseURL+"Transcript.axd?mediaId="+g.MediaId;var d=document.createElement("a");d.setAttribute("href",h);d.setAttribute("target","_blank");d.innerHTML="Download Transcript";if(typeof(j.Options.skin)!=c&&typeof(j.Options.skin.theme_colour)!=c){e.style.backgroundColor="#"+j.Options.skin.theme_colour.split("x")[1]}e.appendChild(d);j.Element.appendChild(e);if(g.Transcriptions.length==0){e.style.display="none"}else{e.style.display="block"}}return{RenderList:function(e){var f=e.value;var d=e.data.mediaBase;b(f,d)},RenderDownload:function(e){var f=e.value;var d=e.data.mediaBase;a(f,d)},Render:function(e){var f=e.value;var d=e.data.mediaBase;b(f,d);a(f,d)}}})()});Vio.Extend({Player:(function(){var n="undefined",g="px",e={},d=Vio.$ge,a=Vio.$ce,b=Vio.$ct,c=Vio.$ee,m=[];function l(q,p,o){return(typeof(q[p])==n)?o:q[p]}var f=function(o){if(o.constructor==String){o=d(o)}else{if(o.id==""){o.id="VioTarget_"+Math.floor((Math.random()*100))+"_"+((new Date()).valueOf())}}this.Id=o.id;this.Element=o;this.Options={embedPlayer:{showSplash:false,splashImage:"",showChooser:false,showChooserWhenPlaying:false,playerFormat:"auto",playerQuality:"auto",playerWidth:400,playerHeight:224},player:{autoplay:"always",bg_colour:"0x000000"},playlist:{playlistHeight:224,playlistWidth:200,sort_order:"name",sort_direction:"asc"},advertising:{enabled:false},reporting:{enabled:false},transcription:{enabled:false},mediainfo:{},bookmarks:[],vioadJavascriptUrl:""}};Vio.Extend(f.prototype,{Id:null,Element:null,PlayerElement:null,PlayerOptions:null,MediaInfo:null,PlaylistElement:null,PlaylistControl:null,Options:{}});function h(J){var R=J.value;var D=R.Options.embedPlayer;if(R.Options.advertising.enabled){if(typeof(vioad)==n){var F=document.getElementsByTagName("head")[0];var O=document.createElement("script");O.setAttribute("type","text/javascript");O.setAttribute("src","vioad.js");F.appendChild(O);var V=false,W=setTimeout(function(){V=true},30000);(function(){if(typeof(vioad)!=n){clearTimeout(W);V=true}else{if(!V){setTimeout(arguments.callee,10)}}})()}}var I=Vio.Media.Find(D.mediaId);if(I){setTimeout(function(){Vio.Event.Trigger("RenderMediaInfo",R)},10);setTimeout(function(){Vio.Event.Trigger("RenderPlayerOptions",R)},10);if(R.Options.transcription.enabled){Vio.Event.Bind(window,"RenderTranscription",Vio.Transcription.Render,{mediaBase:I});Vio.Event.Bind(window,"RenderTranscriptionList",Vio.Transcription.RenderList,{mediaBase:I});Vio.Event.Bind(window,"RenderTranscriptionDowload",Vio.Transcription.RenderDownload,{mediaBase:I})}if(D.showSplash){c(R.PlayerElement);var U=D.splashImage;if(U==""){var S=I.FindThumbnail(D.playerWidth);if(S!=null){U=S.Path}}var H=a("img",null,{width:D.playerWidth+g,height:D.playerHeight+g});H.src=U;var p=a("a");p.href="javascript:void(0);";p.onclick=function(){Vio.Player.Render(R.Id);return false};p.appendChild(H);R.PlayerElement.appendChild(p);R.Options.embedPlayer.showSplash=false}else{if(D.showChooser||((D.playerFormat||"")=="")||((D.playerQuality||"")=="")){c(R.PlayerElement);R.PlayerElement.style.width=D.playerWidth+g;R.PlayerElement.style.height=D.playerHeight+g;var S=I.FindThumbnail(D.playerWidth);if(D.splashImage!=""||S!=null){var T=(D.splashImage!="")?D.splashImage:S.Path;R.PlayerElement.style.backgroundImage="url("+T+")";R.PlayerElement.style.backgroundPosition="50% 50%";R.PlayerElement.style.backgroundRepeat="no-repeat"}else{R.PlayerElement.style.backgroundImage="none"}if(I.Urls.length==0){for(var G=0;G<Vio.Media.length;G++){if(Vio.Media[G].Urls.length>0){I=Vio.Media[G];break}}}var P=a("select");P.id=R.Id+"_mediaPlayer";var Q=a("select");Q.id=R.Id+"_mediaQuality";function r(X,q){try{X.add(q,null)}catch(o){X.add(q)}}for(var p in e){for(var G=0;G<I.Urls.length;G++){var C=I.Urls[G].Extension;if((typeof(e[p].SupportsVideo)=="function"&&e[p].SupportsType(I.Urls[G].MimeType))||e[p].CanPlay(I.Urls[G].Extension)){var K=new Option(e[p].Name,p);r(P,K);break}}}var N=[];function E(q){for(var o=0;o<N.length;o++){if(N[o]==q){return true}}return false}for(var G=0;G<I.Urls.length;G++){var L=I.Urls[G].Quality;if(L=="undefined"){continue}if(!E(L)){N.push(L)}}var M={hd:4,high:3,medium:2,low:1};N.sort(function(o,q){return(M[o]||0)>(M[q]||0)});for(var G=0;G<N.length;G++){var K=new Option((N[G]=="hd")?"HD":(N[G].substr(0,1).toUpperCase()+N[G].substr(1)),N[G]);K.selected=(N.length-1)==G;r(Q,K)}var y=a("div","player-chooser");var x=a("div","player-chooser-spacer");y.appendChild(x);var w=a("div","player-chooser-box");x.appendChild(w);var B=a("div","title");B.appendChild(b("Media Player Options"));w.appendChild(B);var u=a("div","choices vio-clearfix");w.appendChild(u);var v=a("div","format");v.appendChild(b("Format"));v.appendChild(P);u.appendChild(v);var z=a("div","quality");z.appendChild(b("Quality"));z.appendChild(Q);u.appendChild(z);var A=a("div","save-button");var s=a("input");s.onclick=function(){Vio.Player.Choose(R.Id);return false};s.type="button";s.setAttribute("value","Save");A.appendChild(s);w.appendChild(A);R.PlayerElement.appendChild(y)}else{if(D.playerFormat=="auto"){R.Options.embedPlayer.playerFormat=(function(){var q=Vio.Media[0];for(var o=0;o<Vio.Player.PreferredPlayers.length;o++){if(e[Vio.Player.PreferredPlayers[o]].IsAvailable(q.Urls)){return(Vio.Player.PreferredPlayers[o]);break}}return null})();h({value:R})}else{e[D.playerFormat].Render(R)}}}}}function k(x){var z=x.value,v=l(z.Options,"embedPlayer",{}),p=l(z.Options,"bookmarks",[]);if(z.PlayerOptions&&(v.showChooserWhenPlaying||p.length>0)){c(z.PlayerOptions);if(p.length>0){var u=a("ul","bookmarks");for(var w=0;w<p.length;w++){var s=a("li");var q=a("a");var r=a("img");q.href=p[w].Url.replace(/\{0\}/i,location.toString()).replace(/\{1\}/i,document.title);q.title=r.tooltip=p[w].Name;r.src=p[w].IconUrl;q.appendChild(r);s.appendChild(q);u.appendChild(s)}z.PlayerOptions.appendChild(u)}if(v.showChooserWhenPlaying){var y=a("a","player-option");y.appendChild(b("Player options"));y.href="javascript:void(0);";y.onclick=function(){Vio.Player.ShowOptions(z.Id)};z.PlayerOptions.appendChild(y)}}}function j(x){var D=x.value,y=l(D.Options,"playlist",{}),w=l(D.Options,"mediainfo",{}),u=l(D.Options,"embedPlayer",{}),z=l(D.Options,"player",{}),C=l(w,"show_title",true),B=l(w,"show_desc",true),A=l(w,"show_date",false),p=l(w,"date_fmt","dd MM yy"),v=Vio.Media.Find(u.mediaId);if(D.MediaInfo&&v){c(D.MediaInfo);if(C){var s=a("div","media-title");s.appendChild(b(v.MediaTitle));D.MediaInfo.appendChild(s)}if(B){var r=a("div","media-description");r.innerHTML=v.MediaDescription;D.MediaInfo.appendChild(r)}if(A){var q=a("div","media-date");q.appendChild(b(Vio.FormatDate(v.DisplayTime,p)));D.MediaInfo.appendChild(q)}}}Vio.Event.Bind(window,"RenderPlayer",h);Vio.Event.Bind(window,"RenderPlayerOptions",k);Vio.Event.Bind(window,"RenderMediaInfo",j);return{Layouts:{},AddTarget:function(q,o,p){if(typeof(Vio.Player.Layouts[q])!="undefined"){var r=new f(o);Vio.Extend(r.Options,p,true);Vio.Player.Layouts[q].AddTarget(r)}},NewTarget:function(o){var p=new f(o);m.push(p);return p},FindTarget:function(r){for(var q=0;q<m.length;q++){if(m[q].Id==r){return m[q]}}for(var o in Vio.Player.Layouts){var p=Vio.Player.Layouts[o].FindTarget(r);if(p!=null){return p}}return null},Render:function(o){var p=Vio.Player.FindTarget(o);if(p!=null){setTimeout(function(){h({value:p})},10)}},Choose:function(o){var r=Vio.Player.FindTarget(o);if(r!=null){var p=d(r.Id+"_mediaPlayer");var q=d(r.Id+"_mediaQuality");r.Options.embedPlayer.playerFormat=p.options[p.selectedIndex].value;r.Options.embedPlayer.playerQuality=q.options[q.selectedIndex].value;r.Options.embedPlayer.showChooser=false;setTimeout(function(){Vio.Event.Trigger("Render",r)},10)}},ShowOptions:function(o){var p=Vio.Player.FindTarget(o);if(p!=null){p.Options.embedPlayer.playerFormat="";p.Options.embedPlayer.playerQuality="";p.Options.embedPlayer.showChooser=false;setTimeout(function(){Vio.Event.Trigger("Render",p)},10)}},CurrentTranscript:null,MediaTimeTranscriptionCallback:function(q){var r=q.target.getAttribute("id");var v=document.getElementById(r+"_transcriptions");var s=Math.round(q.currentTime);var u=document.getElementById(r+"_transcriptions_"+s);if(u!=null&&u!=Vio.Player.CurrentTranscript){u.setAttribute("class","current");if(Vio.Player.CurrentTranscript!=null){Vio.Player.CurrentTranscript.removeAttribute("class");if(u.offsetParent==v){v.scrollTop=u.offsetTop}else{var p=v.scrollTop;var o=parseInt(Vio.Player.CurrentTranscript.style.borderWidth.split("px")[0]);if(isNaN(o)){o=0}v.scrollTop=p+Vio.Player.CurrentTranscript.clientHeight+o}}Vio.Player.CurrentTranscript=u}},MediaPlayers:e,PreferredPlayers:["Flash","Quicktime","Html5","WindowsMedia","Silverlight"]}})()});Vio.Extend({Playlist:(function(){var j="undefined",e="px",d=Vio.$ge,a=Vio.$ce,b=Vio.$ct,c=Vio.$ee;function h(n,m,l){return(typeof(n[m])==j)?l:n[m]}function f(C){var K=C.value,D=K.Options.playlist,q=K.Options.embedPlayer,E=K.Options.player,s=Vio.Groups.Find(q.groupId||null),z=h(q,"mediaId",""),J=h(D,"show_title",true),H=h(D,"show_desc",true),I=h(D,"show_thumbnail",true),G=h(D,"show_date",false),M=h(D,"thumbnail_width",96),L=h(D,"thumbnail_height",54),v=h(D,"item_height",60),w=h(D,"item_width",300),p=h(D,"desc_cutoff",-1),N=h(D,"title_cutoff",-1),m=h(D,"date_fmt","dd MM yy"),r=h(D,"filter","");if(r.constructor==String){r=new RegExp(r,"igm")}function n(o){return o=="Video"?E.default_video_thumb:o=="Audio"?E.default_audio_thumb:E.default_image_thumb}function O(Q,o){if(o<0||Q.length<o){return Q}else{var P=Q.substr(0,o);return P.substr(0,P.lastIndexOf(" "))+" ..."}}c(K.PlaylistElement);var l=1;function B(){this.className=this.className+" hover"}function A(){this.className=this.className.replace(/\shover/,"")}function F(X,T){var S=a("div");T="media-card vio-clearfix "+(T.length>0?T+" ":"")+X.MediaType.toLowerCase()+((++l%2)==0?"":" alt")+(X.MediaId==z?" now-playing":"");S.className=T;S.setAttribute("rel",X.MediaId);S.onmouseover=B;S.onmouseout=A;var o=a("a");var P=a("a");S.onclick=o.onclick=P.onclick=function(Z){if(typeof(Z)==j){Z=window.event}Vio.Playlist.PlayMedia(K.Id,X.MediaId);if(typeof(Z.cancelBubble)!=j){Z.cancelBubble=true}else{Z.stopPropagation()}return false};o.href=P.href="javascript:void(0);";if(I){o.style.width=M+e;o.style.height=L+e;o.className="thumbnail";var W=a("img");var Y=X.FindThumbnail(M);if(Y==null){W.src=n(X.MediaType);W.style.height=L+e;W.style.width=((L/54)*96)+e;if(L!=54||M!=96){W.style.marginLeft=(((M-((L/54)*96))/2))+e}}else{W.src=Y.Path;W.style.height=L+e;W.style.width=Math.round((L/Y.Height)*Y.Width)+e;if(L!=Y.Height||M!=Y.Width){W.style.marginLeft=(((M-((L/Y.Height)*Y.Width))/2))+e}}o.appendChild(W);S.appendChild(o)}if(J||H||G){var U=a("dl");if(J){var V=a("dt");P.appendChild(b(O(X.MediaTitle,N)));V.appendChild(P);U.appendChild(V)}if(H){var Q=a("dd");Q.innerHTML=(O(X.MediaDescription,p));U.appendChild(Q)}if(G){var R=a("dd");R.appendChild(b(Vio.FormatDate(X.DisplayTime,m)));U.appendChild(R)}S.appendChild(U)}K.PlaylistElement.appendChild(S)}if(s){var x=s.Filter(r);for(var u=0;u<x.length;u++){F(x[u],u==0?"first":u==(x.length-1)?"last":"")}}else{var y=Vio.Media.Find(z);if(y!=null){F(y,"first")}}}function g(r){var u=r.value,s=u.Options.playlist,n=Vio.Groups.Find(u.Options.embedPlayer.groupId||"");c(u.PlaylistControl);if(n!=null){var v=a("ul","vio-clearfix");var p=a("li");if(n.SortName=="name"){p.className=n.SortDirection}var l=a("a","sort");l.href="javascript:void(0);";l.onclick=function(){Vio.Playlist.SortMedia(u.Id,"name")};l.appendChild(b("Name"));p.appendChild(l);v.appendChild(p);var q=a("li");if(n.SortName=="date"){q.className=n.SortDirection}var m=a("a","sort");m.href="javascript:void(0);";m.onclick=function(){Vio.Playlist.SortMedia(u.Id,"date")};m.appendChild(b("Date"));q.appendChild(m);v.appendChild(q);u.PlaylistControl.appendChild(v)}}function k(r){var s=r.value,n=h(s.Options,"embedPlayer",{}),q=h(n,"mediaId","");if(s.PlaylistElement&&q!=""){var l=s.PlaylistElement.childNodes;var m=(/\snow-playing/);for(var p=0;p<l.length;p++){if(l[p]&&l[p].nodeType==1){if(m.test(l[p].className)){l[p].className=l[p].className.replace(m,"")}if(l[p].getAttribute("rel")==q){l[p].className=l[p].className+" now-playing"}}}}}Vio.Event.Bind(window,"RenderPlaylist",f);Vio.Event.Bind(window,"RenderPlaylistControl",g);Vio.Event.Bind(window,"RenderMediaInfo",k);return{PlayMedia:function(n,l){var m=Vio.Player.FindTarget(n);if(m!=null){m.Options.embedPlayer.mediaId=l;setTimeout(function(){Vio.Event.Trigger("RenderPlayer",m)},10)}return true},FilterMedia:function(n,l){var m=Vio.Player.FindTarget(n);if(m!=null){m.Options.playlist.filter=l;setTimeout(function(){Vio.Event.Trigger("RenderPlaylist",m)},10)}},SortMedia:function(o,m){var n=Vio.Player.FindTarget(o);if(n!=null){var l=Vio.Groups.Find(n.Options.embedPlayer.groupId||"");if(l!=null){l.Sort(m,(m==l.SortName)?(l.SortDirection=="asc"?"desc":"asc"):(m=="date"?"desc":"asc"));setTimeout(function(){Vio.Event.Trigger("RenderPlaylist",n)},10);setTimeout(function(){Vio.Event.Trigger("RenderPlaylistControl",n)},10)}}}}})()});Vio.Extend(Vio,{DragDrop:(function(){var b=undefined;var f=navigator.platform.toLowerCase()=="ipad";function e(h,g,j,l,k,m){if(f){Vio.Event.Bind(h,"touchstart",d,{bindings:g,x1:j,y1:l,x2:k,y2:m})}else{Vio.Event.Bind(h,"mousedown",d,{bindings:g,x1:j,y1:l,x2:k,y2:m})}}function d(g){if(b){c(g)}for(var h=0;h<g.data.bindings.length;h++){Vio.Event.Unbind(g.data.bindings[h].obj,g.data.bindings[h].evt,g.data.bindings[h].callback)}if(f){g.preventDefault();Vio.Event.Bind(document,"touchmove",a,g.data);Vio.Event.Bind(document,"touchend",c,g.data)}else{Vio.Event.Bind(document,"mousemove",a,g.data);Vio.Event.Bind(document,"mouseup",c,g.data)}b=this}function a(h){var g=h.clientX||h.touches[0].clientX;if(f){h.preventDefault()}var k=h.data.x1;var j=h.data.x2;var l=0;if(g>=k&&g<=j){l=g-k}if(g>j){l=j-k}b.style.left=l+"px"}function c(g){Vio.Event.Trigger("objectDropped",parseInt(b.style.left.split("p")[0])+19,b,null);if(f){g.preventDefault();Vio.Event.Unbind(document,"touchmove",a);Vio.Event.Unbind(document,"touchend",c)}else{Vio.Event.Unbind(document,"mousemove",a);Vio.Event.Unbind(document,"mouseup",c)}for(var h=0;h<g.data.bindings.length;h++){Vio.Event.Bind(g.data.bindings[h].obj,g.data.bindings[h].evt,g.data.bindings[h].callback,g.data.bindings[h].data)}b=undefined}return{initElement:e}})()});if(typeof(VioLoader)=="undefined"){var VioLoader=(function(){var UNDEF="undefined",isRun=false,LoadStack=new Array();function log(o){if(typeof(window.console)!=UNDEF&&typeof(window.console.log)=="function"){console.log(o)}}function checkScriptOptions(opts){var s=document.getElementsByTagName("script"),t=s[s.length-1],o=eval(t.innerHTML)||{};if(typeof(opts.embedPlayer)==UNDEF){opts.embedPlayer={}}if(typeof(opts.playlist)==UNDEF){opts.playlist={}}if(typeof(opts.advertising)==UNDEF){opts.advertising={}}if(typeof(opts.transcription)==UNDEF){opts.transcription={}}if(typeof(opts.viocast)==UNDEF){opts.viocast={}}var embedMap={PlayerWidth:"playerWidth",PlayerHeight:"playerHeight",ShowSplash:"showSplash",SplashImage:"splashImage",ShowChooser:"showChooser",ShowChooserWhenPlaying:"showChooserWhenPlaying",PlayerFormat:"playerFormat",DefaultExtension:"playerExtension",DefaultQuality:"playerQuality",AutoStart:"autoStart",AutoRewind:"autoRewind"},playlistMap={PlaylistWidth:"playlistWidth",PlaylistHeight:"playlistHeight"},advertisingMap={AdvertisingEnabled:"enabled"},transcriptionMap={TranscriptionEnabled:"enabled",TranscriptionURL:"sourceURL"};for(var a in o){if(typeof(o[a])!="function"){if(typeof(embedMap[a])!=UNDEF){opts.embedPlayer[embedMap[a]]=o[a]}else{if(typeof(playlistMap[a])!=UNDEF){opts.playlist[playlistMap[a]]=o[a]}else{if(typeof(advertisingMap[a])!=UNDEF){opts.advertising[advertisingMap[a]]=o[a]}else{if(typeof(transcriptionMap[a])!=UNDEF){opts.transcription[transcriptionMap[a]]=o[a]}}}}}}return t}return{Fn:function(fn){if(!isRun){LoadStack.push(fn)}else{fn.call(null)}},Add:function(playerName,options){t=checkScriptOptions(options);var playerId=/playerid=([0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12})/.exec(t.src)[1];var css=Vio.BaseURL+"StyleSheet.axd?playerId="+playerId;LoadStack.push(function(){if(typeof(document.createStyleSheet)=="function"){document.createStyleSheet(css)}else{var head=document.getElementsByTagName("head")[0];var style=document.createElement("link");style.setAttribute("rel","stylesheet");style.setAttribute("type","text/css");style.setAttribute("href",css);head.appendChild(style)}});var d=document.createElement("div");d.className="vio-container vio-clearfix";t.parentNode.replaceChild(d,t);LoadStack.push((function(){Vio.Player.AddTarget(playerName,d,options)}))},Run:function(){if(!isRun){isRun=true;for(var i=0;i<LoadStack.length;i++){try{LoadStack[i].call(null)}catch(ex){log(ex)}}}}}})()}Vio.Extend(Vio,{TimeSpan:(function(){function a(c){return((c<10)?"0":"")+c.toString()}var b=function(c){this.seconds=c};b.prototype.toString=function(c){if(typeof(c)=="undefined"){c="hh:mm:ss"}var d=Math.floor(this.seconds/3600);var e=Math.floor((this.seconds/60)-(d*60));var f=Math.round(this.seconds-(e*60));return c.replace(/ss/,a(f)).replace(/mm/,a(e)).replace(/hh/,d)};return b})()});Vio.Extend(Vio.Player.MediaPlayers,{Flash:(function(){var l="undefined",j="object",m=window,c=document,g=navigator,b=Vio.$ce,f=Vio.$ge,d="application/x-shockwave-flash",a=Vio.Browser,e="4.1.14";var k=function(){var z="Shockwave Flash",A="ShockwaveFlash.ShockwaveFlash",r="Flash/expressInstall.swf",x=false,v=[],u=false;function D(E){return E.toLowerCase()}function C(E){return parseInt(E,10)}var w=(function(){var H=[0,0,0],F=null;if(typeof g.plugins!=l&&typeof g.plugins[z]==j){F=g.plugins[z].description;if(F&&!(typeof g.mimeTypes!=l&&g.mimeTypes[d]&&!g.mimeTypes[d].enabledPlugin)){x=true;F=F.replace(/^.*\s+(\S+\s+\S+$)/,"$1");H[0]=C(F.replace(/^(.*)\..*$/,"$1"));H[1]=C(F.replace(/^.*\.(.*)\s.*$/,"$1"));H[2]=/[a-zA-Z]/.test(F)?C(F.replace(/^.*[a-zA-Z]+(.*)$/,"$1")):0}}else{if(typeof m.ActiveXObject!=l){try{var E=new ActiveXObject(A);if(E){F=E.GetVariable("$version");if(F){F=F.split(" ")[1].split(",");H=[C(F[0]),C(F[1]),C(F[2])]}}}catch(G){}}}return H})();function n(){return s("6.0.65")&&!u}function B(E,H,J){u=true;var G=f(J);if(G){E.id="SWF$Object$Expr$Inst";E.width=Math.max(E.width||310,310);E.height=Math.max(E.height||137,137);var I=x?"PlugIn":"ActiveX",F="MMredirectURL="+m.location.toString().replace(/&/g,"%26")+"&MMplayerType="+I+"&MMdoctitle="+c.title;if(typeof H.flashvars!=l){H.flashvars+="&"+F}else{H.flashvars=F}q(E,H,J)}}function q(F,P,J){var Q,H=f(J);if(H){if(typeof F.id==l){F.id=J+"_obj"}if(a.msie){var G=b("span");var E="";for(var I in F){if(F[I]!=Object.prototype[I]){if(D(I)=="data"){P.movie=F[I]}else{if(D(I)=="styleclass"){E+=' class="'+F[I]+'"'}else{if(D(I)!="classid"){E+=" "+I+'="'+F[I]+'"'}}}}}var O="";for(var K in P){if(P[K]!=Object.prototype[K]){O+='<param name="'+K+'" value="'+P[K]+'" />'}}H.style.visibility="hidden";H.appendChild(G);G.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+E+">"+O+"</object>";H.style.visibility="visible";v[v.length]=F.id;Q=f(F.id)}else{var N=b(j);N.setAttribute("type",d);for(var L in F){if(F[L]!=Object.prototype[L]){if(D(L)=="styleclass"){N.setAttribute("class",F[L])}else{if(D(L)!="classid"){N.setAttribute(L,F[L])}}}}for(var M in P){if(P[M]!=Object.prototype[M]&&D(M)!="movie"){p(N,M,P[M])}}H.appendChild(N);Q=N}}return Q}function p(E,G,H){var F=b("param");F.setAttribute("name",G);F.setAttribute("value",H);E.appendChild(F)}function y(E){var F=f(E);if(F&&F.nodeName=="OBJECT"){if(a.msie){F.style.display="none";(function(){if(F.readyState==4){for(var G in F){if(typeof F[G]=="function"){F[G]=null}}F.parentNode.removeChild(F)}else{setTimeout(arguments.callee,10)}})()}else{F.parentNode.removeChild(F)}}}function s(F){var E=w,G=F.split(".");G[0]=C(G[0]);G[1]=C(G[1])||0;G[2]=C(G[2])||0;return(E[0]>G[0]||(E[0]==G[0]&&E[1]>G[1])||(E[0]==G[0]&&E[1]==G[1]&&E[2]>=G[2]))?true:false}var o=function(){if(a.usesAttachEvent){window.attachEvent("onunload",function(){for(var E=0;E<v.length;E++){y(v[E])}})}}();return{embed:function(J,I,L,G,K,F,H,E){Vio.OnReady(function(){L+="";G+="";var M={};if(E&&typeof E===j){for(var O in E){M[O]=E[O]}}M.data=J;M.width=L;M.height=G;var R={};if(H&&typeof H===j){for(var P in H){R[P]=H[P]}}if(F&&typeof F===j){for(var Q in F){if(typeof R.flashvars!=l){R.flashvars+="&"+Q+"="+F[Q]}else{R.flashvars=Q+"="+F[Q]}}}if(s(K)){q(M,R,I)}else{if(n()){M.data=Vio.BaseURL+r;B(M,R,I)}else{var N=f(I);N.innerHTML='<p style="padding:1em;">The minimum supported version of flash is '+K+'. Please visit <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">Adobe</a> to get the latest version of the Flash plugin.</p>'}}})},getVersion:function(){return{major:w[0],minor:w[1],release:w[2]}},hasVersion:s,remove:function(E){y(E)}}}();function h(n){if(a.msie){return n.getAttribute("classid")=="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"}else{return n.type==d}return false}return{Name:"Flash",Render:function(v){var r=Vio.$go(v.PlayerElement),q=v.Options.embedPlayer;if(r&&h(r)){r.loadViostream({id:q.mediaId});r.transcriptionReload();setTimeout(function(){Vio.Event.Trigger("RenderTranscription",v)},10)}else{Vio.$ee(v.PlayerElement);var n=v.Element.getAttribute("id")+"_flash_player";var o=b("div");o.id=n;var p={configURL:encodeURIComponent(Vio.BaseURL+"ConfigXml.axd?playerId="+q.playerId),playerId:q.playerId,defaultMediaId:q.mediaId,clientId:n};for(var s in q){p[s]=q[s]}if(v.Options.transcription.enabled){p.transcriptionEnabled=true;p.transcriptionSourceURL=v.Options.transcription.sourceURL}if(v.Options.advertising.enabled){p.advertisingEnabled=true}var u=Vio.BaseURL+"Flash/VioPlayer.swf?v="+e;if(typeof(v.Options.streaming_method)!=l&&v.Options.streaming_method=="AkamaiSecureTrueStream"&&v.Options.secure_player_url!=""){u=v.Options.secure_player_url}k.embed(u,o,q.playerWidth,q.playerHeight,"9.0.115",p,{allowFullScreen:true,allowScriptAccess:"always",wmode:"transparent"},{id:o.id+"_obj"});v.PlayerElement.appendChild(o)}},GetVersion:k.getVersion,CanPlay:function(n){return(/flv|mp3|mp4|gif|png|jpg|rtmp|rtmpe/i).test(n)},IsAvailable:function(q){var o=Vio.Player.MediaPlayers.Flash.GetVersion();var n=(o.major!=0&&o.minor!=0&&o.release!=0);if(n){for(var p=0;p<q.length;p++){n=Vio.Player.MediaPlayers.Flash.CanPlay(q[p].Extension);if(n){break}}}return(n)},MediaTimeTranscriptionCallback:function(n){var p=n.clientId.split("_flash_player");var o=Vio.Player.FindTarget(p[0]);Vio.Player.MediaTimeTranscriptionCallback({currentTime:n.time,target:o.Element})},MediaTimeProgressCallback:function(o){var n=o.current;var q=o.clientId.split("_flash_player");var p=Vio.Player.FindTarget(q[0]);Vio.Event.Trigger("mediaTimeUpdate",{currentTime:n,duration:o.total,target:p},p,null)}}})()});Vio.Extend(window,{vioPlayerReady:function(a){var d=a.split("_flash_player");var c=Vio.Player.FindTarget(d[0]);if(typeof(c)!="undefined"&&c!=null){var b=document.getElementById(a+"_obj");if(b!=null){if(c.Options.transcription.enabled){b.addEventListener("transcriptionUpdatedEvent","Vio.Player.MediaPlayers.Flash.MediaTimeTranscriptionCallback");setTimeout(function(){Vio.Event.Trigger("RenderTranscription",c)},10)}if(typeof(c.Options.embedPlayer.viocastId)!="undefined"&&c.Options.embedPlayer.viocastId>0){b.addEventListener("progressEvent","Vio.Player.MediaPlayers.Flash.MediaTimeProgressCallback");Vio.Event.Bind(c,"slideSeekEvent",function(e){b.seek(e.value.time,"seconds")},null)}}}}});Vio.Extend(Vio.Player.MediaPlayers,{Quicktime:(function(){var h="undefined",e="video/quicktime",d="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",a=Vio.Browser;var b=(function(){if(navigator.plugins!=null&&navigator.plugins.length>0){for(i=0;i<navigator.plugins.length;i++){var k=navigator.plugins[i];if(k.name.indexOf("QuickTime")>-1){return true}}}else{if(Vio.Browser.msie){var l=null;try{l=new ActiveXObject("QuickTime.QuickTime");if(l!=null){return true}}catch(j){}}}return false})();function g(l,p,q,n,o){var k={};k.width=q+"";k.height=n+"";k.postdomevents=true;k.style="behavior:url(#qt_event_source);";var m="";if(a.msie){m+='<object id="qt_event_source" classid="clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598"></object>'}m+="<object ";if(Vio.Browser.msie){k.classid=d;k.codebase="http://www.apple.com/qtactivex/qtplugin.cab";o.src=p}else{k.type=e;k.pluginspage="http://www.apple.com/quicktime/download/";k.data=p}o.qtsrc=p;for(var j in k){m+=(j+'="'+k[j]+'" ')}m+=">";for(var j in o){m+='<param name="'+j+'" value="'+o[j]+'" />'}m+="</object>";l.innerHTML=m}function c(j){if(a.msie){return j.getAttribute("classid")==d}else{return j.type==e}}return{Name:"Quicktime",Render:function f(s){var o=s.Options.embedPlayer;var r=s.Options.player;var n=Vio.Media.Find(o.mediaId);if(n&&n.Urls.length>0){var l=["mov","mp4","mp3","m3u8"];var m=0;while(typeof(o.playerExtension)==h&&m<l.length){if(n.HasUrl(l[m])){o.playerExtension=l[m]}m++}var u=n.FindUrl(o.playerExtension,o.playerQuality);if(u){var p=Vio.$go(s.PlayerElement);if(p&&c(p)){p.SetURL(u.Url)}else{Vio.$ee(s.PlayerElement);var q={controller:true,enablejavascript:true,scale:(r.scaling=="fit"?"aspect":"tofit"),autoplay:(r.autoplay=="always"?true:false),volume:(Math.round(100*parseFloat(r.volume_default||"0.8"))),postdomevents:true};var k=document.createElement("div");s.PlayerElement.appendChild(k);g(k,u.Url,o.playerWidth,o.playerHeight,q);var j=null;var p=k.childNodes[0];Vio.Event.Bind(p,"qt_play",function(){if(j!=null){clearInterval(j)}j=setInterval(function(){var v=Math.round(p.GetTime()/p.GetTimeScale());Vio.Event.Trigger("mediaTimeUpdate",{currentTime:v,target:s},s.Element,null)},1000)},false);Vio.Event.Bind(p,"qt_pause",function(){clearInterval(j)},false);Vio.Event.Bind(p,"qt_ended",function(){clearInterval(j)},false);if(s.Options.transcription.enabled&&!a.msie){Vio.Event.Trigger("RenderTranscription",s);Vio.Event.Bind(s.Element,"mediaTimeUpdate",Vio.Player.MediaPlayers.Quicktime.MediaTimeTranscriptionCallback,{target:s})}if(Vio.Browser.msie||Vio.Device.iPhone||Vio.Device.iPad){Vio.Event.Trigger("RenderTranscriptionDownload",s)}if(s.Options.reporting.enabled){$v.track.player.add(s.Options.embedPlayer.playerId,s.Options.embedPlayer.playerName);Vio.Event.Bind(s.Element,"mediaTimeUpdate",function(v){if(Math.round(v.value.currentTime)%10==0){$v.track.video.progress(v.data.mediaId,v.value.target.Options.embedPlayer.playerId,v.value.currentTime)}},{mediaId:n.MediaId});Vio.Event.Bind(p,"qt_load",function(v){$v.track.video.load(n.MediaId,s.Options.embedPlayer.playerId,{duration:u.Duration,format:u.MimeType,quality:u.Quality,playerType:s.Options.embedPlayer.playerFormat})},false);Vio.Event.Bind(p,"qt_ended",function(){$v.track.video.end(n.MediaId,s.Options.embedPlayer.playerId)},false);Vio.Event.Bind(p,"qt_play",function(){$v.track.video.view(n.MediaId,s.Options.embedPlayer.playerId)},false)}}}else{Vio.Log("media item not available")}}else{Vio.Media.LoadP(o.mediaId,function(){var v=Vio.Media.Find(o.mediaId);if(v&&v.Urls.length>0){f(s)}})}},CanPlay:function(j){switch(j){case"mov":case"mp4":case"mp3":return true;break}return false},IsAvailable:function(n){var m=false;qtObj=false;if(navigator.plugins&&navigator.plugins.length){for(var k=0;k<navigator.plugins.length;k++){var l=navigator.plugins[k];if(l.name.indexOf("QuickTime")>-1){m=true}}}else{execScript('on error resume next: qtObj = IsObject(CreateObject("QuickTime.QuickTime"))',"VBScript");m=qtObj}var j=m;if(j){for(var k=0;k<n.length;k++){j=Vio.Player.MediaPlayers.Quicktime.CanPlay(n[k].Extension);if(j){break}}}return(j)},MediaTimeTranscriptionCallback:function(j){Vio.Player.MediaTimeTranscriptionCallback({currentTime:j.value.currentTime,target:j.data.target.Element})}}})()});Vio.Extend(Vio.Player.MediaPlayers,{WindowsMedia:(function(){var d="undefined",f="application/x-ms-wmp",e="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6";browser=Vio.Browser;function c(j,n,o,l,m){var h={};j.id="VioPlayer"+Vio.Rand();h.width=o+"";h.height=l+"";h.id="wmv_player";var k="<object ";if(Vio.Browser.msie){h.classid=e;m.src=n}else{h.type=f;h.data=n}m.URL=n;m.FileName=n;for(var g in h){k+=(g+'="'+h[g]+'" ')}k+=">";for(var g in m){k+='<param name="'+g+'" value="'+m[g]+'" />'}k+="</object>";j.innerHTML=k}function a(g){if(browser.msie){return g.getAttribute("classid")==e}else{return g.type==f}return false}return{Name:"Windows Media",Render:function b(q){var l=q.Options.embedPlayer;var o=q.Options.player;var k=Vio.Media.Find(l.mediaId);if(k&&k.Urls.length>0){var h=["wmv","wma","mp3"];var j=0;while(typeof(l.playerExtension)==d&&j<h.length){if(k.HasUrl(h[j])){l.playerExtension=h[j]}j++}var r=k.FindUrl(l.playerExtension,l.playerQuality);if(r){var m=Vio.$go(q.PlayerElement);if(m&&a(m)&&typeof(m.newMedia)=="function"){m.currentMedia=m.newMedia(r.Url)}else{Vio.$ee(q.PlayerElement);var n={AutoStart:(o.autoplay=="always"?1:0),AllowScan:1,EnablePositionControls:false,EnableFullScreenControls:true,ShowPositionControls:false,ShowTracker:1,StretchToFit:(o.scaling=="fit"?1:0),DisplaySize:4,AutoSize:0,uiMode:"mini",AllowChangeDisplaySize:1,Volume:(Math.round(100*parseFloat(o.volume_default||"0.8")))};var g=document.createElement("div");q.PlayerElement.appendChild(g);c(g,r.Url,l.playerWidth,l.playerHeight,n);var m=g.childNodes[0];checkTimeInterval=null;function p(s){switch(s){case 2:Vio.Event.Trigger("mediaPaused",true,q.element,null);clearInterval(checkTimeInterval);case 3:if(checkTimeInterval!=null){clearInterval(checkTimeInterval)}Vio.Event.Trigger("MediaPlaying",null,q.element,null);checkTimeInterval=setInterval(function(){var u=Math.round(m.controls.currentPosition);Vio.Event.Trigger("mediaTimeUpdate",{currentTime:u,target:q},q.element,null)},1000);break;case 8:Vio.Event.Trigger("MediaEnded",null,q.element,null);case 10:Vio.Event.Trigger("mediaLoadStart",null,q.element,null);default:clearInterval(checkTimeInterval)}}if(m.attachEvent){m.attachEvent("PlayStateChange",p)}else{if(m.addEventListener){m.addEventListener("PlayStateChange",p,false)}}if(q.Options.transcription.enabled){Vio.Event.Bind(q.Element,"mediaTimeUpdate",Vio.Player.MediaPlayers.WindowsMedia.MediaTimeTranscriptionCallback,{target:q})}if(q.Options.reporting.enabled){Vio.Event.Bind(player,"mediaTimeUpdate",function(s){if(Math.round(s.value.currentTime)%10==0){$v.track.video.progress(s.data.mediaId,s.data.target.Options.embedPlayer.playerId,s.value.currentTime)}},{mediaId:k.MediaId,target:q});Vio.Event.Bind(player,"mediaLoadStart",function(s){$v.track.video.load(s.data.mediaId,s.data.target.Options.embedPlayer.playerId,{duration:r.Duration,format:r.MimeType,quality:r.Quality,playerType:s.data.target.Options.embedPlayer.playerFormat})},{mediaId:k.MediaId,target:q});Vio.Event.Bind(player,"mediaEnded",function(s){$v.track.video.end(s.data.mediaId,s.data.target.Options.embedPlayer.playerId)},{mediaId:k.MediaId,target:q});Vio.Event.Bind(player,"mediaPlaying",function(s){$v.track.video.view(s.data.mediaId,s.data.target.Options.embedPlayer.playerId)},{mediaId:k.MediaId,target:q})}}}else{Vio.Log("no media")}}else{Vio.Media.LoadP(l.mediaId,function(){var s=Vio.Media.Find(l.mediaId);if(s&&s.Urls.length>0){b(q)}})}},CanPlay:function(g){switch(g){case"wmv":case"wma":case"mp3":return true;break}return false},IsAvailable:function(k){var l=false;wmpObj=false;if(navigator.plugins&&navigator.plugins.length){for(var h=0;h<navigator.plugins.length;h++){var j=navigator.plugins[h];if(j.name.indexOf("Windows Media Player")>-1){l=true}}}else{execScript('on error resume next: wmpObj = IsObject(CreateObject("MediaPlayer.MediaPlayer.1"))',"VBScript");l=wmpObj}var g=l;if(g){for(var h=0;h<k.length;h++){g=Vio.Player.MediaPlayers.WindowsMedia.CanPlay(k[h].Extension);if(g){break}}}return(g)},MediaTimeTranscriptionCallback:function(g){Vio.Player.MediaTimeTranscriptionCallback({currentTime:g.value.currentTime,target:g.data.target.Element})}}})()});Vio.Extend(Vio.Player.MediaPlayers,{Html5:(function(){var j="undefined";var k;var e=(navigator.platform.toLowerCase()=="ipad"||navigator.platform.toLowerCase()=="iphone"||navigator.platform.toLowerCase()=="ipod")?true:false;var d=(navigator.userAgent.search(/Android/i)>0);function b(n){var m;var l=document.getElementsByClassName("player-error");if(l.length>0){m=l[0]}if(m){m.parentNode.removeChild(m)}}function a(s,u,q,r){var m;var l=document.getElementsByClassName("player-error");if(l.length>0){m=l[0]}else{m=document.createElement("div");var p=u/2;var n=q;var o=10;m.className="player-error";m.style.position="absolute";m.style.width=(p-o)+"px";m.style.height=(65-o)+"px";m.style.left=p/2+"px";m.style.top=(n-65)/2+"px";s.PlayerElement.appendChild(m)}m.innerHTML=r}function g(p,q,l,o,m){p.setAttribute("width",q);p.setAttribute("height",l);for(i=0;i<o.length;i++){var n=document.createElement("source");n.src=o[i].Url;if(typeof(o[i].MimeType)!=j){n.type=o[i].MimeType}p.appendChild(n)}p.load();if(m){p.play()}}var c=function(l,m){this.player=l;this.options=m;var n=this;var o=this.player;this.player.addEventListener("timeupdate",function(p){Vio.Event.Trigger("mediaTimeUpdate",{currentTime:p.target.currentTime,duration:p.target.duration},n,null)},false);this.player.addEventListener("play",function(p){Vio.Event.Trigger("mediaResumed",true,n,null)},false);this.player.addEventListener("pause",function(p){Vio.Event.Trigger("mediaPaused",true,n,null)},false);this.player.addEventListener("waiting",function(p){Vio.Event.Trigger("mediaWaiting",true,n,null)},false);this.player.addEventListener("playing",function(p){Vio.Event.Trigger("mediaPlaying",true,n,null)},false);this.player.addEventListener("ended",function(p){Vio.Event.Trigger("mediaEnded",true,n,null)},false);this.player.addEventListener("error",function(p){Vio.Event.Trigger("mediaError",p,n,null)},false);this.player.addEventListener("loadstart",function(p){Vio.Event.Trigger("mediaLoadStart",p,n,null)},false);this.player.addEventListener("loadedmetadata",function(q){var r=false;if(o.getAttribute("controls")!=null){r=true}else{for(var s=0;s<n.player.parentNode.childNodes.length;s++){if(n.player.parentNode.childNodes[s].className=="player-controls"){r=true;break}}}if(!r&&Vio.Player.Html5PlayerSkin.RenderControls()){var u=Vio.Player.Html5PlayerSkin.LoadSkin(n)}else{var p=n.player.parentNode.getElementsByClassName("player-info-container");if(p.length>0){Vio.Event.Trigger("mediaChanged",{mb:n.mediaBase},p[0],null)}}},false);Vio.Event.Bind(n,"skinReady",function(){if(typeof(o.buffered)!=j){n.beginBufferRequests()}else{o.addEventListener("progress",function(p){Vio.Event.Trigger("mediaProgress",(p.loaded/p.total),n,null)},false)}},true)};c.prototype=(function(){var r;function m(){var z=this;var x=this.player;function y(){var A=x.buffered.end(0);Vio.Event.Trigger("mediaProgress",(A/x.duration),z,null);if(A>=x.duration){clearInterval(r)}}r=setInterval(y,500)}function q(){if(this.player.paused){this.player.play()}else{this.player.pause()}}function s(x){if(x>=0||x<=video.duration){this.player.currentTime=x;Vio.Event.Trigger("mediaSeeking",this.player,self,null)}}function u(x){this.player.Volume=x}function o(){var x=new Object();x.width=this.player.width;x.height=this.player.height;return(x)}function n(){return(this.player.currentTime)}function p(){return(this.player.duration)}function v(){var x=false;if(typeof(this.player.webkitSupportsFullscreen)!=j){x=this.player.webkitSupportsFullscreen}return(x)}function w(z,y){if(this.supportsFullscreen()){if(typeof(this.player.webkitEnterFullscreen)!=j){if(!this.player.webkitDisplayingFullscreen()){this.player.webkitEnterFullscreen()}else{this.player.webkitExitFullscreen()}}}else{var x=this.player.parentNode.parentNode;if(typeof(x)!=j){if(!this.displayingFullscreen){x=document.body.appendChild(x);x.style.position="absolute";x.style.top=0;x.style.left=0;x.style.width=document.body.clientWidth+"px";x.style.height=document.body.clientHeight+"px";this.player.style.zIndex=100;this.player.setAttribute("width",document.body.clientWidth);this.player.setAttribute("height",document.body.clientHeight);this.displayingFullscreen=true}else{x.style.position="relative";x.style.top="auto";x.style.left="auto";x.style.width=z+"px";x.style.height=y+"px";this.player.style.zIndex=0;this.player.setAttribute("width",z);this.player.setAttribute("height",y);this.displayingFullscreen=false}}}}function l(z,y){var x=this.player.parentNode.parentNode;x.style.width=z+"px";x.style.height=y+"px";this.player.setAttribute("width",z);this.player.setAttribute("height",y)}return{PlayPause:q,SeekVideo:s,SetVolume:u,Dimensions:o,CurrentTime:n,Duration:p,beginBufferRequests:m,supportsFullscreen:v,toggleFullscreen:w,displayingFullscreen:false,adjustSize:l}})();function h(n,m,l){return(typeof(n[m])==j)?l:n[m]}return{Name:"HTML Video",Render:function f(z){var u=z.Options.embedPlayer;b(z);if(typeof(Vio.Player.Html5PlayerSkin)==j){if(typeof(z.Options.skin)==j||typeof(z.Options.skin.html5_url)==j){Vio.Extend(Vio.Player,{Html5PlayerSkin:{RenderControls:function(){return false},LoadSkin:function(H){return null}}})}else{var q=document.getElementsByTagName("head")[0];var y=document.createElement("script");y.setAttribute("type","text/javascript");y.setAttribute("src",z.Options.skin.html5_url);q.appendChild(y);var B=false,C=setTimeout(function(){a(z,u.playerWidth,u.playerHeight,"Your connection has timed out whilst accessing external files");B=true},30000)}(function(){if(typeof(Vio.Player.Html5PlayerSkin)==j){if(!B){setTimeout(arguments.callee,10)}}else{clearTimeout(C);B=true;f(z)}})();return}var G=isNaN(u.playerWidth*1)?u.playerWidth:u.playerWidth+"px";z.PlayerElement.style.width=u.playerWidth+"px";z.PlayerElement.style.height=u.playerHeight+"px";z.PlayerElement.style.position="relative";var w=z.Options.player;var s=Vio.Media.Find(u.mediaId);if(s&&s.Urls.length>0){var p=["mp4","ogg"];var D=new Array();var r=0;while(typeof(u.playerExtension)==j&&r<p.length){if(s.HasUrl(p[r])){D.push(s.FindUrl(p[r],u.playerQuality))}r++}if(D.length>0){var A=s.FindThumbnail(u.playerWidth);var E=z.PlayerElement.getElementsByTagName("video");if(E.length>0){var F=E[0];var v=F.childNodes;if(v.length>0){for(r=(v.length-1);r>=0;r--){F.removeChild(v[r])}}g(F,u.playerWidth,u.playerHeight,D,true)}else{F=document.createElement("video");var m=h(w,"bg_colour","#000000");F.style.background=m.replace(/0x/,"#");var n=document.createElement("div");z.PlayerElement.appendChild(n);if(typeof(A)!=j&&A!=null){F.setAttribute("poster",A.Path)}if(!Vio.Player.Html5PlayerSkin.RenderControls()){F.setAttribute("controls","controls")}F.setAttribute("preload","metadata");var l=h(w,"autoplay",false);F.setAttribute("autoplay",(l=="always"?true:false));n.appendChild(F);g(F,u.playerWidth,u.playerHeight,D,false)}var x=new c(F,z.Options);x.mediaBase=s;function o(H){var I;switch(H.value.target.error.code){case H.value.target.error.MEDIA_ERR_DECODE:I="Your browser does not support playback of this video.";break;case H.value.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:I="Your browser does not support playback of this video.";break;default:I="An unknown error occurred"}a(z,u.playerWidth,u.playerHeight,I)}Vio.Event.Trigger("playerReady",{tag:F,player:x},z.Element,null);Vio.Event.Bind(x,"mediaError",o,true);if(z.Options.transcription.enabled){if(Vio.Device.iPhone||Vio.Browser.msie){Vio.Event.Trigger("RenderTranscriptionDownload",z)}else{Vio.Event.Bind(x,"mediaTimeUpdate",Vio.Player.MediaPlayers.Html5.MediaTimeTranscriptionCallback,{target:z});Vio.Event.Trigger("RenderTranscription",z)}}if(typeof(z.Options.embedPlayer.viocastId)!=j&&z.Options.embedPlayer.viocastId>0){Vio.Event.Bind(x,"mediaTimeUpdate",function(H){Vio.Event.Trigger("mediaTimeUpdate",{currentTime:H.value.currentTime,duration:H.value.duration,target:z},z,null)},null);Vio.Event.Bind(z,"slideSeekEvent",function(H){x.SeekVideo(H.value.time)},null)}if(z.Options.reporting.enabled){Vio.Event.Bind(x,"mediaTimeUpdate",function(H){if(Math.round(H.value.currentTime)%10==0){$v.track.video.progress(H.data.mediaId,H.data.target.Options.embedPlayer.playerId,H.value.currentTime)}},{mediaId:s.MediaId,target:z});Vio.Event.Bind(x,"mediaLoadStart",function(I){var K=null;var H=I.value.target.currentSrc;for(var J=0;J<s.Urls.length;J++){if(s.Urls[J].Url==H){K=s.Urls[J];break}}if(K!=null){$v.track.video.load(I.data.mediaId,I.data.target.Options.embedPlayer.playerId,{duration:K.Duration,format:K.MimeType,quality:K.Quality,playerType:I.data.target.Options.embedPlayer.playerFormat})}},{mediaId:s.MediaId,target:z});Vio.Event.Bind(x,"mediaEnded",function(H){$v.track.video.end(H.data.mediaId,H.data.target.Options.embedPlayer.playerId)},{mediaId:s.MediaId,target:z});Vio.Event.Bind(x,"mediaPlaying",function(H){$v.track.video.view(H.data.mediaId,H.data.target.Options.embedPlayer.playerId)},{mediaId:s.MediaId,target:z})}}else{Vio.Log("media item not available")}}else{Vio.Media.LoadP(u.mediaId,function(){var H=Vio.Media.Find(u.mediaId);if(H&&H.Urls.length>0){f(z)}})}},DisplayError:a,CanPlay:function(m){var l=Vio.Player.MediaPlayers.Html5.SupportsType(m);return(l)},GetPlayImage:function(){return(Vio.BaseURL+"Images/click_to_play.png")},SupportsVideo:function(){return(!!document.createElement("video").canPlayType)},SupportsType:function(n){var l="";var m=false;var o=document.createElement("video");if(typeof(o.canPlayType)!=j){l=o.canPlayType(n)}if(l=="maybe"||l=="probably"){m=true}return(m)},IsAvailable:function(n){var l=Vio.Player.MediaPlayers.Html5.SupportsVideo();if(l){for(var m=0;m<n.length;m++){l=Vio.Player.MediaPlayers.Html5.CanPlay(n[m].MimeType);if(l){break}}}return(l)},MediaTimeTranscriptionCallback:function(l){Vio.Player.MediaTimeTranscriptionCallback({currentTime:l.value.currentTime,target:l.data.target.Element})}}})()});Vio.Extend(Vio.Player.MediaPlayers,{Silverlight:(function(){var k="undefined",g="object",l=window,c=document,e=navigator,b=Vio.$ce,d=Vio.$ge,j="application/x-silverlight-2",a=Vio.Browser;var h=function(){objIdArr=[],function r(s){return s.toLowerCase()};function q(s){return parseInt(s,10)}var p=(function(){if(a.msie){try{var u=new ActiveXObject("AgControl.AgControl");return true}catch(s){return false}}return !!navigator.plugins["Silverlight Plug-In"]})();function n(s,x,y,v,w){var u="<object ";u+=('width="'+y+'" ');u+=('height="'+v+'" ');u+=('type="'+j+'" ');u+=('data="data:'+j+'," ');u+=('id="'+s.id+'_obj" ');u+=">";u+='<param name="source" value="'+x+'" />';u+='<param name="minRuntimeVersion" value="4.0.50401.0" />';u+='<param name="onerror" value="onSilverlightError" />';u+='<param name="background" value="black" />';u+='<param name="MaxFrameRate" value="30" />';u+='<param name="initparams" value="MS.SP.url='+Vio.BaseURL+" ,showstatistics=false, autoplay=true, muted=false, playlistoverlay=true, loglevel=Information, theme="+Vio.BaseURL+"Silverlight/Viocorp.xaml,smfPlugins="+Vio.BaseURL+"Silverlight/OVPBasicMediaPlugin.xap "+Vio.BaseURL+"Silverlight/OVPOverlayLogWriter.xap, stretchmode=Fit, stretchmodefullscreen=Fit, mediasource="+w+'" />';u+='<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none;"></a>';u+="</object>";s.style.visibility="hidden";s.innerHTML=u;s.style.visibility="visible"}function o(){return p}function m(s,v,w){var u=b("param");u.setAttribute("name",v);u.setAttribute("value",w);s.appendChild(u)}return{embed:function(v,w,x,s,u){Vio.OnReady(function(){x+="";s+="";var y=d(w);if(o()){n(y,v,x,s,u)}else{y.innerHTML='<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a>'}})},isInstalled:function(){return o()}}}();function f(m){return m.type==j}return{Name:"Silverlight",Render:function(s){me=s.Options.embedPlayer;var p=Vio.Media.Find(me.mediaId);if(p&&p.Urls.length>0){var n=["wmv","wma","mp3","mp4","asx"];var o=0;while(typeof(me.playerExtension)==k&&o<n.length){if(p.HasUrl(n[o])){me.playerExtension=n[o]}o++}var q=p.FindUrl(me.playerExtension,me.playerQuality);if(q){var r=Vio.$go(s.PlayerElement);if(r&&f(r)&&r.Source){r.source=q.Url}else{Vio.$ee(s.PlayerElement);var m=b("div");m.id="VioPlayer"+Vio.Rand();s.PlayerElement.appendChild(m);h.embed(Vio.BaseURL+"Silverlight/OVP.xap",m,me.playerWidth,me.playerHeight,q.Url)}}else{Vio.Log("no media")}}else{Vio.Media.LoadP(me.mediaId,function(){var u=Vio.Media.Find(me.mediaId);if(u&&u.Urls.length>0){Render(s)}})}},CanPlay:function(m){return(/wmv|wma|mp3|mp4|asx|gif|png|jpg/i).test(m)},IsAvailable:function(o){var m=h.isInstalled();if(m){for(var n=0;n<o.length;n++){m=Vio.Player.MediaPlayers.Silverlight.CanPlay(o[n].MimeType);if(m){break}}}return(m)}}})()});Vio.Extend({BaseURL:"http://player.cdn.vioapi.com/v6.8/"});
