function switchVideo(B,A){var C=randMC.getElement(B);if(C.length>0){if(randMC.sameElm(B)==false){jQuery("#now_playing .content span").fadeOut("fast");jQuery(".sm_video").removeClass("nowplaying").find(".nowplaying").css("display","none");jQuery("#videoPlayerR").fadeOut("fast",function(){jQuery(this).remove();jQuery("#mediacenterContent").html('<div id="videoPlayer"></div>');var J=C.find("settings").text();var K={wmode:"window",width:"580",height:"355",version:"9.0.0"};var H={};C.find("flash").find("*").each(function(){H[this.tagName.toLowerCase()]=jQuery(this).text();});var G=jQuery.extend({},K,H);var E={settings:J};var I={};I.play="true";I.loop="true";I.quality="high";I.scale="showall";I.allowfullscreen="true";I.allowscriptaccess="sameDomain";I.wmode=G.wmode;var F={};F.id="videoPlayerR";swfobject.embedSWF("/ui/swf/videoPlayer.swf","videoPlayer",G.width,G.height,G.version,false,E,I,F);var D=C.find("title").eq(0).text();jQuery("#now_playing .video_title").text(D);jQuery("#now_playing .speaker").text(C.find("speaker[nowplaying=true]").eq(0).find("name").text());jQuery("#now_playing .video_speaker_title").text(C.find("speaker[nowplaying=true]").eq(0).find("title").text());jQuery("#now_playing .content span").fadeIn("fast");jQuery(".sm_video[rel="+B+"]").addClass("nowplaying").find(".nowplaying").eq(0).show("normal");randMC.updateURL(D);if(A==true&&(jQuery.browser.safari==false||parseInt(jQuery.browser.version.substr(0,3),10)>500)){jQuery().scrollTo(jQuery("#publication_data"),800);}});}}else{setTimeout(function(){switchVideo(B,A);},250);}}jQuery(document).ready(function(){if(swfobject.hasFlashPlayerVersion("9.0.0")){jQuery("#videoPlayer").html("");}if(jQuery("body").hasClass("video_subpage")){randMC.disableURL(true);randMC.onLoaded(function(){switchVideo(jQuery("#sm_videos .onload").attr("rel"),false);});}else{jQuery("#sm_videos .sm_video").each(function(){var C=jQuery(this).attr("rel");jQuery("a",this).each(function(){var E=jQuery(this);var D=E.attr("href");E.attr("href","javascript://");E.click(function(){switchVideo(C,true);});});});var B=window.location.href;B=B.replace(/\?(.*?)$/,"");var A=B.split("#");if(A.length>1){randMC.onLoaded(function(){randMC.checkHash(A[1]);});}else{randMC.onLoaded(function(){switchVideo(randMC.getFirstElement().attr("guid"),false);});}}});function multimediaCenter(){var A=this;A.cache=new Object;A.cacheSaved=false;A.lastElm=null;A.onloadGUID=null;A.windowURL=window.location.href;A.windowHash="";A.windowURLDisable=false;A.onLoadFunction=new Array;A.fetchXML=function(B){jQuery.get("multimedia.xml",function(D,C){if(C=="success"){if(jQuery("media",D).length>0){A.cache=D;A.cacheSaved=true;if(typeof (B)=="function"){B.call(A);}}A.doneLoading();}});};A.checkCache=function(B){if(A.cacheSaved==false){A.fetchXML(B);return false;}else{return true;}};A.getElement=function(C){if(A.checkCache()){var B=jQuery("media[guid="+C+"]",A.cache).eq(0);return B;}else{return[];}};A.getAllElements=function(B){if(A.checkCache(B)){return jQuery("media",A.cache);}else{return[];}};A.getFirstElement=function(){if(A.checkCache()){return jQuery("media[onload=true]",A.cache).eq(0);}};A.sameElm=function(B){if(B==A.lastElm){return true;}else{A.lastElm=B;return false;}};A.checkHash=function(){var C=A.windowHash;var B=A.getAllElements(A.checkHash);var D=false;if(typeof (B)!="undefined"){B.each(function(E){if(A.urlSafe(jQuery(this).find("title").eq(0).text())==C){onloadGUID=jQuery(this).attr("guid");switchVideo(onloadGUID,false);D=true;return false;}if((E-1)==B.length&&D==false){switchVideo(A.getFirstElement().attr("guid"),false);}});}};A.updateURL=function(B){if(A.windowURLDisable==false){window.location.href=A.windowURL+"#"+A.urlSafe(B);}};A.urlSafe=function(B){return B.toLowerCase().replace(/[^a-zA-Z 0-9]+/g,"").replace(/[ \t]/g,"_").replace(/[^a-zA-Z0-9_-]/,"").replace(/--/g,"_");};A.fixURL=function(){var C=A.windowURL.replace(/\?(.*?)$/,"");var B=C.split("#");A.windowURL=B[0];A.windowHash=B[1];};A.disableURL=function(B){if(B==true){A.windowURLDisable=true;}else{A.windowURLDisable=false;}};A.onLoaded=function(B){if(A.cacheSaved==false){A.onLoadFunction.push(B);}else{if(typeof (B)=="function"){B.call();}}};A.doneLoading=function(){jQuery.each(A.onLoadFunction,function(B,C){if(typeof (C)=="function"){C.call();}});A.onLoadFunction=[];};A.fixURL();A.fetchXML();}randMC=new multimediaCenter();(function(B){var A=B.scrollTo=function(D,F,E){B(window).scrollTo(D,F,E);};A.defaults={axis:"y",duration:1};A.window=function(D){return B(window).scrollable();};B.fn.scrollable=function(){return this.map(function(){var D=this.parentWindow||this.defaultView,G=this.nodeName=="#document"?D.frameElement||D:this,F=G.contentDocument||(G.contentWindow||G).document,E=G.setInterval;return G.nodeName=="IFRAME"||E&&B.browser.safari?F.body:E?F.documentElement:this;});};B.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0;}if(typeof D=="function"){D={onAfter:D};}D=B.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2;}D.offset=C(D.offset);D.over=C(D.over);return this.scrollable().each(function(){var H=this,N=B(H),M=F,G,L={},K=N.is("html,body");switch(typeof M){case"number":case"string":if(/^([+-]=)?\d+(px)?$/.test(M)){M=C(M);break;}M=B(M,this);case"object":if(M.is||M.style){G=(M=B(M)).offset();}}B.each(D.axis.split(""),function(O,V){var T=V=="x"?"Left":"Top",R=T.toLowerCase(),U="scroll"+T,S=H[U],Q=V=="x"?"Width":"Height",P=Q.toLowerCase();if(G){L[U]=G[R]+(K?0:S-N.offset()[R]);if(D.margin){L[U]-=parseInt(M.css("margin"+T))||0;L[U]-=parseInt(M.css("border"+T+"Width"))||0;}L[U]+=D.offset[R]||0;if(D.over[R]){L[U]+=M[P]()*D.over[R];}}else{L[U]=M[R];}if(/^\d+$/.test(L[U])){L[U]=L[U]<=0?0:Math.min(L[U],I(Q));}if(!O&&D.queue){if(S!=L[U]){J(D.onAfterFirst);}delete L[U];}});J(D.onAfter);function J(O){N.animate(L,E,D.easing,O&&function(){O.call(this,F,D);});}function I(O){var Q="scroll"+O,P=H.ownerDocument;return K?Math.max(P.documentElement[Q],P.body[Q]):H[Q];}}).end();};function C(D){return typeof D=="object"?D:{top:D,left:D};}})(jQuery);