var $j=jQuery.noConflict();var blindId="#curtain";var protectorId="#plastic";var controlId="#sticker";var statusId="#challenge_av";var playerDefault="flixplayer";var autoPlayDefault=0;var widthDefault=590;var heightDefault=332;var sample_rate=750;var vidObjMap={};var YouTube=new function(){this.sig="client=ytapi-MemamsaLLC-SceneThis-0dr821sf-1&key=AI39si73N7GIjVNhG1D2Qw27ov4Ko3kutlhTFObWEaWaCQEfEN10wwRcLlDY7nKNjOcHqcF0-r94A1NysH0RKfGIPQUtP4oX4Q";this.vurl="http://www.youtube.com/v/";this.playerParams={allowScriptAccess:"always",bgcolor:"#cccccc",wmode:"transparent"};this.UNSTARTED=-1;this.ENDED=0;this.PLAYING=1;this.PAUSED=2;this.BUFFERING=3;this.CUED=5};function Video(a){this.ytid=a;this.playerId=playerDefault;this.autoPlay=autoPlayDefault;this.width=widthDefault;this.height=heightDefault;this.embedComplete=false;this.to_minrec=null;this.to_maxrec=null;this.to_playback=null;this.seekto=this.playto=this.playback=null;this.doFullPlayback=false;this.afterplay=null;this.optionStr="&enablejsapi=1&rel=0&disablekb=1&showinfo=0&iv_load_policy=3";this.video_url=YouTube.vurl+a+this.optionStr;this.player=null;vidObjMap[a]=this;this.resetDisplay()}Video.prototype.isEmbedded=function(){return this.embedComplete};Video.prototype.setEmbed=function(a){this.embedComplete=a};Video.prototype.setAutoPlay=function(a){this.autoPlay=a?1:0;if(this.autoPlay==0){$j(controlId).show().css({"z-index":ZCUE3})}};Video.prototype.setPlayerElement=function(a){this.playerId=a};Video.prototype.setSize=function(b,a){this.width=b;this.height=a};Video.prototype.resetDisplay=function(){$j(blindId).css({"z-index":ZBASE}).hide();$j(protectorId).css({"z-index":ZBASE}).hide();$j(controlId).css({"z-index":ZBASE}).hide()};function onYouTubePlayerReady(a){var b=vidObjMap[a];if(b){b.setEmbed(true);b.playBackCtl()}}Video.prototype.embed=function(a){if(typeof(a)!="undefined"&&a){this.autoPlay=1}if(typeof(player_id)!="undefined"&&player_id){this.playerId=player_id}this.video_url+="&playerapiid="+this.ytid;this.video_url+="&autoplay="+this.autoPlay;if(this.seekto){this.video_url+="&start="+this.seekto}this.video_url+="&"+YouTube.sig;swfobject.embedSWF(this.video_url,this.playerId,this.width,this.height,"8",null,null,YouTube.playerParams,{id:this.playerId});this.player=$j("#"+this.playerId)[0]};Video.prototype.playBackFull=function(){this.resetDisplay();if(this.player){if(typeof(this.player.getPlayerState)=="function"){var a=this.player.getPlayerState();if(a==YouTube.ENDED||a==YouTube.PAUSED){this.player.seekTo(0);this.player.playVideo()}this.player.unMute()}}if(this.to_playback){clearInterval(this.to_playback)}$j(statusId).text("")};Video.prototype.onCluePlayed=function(a){this.afterplay=a};Video.prototype.checkForStop=function(a){if(!a.player||!a.player.getCurrentTime){return false}var b=a.player.getCurrentTime();var c=(a.player.getPlayerState()==YouTube.ENDED);if((b>0&&b>=a.playto)||c){if(a.player&&a.player.pauseVideo){a.player.pauseVideo()}if(a.player&&a.player.unMute){a.player.unMute()}if(a.afterplay&&typeof(a.afterplay)=="function"){a.afterplay()}clearInterval(a.to_playback)}};Video.prototype.setPlayBackCtl=function(a,c,b){this.seekto=a;this.playto=c;this.playback=b;this.doFullPlayback=false};Video.prototype.setPlayBackFull=function(){this.doFullPlayback=true};Video.prototype.playBackCtl=function(c){if(typeof(this.player)==="undefined"||typeof(this.player.seekTo)!=="function"){this.player=$j("#"+this.playerId)[0]}if(!this.player){return}if(this.doFullPlayback){this.playBackFull();return}$j(protectorId).show().css({"z-index":ZCUE4});var d=this.player.getPlayerState();if(c||d==YouTube.ENDED||d==YouTube.PAUSED){this.player.seekTo(this.seekto)}this.player.playVideo();switch(this.playback){case"vidonly":case 1:$j(blindId).css({"z-index":ZBASE}).hide();this.player.mute();$j(statusId).text("[ Audio Muted ]");break;case"audonly":case 2:$j(blindId).show().css({"z-index":ZCUE4});this.player.addEventListener("onStateChange","sceneBuffering");break;case"audvid":case 0:$j(blindId).css({"z-index":ZBASE}).hide();$j("#"+this.playerId).css({"z-index":ZCUE3});this.player.unMute();break}if(this.playback!="vidonly"||this.playback!=1){if(this.player.getVolume()<10){this.player.setVolume(42)}}var a=this;var b=function(){a.checkForStop(a)};this.to_playback=setInterval(b,sample_rate)};Video.prototype.clear=function(){if(this.player){try{if(player&&player.stopVideo){player.stopVideo()}if(player&&player.clearVideo){player.clearVideo()}}catch(b){}}var a="position:absolute; z-index:"+ZCUE3+";display:none;";var c=TAG("div",{id:this.playerId,style:a});$j("#"+this.playerId).replaceWith(c);vidObjMap[this.ytid]=null};Video.prototype.play=function(){if(this.player&&this.player.playVideo&&typeof(this.player.playVideo)=="function"){this.player.playVideo()}};Video.prototype.getCurrentTime=function(){if(this.player&&this.player.getCurrentTime&&typeof(this.player.getCurrentTime)=="function"){return this.player.getCurrentTime()}return -1};function clearVideo(){for(key in vidObjMap){var a=vidObjMap[key];if(a&&typeof(a)=="object"&&a.clear&&typeof(a.clear)=="function"){a.clear()}}vidObjMap={}};