if(typeof jQuery=="undefined"){throw"Gypsy Player requires jQuery!"}$GP={players:[],hash:{},serial:false,error:function(A){if(typeof console!="undefined"){console.log(A)}if(false){alert(A)}},events:{onPlay:function(){},onPause:function(){},onFinish:function(){},onReady:function(){}},registerPlayer:function(E){var A=false;if(!E._trace){A=true}else{if(navigator.plugins&&navigator.plugins.length){for(var C=0,B=navigator.plugins.length;C<B;++C){if(navigator.plugins[C].name.indexOf(E._trace[0])>-1){A=true;break}}}else{try{A=new ActiveXObject(E._trace[1])||false}catch(D){}}}E.enabled=Boolean(A);this.players.push(E)},unregisterPlayer:function(B){var A=this.players.length;while(A--){if(this.players[A]&&this.players[A].name==B){delete this.players[A]}}},control:{click:function(){var B=jQuery(this).attr("name"),A=$GP.hash[this._dp];if($GP.events[B+"Press"]){if($GP.events[B+"Press"](A)){A.cmd(B)}}else{A.cmd(B)}}},getStreamType:function(B){var C=B.indexOf("?"),B=(C>-1)?B.substring(0,C):B,A=/.+\.([^.]+)$/.exec(B)||[];return A[1]||"unknown"},url:{silverlight:"digomePlayer/digomePlayer.xap",flash:"digomePlayer/digomePlayer.swf"},IE:(jQuery.browser.msie)};(function(D){D.fn.gypsy=function(G){return this.each(function(){var M=D.extend({width:"720",height:"480",onReady:function(N){},autoPlay:false,playerParams:{},url:D(this).attr("src")||D(this).attr("href")||"",forceExtension:false},G),K=(M.forceExtension)?M.forceExtension:$GP.getStreamType(M.url);var L=$GP.players,I=L.length;while(I--){if(L[I]&&D.inArray(K,L[I].ext)>=0&&L[I].enabled){return E(this,L[I],M)}}$GP.serial=M.serial||false;var I=L.length,H=false;while(I--){if(D.inArray(K,L[I].ext)>=0){if(!H){H="Your browser does not support viewing ."+K+" files. <br /> Please install one of the following to play these files &raquo; <br />"}H+=' - <a href="'+L[I].url+'">'+L[I].name+"</a> <br />"}}if(!H){H="Unsupported Video Type ("+K+")"}if(M.serial){var J=$GP.hash[M.serial];$GP.events.onFinish(J);jQuery(J.e).html(H).height(M.height).width(M.width)}else{D(this).prepend(H)}})};function E(M,H,N){A++;var Q=$GP.serial=N.serial||A;if(H._beforeEmbed){H._beforeEmbed(Q)}var G={width:N.width,height:N.height},I=D.extend({},H._params,N.playerParams),L="";H.setStream.call(I,N.url);for(var O in I){L+=F({name:"param",attr:{name:O,value:I[O]}})}var J=(H._obj)?F({name:"object",attr:D.extend({id:"gp_"+Q},H._obj,G),child:[L,($GP.IE||!H._embed)?{}:{name:"embed",attr:D.extend({name:"gp_"+Q},H._embed,G,I)}]}):'<div id="gp_'+Q+'" class="digome-player-content" />';B[Q]=D.extend(B[Q],{api:H.API,e:M,c:N,serial:Q,ext:H.ext,i:null,plugin:H.name,cmd:function(){var R=D.makeArray(arguments);var W=R.shift(),U=$GP.control[W]||false,T=this.api[W]||false;try{if(W=="setStream"&&!this.c.forceExtension){if(!this.ext||D.inArray($GP.getStreamType(R[0]),this.ext)<0){var V=D.extend({},this.c,{serial:this.serial,autoPlay:R[1]||this.cmd("isPlaying"),url:R[0]});clearInterval(this.i);this.cmd("stop");this.cmd("stop");this.ext=null;D(this.stream).unbind().css("display","none").remove();D("#dpQTevt"+this.serial).remove();$GP.events.onPause(this);return D(M).gypsy(V)}}if(U){U.apply(this.stream,R)}if(T){return(D.isFunction(T))?T.apply(this.stream,R):this.stream[T]()}}catch(S){$GP.error('error executing "'+W+'" -> '+S)}}});D(M).html(J);if(H._afterEmbed){H._afterEmbed(Q,J,M)}var P=H.onStart||function(){},K=0;B[Q].i=setInterval(function(){if(K++>70){clearInterval(B[Q].i);return $GP.error("Preparing plugin timed out!")}var S=D("#gp_"+Q)[0],R=D("embed",S)[0];if(H._isReady.apply(S)){B[Q].stream=S}else{if(H._isReady.apply(R)){B[Q].stream=R}else{return }}clearInterval(B[Q].i);P.call(B[Q].stream,B[Q]);if(N.autoPlay){setTimeout(function(){B[Q].cmd("play")},300)}$GP.events.onReady.call(B[Q].stream,B[Q]);return N.onReady.call(B[Q].stream,B[Q])},200)}function F(I){if(typeof (I.name)=="undefined"){return""}var H="<"+I.name,J="";if(I.attr){for(k in I.attr){H=H+" "+k+'="'+I.attr[k]+'"'}}if(I.child){if(typeof (I.child)=="string"){I.child=[I.child]}for(var G=0;G<I.child.length;G++){J+=(typeof (I.child[G])=="object")?F(I.child[G]):I.child[G]}}return(I.selfClose)?H+"/>":H+">"+J+"</"+I.name+">"}var B=$GP.hash,C=$GP.players,A=0})(jQuery);$GP.registerPlayer({name:"Adobe Flash Player",url:"http://www.adobe.com/products/flashplayer/",ext:["flash","flv","mp3","mp4","f4v","m4v"],_obj:{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},_embed:{type:"application/x-shockwave-flash"},_trace:["Shockwave Flash","ShockwaveFlash.ShockwaveFlash.7"],_params:{allowScriptAccess:"always",allowFullScreen:true,bgcolor:"#000000",wmode:"Opaque"},setStream:function(A){this.FlashVars="videoURL="+A+"&autoStart=false&id="+this.id},onStart:function(A){this.addCallback("onPlay","$GP.flashHandler");this.addCallback("onPause","$GP.flashHandler");this.addCallback("onFinish","$GP.flashHandler");this.addCallback("onWait","$GP.flashHandler");this.addCallback("onError","$GP.flashHandler")},_beforeEmbed:function(A){this._params.src=$GP.url.flash;this._params.id="gp_"+A},_afterEmbed:function(B,D,C){if($GP.IE){jQuery("object",C).remove();try{C.innerHTML=D}catch(A){alert("IE: unable to inject player. Non block item (<p>?) upstream.");return }}},_isReady:function(){try{return(this.isReady()&&this.getVersion())}catch(A){}return false},API:{play:"playStream",stop:"stopStream",pause:"pauseStream",getVolume:"getVolume",setVolume:function(A){this.setVolume(A)},fullscreen:function(){alert("Please double click the video to enter fullscreen mode.")},mute:function(){this.setVolume(0)},unmute:function(){this.setVolume(100)},getProgress:"getProgress",setProgress:function(A){this.setProgress(A)},getBuffer:"getBuffer",getReceived:"getReceived",getStream:"getStream",setStream:function(A,B){this.setStream(A);if(B||this.isStreamPlaying()){this.playStream()}},isPlaying:"isStreamPlaying"}});$GP.flashHandler=function(A,B,C){B=B.replace(/gp\_/,"")||$GP.serial;C=C||null;if(typeof ($GP.events[A])!="undefined"){$GP.events[A]($GP.hash[B],C)}};$GP.registerPlayer({name:"Image Player",url:"http://digome.com/",ext:["jpg","jpeg","gif","png"],_obj:false,_embed:false,_trace:false,_params:{},setStream:function(){},onStart:function(A){jQuery(this).height("100%").width("100%").html('<img src="'+A.c.url+'"/>').css("overflow","hidden")},_isReady:function(){return true},API:{play:function(){},stop:function(){},pause:function(){},getVolume:function(){return this._volume||100},setVolume:function(A){this._volume=A},fullscreen:function(){return },mute:function(){this._volume=0},unmute:function(){this._volume=100},getProgress:function(){return 100},setProgress:function(){},getBuffer:function(){return 100},getReceived:function(){return 100},getStream:function(){return jQuery("img",this).attr("src")},setStream:function(A,B){var C=jQuery(this);C.fadeOut(function(){C.html('<img src="'+A+'" />').fadeIn()})},isPlaying:function(){return true}}});(function($){var $ERR=function(e){alert("DigomePlayer - "+e);throw ("DP")};$GP.DP={registerSkin:function(path){path=path||"digomePlayer/skin";if(path.charAt(path.length-1)!="/"){path+="/"}var skin={path:path};this.skins.push(skin);$("head").append('<link rel="stylesheet" href="'+path+'dpSkin.css" type="text/css" />');$.ajax({url:path+"dpSkin.html",success:function(html){skin.markup=html},error:function(){skin.fail=true}});$.get(path+"dpSkin.js",null,function(js){eval(js);$.extend(skin,$GP.DP.skinTemplate,DigomePlayerSkin)},"text");this.lastSkin=skin},load:function(selector,skinName){if(!this.lastSkin){$ERR("No Registered Skins")}var skin=this.lastSkin;var i=0;(function onSkinReady(){if(i++>60){$ERR('Timeout registering "'+((skinName)?skinName:skin.path)+'" Skin.')}if(skin.fail){$ERR('Error Loading "'+((skinName)?skinName:skin.path)+'" Skin.')}if(skinName&&skinName!=skin.name){skin={};var x=$GP.DP.skins,y=x.length;while(y--){if(x[y].name==skinName){skin=x[y];break}}}if(!skin.name||!skin.markup){return setTimeout(onSkinReady,333)}$(selector).each(function(i){var d="{}",m=/({.*})/.exec(this.className);if(m){d=m[1]}if(d.indexOf("{")<0){d="{"+d+"}"}d=eval("("+d+")");var o=$.extend({url:this.href,playerParams:{},timeout:"Unable to load Video. Please try again.",isStream:false},d);skin.draw(this,o);if(!skin.movie||skin.movie.length<1){$ERR("Skin did not declare valid movie element(s).")}skin.movie.gypsy(o);var S=$GP.serial;if(S){skin.serial=S;skin.timeout=o.timeout;skin.isStream=o.isStream;$GP.hash[S].skin=$.extend({},skin);$GP.hash[S].Q=[];setTimeout(function(){$GP.hash[S].skin.onDraw(S,o)},9)}if(o.tab){skin.tabAdd(o.url,o.tab,S)}$(this).remove()})})()},skins:[],lastSkin:false,skinTemplate:{draw:function(e){$(e).after(skin.markup)},onDraw:function(){},addComponent:function(type,selector,alt){alt=alt||false;var s=this.serial,e=(typeof (selector)=="string")?$(selector,this.xml):$(selector);e[0]._dp=s;if(e.length<1){$ERR('Unable to register Skin Component "'+type+', invalid selector."')}switch(type){case"control":e.each(function(){$(this).click($GP.DP.controlClick)[0]._dp=s}).bind("mouseenter mouseleave",function(e){$(this)[((e.type=="mouseenter")?"add":"remove")+"Class"]("dpHover")});break;case"playhead":if(alt){if(typeof (alt)=="string"){alt=$(alt,this.xml)}}else{alt=e.parent()}var b=alt.offset();b.right=b.left+alt.width();b.width=b.right-b.left;this.scrubBar={i:null,e:e,p:0,b:b,start:function(){if(!this.i){this.i=setInterval(function(){var h=$GP.hash[s];h.skin.scrubBar.setPos(h.cmd("getProgress"))},400)}},stop:function(){clearInterval(this.i);this.i=null},setPos:function(p){if(p>=0&&p!=this.p){this.e.width(b.width*p/100);this.p=p}}};$(alt).mousedown(function(z){var o=$(this),h=e,v=$GP.hash[h[0]._dp],slide=function(e){var i=(e.clientX<b.left)?"0px":((e.clientX>b.right)?"100%":e.clientX-b.left+"px");h.width(i)};b.w=h.width();v.cmd("pause");h.stop(true).width(z.clientX-b.left+"px");$().mousemove(slide).one("mouseup",function(e){$().unbind("mousemove",slide);var p=(true)?h.width():b.w;v.cmd("setProgress",parseInt(100*p/(b.width)));v.cmd("play")})});break;case"progress":this.progress={i:null,e:e,start:function(){if(!this.i){this.i=setInterval(function(){var h=$GP.hash[s];h.skin.progress.setPos(h.cmd("getReceived"))},400)}},stop:function(){clearInterval(this.i);this.i=null},setPos:function(p){this.e.width(p+"%");if(p>=100){this.stop()}}};break;case"volume":var bar=(alt)?$(alt,this.xml):false,box=e.parent();var b=box.offset();b.right=b.left+box.width();b.width=b.right-b.left;this.volume={handle:e,handleWidth:e.width(),bar:bar,b:b,set:function(v){var h=$GP.hash[s],w=this.b.width*v/100,l=(this.b.width-this.handleWidth)*v/100;this.bar.width(w);this.handle.css("left",l+"px");h.cmd("setVolume",v);if(v==0&&h.skin.onMute){h.skin.onMute()}else{if(h.skin.onUnmute){h.skin.onUnmute()}}}};$(box).mousedown(function(z){var h=$GP.hash[e[0]._dp],slide=function(e){var i=(e.clientX<b.left)?0:((e.clientX>b.right)?100:(100*(e.clientX-b.left)/b.width));h.skin.volume.set(i)};h.skin.volume.set(100*(z.clientX-b.left)/b.width);$().mousemove(slide).one("mouseup",function(){$().unbind("mousemove",slide)})});break;case"mute":e.click(function(){var h=$GP.hash[this._dp],vol=h.cmd("getVolume");if(vol>0){this._vol=vol;h.skin.volume.set(0)}else{h.skin.volume.set(this._vol||50)}});break}},setStatus:function(txt){if(this.status){this.status.html(txt).show()}},tabAdd:function(){},tabDel:function(){},tabClick:function(){},onPlay:function(){},onPause:function(){},showStatus:function(msg){},hideStatus:function(){}},controlClick:function(){if($GP.hash[this._dp].skin.isStream&&$(this).attr("name")=="pause"){$GP.hash[this._dp].cmd("stop")}else{$GP.control.click.apply(this)}}};$.extend($GP.events,{onPlay:function(h){var i=0,stream=h.cmd("getStream");h._p=true;(function onPlaying(){if(!h._p){return }if(i++>30){h.cmd("pause");h.cmd("setStream",stream,false);return h.skin.showStatus(h.skin.timeout)}if(!h.cmd("isPlaying")){if(i%10==0){h.cmd("play")}return setTimeout(onPlaying,333)}if(!h.skin.buffering){h.skin.hideStatus()}if(h.skin.scrubBar){h.skin.scrubBar.start()}if(h.skin.progress){h.skin.progress.start()}h.skin.onPlay()})()},onPause:function(h){h._p=false;if(h.skin.scrubBar){h.skin.scrubBar.stop()}h.skin.onPause()},onWait:function(h){if(h.skin.buffering){return }h.skin.buffering=true;(function pollBuffer(){var b=h.cmd("getBuffer");if(b<100){h.skin.showStatus("Buffering ("+b+"%)");return setTimeout(pollBuffer,800)}h.skin.hideStatus();h.skin.buffering=false})()},onError:function(h,msg){h._p=false;return h.skin.showStatus(msg)},onFinish:function(h){h._p=false;if(h.skin.scrubBar){h.skin.scrubBar.stop()}},onReady:function(h){if(h.skin.volume){h.skin.volume.set(h.cmd("getVolume"))}if(h.plugin=="Image Player"){h.skin.hideControls()}else{h.skin.showControls()}}})})(jQuery);DigomePlayer=$GP.DP;