var VideoPlayList=new Class({initialize:function(a){this.options=Object.extend({menu_container:null,menu_items:null,video_container:null,navContainer:null,navigation:{playlist_position:null},loadVideo:{width:null,height:null,path_base:null,videofile:null,autoplay:null,preview:null},playVideos:{autoplay:null}},a||{});this.start()},start:function(){this.Navigation();this.LoadVideo();this.PlayVideos()},Navigation:function(c){var b=new Fx.Scroll(this.options.menu_container,{wait:false,duration:500,transition:Fx.Transitions.Quad.easeInOut});var f=0;var e=$(this.options.menu_container).getElements(this.options.menu_items);$(this.options.menu_container).addEvent("mousewheel",function(j){j=new Event(j);j.stop();var i=f-j.wheel;if(j.wheel>0&&i<0){i=0}if(j.wheel<0&&i>e.length-1){i=e.length-1}b.toElement(e[i]);f=i;e.removeClass("menu_item_highlight");e[i].addClass("menu_item_highlight")});var a=new Element("a").set({"class":"scrollNavUp",href:"#"}).setStyle("z-index",99).injectInside($(this.options.navContainer)).addEvent("click",function(j){new Event(j).stop();var i=f-1;if(i<0){i=0}b.toElement(e[i]);f=i;e.removeClass("menu_item_highlight");e[i].addClass("menu_item_highlight")});var h=new Element("a").set({"class":"scrollNavDown",href:"#"}).setStyle("z-index",99).injectInside($(this.options.navContainer)).addEvent("click",function(j){new Event(j).stop();var i=f+1;if(i>e.length-1){i=e.length-1}b.toElement(e[i]);f=i;e.removeClass("menu_item_highlight");e[i].addClass("menu_item_highlight")});var d=new Fx.Styles(a,{duration:200,transition:Fx.Transitions.linear,wait:false});var g=new Fx.Styles(h,{duration:200,transition:Fx.Transitions.linear,wait:false});d.start({opacity:0.6});g.start({opacity:0.6});a.addEvent("mouseover",function(){d.start({opacity:1.2})});a.addEvent("mouseout",function(){d.start({opacity:0.6})});h.addEvent("mouseover",function(){g.start({opacity:1.2})});h.addEvent("mouseout",function(){g.start({opacity:0.6})})},LoadVideo:function(){var a=this.options.loadVideo;this.moke_call=new mokeCall();this.moke_call.my_width=a.width;this.moke_call.my_height=a.height;this.moke_call.swfPath=a.path_base;this.moke_call.preview=a.preview;this.moke_call.loadVideo(this.options.video_container,a.videofile);moke_player.setAutoPlay(a.autoplay)},PlayVideos:function(){var a=$(this.options.menu_container).getElements(this.options.menu_items);a.each(function(c){var d=c.getElement(".YJStudio_movie");var b=c.getElement(".neo_on img");c.addEvent("click",function(e){new Event(e).stop;if(b.getProperty("alt")=="available"){this.moke_call.preview=this.PrevPath(b.getProperty("src"))}else{this.moke_call.preview=null}this.moke_call.loadVideo(this.options.video_container,d.getProperty("href"));moke_player.setAutoPlay(this.options.playVideos.autoplay);a.removeClass("menu_itemhover");c.removeClass("menu_item_highlight").addClass("menu_itemhover")}.bind(this));d.addEvent("click",function(e){new Event(e).stop();if(b.getProperty("alt")=="available"){this.moke_call.preview=this.PrevPath(b.getProperty("src"))}else{this.moke_call.preview=null}this.moke_call.loadVideo(this.options.video_container,d.getProperty("href"));moke_player.setAutoPlay(this.options.playVideos.autoplay);a.removeClass("menu_itemhover");c.removeClass("menu_item_highlight").addClass("menu_itemhover")}.bind(this))}.bind(this))},PrevPath:function(b){var a=b;a=a.replace("&h=68","");a=a.replace("gallery/prevthumb?img=","");return"/gallery/watermark?img="+a+"&w="+my_prev_width+"&h="+my_prev_height}});var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var a;var b;var c;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(c){a=-1}}return a}function GetSwfVer(){var g=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var f=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+f].description;var e=a.split(" ");var c=e[2].split(".");var h=c[0];var b=c[1];var d=e[3];if(d==""){d=e[4]}if(d[0]=="d"){d=d.substring(1)}else{if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0){d=d.substring(0,d.indexOf("d"))}}}var g=h+"."+b+"."+d}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){g=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){g=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){g=2}else{if(isIE&&isWin&&!isOpera){g=ControlVersion()}}}}}return g}function DetectFlashVer(f,d,c){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var e=versionArray[0];var a=versionArray[1];var b=versionArray[2];if(e>parseFloat(f)){return true}else{if(e==parseFloat(f)){if(a>parseFloat(d)){return true}else{if(a==parseFloat(d)){if(b>=parseFloat(c)){return true}}}}}return false}}}function AC_AddExtension(b,a){if(b.indexOf("?")!=-1){return b.replace(/\?/,a+"?")}else{return b+a}}function AC_Generateobj(e,d,a){var c="";if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in e){c+=b+'="'+e[b]+'" '}c+=">";for(var b in d){c+='<param name="'+b+'" value="'+d[b]+'" /> '}c+="</object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '}c+="> </embed>"}document.write(c)}function AC_FL_RunContent(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_SW_RunContent(){var a=AC_GetArgs(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_GetArgs(b,e,g,d,h){var a=new Object();a.embedAttrs=new Object();a.params=new Object();a.objAttrs=new Object();for(var c=0;c<b.length;c=c+2){var f=b[c].toLowerCase();switch(f){case"classid":break;case"pluginspage":a.embedAttrs[b[c]]=b[c+1];break;case"src":case"movie":b[c+1]=AC_AddExtension(b[c+1],e);a.embedAttrs.src=b[c+1];a.params[g]=b[c+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":a.objAttrs[b[c]]=b[c+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":a.embedAttrs[b[c]]=a.objAttrs[b[c]]=b[c+1];break;default:a.embedAttrs[b[c]]=a.params[b[c]]=b[c+1]}}a.objAttrs.classid=d;if(h){a.embedAttrs.type=h}return a}MOKEVideo=function(f,e,g,d,h,c,a,b){h=(h)?h:"";this.DEFAULT_SWF_PATH=h+"flash/yjvideo";this.DEFAULT_SKIN_PATH=h+"skins/yjms2.swf";this.DEFAULT_FOLDER=h;this.PREVIEW_IMAGE=e||this.DEFAULT_FOLDER+"images/playVideo.png";this.DEFAULT_WIDTH=320;this.DEFAULT_HEIGHT=240;this.ERROR_DIV_NOT_FOUND="The specified DIV element was not found.";this.id=FAVideoManagerInstance.addPlayer(this);this.rendered=false;this.inited=false;this.divName=f;this.name="FAVideo_"+f;this.videoPath=g;this.bgColor=(d!="undefined")?d:"000000";this.width=(c>0)?c:this.DEFAULT_WIDTH;this.height=(a>0)?a:this.DEFAULT_HEIGHT;this.player=null;this.initProperties();this.setOptions(b);this.createPlayer();this.render()};MOKEVideo.prototype.play=function(b,a){this.autoPlay=true;if(a!=null){this.setTotalTime(a)}if(b!=null){this.videoPath=b}if(this.videoPath==null&&!this.firstLoad){this.dispatchEvent({type:"error",error:"FAVideo::play - No videoPath has been set."});return}if(b==null&&this.firstLoad&&!this.autoLoad){b=this.videoPath}this.firstLoad=false;this.callMethod("playVideo",b,a)};MOKEVideo.prototype.load=function(a){if(a!=null){this.videoPath=a}if(this.videoPath==null){this.dispatchEvent({type:"error",error:"FAVideo::loadVideo - No videoPath has been set."});return}this.firstLoad=false;this.autoPlay=false;this.callMethod("loadVideo",this.videoPath)};MOKEVideo.prototype.pause=function(a){this.callMethod("pause",a)};MOKEVideo.prototype.stop=function(){this.callMethod("stop")};MOKEVideo.prototype.seek=function(a){this.callMethod("seek",a)};MOKEVideo.prototype.setSize=function(b,a){this.width=b;this.height=a;this.container.style.width=this.width+"px";this.container.style.height=this.height+"px";this.callMethod("setSize",this.width,this.height)};MOKEVideo.prototype.addEventListener=function(b,a,c){if(this.listeners==null){this.listeners={}}if(this.listeners[b]==null){this.listeners[b]=[]}else{this.removeEventListener(b,a,c)}this.listeners[b].push({target:a,func:c})};MOKEVideo.prototype.removeEventListener=function(c,a,d){for(var b=0;b<this.listeners[c].length;b++){var e=this.listeners[c][b];if(e.target==a&&e.func==d){this.listeners[c].splice(b,1);break}}};MOKEVideo.prototype.getVolume=function(){return this.volume};MOKEVideo.prototype.setVolume=function(a){this.setProperty("volume",a)};MOKEVideo.prototype.getAutoPlay=function(){return this.autoPlay};MOKEVideo.prototype.setAutoPlay=function(a){this.setProperty("autoPlay",a)};MOKEVideo.prototype.getClickToTogglePlay=function(){return this.clickToTogglePlay};MOKEVideo.prototype.setClickToTogglePlay=function(a){this.setProperty("clickToTogglePlay",a)};MOKEVideo.prototype.getAutoLoad=function(){return this.autoLoad};MOKEVideo.prototype.setAutoLoad=function(a){this.setProperty("autoLoad",a)};MOKEVideo.prototype.getSkinAutoHide=function(){return this.skinAutoHide};MOKEVideo.prototype.setSkinAutoHide=function(a){this.setProperty("skinAutoHide",a)};MOKEVideo.prototype.getSkinVisible=function(){return this.skinVisible};MOKEVideo.prototype.setSkinVisible=function(a){this.setProperty("skinVisible",a)};MOKEVideo.prototype.getPlayheadTime=function(){return this.playheadTime};MOKEVideo.prototype.setPlayheadTime=function(a){this.setProperty("playheadTime",a)};MOKEVideo.prototype.getTotalTime=function(){return this.totalTime};MOKEVideo.prototype.setTotalTime=function(a){this.setProperty("totalTime",a)};MOKEVideo.prototype.getBufferTime=function(){return this.bufferTime};MOKEVideo.prototype.setBufferTime=function(a){this.setProperty("bufferTime",a)};MOKEVideo.prototype.getVideoScaleMode=function(){return this.videoScaleMode};MOKEVideo.prototype.setVideoScaleMode=function(a){this.setProperty("videoScaleMode",a)};MOKEVideo.prototype.getVideoAlign=function(){return this.videoAlign};MOKEVideo.prototype.setVideoAlign=function(a){this.setProperty("videoAlign",a)};MOKEVideo.prototype.getPlayheadUpdateInterval=function(){return this.playheadUpdateInterval};MOKEVideo.prototype.setPlayheadUpdateInterval=function(a){this.setProperty("playheadUpdateInterval",a)};MOKEVideo.prototype.getPreviewImagePath=function(){return this.previewImagePath};MOKEVideo.prototype.setPreviewImagePath=function(a){this.setProperty("previewImagePath",a)};MOKEVideo.prototype.getThemeColor=function(){return this.themeColor};MOKEVideo.prototype.setThemeColor=function(a){this.setProperty("themeColor",a)};MOKEVideo.prototype.getSkinPath=function(){return this.skinPath};MOKEVideo.prototype.setSkinPath=function(a){this.setProperty("skinPath",a)};MOKEVideo.prototype.getSkinVisible=function(){return this.skinVisible};MOKEVideo.prototype.setSkinVisible=function(a){this.setProperty("skinVisible",a)};MOKEVideo.prototype.update=function(a){for(var b in a){this[b]=a[b]}a.type="change";this.dispatchEvent(a)};MOKEVideo.prototype.event=function(b,a){switch(b){case"progress":this.bytesLoaded=a.bytesLoaded;this.bytesTotal=a.bytesTotal;this.dispatchEvent({type:"progress",bytesLoaded:this.bytesLoaded,bytesTotal:this.bytesTotal});break;case"playheadUpdate":this.playheadTime=a.playheadTime;this.totalTime=a.totalTime;this.dispatchEvent({type:"playheadUpdate",playheadTime:this.playheadTime,totalTime:this.totalTime});break;case"stateChange":this.state=a.state;this.dispatchEvent({type:"stateChange",state:this.state});break;case"change":this.dispatchEvent({type:"change"});break;case"complete":this.startNextVideo();this.dispatchEvent({type:"complete"});break;case"ready":this.dispatchEvent({type:"ready"});break;case"metaData":this.dispatchEvent({type:"metaData",infoObject:a});break;case"cuePoint":this.dispatchEvent({type:"cuePoint",infoObject:a});break;case"init":this.inited=true;this.callMethod("setSize",this.width,this.height);this.invalidateProperty("clickToTogglePlay","skinVisible","skinAutoHide","autoPlay","autoLoad","volume","bufferTime","videoScaleMode","videoAlign","playheadUpdateInterval","skinPath","previewImagePath");this.validateNow();this.makeDelayCalls();if(this.autoPlay){this.play(this.videoPath)}else{if(this.autoLoad){this.load(this.videoPath)}}this.dispatchEvent({type:"init"});break}};MOKEVideo.prototype.render=function(){var a=this.getElement(this.divName);if(a==null){return}this.pluginError=false;a.innerHTML=this.content;this.player=this.getElement(this.name);this.container=this.getElement(this.name+"_Container");this.rendered=true};MOKEVideo.prototype.setOptions=function(a){if(a==null){return}var c=["volume","skinAutoHide","skinVisible","autoPlay","clickToTogglePlay","autoLoad","playHeadTime","totalTime","bufferTime","videoScaleMode","videoAlign","playheadUpdateInterval","skinPath","previewImagePath"];for(var b=0;b<c.length;b++){var d=c[b];if(a[d]==null){continue}this.setProperty(d,a[d])}};MOKEVideo.prototype.initProperties=function(){this.delayCalls=[];this.videoWidth=0;this.videoHeight=0;this.totalTime=0;this.bytesLoaded=0;this.bytesTotal=0;this.state=null;this.volume=50;this.clickToTogglePlay=true;this.autoPlay=true;this.autoLoad=true;this.skinAutoHide=false;this.skinVisible=false;this.skinPath=this.DEFAULT_SKIN_PATH;this.playheadTime=null;this.bufferTime=0.1;this.videoScaleMode="maintainAspectRatio";this.videoAlign="center";this.playheadUpdateInterval=1000;this.previewImagePath=this.PREVIEW_IMAGE;this.themeColor=null;this.firstLoad=true;this.pluginError=false};MOKEVideo.prototype.createPlayer=function(){this.requiredMajorVersion=8;this.requiredMinorVersion=0;this.requiredRevision=0;this.content="";var d="";var b=DetectFlashVer(6,0,65);var c=DetectFlashVer(this.requiredMajorVersion,this.requiredMinorVersion,this.requiredRevision);if(b&&!c){var e=(isIE==true)?"ActiveX":"PlugIn";var f=window.location;document.title=document.title.slice(0,47)+" - Flash Player Installation";var a=document.title;d=this.AC_FL_RunContent("src","playerProductInstall","FlashVars","MMredirectURL="+f+"&MMplayerType="+e+"&MMdoctitle="+a+"","width","100%","height","100%","align","middle","id",this.name,"quality","high","bgcolor","#"+this.bgColor,"name",this.name,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer")}else{if(c){d=this.AC_FL_RunContent("src",this.DEFAULT_SWF_PATH,"width","100%","height","100%","align","middle","id",this.name,"quality","high","wmode","opaque","bgcolor","#"+this.bgColor,"allowFullScreen","true","name",this.name,"flashvars","playerID="+this.id+"&initialVideoPath="+this.videoPath,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer","menu","false")}else{d="This content requires the <a href=http://www.adobe.com/go/getflash/>Adobe Flash Player</a>.";this.pluginError=true}}this.content="<div id='"+this.name+"_Container' class='FAVideo' style='width:"+this.width+"px;height:"+this.height+"px;'>"+d+"</div>";return this.content};MOKEVideo.prototype.getElement=function(b){var a;if(navigator.appName.indexOf("Microsoft")!=-1){return window[b]}else{if(document[b]){a=document[b]}else{a=document.getElementById(b)}return a}};MOKEVideo.prototype.invalidateProperty=function(){if(this.invalidProperties==null){this.invalidProperties={}}for(var a=0;a<arguments.length;a++){this.invalidProperties[arguments[a]]=true}if(this.validateInterval==null&&this.inited){var b=this;this.validateInterval=setTimeout(function(){b.validateNow()},100)}};MOKEVideo.prototype.validateNow=function(){this.validateInterval=null;var a={};for(var b in this.invalidProperties){a[b]=this[b]}this.invalidProperties={};this.player.callMethod("update",a)};MOKEVideo.prototype.callMethod=function(c,b,a){if(this.inited){this.player.callMethod(c,b,a)}else{this.delayCalls.push(arguments)}};MOKEVideo.prototype.makeDelayCalls=function(){for(var a=0;a<this.delayCalls.length;a++){this.callMethod.apply(this,this.delayCalls[a])}};MOKEVideo.prototype.setProperty=function(b,a){this[b]=a;if(this.inited){this.invalidateProperty(b)}};MOKEVideo.prototype.dispatchEvent=function(e){if(this.listeners==null){return}var c=e.type;var a=this.listeners[c];if(a==null){return}for(var b=0;b<a.length;b++){var d=a[b];d.func.apply(d.target,[e])}};MOKEVideo.prototype.AC_Generateobj=function(e,d,a){var c="";if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in e){c+=b+'="'+e[b]+'" '}c+=">";for(var b in d){c+='<param name="'+b+'" value="'+d[b]+'" /> '}c+="</object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '}c+="> </embed>"}return c};MOKEVideo.prototype.AC_FL_RunContent=function(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");return this.AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)};MOKEVideo.prototype.startNextVideo=function(){this.callMethod("setPreviewVisible")};FAVideoManager=function(){hash={};uniqueID=1};FAVideoManager.prototype.addPlayer=function(a){hash[++uniqueID]=a;return uniqueID};FAVideoManager.prototype.getPlayer=function(a){return hash[a]};FAVideoManager.prototype.callMethod=function(e,a){var d=FAVideoManagerInstance.getPlayer(e);if(d==null){alert("Player with id: "+e+" not found")}if(d[a]==null){alert("Method "+a+" Not found")}var b=new Array();for(var c=2;c<arguments.length;c++){b.push(arguments[c])}d[a].apply(d,b)};if(FAVideoManagerInstance==null){var FAVideoManagerInstance=new FAVideoManager()}var my_width=null;var my_height=null;var my_bgcolor=null;var my_videos=new Array();mokeCall=function(){this.defaultWidth=500;this.defaultheight=240;this.defaultBgColor="000000";this.swfPath="yjvideo";this.preview=null};mokeCall.prototype.stopVideo=function(a){a.stop();isPlaying=false};mokeCall.prototype.seekVideo=function(b,a){b.seek(p_player.getPlayheadTime()+a)};mokeCall.prototype.playVideo=function(a){a.play()};mokeCall.prototype.changeVideo=function(b,a){stopVideo(p_player);b.videoPath=a;loadVideo("moke_video",a)};mokeCall.prototype.loadVideo=function(a,b){local_width=(this.my_width)?this.my_width:this.defaultWidth;local_height=(this.my_height)?this.my_height:this.defaultheight;local_bgcolor=(this.my_bgcolor)?this.my_bgcolor:this.defaultBgColor;moke_player=new MOKEVideo(a,this.preview,b,local_bgcolor,this.swfPath);moke_player.DEFAULT_SWF_PATH=this.swfPath;moke_player.setSize(local_width,local_height);moke_player.setSkinVisible(true);moke_player.setSkinAutoHide(true);moke_player.setAutoPlay(true)};mokeCall.prototype.makeScrollbar=function(d,g,e,a,f){alert(d.getScrollSize());var b=(a?(d.getScrollSize().x-d.getSize().x):(d.getScrollSize().y-d.getSize().y));var c=new Slider(g,e,{steps:b,mode:(a?"horizontal":"vertical"),onChange:function(i){var h=(a?i:0);var j=(a?0:i);d.scrollTo(h,j)}}).set(0);if(!(f)){$$(d,g).addEvent("mousewheel",function(i){i=new Event(i).stop();var h=c.step-i.wheel*50;c.set(h)})}$(document.body).addEvent("mouseleave",function(){c.drag.stop()})};mokeCall.prototype.addToList=function(a){this.my_video.push(a)};