/*!
 * projekktor zwei
 * http://www.projekktor.com
 *
 * Copyright 2010, Sascha Kluger, Spinning Airwhale Media, http://www.spinningairwhale.com
 * under GNU General Public License
 * http://www.projekktor.com/license/
 *
 * You can use, modify and distribute the software, but do so in the spirit of Open Source.
 * You need to leave the copyright notices intact.
 * You need to be able to share any modifications you make to the Projekktor source (not the software Projekktor is integrated to).
 * Give credit where credit is due, spread the word, link to us if you can.
 *
 * Includes jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * ,------------------------------------------,      .    _  .
 * |  Naaah, love shines through !!1          |      |\_|/__/|
 * |------------------------------------------|     / / \/ \  \
 *                                           \     /__|O||O|__ \
 *                                             \  |/_ \_/\_/ _\ |
 *                                                | | (____) | ||
 *                                                \/\___/\__/  //
 *                                                (_/         ||
 *                                                 |          ||
 *                                                 |          ||\
 *                                                  \        //_/
 *                                                   \______//
 *                                                 __ || __||
 *                                                (____(____)
 */
var playerObjectAUDIOFLASH=function(){};playerObjectAUDIOFLASH.prototype={usingFlash:true,imageElement:{},createMediaElement:function(b){this.elementReady=false;var a=this;if(this.environment.flashVersion[0]<9){this.setTestcard(6);return}var c={id:this.environment.publicName+"_media_flash",name:this.environment.publicName+"_media_flash",src:this.config.playerFlashMP3,width:"1",height:"1",allowScriptAccess:"always",wmode:"opaque",bgcolor:"#000000",FlashVars:null};this.createFlash(c,b);if(this.media.poster){this.imageElement=$(document.createElement("img"));this.imageElement.load(function(d){a.scaleImage()});this.imageElement.error(function(d){a.removeImage()});this.imageElement.appendTo(b).attr({id:this.environment.publicName+"_media_image",src:this.media.poster}).hide()}},scaleImage:function(){var a=$("#"+this.environment.publicName+"_media");this.imageElement.show();this.stretch(this.config.imageScaling,this.imageElement,a.width(),a.height())},removeImage:function(){this.imageElement.remove()},addListeners:function(){this.mediaElement.api_attribute("onprogress","window.PInstance["+this.environment.instanceIdx+"].playerObject.progressListener");this.mediaElement.api_attribute("ontimeupdate","window.PInstance["+this.environment.instanceIdx+"].playerObject.timeListener");this.mediaElement.api_attribute("onended","window.PInstance["+this.environment.instanceIdx+"].playerObject.endedListener");this.mediaElement.api_attribute("onpause","window.PInstance["+this.environment.instanceIdx+"].playerObject.pauseListener");this.mediaElement.api_attribute("onplaying","window.PInstance["+this.environment.instanceIdx+"].playerObject.playingListener");this.mediaElement.api_attribute("onplay","window.PInstance["+this.environment.instanceIdx+"].playerObject.startListener");this.mediaElement.api_attribute("onvolumechange","window.PInstance["+this.environment.instanceIdx+"].playerObject.volumeListener");this.mediaElement.api_attribute("onwaiting","window.PInstance["+this.environment.instanceIdx+"].playerObject.waitingListener");this.mediaElement.api_attribute("oncanplaythrough","window.PInstance["+this.environment.instanceIdx+"].playerObject.canplayListener");this.mediaElement.api_attribute("oncanplay","window.PInstance["+this.environment.instanceIdx+"].playerObject.canplayListener");this.mediaElement.api_attribute("onerror","window.PInstance["+this.environment.instanceIdx+"].playerObject.errorListener")},removeListeners:function(){try{this.mediaElement.api_attribute("ontimeupdate",false);this.mediaElement.api_attribute("onprogress",false);this.mediaElement.api_attribute("onended",false);this.mediaElement.api_attribute("onpause",false);this.mediaElement.api_attribute("onplaying",false);this.mediaElement.api_attribute("onplay",false);this.mediaElement.api_attribute("onvolumechange",false);this.mediaElement.api_attribute("onwaiting",false);this.mediaElement.api_attribute("oncanplaythrough",false);this.mediaElement.api_attribute("oncanplay",false);this.mediaElement.api_attribute("onerror",false)}catch(a){}},setSeek:function(b){try{this.mediaElement.api_seek(b)}catch(a){}},setVolume:function(a){try{this.mediaElement.api_volume(a)}catch(b){}},setPause:function(a){this._isPlaying=false;try{this.mediaElement.api_pause()}catch(b){}},setPlay:function(a){this._isPlaying=true;try{this.mediaElement.api_play()}catch(b){}},getVolume:function(){try{return this.mediaElement.api_get("volume")}catch(a){}},errorListener:function(a){this.setTestcard(4)}};var playerObjectAUDIO=function(){};playerObjectAUDIO.prototype={allowRandomSeek:false,imageElement:{},createMediaElement:function(b){var a=this;if(this.media.poster){this.imageElement=$(document.createElement("img"));this.imageElement.load(function(c){a.scaleImage()});this.imageElement.error(function(c){a.removeImage()});this.imageElement.appendTo(b).attr({id:this.environment.publicName+"_media_image",src:this.media.poster}).hide()}this.mediaElement=$(document.createElement("audio")).appendTo(b).attr({id:this.environment.publicName+"_media_html",src:this.media.file,controls:false,autoplay:false,autobuffer:false,loop:false}).css({width:"1px",height:"1px"});if(this.media.mediaType.indexOf("/ogg")>-1){this.allowRandomSeek=true}this.waitforPlayer()},scaleImage:function(){var a=$("#"+this.environment.publicName+"_media");this.imageElement.show();this.stretch(this.config.imageScaling,this.imageElement,a.width(),a.height())},removeImage:function(){this.imageElement.remove()},waitforPlayer:function(){if(this.elementReady==true){return}var c=this;var a=$("#"+this.environment.publicName+"_media_html");try{if(a==undefined){setTimeout(function(){c.waitforPlayer()},500);return}if(a[0].networkState==undefined){setTimeout(function(){c.waitforPlayer()},500);return}}catch(b){setTimeout(function(){c.waitforPlayer()},500);return}this.mediaElement=a;this.addListeners();this.elementReady=true},addListeners:function(){var a=this;this.mediaElement.bind("pause",function(){a.pauseListener(this)});this.mediaElement.bind("playing",function(){a.playingListener(this)});this.mediaElement.bind("play",function(){a.startListener(this)});this.mediaElement.bind("volumechange",function(){a.volumeListener(this)});this.mediaElement.bind("progress",function(b){a.progressListener(b,this)});this.mediaElement.bind("timeupdate",function(){a.timeListener(this)});this.mediaElement.bind("ended",function(){a.endedListener(this)});this.mediaElement.bind("waiting",function(){a.waitingListener(this)});this.mediaElement.bind("canplaythrough",function(){a.canplayListener(this)});this.mediaElement.bind("canplay",function(){a.canplayListener(this)});this.mediaElement.bind("error",function(){a.errorListener(this)});this.mediaElement.bind("suspend",function(){a.suspendListener(this)})},updatePlayerInfo:function(){var b=this;var a=4;try{if(this._isPlaying==true){if($.browser.opera){a=3}if(this.mediaElement[0].networkState==a&&this.mediaElement[0].networkState!=undefined){this.errorListener()}setTimeout(function(){b.updatePlayerInfo()},500)}}catch(c){}},detachMedia:function(){try{$(this.mediaElement[0]).attr("src","");this.mediaElement[0].load()}catch(a){}},setPlay:function(){try{this.mediaElement[0].play();this._isPlaying=true}catch(a){}this.updatePlayerInfo()},setPause:function(){try{this.mediaElement[0].pause();this._isPlaying=false}catch(a){}},setVolume:function(a){this.mediaElement.attr("volume",a)},setSeek:function(a){this.mediaElement.attr("currentTime",a)}};var playerObjectHTML=function(){};playerObjectHTML.prototype={_autoNext:null,createMediaElement:function(b){var a=this;this.mediaElement=$(document.createElement("iframe")).attr({id:this.environment.publicName+"_media_iframe",name:this.environment.publicName+"_media_iframe",src:this.media.file,scrolling:"no",frameborder:"0",width:"100%",height:"100%"}).css({overflow:"hidden",border:"0px",width:"100%",height:"100%"}).appendTo(b);this.mediaElement.load(function(c){a.success()});this.mediaElement.error(function(c){a.remove()})},detachMedia:function(){clearTimeout(this._autoNext);this.mediaElement.remove()},success:function(){var a=this;if(this.media.duration>0){this._autoNext=setTimeout(function(){a.setPlay()},this.media.duration*1000)}this.elementReady=true},remove:function(){this.mediaElement.remove();this.elementReady=true},setPause:function(){},setPlay:function(){this.sendUpdate("ended")}};var playerObjectIMAGE=function(){};playerObjectIMAGE.prototype={createMediaElement:function(b){var a=this;if(this.media.file==""){this.mediaElement=$(document.createElement("span")).attr({id:this.environment.publicName+"_media_image"}).appendTo(b);$("#"+this.environment.publicName).css({cursor:"pointer"});this.elementReady=true;return}this.mediaElement=$(document.createElement("img")).hide();this.mediaElement.load(function(c){a.scaleImage()});this.mediaElement.error(function(c){a.removeImage()});this.mediaElement.appendTo(b).attr({id:this.environment.publicName+"_media_image",src:this.media.file});if(this.media.isposter===true){$("#"+this.environment.publicName).css({cursor:"pointer"})}this.elementReady=true},removeImage:function(){this.mediaElement.remove()},scaleImage:function(){var a=$("#"+this.environment.publicName+"_media");this.mediaElement.show();this.stretch(this.config.imageScaling,this.mediaElement,a.width(),a.height())},setPlay:function(){this.sendUpdate("start");this.sendUpdate("ended")},setFullscreen:function(a){this.environment.inFullscreen=a;this.sendUpdate("fullscreen",a);this.scaleImage()}};var playerObjectNA=function(){};playerObjectNA.prototype={createMediaElement:function(){this.setTestcard(this.media.errorCode);this.elementReady=true},setPlay:function(){this.sendUpdate("start")},setPause:function(){if(this._hasEnded==false){this._hasEnded=true;this.sendUpdate("ended")}}};var playerObjectPLAYLIST=function(){};playerObjectPLAYLIST.prototype={createMediaElement:function(a){this.elementReady=true},setPlay:function(){this.sendUpdate("playlist",this.media.file)}};var playerObjectVIDEOFLASH=function(){};playerObjectVIDEOFLASH.prototype={usingFlash:true,createMediaElement:function(b){this.elementReady=false;var a=this;if(this.environment.flashVersion[0]<9){this.setTestcard(6);return}var c={id:this.environment.publicName+"_media_flash",name:this.environment.publicName+"_media_flash",src:this.config.playerFlashMP4,width:"100%",height:"100%",allowScriptAccess:"always",allowFullScreen:"true",wmode:"opaque",bgcolor:"#000000",FlashVars:null};this.createFlash(c,b)},addListeners:function(){this.mediaElement.api_attribute("onprogress","window.PInstance["+this.environment.instanceIdx+"].playerObject.progressListener");this.mediaElement.api_attribute("ontimeupdate","window.PInstance["+this.environment.instanceIdx+"].playerObject.timeListener");this.mediaElement.api_attribute("onended","window.PInstance["+this.environment.instanceIdx+"].playerObject.endedListener");this.mediaElement.api_attribute("onpause","window.PInstance["+this.environment.instanceIdx+"].playerObject.pauseListener");this.mediaElement.api_attribute("onplaying","window.PInstance["+this.environment.instanceIdx+"].playerObject.playingListener");this.mediaElement.api_attribute("onplay","window.PInstance["+this.environment.instanceIdx+"].playerObject.startListener");this.mediaElement.api_attribute("onvolumechange","window.PInstance["+this.environment.instanceIdx+"].playerObject.volumeListener");this.mediaElement.api_attribute("onwaiting","window.PInstance["+this.environment.instanceIdx+"].playerObject.waitingListener");this.mediaElement.api_attribute("oncanplaythrough","window.PInstance["+this.environment.instanceIdx+"].playerObject.canplayListener");this.mediaElement.api_attribute("oncanplay","window.PInstance["+this.environment.instanceIdx+"].playerObject.canplayListener");this.mediaElement.api_attribute("onerror","window.PInstance["+this.environment.instanceIdx+"].playerObject.errorListener")},removeListeners:function(){try{this.mediaElement.api_attribute("ontimeupdate",false);this.mediaElement.api_attribute("onprogress",false);this.mediaElement.api_attribute("onended",false);this.mediaElement.api_attribute("onpause",false);this.mediaElement.api_attribute("onplaying",false);this.mediaElement.api_attribute("onplay",false);this.mediaElement.api_attribute("onvolumechange",false);this.mediaElement.api_attribute("onwaiting",false);this.mediaElement.api_attribute("oncanplaythrough",false);this.mediaElement.api_attribute("oncanplay",false);this.mediaElement.api_attribute("onerror",false)}catch(a){}},setSeek:function(b){try{this.mediaElement.api_seek(b)}catch(a){}},setVolume:function(a){try{this.mediaElement.api_volume(a)}catch(b){}},setPause:function(a){this._isPlaying=false;try{this.mediaElement.api_pause()}catch(b){}},setPlay:function(a){this._isPlaying=true;try{this.mediaElement.api_play()}catch(b){}},getVolume:function(){try{return this.mediaElement.api_get("volume")}catch(a){}},errorListener:function(a){this.setTestcard(4)}};var playerObjectVIDEO=function(){};playerObjectVIDEO.prototype={allowRandomSeek:false,videoWidth:0,videoHeight:0,createMediaElement:function(a){this.elementReady=false;if(this.media.mediaType.indexOf("/ogg")>-1){this.allowRandomSeek=true}this.mediaElement=$(document.createElement("video")).appendTo(a).attr({id:this.environment.publicName+"_media_html",src:this.media.file,controls:false,autoplay:false,autobuffer:false,loop:false}).css({width:"100%",height:"100%"});this.waitforPlayer()},waitforPlayer:function(){if(this.elementReady==true){return}var c=this;var a=$("#"+this.environment.publicName+"_media_html");try{if(a==undefined){setTimeout(function(){c.waitforPlayer()},200);return}if(a[0].networkState==undefined){setTimeout(function(){c.waitforPlayer()},200);return}}catch(b){setTimeout(function(){c.waitforPlayer()},200);return}this.mediaElement=a;this.addListeners();this.elementReady=true},addListeners:function(){var a=this;this.mediaElement.bind("loadedmetadata",function(){a.loadedMetaDataListener(this)});this.mediaElement.bind("pause",function(){a.pauseListener(this)});this.mediaElement.bind("playing",function(){a.playingListener(this)});this.mediaElement.bind("play",function(){a.startListener(this)});this.mediaElement.bind("volumechange",function(){a.volumeListener(this)});this.mediaElement.bind("progress",function(b){a.progressListener(b,this)});this.mediaElement.bind("timeupdate",function(){a.timeListener(this)});this.mediaElement.bind("ended",function(){a.endedListener(this)});this.mediaElement.bind("waiting",function(){a.waitingListener(this)});this.mediaElement.bind("canplaythrough",function(){a.canplayListener(this)});this.mediaElement.bind("canplay",function(){a.canplayListener(this)});this.mediaElement.bind("error",function(){a.errorListener(this)});this.mediaElement.bind("suspend",function(){a.suspendListener(this)})},loadedMetaDataListener:function(b){try{this.videoWidth=b.videoWidth;this.videoHeight=b.videoHeight}catch(a){}this._scaleVideo()},updatePlayerInfo:function(){var b=this;var a=4;try{if(this._isPlaying==true){if($.browser.opera){a=3}if(this.mediaElement[0].networkState==a&&this.mediaElement[0].networkState!=undefined){this.errorListener()}setTimeout(function(){b.updatePlayerInfo()},500)}}catch(c){}},detachMedia:function(){try{$(this.mediaElement[0]).attr("src","");this.mediaElement[0].load()}catch(a){}},setPlay:function(){try{this.mediaElement[0].play();this._isPlaying=true}catch(a){}this.updatePlayerInfo()},setPause:function(){try{this.mediaElement[0].pause();this._isPlaying=false}catch(a){}},setVolume:function(a){this.mediaElement.attr("volume",a)},setSeek:function(a){this.mediaElement.attr("currentTime",a)},setFullscreen:function(a){this.environment.inFullscreen=a;this.sendUpdate("fullscreen",a);this._scaleVideo();this.reInit()},_scaleVideo:function(){var c=$("#"+this.environment.publicName+"_media");try{var d=c.width();var g=c.height();var a=this.videoWidth;var b=this.videoHeight;this.stretch(this.config.videoScaling,this.mediaElement,d,g,a,b)}catch(f){}}};var playerObjectVIDEO_MOBILE_APPLE=function(){};playerObjectVIDEO_MOBILE_APPLE.prototype={createMediaElement:function(a){try{if(this.controller.getItemCount()<=1){parent.window.location.href=this.media.file;return}}catch(b){}}};var playerObjectYOUTUBE=function(){};playerObjectYOUTUBE.prototype={usingFlash:true,allowRandomSeek:true,createMediaElement:function(b){this.elementReady=false;var a=this;var c;var d={id:this.environment.publicName+"_media_youtube",name:this.environment.publicName+"_media_youtube",src:"http://www.youtube.com/apiplayer",width:"100%",height:"100%",bgcolor:"#000000",allowScriptAccess:"always",wmode:"opaque",FlashVars:{enablejsapi:1}};this.config.flashVerifyMethod="cueVideoById";this.createFlash(d,b)},flashReadyListener:function(){this._youtubeResizeFix();this.addListeners();this.elementReady=true;this.mediaElement.cueVideoById(this.media.file.replace(/^[^v]+v.(.{11}).*/,"$1"))},flashReinitListener:function(){if($.browser.mozilla){this.mediaElement.cueVideoById(this.media.file.replace(/^[^v]+v.(.{11}).*/,"$1"));if(this._isPlaying){this.setPlay()}}this._youtubeResizeFix();this.addListeners();this.elementReady=true},_youtubeResizeFix:function(){$(this.mediaElement).attr({width:"99.99%",height:"99.99%"})},addListeners:function(){this.mediaElement.addEventListener("onStateChange","window.PInstance["+this.environment.instanceIdx+"].playerObject.youtubeStateChangeListener");this.mediaElement.addEventListener("onError","window.PInstance["+this.environment.instanceIdx+"].playerObject.errorListener")},setSeek:function(b){try{this.mediaElement.seekTo(b,true)}catch(a){}},setVolume:function(a){try{this.mediaElement.setVolume(a*100)}catch(b){}this.volumeListener({})},setPause:function(a){this._isPlaying=false;try{this.mediaElement.pauseVideo()}catch(b){}},setPlay:function(a){try{this.mediaElement.playVideo()}catch(b){}this._isPlaying=true;this.updatePlayerInfo()},getVolume:function(){try{return this.mediaElement.getVolume()/100}catch(a){}},errorListener:function(a){this.setTestcard(4)},youtubeStateChangeListener:function(a){switch(a){case -1:break;case 0:this.endedListener({});case 1:this.startListener({});this.playingListener({});break;case 2:this.pauseListener({});break;case 3:this.waitingListener({});break;case 5:}},updatePlayerInfo:function(){var a=this;(function(){try{if(a._isPlaying==true){a.timeListener({position:a.mediaElement.getCurrentTime(),duration:a.mediaElement.getDuration()});a.progressListener({loaded:a.mediaElement.getVideoBytesLoaded(),total:a.mediaElement.getVideoBytesTotal()});setTimeout(arguments.callee,500)}}catch(b){}})()}};var projekktorBufferingicon=function(){};projekktorBufferingicon.prototype={_bufferingIcon:null,_bufferDelayTimer:null,config:{bufferIconDelay:150,bufferingDomId:"buffering"},initialize:function(){this._bufferingIcon=$(document.createElement("div")).appendTo(this.canvas.media).attr({id:this.player.getPublicName()+"_"+this.config.bufferingDomId,"class":this.config.cssClassPrefix+"buffering"}).hide();if(this.config.designMode==true){this._bufferingIcon.show()}this.pluginReady=true},hideBufferIcon:function(){var a=this;clearTimeout(this._bufferDelayTimer);this._bufferingIcon.stop(true,true);this._bufferingIcon.fadeOut("fast")},showBufferIcon:function(a){var b=this;clearTimeout(this._bufferDelayTimer);if(this._isWaiting==false&&a==false){return}if(a!=true){b._bufferDelayTimer=setTimeout(function(){b.showBufferIcon(true)},b.config.bufferIconDelay);return}this._bufferingIcon.stop(true,true);this._bufferingIcon.fadeIn("fast")},awakingHandler:function(){this.showBufferIcon()},waitingHandler:function(){this.showBufferIcon()},canplayHandler:function(){this.hideBufferIcon()},playHandler:function(){this.hideBufferIcon()},suspendHandler:function(){this.hideBufferIcon()},endedHandler:function(){this.hideBufferIcon()},testcardHandler:function(){this.hideBufferIcon()}};var projekktorControlbar=function(){};projekktorControlbar.prototype={_controlHideTimer:null,_noControlHide:false,_controlsFading:false,_volumeSliderActive:false,_timeTags:{},_container:null,_popsition:{left:0,right:0},mediaData:{},disallowSkip:false,disablePause:false,disableFullscreen:false,controls:false,config:{controlsDisableFade:false,controlsTemplate:"<div {fsexit}></div><div {fsenter}></div><div {play}></div><div {pause}></div><div {prev}></div><div {next}></div><div {timeleft}><span {timedur}>{hr_dur}:{min_dur}:{sec_dur}</span><span {timeremaining}>- {hr_rem}:{min_rem}:{sec_rem}</span></div><div {scrubber}><div {loaded}></div><div {playhead}></div></div><div {vslider}><div {vmarker}></div><div {vknob}></div></div><div {mute}></div><div {vmax}></div>",controlsTemplateFull:null,toggleMute:false,playheadDomId:"playhead",loadedDomId:"loaded",scrubberDomId:"scrubber",playDomId:"play",pauseDomId:"pause",prevDomId:"prev",nextDomId:"next",fsexitDomId:"fsexit",fsenterDomId:"fsenter",vsliderDomId:"vslider",vmarkerDomId:"vmarker",vknobDomId:"vknob",muteDomId:"mute",vmaxDomId:"vmax",startDomId:"start",controlsDomId:"controls",titleDomId:"title",draghandleDomId:"draghandle"},initialize:function(){this._container=$(document.createElement("div")).appendTo(this.playerDom);this.drawControls();this.addGuiListeners();if(this.config.designMode===true){try{this.drawTitle("Phnglui mglwnafh Cthulhu Rlyeh wgahnagl fhtagn.");this.drawUpdateTimeDisplay();$("#"+this.player.getPublicName()+"_"+this.config.playheadDomId).css("width","50%");$("#"+this.player.getPublicName()+"_"+this.config.loadedDomId).css("width","80%")}catch(a){}}this.pluginReady=true},itemHandler:function(a){this.mediaData=a;this.disallowSkip=(this.config.disallowSkip||a.disallowSkip);this.disablePause=(this.config.disablePause||a.disablePause);this.disableFullscreen=(this.config.disableFullscreen||a.disableFullscreen);this.controls=(this.config.controls||a.controls);this.pluginReady=true},updateControls:function(){var a=this;if(this.controls==false){this.hideControlbar(true);return}var b=(this.player.getItemCount()<=1||this.disallowSkip);if(!b){$("#"+this.player.getPublicName()+"_"+this.config.prevDomId).show();$("#"+this.player.getPublicName()+"_"+this.config.nextDomId).show()}else{$("#"+this.player.getPublicName()+"_"+this.config.prevDomId).hide();$("#"+this.player.getPublicName()+"_"+this.config.nextDomId).hide()}if(this.player.getItemIdx()<=1){$("#"+this.player.getPublicName()+"_"+this.config.prevDomId).hide()}if(this.player.getItemIdx()>=this.player.getItemCount()){$("#"+this.player.getPublicName()+"_"+this.config.nextDomId).hide()}if(this.disablePause){$("#"+this.player.getPublicName()+"_"+this.config.pauseDomId).hide();$("#"+this.player.getPublicName()+"_"+this.config.playDomId).hide()}else{if(this.player.getIsPlaying()===true){this.drawPauseButton()}else{this.drawPlayButton()}}if(this.player.getInFullscreen()===true){this.drawExitFullscreenButton()}else{this.drawEnterFullscreenButton()}if(this.disableFullscreen){$("#"+this.player.getPublicName()+"_"+this.config.fsexitDomId).hide();$("#"+this.player.getPublicName()+"_"+this.config.fsenterDomId).hide()}this.drawTitle((this.mediaData.title=="")?this.config.title:this.mediaData.title);this.drawUpdateTimeDisplay();this._container.show();this.drawUpdateVolumeDisplay(this.player.getVolume());clearTimeout(this._controlHideTimer);this._controlHideTimer=setTimeout(function(){a.hideControlbar()},3500)},objectReadyHandler:function(a){if(this.player.getIsStarted()==false||this.player.getIsAutoslide()==true){this.hideControlbar(true)}},detachHandler:function(){this.drawUpdateProgressDisplay();this.drawUpdateTimeDisplay();this._noControlHide=false},startHandler:function(){this.playHandler()},playHandler:function(){this.updateControls()},pauseHandler:function(){this.updateControls()},volumeHandler:function(a){this.drawUpdateVolumeDisplay(a.volume)},progressHandler:function(a){this.drawUpdateProgressDisplay()},timeHandler:function(a){this.drawUpdateTimeDisplay();this.drawUpdateProgressDisplay()},fullscreenHandler:function(a){if(this.player.getIsStarted()){this.drawControls();this.addGuiListeners()}this.updateControls()},addGuiListeners:function(){var a=this;$("#"+this.player.getPublicName()+"_"+this.config.controlsDomId).mouseenter(function(b){a.controlsMouseEnterListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.controlsDomId).mouseleave(function(b){a.controlsMouseLeaveListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.controlsDomId).click(function(b){a.controlsClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.controlsDomId).dblclick(function(b){return false});$("#"+this.player.getPublicName()+"_"+this.config.playDomId).click(function(b){a.playClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.pauseDomId).click(function(b){a.pauseClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.vmaxDomId).click(function(b){a.unmuteClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.muteDomId).click(function(b){a.muteClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.vknobDomId).mousedown(function(b){a.vknobStartDragListener(b,this)});$("#"+this.player.getPublicName()+"_"+this.config.vsliderDomId).click(function(b){a.vsliderClickListener(b,this)});$("#"+this.player.getPublicName()+"_"+this.config.vmarkerDomId).click(function(b){a.vsliderClickListener(b,this)});$("#"+this.player.getPublicName()+"_"+this.config.scrubberDomId).click(function(b){a.scrubberClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.fsexitDomId).click(function(b){a.exitFullscreenClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.fsenterDomId).click(function(b){a.enterFullscreenClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.prevDomId).click(function(b){a.prevClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.nextDomId).click(function(b){a.nextClickListener(b)});$("#"+this.player.getPublicName()+"_"+this.config.draghandleDomId).mousedown(function(b){a.handleStartDragListener(b,this)})},drawControls:function(){var f=this;var c=this.player.getInFullscreen();var e=(c===true&&this.config.controlsTemplateFull!==null)?this.config.controlsTemplateFull:this.config.controlsTemplate;var h=(c===true&&this.config.controlsTemplateFull!==null)?"_full":"";var d="";this._container.hide().html("").attr({id:this.player.getPublicName()+"_"+this.config.controlsDomId,"class":this.config.cssClassPrefix+"controls"+h});var g=e.match(/\{[a-z]*\}/gi);var a="";for(var b=0;b<g.length;b++){a=g[b].replace("{","").replace("}","");d='id="'+this.player.getPublicName()+"_"+a+'" class="'+this.config.cssClassPrefix+a+h+'"';e=e.replace("{"+a+"}",d)}this._container.html(e);this._timeTags={};this._grabTags(this._container);if($.browser.mozilla){this._container.css("MozUserSelect","none")}else{if($.browser.msie){this._container.bind("selectstart",function(){return false})}else{this._container.mousedown(function(){return false})}}if(this.config.designMode===true){this._container.show()}},drawTitle:function(c){var d=this.player.getPublicName()+"_"+this.config.titleDomId;var b=this.config.cssClassPrefix;var a=false;$("#"+d).html((a==false)?c:a)},hideControlbar:function(a){clearTimeout(this._controlHideTimer);if(this.config.designMode===true){return}if(this.config.controlsDisableFade===true&&a!==true){return}if(this._noControlHide==true&&this.config.controls==true){return}if(!this._container.is(":visible")){return}this._container.stop(true,true);if(this.config.controls==false){this._container.hide()}else{if(a==true){this._container.hide()}else{this._container.fadeOut("slow")}}},showControlbar:function(){var a=this;clearTimeout(this._controlHideTimer);if(this.config.controls==false||this.player.getIsStarted()==false||this.player.getIsAutoslide()==true){return}if(this._container.is(":visible")||this._controlsFading==true){a._controlHideTimer=setTimeout(function(){a.hideControlbar()},2500);return}this._controlsFading=true;this._container.stop(true,true);this._container.fadeIn("fast",function(){a._controlsFading=false})},drawUpdateTimeDisplay:function(){try{var d=this.player.getLoadPlaybackProgress();var g=this.player.getDuration();var b=this.player.getPosition()}catch(f){var d=0;var g=0;var b=0}var a=this.config.cssClassPrefix;try{$("#"+this.player.getPublicName()+"_"+this.config.playheadDomId).css("width",d+"%")}catch(f){}var h=$.extend({},this._clockDigits(g,"dur"),this._clockDigits(b,"elp"),this._clockDigits(g-b,"rem"));for(var c in this._timeTags){$("#"+c).html(this._parseTemplate(this._timeTags[c],h))}},drawUpdateProgressDisplay:function(){try{$("#"+this.player.getPublicName()+"_"+this.config.loadedDomId).css("width",this.player.getLoadProgress()+"%")}catch(a){}},drawUpdateVolumeDisplay:function(c){if(this._volumeSliderActive==true){return}if(c==undefined){return}var a=$("#"+this.player.getPublicName()+"_"+this.config.vknobDomId);var b=$("#"+this.player.getPublicName()+"_"+this.config.vsliderDomId);switch(c){case 0:$("#"+this.player.getPublicName()+"_"+this.config.vknobDomId).css("left",0);break;case 1:$("#"+this.player.getPublicName()+"_"+this.config.vknobDomId).css("left",(b.width()-(a.width()/2))+"px");break;default:$("#"+this.player.getPublicName()+"_"+this.config.vknobDomId).css("left",c*(b.width()-(a.width()/2))+"px");break}$("#"+this.player.getPublicName()+"_"+this.config.vmarkerDomId).css("width",c*100+"%");this.drawMuteIcon()},drawPauseButton:function(a){$("#"+this.player.getPublicName()+"_"+this.config.pauseDomId).css("display","block");$("#"+this.player.getPublicName()+"_"+this.config.playDomId).css("display","none")},drawPlayButton:function(a){$("#"+this.player.getPublicName()+"_"+this.config.pauseDomId).css("display","none");$("#"+this.player.getPublicName()+"_"+this.config.playDomId).css("display","block")},drawEnterFullscreenButton:function(a){$("#"+this.player.getPublicName()+"_"+this.config.fsexitDomId).css("display","none");$("#"+this.player.getPublicName()+"_"+this.config.fsenterDomId).css("display","block")},drawExitFullscreenButton:function(a){$("#"+this.player.getPublicName()+"_"+this.config.fsenterDomId).css("display","none");$("#"+this.player.getPublicName()+"_"+this.config.fsexitDomId).css("display","block")},drawMuteIcon:function(b){if(this.config.toggleMute===false){return}var a=this.player.getVolume();if(a>0){$("#"+this.player.getPublicName()+"_"+this.config.muteDomId).css("display","block");$("#"+this.player.getPublicName()+"_"+this.config.vmaxDomId).css("display","none");return}$("#"+this.player.getPublicName()+"_"+this.config.muteDomId).css("display","none");$("#"+this.player.getPublicName()+"_"+this.config.vmaxDomId).css("display","block")},playClickListener:function(a){this.player.sendEvent("play",0);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},pauseClickListener:function(a){this.player.sendEvent("pause",0);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},controlsMouseEnterListener:function(a){this._noControlHide=true},controlsMouseLeaveListener:function(a){this._noControlHide=false},controlsClickListener:function(a){if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},mousemoveHandler:function(a){this.showControlbar()},mouseleaveHandler:function(a){var b=this;this._controlHideTimer=setTimeout(function(){b.hideControlbar()},2500)},prevClickListener:function(a){this.player.sendEvent("previous",0);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},nextClickListener:function(a){this.player.sendEvent("next",0);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},muteClickListener:function(a){this.player.sendEvent("volume",0);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},unmuteClickListener:function(a){this.player.sendEvent("volume",1);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},enterFullscreenClickListener:function(a){this.player.sendEvent("fullscreen",true);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},exitFullscreenClickListener:function(a){this.player.sendEvent("fullscreen",false);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},startClickListener:function(a){this.player.sendEvent("play",false);if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}},scrubberClickListener:function(c){var b=0;if(c==undefined){return}if($.browser.msie){c.cancelBubble=true}else{c.stopPropagation()}if(this.config.disallowSkip==true){return}var a=$("#"+this.player.getPublicName()+"_"+this.config.scrubberDomId).width();var d=$("#"+this.player.getPublicName()+"_"+this.config.loadedDomId).width();var e=c.pageX-$("#"+this.player.getPublicName()+"_"+this.config.scrubberDomId).offset().left;if(e<0||e=="NaN"||e==undefined){b=0}else{if(d!=undefined){if(e>d){e=d-1}b=((e*100/a)*this.player.getDuration()/100)*1}}this.player.sendEvent("seek",b)},vmarkerClickListener:function(a){vsliderClickListener(a)},vsliderClickListener:function(b){if(this._volumeSliderActive==true){return}var a=$("#"+this.player.getPublicName()+"_"+this.config.vsliderDomId).width();var c=b.pageX-$("#"+this.player.getPublicName()+"_"+this.config.vsliderDomId).offset().left;if(c<0||c=="NaN"||c==undefined){result=0}else{result=(c/a)}this.player.sendEvent("volume",result);if($.browser.msie){b.cancelBubble=true}else{b.stopPropagation()}},vknobStartDragListener:function(a,b){if($.browser.msie){a.cancelBubble=true}else{a.stopPropagation()}this._volumeSliderActive=true;var e=this;var d=$(b);var c=$("#"+e.player.getPublicName()+"_"+e.config.vsliderDomId);var j=Math.abs(parseInt(d.position().left)-a.clientX);var f=0;var g=function(k){if($.browser.msie){k.cancelBubble=true}else{k.stopPropagation()}e._container.unbind("mousemove",h);e._container.unbind("mouseup",g);c.unbind("mousemove",h);c.unbind("mouseup",g);d.unbind("mousemove",h);d.unbind("mouseup",g);e._volumeSliderActive=false;return false};var h=function(k){clearTimeout(e._controlHideTimer);if($.browser.msie){k.cancelBubble=true}else{k.stopPropagation()}var l=(k.clientX-j);l=(l>c.width()-d.width()/2)?c.width()-(d.width()/2):l;l=(l<0)?0:l;d.css("left",l+"px");f=Math.abs(l/(c.width()-(d.width()/2)));e.player.sendEvent("volume",f);$("#"+e.player.getPublicName()+"_"+e.config.vmarkerDomId).css("width",f*100+"%");return false};this._container.mousemove(h);this._container.mouseup(g);c.mousemove(h);c.mouseup(g);d.mousemove(h);d.mouseup(g)},handleStartDragListener:function(c,f){var g=this;var e=Math.abs(parseInt(this._container.position().left)-c.clientX);var b=Math.abs(parseInt(this._container.position().top)-c.clientY);if($.browser.msie){c.cancelBubble=true}else{c.stopPropagation()}var a=function(h){if($.browser.msie){h.cancelBubble=true}else{h.stopPropagation()}g.playerDom.unbind("mouseup",a);g.playerDom.unbind("mouseout",a);g.playerDom.unbind("mousemove",d);return false};var d=function(j){if($.browser.msie){j.cancelBubble=true}else{j.stopPropagation()}clearTimeout(g._controlHideTimer);var k=(j.clientX-e);k=(k>g.playerDom.width()-g._container.width())?g.playerDom.width()-g._container.width():k;k=(k<0)?0:k;g._container.css("left",k+"px");var h=(j.clientY-b);h=(h>g.playerDom.height()-g._container.height())?g.playerDom.height()-g._container.height():h;h=(h<0)?0:h;g._container.css("top",h+"px");return false};this.playerDom.mousemove(d);this.playerDom.mouseup(a)},_clockDigits:function(d,h){if(d<0||isNaN(d)||d==undefined){d=0}var f=Math.floor(d/(60*60));var g=d%(60*60);var c=Math.floor(g/60);var b=g%60;var e=Math.ceil(b);var a={};a["min_"+h]=(c<10)?"0"+c:c;a["sec_"+h]=(e<10)?"0"+e:e;a["hr_"+h]=(f<10)?"0"+f:f;return a},_parseTemplate:function(b,c){for(var a in c){replacement='id="'+this.player.getPublicName()+"_"+this.config[a]+'" class="'+this.config.cssClassPrefix+a.replace("DomId","")+'"';b=b.replace("{"+a+"}",c[a])}return b},_grabTags:function(c){var a=this;var b=function(){var d=$(this).html();if(d==""){return}if($(this).children().length>0){a._grabTags($(this));return}a._timeTags[$(this).attr("id")]=$(this).html()};c.children().each(b)}};var projekktorIframeOverlays=function(){};projekktorIframeOverlays.prototype={_xlObject:null,_overlayFrame:null,_hideTimer:null,_isFading:false,player:{},config:{},playerDom:null,canvas:{media:null,projekktor:null},initialize:function(){var a=this;this._overlayFrame=$(document.createElement("iframe")).attr({id:this.player.getPublicName()+"_overlay",name:this.player.getPublicName()+"_overlay",src:"http://localhost/uberelectron/overlay.html",scrolling:"no",frameborder:"0",width:"100%",height:"100%",ALLOWTRANSPARENCY:true}).css({overflow:"hidden",border:"0px",width:"100%",height:"100%"}).appendTo(this.canvas.media);this._overlayFrame.load(function(b){a._waitForXL()});this._overlayFrame.error(function(b){a._overlayFrame()})},_waitForXL:function(){var b=this;var a=b._overlayFrame[0];if(a.contentWindow){a=a.contentWindow}else{if(a.contentDocument){a=a.contentDocument.defaultView}}(function(){try{if(a.pXL){b._xlObject=a.pXL;b.pluginReady=true;return}setTimeout(arguments.callee,500)}catch(c){setTimeout(arguments.callee,500)}})()},_hide:function(){clearTimeout(this._hideTimer);var a=this._overlayFrame;if(!a.is(":visible")){return}a.stop(true,true);a.fadeOut("slow")},_show:function(a){var b=this;clearTimeout(this._hideTimer);var c=this._overlayFrame;if(this._isFading==false){b._hideTimer=setTimeout(function(){b._hide()},a)}this._isFading=true;c.stop(true,true);c.fadeIn("fast",function(){b._isFading=false})},playlistHandler:function(a){},itemHandler:function(a){this._isFading=false;this._xlObject.setInfo(a);this._show(5000);this.pluginReady=true},detachHandler:function(a){this._hide()},objectReadyHandler:function(a){},startHandler:function(a){},doneHandler:function(a){},detachHandler:function(a){},endedHandler:function(a){},playHandler:function(a){},pauseHandler:function(a){},volumeHandler:function(a){},timeHandler:function(f){try{var b=this.player.getLoadPlaybackProgress();var d=this.player.getDuration();var a=this.player.getPosition()}catch(c){var b=0;var d=0;var a=0}this._xlObject.setEndsAt(d-a)},keyHandler:function(a){switch(a){case 39:this.player.sendEvent("next",0);break;case 37:this.player.sendEvent("previous",0);break;case 13:this.player.playpause();break}},progressHandler:function(a){},mousemoveHandler:function(a){this._show(2500)},fullscreenHandler:function(a){},testcardHandler:function(a){},awakingHandler:function(a){}};var projekktorLogo=function(){};projekktorLogo.prototype={player:{},config:{logo:"",logoDelay:0},playerDom:null,logo:null,logoFile:false,fading:false,initialize:function(){this.logo=$(document.createElement("img")).appendTo(this.playerDom).css({id:this.player.getPublicName()+"_logo",position:"absolute",left:"2%",top:"2%"}).hide();this.pluginReady=true},itemHandler:function(b){var a="";this.fading=false;this.logo.stop(true,false);this.logo.hide();this.logoFile=(this.config.logo=="")?false:this.config.logo;this.logoFile=(b.logo==undefined)?this.logoFile:b.logo;if(this.logoFile!=false){this.logo.attr("src",this.logoFile)}this.pluginReady=true},timeHandler:function(){if(this.logoFile===false){return}var a=this.player.getPosition();var c=this.player.getDuration();var b=this;if(!this.logo.is(":visible")&&!this.fading&&a+this.config.logoDelay<c){if(a>this.config.logoDelay&&c>(this.config.logoDelay*2)){this.fading=true;this.logo.fadeIn("slow",function(){b.fading=false})}}if(this.logo.is(":visible")&&!this.fading){if(a+this.config.logoDelay>c){this.fading=true;this.logo.fadeOut("slow",function(){b.fading=false})}}},testcardHandler:function(){this.logo.hide()}};var projekktorPluginInterface=function(){};projekktorPluginInterface.prototype={pluginReady:false,player:{},config:{},playerDom:null,canvas:{media:null,projekktor:null},_init:function(a){$.extend(this.config,a);this.initialize()},initialize:function(){},playlistHandler:function(a){},itemHandler:function(a){this.pluginReady=true},detachHandler:function(a){},objectReadyHandler:function(a){},startHandler:function(a){},doneHandler:function(a){},detachHandler:function(a){},endedHandler:function(a){},canplayHandler:function(a){},playHandler:function(a){},pauseHandler:function(a){},volumeHandler:function(a){},timeHandler:function(a){},progressHandler:function(a){},mousemoveHandler:function(a){},mouseleaveHandler:function(a){},mouseeterHandler:function(a){},fullscreenHandler:function(a){},testcardHandler:function(a){},awakingHandler:function(a){},keyHandler:function(a){}};var projekktorShare=function(){};projekktorShare.prototype={_controlHideTimer:null,_isFading:false,_wasPlaying:false,embPopup:null,socialSidebar:null,socialPopup:null,config:{socialbarDomId:"socialbar",socialButtonDomId:"socialbbutton",socialPopupDomId:"socialpopup",embed:{domId:"embed",code:'<iframe id="{embedid}" src="{playerurl}" width="640" height="385" frameborder="0"></iframe>',nameText:"embed",headlineText:"Copy this:",closeText:"Close Window",descText:"This is the embed code for the current video which supports iPad, iPhone, Flash and native players."},twitter:{nameText:"twitter",domId:"twitter",text:"I found a cool HTML5 video player. Check this out.",code:"http://twitter.com/share?url={pageurl}&text={text}&via=projekktor"},facebook:{nameText:"facebook",domId:"facebook",text:"I found a cool HTML5 video player. Check this out.",code:"http://www.facebook.com/sharer.php?u={pageurl}&t={text}"}},initialize:function(){this.drawSidebar();this.drawPopup();if(this.config.sandBox!==false){this.addTool("embed")}this.addTool("twitter");this.addTool("facebook");this.pluginReady=true},drawSidebar:function(){this.socialSidebar=$(document.createElement("div")).appendTo(this.playerDom).attr({id:this.player.getPublicName()+"_"+this.config.socialbarDomId,"class":this.config.cssClassPrefix+this.config.socialbarDomId}).hide()},drawPopup:function(){this.socialPopup=$(document.createElement("div")).appendTo(this.playerDom).hide().attr({id:this.player.getPublicName()+"_"+this.config.socialPopupDomId,"class":this.config.cssClassPrefix+this.config.socialPopupDomId})},openWindow:function(a){this._isFading=true;this._wasPlaying=this.player.getIsPlaying();if(this._wasPlaying===true){this.player.setPause()}this[a+"FillWindow"](this.socialPopup);this.socialSidebar.hide();this.socialPopup.show()},closeWindow:function(){this._isFading=false;this.socialSidebar.show();this.socialPopup.hide().html("");if(this._wasPlaying===true){this.player.setPlay()}},openURL:function(b){var a=window;a.open(b);return false},addTool:function(a){var c=this;var b=$(document.createElement("div")).appendTo(this.socialSidebar).attr({id:this.player.getPublicName()+"_"+this.config[a].domId}).html(this.config[a].nameText).addClass(this.config.cssClassPrefix+"socialbutton").show();$(document.createElement("div")).addClass(this.config.cssClassPrefix+"socialicon_"+this.config[a].domId).prependTo(b);b.click(function(d){d.stopPropagation();c[a+"Click"]()})},hideSidebar:function(){clearTimeout(this._controlHideTimer);if(!this.socialSidebar.is(":visible")){return}this.socialSidebar.stop(true,true);this.socialSidebar.fadeOut("slow")},showSidebar:function(){var a=this;if(this._isFading==true){return}if(this.player.getIsStarted()!==true){return}clearTimeout(this._controlHideTimer);if(this.socialSidebar.is(":visible")){a._controlHideTimer=setTimeout(function(){a.hideSidebar()},2500);return}this._isFading=true;this.socialSidebar.stop(true,true);this.socialSidebar.fadeIn("fast",function(){a._isFading=false})},mousemoveHandler:function(){this.showSidebar()},embedClick:function(){this.openWindow("embed")},embedFillWindow:function(a){var b=this;$(document.createElement("p")).appendTo(a).html(this.config.embed.descText);$(document.createElement("h3")).appendTo(a).html(this.config.embed.headlineText);$(document.createElement("textarea")).appendTo(a).attr("readonly","readonly").val(this.getEmbedCode()).click(function(){this.select()}).focus(function(){this.select()});$(document.createElement("a")).appendTo(a).html(this.config.embed.closeText).click(function(){b.closeWindow()})},getEmbedCode:function(){var a=this.config.embed.code;var c={};c.embedid=this.player.randomId(8);c.playerurl=window.location.href+window.location.hash;for(var b in c){a=a.replace("{"+b+"}",c[b])}return a},twitterClick:function(){var a=this.config.twitter.code;var c={};c.text=escape(this.config.twitter.text);c.pageurl=escape(this.player.getSandboxWindow().attr("location"));for(var b in c){a=a.replace("{"+b+"}",c[b])}this.openURL(a)},facebookClick:function(){var a=this.config.facebook.code;var c={};c.text=escape(this.config.facebook.text);c.pageurl=escape(this.player.getSandboxWindow().attr("location"));for(var b in c){a=a.replace("{"+b+"}",c[b])}this.openURL(a)}};var projekktorStartbutton=function(){};projekktorStartbutton.prototype={_startButton:null,initialize:function(){var a=this;this._startButton=$(document.createElement("div")).appendTo(this.canvas.media).attr({id:this.player.getPublicName()+"_"+this.config.startDomId,"class":this.config.cssClassPrefix+"start"}).hide();this.pluginReady=true;if(this.config.autoplay===false){this._startButton.show()}this._startButton.click(function(){a.player.setPlay()})},doneHandler:function(){try{if(this.config.autoplay===false){this._startButton.show()}}catch(a){}},startHandler:function(){try{this._startButton.hide()}catch(a){}},testcardHandler:function(b){try{this._startButton.hide()}catch(a){}}};var projekktorTracker=function(){};projekktorTracker.prototype={isPlaying:false,isWaiting:false,waitTime:null,trackData:{},playbackStart:0,sessionID:null,trackThis:false,endpointFailed:false,endpoint:"http://localhost/tracker/",initialize:function(){this._resetTrackData();this.sessionID=this._uuid()},itemHandler:function(a){this._resetTrackData();if(this.endpointFailed==true){return}if(a.isposter!==true&&this.player.getItemId()!==null){this.trackThis=true}else{this.trackThis=false;return}this.trackData.i.l=a.file;this.trackData.i.m=this.player.getMediaType().split("/")[0];this.trackData.i.t=this.player.getMediaType().split("/")[1];this.trackData.uid=this._getUserUUID();this.trackData.sid=this.sessionID;this.trackData.pl.l=this.player.getItemCount();this.trackData.i.id=this.player.getItemId();this.pluginReady=true},detachHandler:function(a){this.trackIt()},endedHandler:function(a){this.trackData.evt.push(this._getEventObj("ended"))},seekHandler:function(a){this.trackData.evt.push(this._getEventObj("seek",a.dest))},waitingHandler:function(){if(this.isWaiting==false){this.isWaiting=true;this.waitTime=Number(new Date())}},canplayHandler:function(){if(this.isWaiting==true){this.isWaiting=false;this.trackData.evt.push(this._getEventObj("wait",this._roundNumber((Number(new Date())-this.waitTime)/1000,1)))}},playHandler:function(a){if(this.playbackStart==0){this.playbackStart=Number(new Date());this.trackData.evt.push(this._getEventObj("start"))}else{this.trackData.evt.push(this._getEventObj("play"))}},previousHandler:function(a){this.trackData.evt.push(this._getEventObj("prev"))},nextHandler:function(a){this.trackData.evt.push(this._getEventObj("next"))},pauseHandler:function(a){this.trackData.evt.push(this._getEventObj("pause"))},timeHandler:function(a){if(this.trackData.i.d<=0){this.trackData.i.d=this._roundNumber(this.player.getDuration(),2)}},fullscreenHandler:function(a){this.trackData.events.push(this._getEventObj("fullscreen"))},testcardHandler:function(a){this.trackData.events.push(this._getEventObj("testcard"))},trackIt:function(c){if(this.trackThis===false){return}if(this.endpointFailed==true){return}var a=this;if(this.playbackStart>0){this.trackData.pd=this._roundNumber((Number(new Date())-this.playbackStart)/1000,1)}this.trackData.bw=this.player.getKbPerSec();try{$.ajax({type:"POST",url:this.endpoint,data:this.trackData,success:function(d){a.endpointFailed=false},error:function(d){a.endpointFailed=true}})}catch(b){}},_getEventObj:function(a,b){return{n:a,tidx:this._roundNumber(this.player.getPosition(),2),pbt:this._roundNumber((Number(new Date())-this.playbackStart)/1000,2),v:(b)?b:0}},_resetTrackData:function(){this.trackData={uid:0,sid:0,pd:0,pl:{l:0},i:{id:"",l:"",m:"",t:"",d:0},bw:0,evt:[]};this.playbackStart=0},_roundNumber:function(a,b){if(a<=0||isNaN(a)){return 0}return Math.round(a*Math.pow(10,b))/Math.pow(10,b)},_getUserUUID:function(){var a="prkusruuid";var b=null;b=this._readCookie(a);if(b==null){b=this._uuid();this._setCookie(a,b)}return b},_uuid:function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");var c=new Array(36),b=0,d;for(var a=0;a<36;a++){if(a==8||a==13||a==18||a==23){c[a]="-"}else{if(a==14){c[a]="4"}else{if(b<=2){b=33554432+(Math.random()*16777216)|0}d=b&15;b=b>>4;c[a]=e[(a==19)?(d&3)|8:d]}}}return c.join("")},_setCookie:function(d,b){var a;var c;a=new Date();a.setTime(a.getTime()+356*86400000);document.cookie=d+"="+escape(b)+";expires="+a.toGMTString()+";path="+(c?c:"/")},_readCookie:function(b){var a=document.cookie.split(";");var e=b+"=";for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}};var playerObject=function(){};playerObject.prototype={_hideTimer:null,_controlsFading:false,_nohide:false,_isPlaying:false,_isSeeking:false,_isStarted:false,_isTestcard:false,_hasEnded:false,_KbPerSec:0,_bandWidthTimer:null,usingFlash:false,isAutoslide:false,allowRandomSeek:false,elementReady:false,mediaElement:null,environment:{},controller:{},config:{},media:{duration:0,position:0,startOffset:0,file:false,poster:"",ended:false,message:"",error:null,mediaType:"",loadProgress:0,errorCode:0,message:"",type:"NA"},init:function(b){var a=this;this.controller=b.controller;this._ffReinitIsPaused=null;$.extend(this.environment,b.environment);$.extend(this.config,b.config);this.media=b.media;this.createMediaElement(this.getDestcontainer());this.waitForPlayerElement()},getDestcontainer:function(){this.elementReady=false;var a=$("#"+this.environment.publicName+"_media");a.html("");return a},createMediaElement:function(){},sendUpdate:function(a,b){this.controller._modelUpdateListener(a,b)},waitForPlayerElement:function(){var a=this;(function(){try{if(a.elementReady!==true){setTimeout(arguments.callee,70);return}}catch(b){}a.controller._modelUpdateListener("objectReady")})()},addListeners:function(){},removeListeners:function(){try{this.mediaElement.unbind()}catch(a){}},detachMedia:function(){},destroy:function(){this.setPause();this.removeListeners();this.detachMedia();$(this.mediaElement).remove();this.getDestcontainer()},reInit:function(){if(this.usingFlash===false||!($.browser.mozilla)||this._isTestcard==true||this.config.bypassFlashFFFix===true){this.flashReinitListener();return}this.sendUpdate("FFreinit");this.removeListeners();this.createMediaElement(this.getDestcontainer());this.waitForPlayerElement()},applyCommand:function(b,a){if(b=="play"&&this._isStarted==false){this.sendUpdate("awaking")}switch(b){case"play":this.setPlay();break;case"pause":this.setPause();break;case"volume":this.setVolume(a);break;case"seek":if(this.media.loadProgress==-1){break}this._isSeeking=true;this.setSeek(a);break;case"fullscreen":this.setFullscreen(a);break}},setPrev:function(){},setNext:function(){},setSeek:function(a){},setPlay:function(){},setPause:function(){},setVolume:function(a){},setFullscreen:function(a){this.environment.inFullscreen=a;this.sendUpdate("fullscreen",a);this.reInit()},getVolume:function(){var a=this.mediaElement.attr("muted");return(a==true)?0:this.mediaElement.attr("volume")},getLoadProgress:function(){return this.media.loadProgress},getLoadPlaybackProgress:function(){return this.media.playProgress},getPosition:function(){return this.media.position},getDuration:function(){return this.media.duration},getInFullscreen:function(){return this.environment.inFullscreen},getIsAutoslide:function(){return this.isAutoslide},getKbPerSec:function(){return this._KbPerSec},timeListener:function(d){if(d==undefined){return}var c=(d.position!=undefined)?d.position:d.currentTime;var b=d.duration;var a=(c>0&&b>0)?c*100/b:0;this.media.duration=this._roundNumber(b,2);this.media.position=this._roundNumber(c,2);this.media.playProgress=a;if(this._isSeeking==true){this._isSeeking=false;this.sendUpdate("seek",this.media.position)}else{this.sendUpdate("time")}this.loadProgressUpdate()},loadProgressUpdate:function(){try{if(typeof this.mediaElement[0].buffered!=="object"){return}var c=this.mediaElement[0];var a=Math.round(c.buffered.end(c.buffered.length-1)*100)/100;var b=a*100/this.media.duration;this.media.loadProgress=(this.allowRandomSeek===true)?100:-1;this.media.loadProgress=(this.media.loadProgress<100||this.media.loadProgress==undefined)?b:100;this.sendUpdate("progress")}catch(d){}},progressListener:function(a,g){try{if(typeof this.mediaElement[0].buffered=="object"){this.mediaElement.unbind("progress");return}}catch(f){}if(this._bandWidthTimer==null){this._bandWidthTimer=(new Date()).getTime()}var d=0;var c=0;if(!isNaN(a.loaded/a.total)){d=a.loaded;c=a.total}else{if(a.originalEvent&&!isNaN(a.originalEvent.loaded/a.originalEvent.total)){d=a.originalEvent.loaded;c=a.originalEvent.total}else{if(g&&!isNaN(g.loaded/g.total)){d=g.loaded;c=g.total}else{try{this.media.loadProgress=(this.allowRandomSeek===true)?100:-1;this.sendUpdate("progress")}catch(f){}return}}}var b=(d>0&&c>0)?d*100/c:0;if(Math.round(b)>Math.round(this.media.loadProgress)){this._KbPerSec=((d/1024)/(((new Date()).getTime()-this._bandWidthTimer)/1000))}this.media.loadProgress=(this.media.loadProgress<100||this.media.loadProgress==undefined)?b:100;this.media.loadProgress=(this.allowRandomSeek===true)?100:this.media.loadProgress;this.sendUpdate("progress")},canplayListener:function(a){this.sendUpdate("canplay")},canplaythroughListener:function(a){this.sendUpdate("canplaythrough")},suspendListener:function(a){this.sendUpdate("suspend")},playingListener:function(a){this.sendUpdate("play")},startListener:function(a){if(this._isStarted===false){this.sendUpdate("start");this._isStarted=true}},pauseListener:function(a){this.sendUpdate("pause")},volumeListener:function(a){this.sendUpdate("volume")},endedListener:function(a){this._hasEnded=true;this.sendUpdate("ended")},suspendListener:function(a){this.sendUpdate("suspend")},waitingListener:function(a){this.sendUpdate("waiting")},flashReadyListener:function(){if(this.config.flashParams===null){this.addListeners();this.mediaElement.api_config({scaling:this.config.videoScaling});this.mediaElement.api_source(this.media.file)}this.elementReady=true},flashReinitListener:function(){try{if($.browser.mozilla){if(this.config.flashParams===null){this.mediaElement.api_source(this.media.file)}if(this._isPlaying){this.setPlay()}}if(this.config.flashParams===null){this.addListeners()}this.elementReady=true}catch(a){}},errorListener:function(a){try{switch(a.target.error.code){case a.target.error.MEDIA_ERR_ABORTED:this.setTestcard(1);break;case a.target.error.MEDIA_ERR_NETWORK:this.setTestcard(2);break;case a.target.error.MEDIA_ERR_DECODE:this.setTestcard(3);break;case a.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:this.setTestcard(4);break;default:this.setTestcard(5);break}}catch(b){}},setTestcard:function(e,a){this._isTestcard=true;var d=this;var c=$("#"+this.environment.publicName+"_media");var b=(this.config.messages[e]!=undefined)?this.config.messages[e]:this.config.messages[0];b=(a!=undefined&&a!="")?a:b;if(this.controller.getItemCount()>1){b+=this.config.messages[99]}if(b.length<3){b="ERROR"}if(e==100){b=""}c.attr("style","width: 100%; height:100%;");c.html("");this.mediaElement=$(document.createElement("div")).attr({"class":"pptestcard"}).appendTo(c);if(b.length>0){$(document.createElement("p")).appendTo(this.mediaElement).html(b);this.sendUpdate("testcard")}},stretch:function(a,f,m,k,d,g){if(f==undefined){return}var e=(d)?d:f.width();var b=(g)?g:f.height();var h=m/e;var l=k/b;var c=0;var j=0;switch(a){case"fill":if(h>l){c=e*h;j=b*h}else{c=e*l;j=b*l}break;case"aspectratio":default:if(h>l){c=e*l;j=b*l}else{c=e*h;j=b*h}break}f.css({margin:0,padding:0,position:"absolute",width:c/m*100+"%",height:j/k*100+"%",left:((m/2-c/2)/m*100)+"%",top:((k/2-j/2)/k*100)+"%"})},toAttributeString:function(b){var c="";for(var a in b){if(typeof b[a]!="function"){c+=a+'="'+b[a]+'" '}}return c},toFlashvarsString:function(e){var b="";var a="";for(var d in e){if(typeof e[d]!="function"){a=e[d];for(var c in this.media){if(typeof a!="string"){continue}a=a.replace("{"+c+"}",this.media[c])}b+=d+"="+encodeURIComponent(a)+"&"}}return b.replace(/&$/,"")},createFlash:function(g,b){var e=(g.FlashVars===null)?this.config.flashParams:g.FlashVars;if(e){e=this.toFlashvarsString(e);if(e.length>0){g.src+="?"+e}}var a="";var d="";var c="";var f="";if($.browser.msie){f=' id="'+g.id+'" '}var d="<object"+f+' codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"  name="'+g.name+'" width="'+g.width+'" height="'+g.height+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">';d+='<param name="movie" value="'+g.src+'"></param>';d+='<param name="allowScriptAccess" value="'+g.allowScriptAccess+'"></param>';d+='<param name="allowFullScreen" value="'+g.allowFullScreen+'"></param>';d+='<param name="wmode" value="'+g.wmode+'"></param>';var c="<embed "+this.toAttributeString(g)+' pluginspage="http://www.macromedia.com/go/getflashplayer" swliveconnect="true" type="application/x-shockwave-flash"></embed>';a=d+c;a+="</object>";if($.browser.mozilla){a=c}b[0].innerHTML=a;this.mediaElement=$("#"+g.id)[0];this._waitforPlayer()},_waitforPlayer:function(){if(this.elementReady==true){return}var a=this;(function(){try{if(a.mediaElement==undefined){setTimeout(arguments.callee,100)}else{if(a.mediaElement[a.config.flashVerifyMethod]==undefined){setTimeout(arguments.callee,100)}else{a.flashReadyListener()}}}catch(b){setTimeout(arguments.callee,100)}})()},_roundNumber:function(a,b){if(a<=0||isNaN(a)){return 0}return Math.round(a*Math.pow(10,b))/Math.pow(10,b)}};if(typeof jQuery==="undefined"){alert("Projekktor Warning [1]: JQuery 1.4.1 or later required.")}else{if($.browser.msie){(function(){if(!
/*@cc_on!@*/
0){return}var e="audio,video".split(",");for(var i=0;i<e.length;i++){document.createElement(e[i])}})();if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,d){for(var b=(d||0),a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}}$(document).ready(function(){if(a==undefined){var a={}}if(a.spawn!==false||a.sandBox===true){$.each($("video.projekktor,audio.projekktor"),function(b,c){new projekktor_player(c).initialize();if(a.sandBox===true){window.player=window.PInstance[0]}})}})}function projekktor_player(destDOM){this.destDOM=destDOM;this.config=$.extend({plugins:["Startbutton","Controlbar","Logo","Bufferingicon"],version:"0.7.15",cssClassPrefix:"pp",playerFlashMP4:"playerMP4.swf",flashParams:null,flashVerifyMethod:"api_get",playerFlashMP3:"playerMP3.swf",enableFlashFallback:true,enableNativePlayback:true,enableKeyboard:true,bypassFlashFFFix:false,volume:0.5,poster:false,defaultPoster:"default-poster.jpg",imageScaling:"aspectratio",videoScaling:"aspectratio",loop:false,autoplay:false,controls:false,start:false,stop:false,forceFullViewport:false,sandBox:false,sandBoxHashObserve:true,FilePosterSeparator:";",allowPlaybackFrom:[],dynamicTypeExtensions:[],disablePause:false,disallowSkip:false,disableFullscreen:false,messages:{0:"An unknown error occurred. ",1:"You aborted the video playback. ",2:"A network error caused the video download to fail part-way. ",3:"The video playback was aborted due to a corruption problem. ",4:"The video could not be loaded, either because the server or network failed or because the format is not supported. ",5:"Sorry, your browser does not support the media format of the requested clip. ",6:"You need to update your Flash Plugin to a newer version!",98:"Invalid Playlist Data!",99:"Click display to proceed. "},debug:false,debugLevel:1,desginGrid:"style/layout_grid.gif",designMode:false},{});this.environment={instanceIdx:0,publicName:null,playerStyle:null,scrollTop:null,scrollLeft:null,bodyOverflow:null,playerDom:{},mediaDom:{},media_canvasDom:{},media_clickcatcherDom:{},canvasDom:{},volume:null,agent:"standard",modelExtensions:{},touchGallery:false,referenceWidth:1,referenceHeight:1,flashVersion:0,mouseIsOver:true};this.properties={itemsOffset:false,itemsLimit:10,currentItem:0,sources:[],playlistServer:""};this.platformPriority=["native","flash"];this.mediaTypes={0:{ext:"NaN",type:"none/none",model:"NA",platform:"native"},1:{ext:"json",type:"text/json",model:"playlist",platform:"internal"},2:{ext:"xml",type:"text/xml",model:"playlist",platform:"internal"},3:{ext:"ogv",type:"video/ogg",model:"video",platform:"native"},4:{ext:"m4v",type:"video/mp4",model:"video",platform:"flash"},5:{ext:"webm",type:"video/webm",model:"video",platform:"native"},6:{ext:"ogg",type:"video/ogg",model:"video",platform:"native"},7:{ext:"anx",type:"video/ogg",model:"video",platform:"native"},8:{ext:"jpg",type:"image/jpeg",model:"image",platform:"native"},9:{ext:"gif",type:"image/gif",model:"image",platform:"native"},10:{ext:"png",type:"image/png",model:"image",platform:"native"},11:{ext:"flv",type:"video/x-flv",model:"videoflash",platform:"flash",fixed:true},12:{ext:"flv",type:"video/flv",model:"videoflash",platform:"flash",fixed:true},13:{ext:"mp4",type:"video/mp4",model:"videoflash",platform:"flash"},14:{ext:"mov",type:"video/quicktime",model:"videoflash",platform:"flash"},15:{ext:"youtube.com",type:"video/youtube",model:"youtube",platform:"flash",fixed:true},16:{ext:"ogg",type:"audio/ogg",model:"audio",platform:"native"},17:{ext:"oga",type:"audio/ogg",model:"audio",platform:"native"},18:{ext:"mp3",type:"audio/mp3",model:"audioflash",platform:"flash"},19:{ext:"html",type:"text/html",model:"html",platform:"internal"}};this.browserSwitch={0:{regex:"iPhone",agent:"iphone",modelExtensions:{video:"mobile_apple"}},1:{regex:"iPad",agent:"ipad",modelExtensions:{video:"mobile_apple"}},2:{regex:"iPod",agent:"ipod",modelExtensions:{video:"mobile_apple"}}};this.media=[];this.plugins=[];this.listeners=[];this.mediaGrid={};this.playerObject={};this.__autostart=false;this._isReady=false;this._isStarted=false;this._isPlaying=false;this._isWaiting=false;this._hasError=false;this._displayClicks=0;this._isInFullscreen=false;this._pctLoaded=0;this._FFreinit=false;this._preload={init:0,playlist:0,posters:0};this.initialize=function(){var ref=this;var destDOM=$(this.destDOM);if(window.PInstance==undefined){window.PInstance=[]}this.environment.publicName=this.randomId(8);this.environment.instanceIdx=window.PInstance.length;this.environment.referenceWidth=destDOM.attr("width");this.environment.referenceHeight=destDOM.attr("height");this.environment.flashVersion=this._flashVersion().match(/\d+/g);window.PInstance[this.environment.instanceIdx]=this;$.extend(this.config,window.PROJEKKTOR_CONFIG||{});this.properties.sources=this._getSourcesFromContainer(destDOM);if(this.config.sandBox!==false){this.properties.sources=this._getFilesFromHash(0)}this.config.autoplay=(destDOM.attr("autoplay")!==undefined&&destDOM.attr("autoplay")!==false);this.__autostart=(destDOM.attr("autostart")!==undefined&&destDOM.attr("autostart")!==false);this.config.autoplay=(this.config.autoplay||this.__autostart);this.config.controls=(destDOM.attr("controls")!==undefined&&destDOM.attr("controls")!==false);this.config.loop=(destDOM.attr("loop")!==undefined&&destDOM.attr("loop")!==false)?true:this.config.loop;this.config.title=(destDOM.attr("title")!==""&&destDOM.attr("title")!==undefined&&destDOM.attr("title")!==false)?destDOM.attr("title"):false;this.config.poster=($(this.destDOM).attr("poster")!==""&&destDOM.attr("poster")!==undefined&&destDOM.attr("poster")!==false)?$(this.destDOM).attr("poster"):"";if($.browser.msie){var htmlTag=destDOM.parent().html().toLowerCase();var attr=["autoplay","controls","loop"];for(var i=0;i<attr.length;i++){if(htmlTag.indexOf(attr[i])==-1){continue}this.config[attr[i]]=true}}if(this.config.designMode===true){this.config.poster=this.config.desginGrid}for(var i in this.browserSwitch){if(navigator.userAgent.match(new RegExp(this.browserSwitch[i].regex))){this.environment.agent=this.browserSwitch[i]["agent"];this.environment.modelExtensions=this.browserSwitch[i]["modelExtensions"];break}}if(this.environment.agent=="ipad"){destDOM.attr("poster","");return}this.environment.playerDom=$(document.createElement("div")).attr({id:this.environment.publicName,style:destDOM.attr("style"),"class":"projekktor"}).css("overflow","hidden").css("width",this.environment.referenceWidth+"px").css("height",this.environment.referenceHeight+"px");destDOM.replaceWith(this.environment.playerDom);var css={position:"absolute",overflow:"hidden",top:0,left:0,height:"100%",width:"100%",display:"block"};this.environment.mediaDom=$(document.createElement("div")).appendTo(this.environment.playerDom).attr({id:this.environment.publicName+"_media"}).css(css).css("z-index",2);this.environment.media_canvasDom=$(document.createElement("div")).appendTo(this.environment.playerDom).attr({id:this.environment.publicName+"_media_canvas"}).css(css).css("z-index",10);this.environment.media_clickcatcherDom=$(document.createElement("div")).appendTo(this.environment.media_canvasDom).attr({id:this.environment.publicName+"_media_clickcatcher"}).css(css).css("cursor","pointer");this.mediaGrid=this._testMediaSupport();try{$("#projekktorver").html("V"+this.config.version)}catch(e){}if(this.config.forceFullViewport==true&&this.config.sandboxed!==true){this.config.disableFullscreen=true;this._enterFullViewport()}if(this.config.sandBox!==false){this.getSandboxWindow().ready(function(){ref._enterFullViewport();ref.environment.inFullscreen=false});if(this.config.sandBoxHashObserve==true){this._initHashChangeDetect()}}for(var i in this.properties.sources){if(this.properties.sources[i].type=="text/json"||this.properties.sources[i].type=="text/xml"){this.setFile(this.properties.sources[i].src,true);return}}this.setFile({0:{file:this.properties.sources}})};this._reelLoad=function(url,dataType){var ref=this;$.ajax({url:url,success:function(data){ref.properties.playlistServer=url;ref._reelParse(data,dataType)},error:function(data){ref._debug("Can not load "+url+" as "+dataType)}})};this._reelParse=function(data,dataType){var uuups=[{file:"none",type:"NA",errorCode:98}];switch(dataType){case"json":if(typeof data=="string"){try{data=$.parseJSON(data)}catch(e){data=uuups}}break;case"xml":if(typeof data=="string"){try{data=this._xmlParser(this._textToXML(data));data=this._projekktorizeRSS(data)}catch(e){data=uuups}break}try{data=this._xmlParser(data);data=this._projekktorizeRSS(data)}catch(e){data=uuups}break;default:data=[{file:"none",type:"NA",errorCode:98}];break}this._debug("Parsed incoming data as "+dataType);this._reelUpdate(data)};this._reelUpdate=function(obj){var ref=this;var data=obj||{};this.media=[];this.media[0]=null;try{var setValue=null;for(var props in data.config){this.config[props]=this._cleanValue(data.config[props]);this._debug("Updated config var: "+props+" to "+this.config[props])}delete (data.config)}catch(e){}for(var items in data){if(data[items].file==undefined){continue}this.media.push(this._prepareMedia(this._cleanValue(data[items])))}this._registerPlugins()};this._pluginsReady=function(){this.setPlayerPoster(this.config.poster);this._bubbleEvent("playlist",{});this.setActiveItem(0)};this._prepareMedia=function(data){var mediaFile="";var mediaType="";var mediaModel="playerObjectNA";var fileExt="";var extTypes={};var typesModels={};var errorCode=(data.errorCode!=undefined)?data.errorCode:5;var lastLevel=100;var extRegEx=[];for(var i in this.mediaTypes){extRegEx.push("."+this.mediaTypes[i].ext);extTypes[this.mediaTypes[i].ext]=this.mediaTypes[i];typesModels[this.mediaTypes[i].type]=this.mediaTypes[i]}extRegEx=extRegEx.join("|");if(typeof data.file=="string"){data.file=[{src:data.file}];if(typeof data.type=="string"){data.file=[{src:data.file,type:data.type}]}}if(data.isposter===true){data.file[0].src=(data.file[0].src=="")?this.config.defaultPoster:data.file[0].src}if(this.config.dynamicTypeExtensions.length>0&&data.isposter!==true&&data.file.length>0){var srcBase=data.file[0].src;var tmp=[];data.file=[];for(var i=0;i<this.config.dynamicTypeExtensions.length;i++){tmp.push({src:srcBase+this.config.dynamicTypeExtensions[i].ext,type:this.config.dynamicTypeExtensions[i].type})}data.file=tmp}var sourceObj={};for(var index in data.file){sourceObj=data.file[index];if(typeof sourceObj=="string"){sourceObj={src:sourceObj}}if(sourceObj.src==undefined){continue}try{fileExt=sourceObj.src.match(new RegExp(extRegEx))[0];fileExt=(!fileExt)?"NaN":fileExt.replace(".","")}catch(e){fileExt="NaN"}if(sourceObj.type===undefined||sourceObj.type===""){if(extTypes[fileExt]){$.extend(sourceObj,extTypes[fileExt])}}else{try{var codecMatch=sourceObj.type.split(" ").join("").split(/[\;]codecs=.([a-zA-Z0-9\,]*)[\'|\"]/i);if(codecMatch[1]!==undefined){sourceObj.codec=codecMatch[1];sourceObj.type=codecMatch[0]}}catch(e){}if(typesModels[sourceObj.type]){$.extend(sourceObj,typesModels[sourceObj.type])}}if(lastLevel>this.platformPriority.indexOf(sourceObj.platform)&&this.mediaGrid[sourceObj.type]!="NA"){lastLevel=this.platformPriority.indexOf(sourceObj.platform);try{mediaModel="playerObject"+this.mediaGrid[sourceObj.type].toUpperCase()}catch(e){mediaModel="playerObjectNA"}mediaFile=sourceObj.src;mediaType=sourceObj.type}if(index==="src"){break}}if(typeof eval(mediaModel)!=="function"){mediaModel="playerObjectNA";errorCode=0}else{if(this.environment.modelExtensions[this.mediaGrid[mediaType]]!=undefined){mediaModel+="_"+(this.environment.modelExtensions[this.mediaGrid[mediaType]].toUpperCase())}}if(sourceObj.title!=undefined){data.title=sourceObj.title}if(sourceObj.poster!=undefined){data.poster=sourceObj.poster}var block=0;if(this.config.allowPlaybackFrom.length>0){for(var i=0;i<this.config.allowPlaybackFrom.length;i++){if(mediaFile.indexOf(this.config.allowPlaybackFrom[i])>-1){block++}}if(block==0){mediaFile=""}}data.file=mediaFile;data.mediaType=mediaType;data.mediaModel=mediaModel;data.poster=(data.poster!=undefined)?data.poster:this.config.defaultPoster;data.errorCode=errorCode;data.ID=this.randomId(8);data._VALIDATED=true;if(!data.isposter){this._debug("Prepared new item. Type: "+mediaType+" Model: "+data.mediaModel+" File:"+data.file+" Priority: "+lastLevel)}return data};this._modelUpdateListener=function(type,value){var ref=this;if(type!="time"&&type!="progress"){this._debug("Received model event: '"+type+"' while handling '"+this.media[this.properties.currentItem].file+"' using '"+this.media[this.properties.currentItem].mediaModel+"'")}switch(type){case"objectReady":this._bubbleEvent("objectReady",{});(function(){try{for(var i=0;i<ref.plugins.length;i++){if(ref.plugins[i].pluginReady!==true){setTimeout(arguments.callee,100);return}}ref._bubbleEvent("pluginsReady",{});ref._startPlayback()}catch(e){}})();break;case"awaking":this._bubbleEvent("awaking",{});break;case"start":if(this._isStarted==false){this._isReady=true;this._isStarted=true;this._isPlaying=true;this._bubbleEvent("start",{});break}case"play":case"FFreinit":if(this._isPlaying===false){this._isPlaying=true;this._bubbleEvent("play",{});this.playerObject.applyCommand("volume",this.config.volume);break}if(this._isWaiting===true){this._bubbleEvent("canplay",{});this._isWaiting=false}break;case"pause":if(this.config.disablePause==true||this.media[this.properties.currentItem].disablePause==true){this.playerObject.applyCommand("play",0);break}if(this._isPlaying==true){this._isPlaying=false;this._bubbleEvent("pause",{})}break;case"seek":this._bubbleEvent("seek",{dest:value});break;case"testcard":this._isWaiting=false;this._hasError=true;this._bubbleEvent("testcard",{});break;case"volume":this.config.volume=this.playerObject.getVolume();this._bubbleEvent("volume",{volume:this.config.volume});break;case"suspend":this._isWaiting=false;this._bubbleEvent("suspend",{});break;case"progress":this._bubbleEvent("progress",{});break;case"time":this._bubbleEvent("time",{});break;case"fullscreen":if(this.config.sandBox!==false){if(value==true){this._enterSandboxFullViewport()}else{this._exitSandboxFullViewport()}}else{if(value==true){this._enterFullViewport()}else{this._exitFullViewport()}}this._bubbleEvent("fullscreen",{});break;case"ended":this._bubbleEvent("ended",{});if(this.properties.currentItem+1==this.media.length){this._bubbleEvent("done",{})}this.setActiveItem("next");break;case"waiting":if(this._isWaiting!==true){this._bubbleEvent("waiting",{});this._isWaiting=true}break;case"canplaythrough":case"canplay":if(this.config.start!==false&&this._isReady===false){this.playerObject.applyCommand("seek",this.config.start);this._isReady=true;break}this._bubbleEvent("canplay",{});this._isWaiting=false;if(this._isPlaying===false){this._bubbleEvent("time",{})}break;case"playlist":this.config.autoplay=true;this.setFile(value,true);break}};this._startPlayback=function(){if(this.config.flashBreakOut==true&&this.getUsesFlash()){this.environment.media_clickcatcherDom.hide();this.environment.media_canvasDom.hide();return}else{this._addGUIListeners()}if(this.config.autoplay==true||this.properties.currentItem>0){this.playerObject.applyCommand("play")}if(this.config.start===false||this._hasError===true){this._isReady=true}if(this._hasError===true){this._bubbleEvent("error",{})}};this._addGUIListeners=function(){var ref=this;if(this.config.designMode===true){return}this.environment.mediaDom.unbind();this.environment.mediaDom.click(function(event){ref._displayClickListener(event)});this.environment.mediaDom.mousemove(function(event){ref._displayMousemoveListener(event)});this.environment.media_clickcatcherDom.unbind();this.environment.media_clickcatcherDom.click(function(event){ref._displayClickListener(event)});this.environment.media_clickcatcherDom.mousemove(function(event){ref._displayMousemoveListener(event)});this.environment.media_clickcatcherDom.mouseenter(function(event){ref._displayMouseEnterListener(event)});this.environment.media_clickcatcherDom.mouseleave(function(event){ref._displayMouseLeaveListener(event)});var keyPressHandler=function(evt){ref._keyListener(evt)};if(this.config.enableKeyboard===true){$(document.documentElement).unbind("keydown",keyPressHandler);$(document.documentElement).unbind("keypress",keyPressHandler);if(!$.browser.mozilla){$(document.documentElement).keydown(keyPressHandler)}else{$(document.documentElement).keypress(keyPressHandler)}}};this._removeGUIListeners=function(){$("#"+this.environment.publicName).unbind()};this._registerPlugins=function(){var ref=this;if(this.config.plugins.length==0||this.plugins.length>0){this._pluginsReady();return}for(var i=0;i<this.config.plugins.length;i++){var pluginName="projekktor"+this.config.plugins[i];var pluginObj=$.extend(new projekktorPluginInterface(),eval(pluginName).prototype);pluginObj.player=this;pluginObj.playerDom=this.environment.media_canvasDom;pluginObj.canvas.media=this.environment.media_canvasDom;pluginObj.canvas.projekktor=this.environment.canvasDom;pluginObj._init(this.config);this.plugins.push(pluginObj)}(function(){try{for(var i=0;i<ref.plugins.length;i++){if(ref.plugins[i].pluginReady!==true){setTimeout(arguments.callee,100);return}}ref._pluginsReady()}catch(e){}})()};this._unbindPlugins=function(rmvPl){if(this.plugins.length==0){return}var pluginsToRemove=rmvPl||[];for(var j=0;j<this.plugins.length;j++){if($.inArray(j,pluginsToRemove)||pluginsToRemove.length===0){$(this.plugins[j]).unbind()}}};this._bubbleEvent=function(eventType,data){if(this.plugins.length>0){for(var i in this.plugins){try{this.plugins[i][eventType+"Handler"](data)}catch(e){}}}if(this.listeners.length>0){for(var i in this.listeners){try{if(this.listeners[i]["event"]==eventType||this.listeners[i]["event"]=="*"){this.listeners[i]["callback"](eventType)}}catch(e){}}}};this._detachPlayerObject=function(){this._isStarted=false;this._isPlaying=false;this._isReady=false;this._hasError=false;this._isWaiting=false;this._displayClicks=0;for(var i=0;i<this.plugins.length;i++){this.plugins[i].pluginReady=false}try{$(this).unbind();this._unbindPlugins();this._removeGUIListeners();this.playerObject.destroy();this.playerObject=null}catch(e){}this._bubbleEvent("detach",{})};this._displayClickListener=function(evt){var ref=this;this._displayClicks++;if(this._displayClicks>0){setTimeout(function(){if(ref._displayClicks==1){ref._displaySingleClick()}else{if(ref._displayClicks==2){ref._displayDblClick()}}ref._displayClicks=0;if($.browser.msie){evt.cancelBubble=true}else{evt.stopPropagation()}},250)}return false};this._displaySingleClick=function(){this.setPlayPause()};this._displayDblClick=function(){var ref=this;if(!this._isStarted){return}else{if(this.config.disableFullscreen!==true){}}};this._displayMousemoveListener=function(evt){this._bubbleEvent("mousemove",{});if($.browser.msie){evt.cancelBubble=true}else{evt.stopPropagation()}};this._displayMouseEnterListener=function(evt){this._bubbleEvent("mouseenter",{});this.environment.mouseIsOver=true;if($.browser.msie){evt.cancelBubble=true}else{evt.stopPropagation()}};this._displayMouseLeaveListener=function(evt){this._bubbleEvent("mouseleave",{});this.environment.mouseIsOver=false;if($.browser.msie){evt.cancelBubble=true}else{evt.stopPropagation()}};this._keyListener=function(evt){if(this.environment.mouseIsOver!==true){return}this._bubbleEvent("key",evt.keyCode);switch(evt.keyCode){case 27:this.setFullscreen(false);break;case 13:this.setFullscreen(true);break;case 39:break;case 37:break;case 0:this.setPlayPause();break}};this._setMediaContainer=function(width,height,x,y){var widthRatio=width/this.environment.referenceWidth;var heightRatio=height/this.environment.referenceHeight;var css={width:"100%",height:"100%",top:0,left:0};try{this.environment.mediaDom.css(css);this.environment.media_canvasDom.css(css);this.environment.media_clickcatcherDom.css(css)}catch(e){}};this._enterFullViewport=function(){if(this.environment.inFullscreen===true){return}this.environment.scrollTop=$(window).scrollTop();this.environment.scrollLeft=$(window).scrollLeft();this.environment.playerStyle=this.environment.playerDom.attr("style");this.environment.bodyOverflow=$("body").css("overflow");$(window).scrollTop(0);$(window).scrollLeft(0);$("body").css("overflow","hidden");this.environment.playerDom.css({position:"fixed",display:"block",top:0,left:0,width:"100%",height:"100%",zIndex:99997});this.environment.inFullscreen=true};this._exitFullViewport=function(){if(this.environment.inFullscreen===false){return}this.environment.playerDom.attr("style",this.environment.playerStyle);$("body").css("overflow",this.environment.bodyOverflow);$(window).scrollTop(this.environment.scrollTop);$(window).scrollLeft(this.environment.scrollLef);this.environment.inFullscreen=false};this._enterSandboxFullViewport=function(){if(this.environment.inFullscreen===true){return}var win=this.getSandboxWindow();var iframe=this.getSandboxIframe();this.environment.scrollTop=win.scrollTop();this.environment.scrollLeft=win.scrollLeft();this.environment.playerStyle=iframe.attr("style");this.environment.sandBoxWidth=iframe.attr("width");this.environment.sandBoxHeight=iframe.attr("height");this.environment.bodyOverflow=$(win[0].document.body).css("overflow");win.scrollTop(0);win.scrollLeft(0);$(win[0].document.body).css("overflow","hidden");iframe.css({position:"fixed",display:"block",top:0,left:0,width:"100%",height:"100%",zIndex:9999});this.environment.inFullscreen=true};this._exitSandboxFullViewport=function(){if(this.environment.inFullscreen===false){return}var win=this.getSandboxWindow();var iframe=this.getSandboxIframe();win.scrollTop(this.environment.scrollTop);win.scrollLeft(this.environment.scrollLef);$(win[0].document.body).css("overflow",this.environment.bodyOverflow);iframe.attr("width",this.environment.sandBoxWidth+"px");iframe.attr("height",this.environment.sandBoxHeight+"px");iframe.attr("style",(this.environment.playerStyle==undefined)?"":this.environment.playerStyle);this.environment.inFullscreen=false};this.setActiveItem=function(mixedData){var result=0;if(typeof mixedData=="string"){switch(mixedData){case"previous":if(this.config.disallowSkip==true){return}result=this.properties.currentItem-1;break;default:case"next":if(this.config.disallowSkip==true){return}result=this.properties.currentItem+1;break}}else{if(typeof mixedData=="number"){result=mixedData}else{return false}}if(this.config.loop===true){if(result>this.getItemCount()){result=1}if(result<1){result=0}}else{if(result>this.getItemCount()){result=0}if(result<0){result=0}}if(this.config.autoplay===true&&result===0){result=1}this._detachPlayerObject();this.properties.currentItem=result;this.config.volume=(this.environment.volume!==null)?this.environment.volume:this.config.volume;this.playerObject=new playerObject();this.playerObject=$.extend(true,{},new playerObject(),eval(this.media[this.properties.currentItem].mediaModel).prototype);this.playerObject.init($.extend(true,{},{media:this.media[this.properties.currentItem],controller:this,environment:this.environment,config:this.config}));this._setMediaContainer();this._bubbleEvent("item",this.media[this.properties.currentItem])};this.getItemCount=function(){return this.media.length-1};this.getIsPlaying=function(){return this._isPlaying};this.getIsAutoslide=function(){return this.playerObject.getIsAutoslide()};this.getIsStarted=function(){return this._isStarted};this.getLoadProgress=function(){try{return this.playerObject.getLoadProgress()}catch(e){return 0}};this.getKbPerSec=function(){try{return this.playerObject.getKbPerSec()}catch(e){return 0}};this.getItemId=function(idx){if(this.config.poster===undefined){if(idx==undefined){return this.media[this.properties.currentItem].ID}return this.media[idx].ID}else{if(idx==undefined){return this.media[this.properties.currentItem+1].ID}return this.media[idx+1].ID}};this.getItemIdx=function(){return this.properties.currentItem};this.getItem=function(idx){switch(idx){case"next":return this.media[this.properties.currentItem+1];case"prev":return this.media[this.properties.currentItem-1];case"current":return this.media[this.properties.currentItem];default:return this.media[idx]}};this.getVolume=function(){return this.config.volume};this.getTrackId=function(){if(this.config.trackId){return this.config.trackId}if(this.properties.playlistServer!=null){return"pl"+this.properties.currentItem}return null};this.getLoadPlaybackProgress=function(){try{return this.playerObject.getLoadPlaybackProgress()}catch(e){return 0}};this.getDuration=function(){try{return this.playerObject.getDuration()}catch(e){return 0}};this.getPosition=function(){try{return this.playerObject.getPosition()}catch(e){return 0}};this.getTimeLeft=function(){try{return this.playerObject.getDuration()-this.playerObject.getPosition()}catch(e){return this.media[this.properties.currentItem].duration}};this.getInFullscreen=function(){return this.environment.inFullscreen};this.getPublicName=function(){return this.environment.publicName};this.getIsPlaying=function(){return this._isPlaying};this.getMediaType=function(){return this.media[this.properties.currentItem].mediaType};this.getUsesFlash=function(){return(this.media[this.properties.currentItem].mediaModel.indexOf("FLASH")>-1)};this.getSandboxWindow=function(){return $(parent.window)};this.getSandboxIframe=function(){return window.$(frameElement)};this.getPlaylist=function(){return $.extend(true,[],this.media.slice(1))};this.setPlay=function(){if(this._isReady===false){return false}this.playerObject.applyCommand("play",false);return true};this.setPause=function(){if(this._isReady===false){return false}this.playerObject.applyCommand("pause",false);return true};this.setPlayPause=function(){if(!this._isPlaying||!this._isStarted){this.setPlay();return true}this.setPause();return false};this.setPlayhead=function(position){if(this.config.disallowSkip==true){return}if(typeof position!="number"){return}this.playerObject.applyCommand("seek",position)};this.getPreloaderPct=function(){var preLoadJobs=0;var percentTotal=0;if(this._pctLoaded>=100){this._pctLoaded=0;for(var i in this._preload){this._preload[i]=0}return 100}for(var i in this._preload){preLoadJobs++;percentTotal+=this._preload[i]}return Math.ceil(percentTotal/preLoadJobs)};this.setPlayerPoster=function(url){var posterItem=this._prepareMedia({file:url,isposter:true});this._debug("Setting poster - url:"+posterItem.file);this.media[0]=posterItem};this.setFile=function(arg,ext){this._isStarted=false;this._detachPlayerObject();var data=arg||{};var externalData=ext||false;var result={};if(typeof arg=="object"){this._debug("Applying incoming JS Object",arg);this._reelUpdate(arg);return}if(typeof arg=="string"){var splt=[];splt[0]=arg;if(arg.indexOf(this.config.FilePosterSeparator)>-1){splt=arg.split(this.config.FilePosterSeparator);data.config={poster:splt[1]}}else{result[0]={};result[0].file=arg}if(externalData===false){this._debug("Applying incoming single file:"+result[0]["file"],data);this._reelUpdate(result)}else{this._debug("Loading external data from "+splt[0]);this._reelLoad(splt[0],"json")}return}this._debug("---- uuups ----")};this.addListener=function(evt,callback){var listenerObj={event:evt,callback:callback};this.listeners.push(listenerObj)};this.removeListener=function(evt,callback){for(var i=0;i<this.listeners.length;i++){if(this.listeners[i].event!=evt){continue}if(this.listeners[i].callback!=callback){continue}this.listeners.splice(i,1);return true}return false};this.sendEvent=function(command,parameter){switch(command){case"next":this.setActiveItem("next");break;case"previous":this.setActiveItem("previous");break;case"fullscreen":this.setFullscreen(parameter);break;default:this.playerObject.applyCommand(command,parameter);break}};this.setFullscreen=function(full){if(this.config.disableFullscreen||this.media[this.properties.currentItem].disableFullscreen==true){return}this.playerObject.applyCommand("fullscreen",full)};this.ping=function(){alert("pong")};this._testMediaSupport=function(){var result=[];var hasNativeAudio=false;var hasFlash=(this.environment.flashVersion[0]>0);var nativeElementType="";for(i in this.mediaTypes){result[this.mediaTypes[i]["type"]]="NA";if(this.mediaTypes[i]["model"]=="image"&&this.mediaTypes[i]["platform"]=="native"){result[this.mediaTypes[i]["type"]]="image";continue}if(this.mediaTypes[i]["platform"]=="internal"){result[this.mediaTypes[i]["type"]]=this.mediaTypes[i]["model"];continue}if(hasFlash==true&&this.mediaTypes[i]["platform"]=="flash"){if(this.mediaTypes[i]["model"]=="flash"){if(this.config.enableFlashFallback==true){result[this.mediaTypes[i]["type"]]=this.mediaTypes[i]["model"]}}else{result[this.mediaTypes[i]["type"]]=this.mediaTypes[i]["model"]}}if(this.mediaTypes[i]["fixed"]!==true&&this.config.enableNativePlayback!==false){if((this.mediaTypes[i]["type"].indexOf("video")>-1||this.mediaTypes[i]["type"].indexOf("audio")>-1)){try{nativeElementType=(this.mediaTypes[i]["type"].indexOf("video")>-1)?"video":"audio";var testObject=document.createElement(nativeElementType);if(testObject.canPlayType!=false){switch(testObject.canPlayType(this.mediaTypes[i]["type"])){case"no":break;case"":break;case"maybe":if($.browser.opera){break}case"probably":default:result[this.mediaTypes[i]["type"]]=nativeElementType}}}catch(e){}}}}this._debug("Client media support matrix:",result);return result};this._getSourcesFromContainer=function(target){if(target==undefined){return""}var result={};var i=0;var poster=false;var title="";if(target.attr("poster")){poster=target.attr("poster")}if(target.attr("title")){title=target.attr("title")}if(target.attr("src")){result[i]={src:target.attr("src"),type:target.attr("type"),poster:poster,title:title};i++}$(target).children().each(function(){if($(this).attr("src")){result[i]={src:$(this).attr("src"),type:$(this).attr("type"),poster:poster,title:title};i++}});return result};this.randomId=function(length){var chars="abcdefghiklmnopqrstuvwxyz";var result="";for(var i=0;i<length;i++){var rnum=Math.floor(Math.random()*chars.length);result+=chars.substring(rnum,rnum+1)}return result};this._flashVersion=function(){try{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{axo.AllowScriptAccess="always"}catch(e){return"6,0,0"}}catch(e){}return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(e){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}}catch(e){}}return"0,0,0"};this._cleanValue=function(value){switch(value){case"false":return false;case"true":return true;case"null":return null;case"undefined":return"";default:return value}};this._xmlParser=function(xdoc){try{if(!xdoc){return null}var tmpObj={};tmpObj.typeOf="JSXBObject";var xroot=(xdoc.nodeType==9)?xdoc.documentElement:xdoc;tmpObj.RootName=xroot.nodeName||"";if(xdoc.nodeType==3||xdoc.nodeType==4){return xdoc.nodeValue}var isNumeric=function(s){var testStr="";if(s&&typeof s=="string"){testStr=s}var pattern=/^((-)?([0-9]*)((\.{0,1})([0-9]+))?$)/;return pattern.test(testStr)};function formatName(name){var regEx=/-/g;var tName=String(name).replace(regEx,"_");return tName}function setAttributes(obj,node){if(node.attributes.length>0){var a=node.attributes.length-1;var attName;obj._attributes=[];do{attName=String(formatName(node.attributes[a].name));obj._attributes.push(attName);obj[attName]=$.trim(node.attributes[a].value)}while(a--)}}function setHelpers(grpObj){grpObj.getNodeByAttribute=function(attr,obj){if(this.length>0){var cNode;var maxLen=this.length-1;try{do{cNode=this[maxLen];if(cNode[attr]==obj){return cNode}}while(maxLen--)}catch(e){return false}return false}};grpObj.contains=function(attr,obj){if(this.length>0){var maxLen=this.length-1;try{do{if(this[maxLen][attr]==obj){return true}}while(maxLen--)}catch(e){return false}return false}};grpObj.indexOf=function(attr,obj){var pos=-1;if(this.length>0){var maxLen=this.length-1;try{do{if(this[maxLen][attr]==obj){pos=maxLen}}while(maxLen--)}catch(e){return -1}return pos}};grpObj.SortByAttribute=function(col,dir){if(this.length){function getValue(pair,idx){var out=pair[idx];out=(isNumeric(out))?parseFloat(out):out;return out}function sortFn(a,b){var res=0;var tA,tB;tA=getValue(a,col);tB=getValue(b,col);if(tA<tB){res=-1}else{if(tB<tA){res=1}}if(dir){res=(dir.toUpperCase()=="DESC")?(0-res):res}return res}this.sort(sortFn)}};grpObj.SortByValue=function(dir){if(this.length){function getValue(pair){var out=pair.Text;out=(isNumeric(out))?parseFloat(out):out;return out}function sortFn(a,b){var res=0;var tA,tB;tA=getValue(a);tB=getValue(b);if(tA<tB){res=-1}else{if(tB<tA){res=1}}if(dir){res=(dir.toUpperCase()=="DESC")?(0-res):res}return res}this.sort(sortFn)}};grpObj.SortByNode=function(node,dir){if(this.length){function getValue(pair,node){var out=pair[node][0].Text;out=(isNumeric(out))?parseFloat(out):out;return out}function sortFn(a,b){var res=0;var tA,tB;tA=getValue(a,node);tB=getValue(b,node);if(tA<tB){res=-1}else{if(tB<tA){res=1}}if(dir){res=(dir.toUpperCase()=="DESC")?(0-res):res}return res}this.sort(sortFn)}}}function setObjects(obj,node){var elemName;var cnode;var tObj;var cName="";if(!node){return null}if(node.attributes.length>0){setAttributes(obj,node)}obj.Text="";if(node.hasChildNodes()){var nodeCount=node.childNodes.length-1;var n=0;do{cnode=node.childNodes[n];switch(cnode.nodeType){case 1:obj._children=[];elemName=(cnode.localName)?cnode.localName:cnode.baseName;elemName=formatName(elemName);if(cName!=elemName){obj._children.push(elemName)}if(!obj[elemName]){obj[elemName]=[]}tObj={};obj[elemName].push(tObj);if(cnode.attributes.length>0){setAttributes(tObj,cnode)}if(!obj[elemName].contains){setHelpers(obj[elemName])}cName=elemName;if(cnode.hasChildNodes()){setObjects(tObj,cnode)}break;case 3:obj.Text+=$.trim(cnode.nodeValue);break;case 4:obj.Text+=(cnode.text)?$.trim(cnode.text):$.trim(cnode.nodeValue);break}}while(n++<nodeCount)}}setObjects(tmpObj,xroot);xdoc=null;xroot=null;return tmpObj}catch(e){return null}};this._textToXML=function(strXML){var xmlDoc=null;try{xmlDoc=($.browser.msie)?new ActiveXObject("Microsoft.XMLDOM"):new DOMParser();xmlDoc.async=false}catch(e){throw new Error("XML Parser could not be instantiated")}var out;try{if($.browser.msie){out=(xmlDoc.loadXML(strXML))?xmlDoc:false}else{out=xmlDoc.parseFromString(strXML,"text/xml")}}catch(e){throw new Error("Error parsing XML string")}return out};this._projekktorizeRSS=function(jsonData){var result={title:jsonData.channel[0]["title"][0]["Text"],desc:jsonData.channel[0]["description"][0]["Text"]};var items=jsonData.channel[0]["item"];for(var i=0;i<items.length;i++){result[i]={title:items[i]["title"][0]["Text"],desc:items[i]["description"][0]["Text"],file:{type:items[i]["enclosure"][0]["url"],src:items[i]["enclosure"][0]["type"]}}}return result};this._preloadImages=function(taskName,imgArray){var cache=[];var ref=this;var imagesLoaded=0;for(var i=imgArray.length;i--;){var cacheImage=document.createElement("img");cacheImage.src=imgArray[i];cache.push(cacheImage);$(cacheImage).load(function(){imagesLoaded++;ref._preload[taskName]=Math.ceil(imagesLoaded*100/imgArray.length)})}};this._initHashChangeDetect=function(){var ref=this;if("onhashchange1" in window){window.onhashchange=function(){ref.setFile(window.location.hash.substring(1))}}else{var storedHash=window.location.hash;window.setInterval(function(){if(window.location.hash!=storedHash){storedHash=window.location.hash;ref.setFile(storedHash.substring(1))}},100)}};this._getFilesFromHash=function(idx){var data=window.location.hash.substring(1);if(data==undefined||data==null){return false}if(data.indexOf(this.config.FilePosterSeparator)>-1){data=data.split(this.config.FilePosterSeparator)}if(data[1]&&idx==1){return data[1]}else{if(idx==0){return data[0]}}return false};this._debug=function(desc,data){if(this.config.debug===false){return}if(this.config.debug=="console"){try{if(desc){console.log(desc)}if(data&&this.config.debugLevel>1){console.log(data)}}catch(e){}return}var result="<pre><b>"+desc+"</b>\n";if(data&&this.config.debugLevel>1){switch(typeof data){case"undefined":break;case"object":var temp="";if(temp==""){temp="";for(var i in data){temp+=i+" : "+data[i]+"\n"}}result+=temp;break;case"string":result+=data}result+="</pre>"}try{$("#"+this.config._debug).prepend(result)}catch(e){}}};
