var $=(typeof $=="undefined")?null:$,ExamplesRepeater={array:{},click:function(b){Event.stop(b);var a=Event.findElement(b,"a");if(a){ExamplesRepeater.show(a.id.substring(12))}},show:function(b){var a=$("ProjectContainer"+b);if(typeof(a)!=="undefined"&&a!=null){if(ExamplesRepeater.array[b]==null){ExamplesRepeater.array[b]=window_factory(a,b,{iframeshim:false,position:[0,0],draggable:false,resizable:false,offsetTop:-25,offsetLeft:(!document.documentElement||!document.documentElement.clientWidth||document.documentElement.clientWidth>500)?-89:0,width:(!document.documentElement||!document.documentElement.clientWidth||document.documentElement.clientWidth>500)?820:429,overlayOpacity:(!document.documentElement||!document.documentElement.clientWidth||document.documentElement.clientWidth>500)?0.3:0.01})}if(typeof(a.select)!=="undefined"){a.select(".VideoLikeContent").each(function(d){tmpID=d.id.substring("Item".length);if(typeof(ExamplesRepeaterAssets[tmpID])!=="undefined"&&ExamplesRepeaterAssets[tmpID]){try{ExamplesRepeaterAssets[tmpID]()}catch(f){if(typeof(window.console)!=="undefined"&&window.console.error){window.console.error(f)}}ExamplesRepeaterAssets[tmpID]=null}});if(typeof(window.console)!=="undefined"){window.console.log("Setup lazy loading for images for node "+b)}a.select(".ImageLikeContent").each(function(d){tmpID=d.id.substring("Item".length);if(typeof(ExamplesRepeaterAssets[tmpID])!=="undefined"&&ExamplesRepeaterAssets[tmpID]){try{ExamplesRepeaterAssets[tmpID]()}catch(f){}ExamplesRepeaterAssets[tmpID]=null}})}if(ExamplesRepeater.array[b]){ExamplesRepeater.array[b].open()}try{$("form1").scrollTo()}catch(c){}SlideshowUserControl.init(b)}return false},hide:function(a){$("ProjectContainer"+a).select(".VideoLikeContent").each(function(d){if(typeof(d.id+"_player")!=="undefined"){var b=window[d.id+"_player"];if(typeof(b)!=="undefined"&&b.pause){b.pause()}}if(d.pause){try{d.pause()}catch(c){}}});$("ProjectContainer"+a).select(".VideoLikeContent object").each(function(c){if(c.pause){try{c.pause()}catch(b){}}});return false}},window_factory=function(c,h,d){var b=new Element("div",{className:"window_header"}),g=new Element("div",{className:"window_title"}),f=new Element("div",{className:"window_close"}),e=new Element("div",{className:"window_contents"}),a=typeof(Control)!=="undefined"?new Control.Modal(c,Object.extend({className:"window",closeOnClick:f,insertRemoteContentAt:e,afterOpen:function(){c.show();g.update(c.readAttribute("title"));try{shortcut.add("Esc",function(){ExamplesRepeater.array[h].close()});shortcut.add("X",function(){ExamplesRepeater.array[h].close()})}catch(i){if(typeof(window.console)!=="undefined"){window.console.warn("Removing shortcut keys threw exception: "+i)}}},afterClose:function(){try{shortcut.remove("Esc");shortcut.remove("X")}catch(i){if(typeof(window.console)!=="undefined"){window.console.warn("Removing shortcut keys threw exception: "+i)}}ExamplesRepeater.hide(c.id.substring("ProjectContainer".length));c.hide()}},d||{})):null;if(a){a.container.insert(b);b.insert(f);a.container.insert(e)}return a},SlideshowUserControl={autoSwitchTimeInSeconds:5,animationDurationInSeconds:1,manualSwitchPauseTimeInSeconds:10,baseZIndex:15000,counterA:0,counterB:0,pe:null,restartTimer:null,init:function(b){var a=$("ProjectContainer"+b);if(typeof(a.select)!=="undefined"){items=a.select(".Item"),labels=null,maxDim={width:300,height:275};if(items.length>0){SlideshowUserControl.counterA=items[0].id.substring("Item".length,items[0].id.indexOf("_"));SlideshowUserControl.counterB=items[0].id.substring(items[0].id.indexOf("_")+1);if(items[0].show){items[0].show()}items.each(function(c){if(!c.getDimensions){maxDim.width=532;maxDim.height=340}else{var d=c.getDimensions();if(d.width>maxDim.width){maxDim.width=d.width}if(d.height>maxDim.height){maxDim.height=d.height}}});a.select(".ItemsContainer .ItemsContainerWrapper").each(function(c){if(c.setStyle){c.setStyle({width:maxDim.width+"px",height:(maxDim.height+5)+"px"})}else{if(c&&c.style){c.style.width=maxDim.width+"px";c.style.height=(maxDim.height+5)+"px"}}})}labels=a.select(".ItemLabel");if(labels.length>0){labels.each(function(c){if(c&&c.removeClassName){c.removeClassName("selected")}});if(labels[0].addClassName){labels[0].addClassName("selected")}else{if(labels[0].className){labels[0].className=labels[0].className+" selected"}}}}},switcher:function(f,e,g){var d=$("Item"+SlideshowUserControl.counterA+"_"+SlideshowUserControl.counterB),b=null,a=null,c=null;if(!d){if(typeof(window.console)!=="undefined"){window.console.error("Current element not found.")}return}if(d.parentNode){c=d.parentNode.parentNode.parentNode;if(f!==null&&typeof(f)!=="undefined"&&f>=0&&e!==null&&typeof(e)!=="undefined"&&e>=0){if(f==SlideshowUserControl.counterA&&e==SlideshowUserControl.counterB&&g!==true){return}if(c){ExamplesRepeater.hide(c.id.substring("ProjectContainer".length))}SlideshowUserControl.counterA=f;SlideshowUserControl.counterB=e}b=$("Item"+SlideshowUserControl.counterA+"_"+SlideshowUserControl.counterB);a=$("SlideshowLink"+SlideshowUserControl.counterA+"_"+SlideshowUserControl.counterB);if(d){d.style.zIndex=SlideshowUserControl.baseZIndex+1}if(b){b.style.zIndex=SlideshowUserControl.baseZIndex;if(b.show){b.show()}else{b.style.display=""}}$(c.id).select(".Item").each(function(h){if(!(h==d||h==b)){h.style.zIndex=SlideshowUserControl.baseZIndex-1}})}if(d.getInlineOpacity){Effect.Fade(d,{duration:SlideshowUserControl.animationDurationInSeconds})}else{d.style.display="none"}window.setTimeout(function(){$$(".ExamplesRepeaterWrapper .ItemsContainer .selected").each(function(h){if(h&&h.removeClassName){h.removeClassName("selected")}});if(a.addClassName){a.addClassName("selected")}else{if(a.className){a.className=a.className+" selected"}}},(SlideshowUserControl.animationDurationInSeconds*1000/2))},click:function(b){Event.stop(b);var a=Event.element(b);SlideshowUserControl.switcher(a.id.substring("SlideshowLink".length,a.id.indexOf("_")),a.id.substring(a.id.indexOf("_")+1),false);return false}};document.observe("dom:loaded",function(){$$("div.ExamplesRepeaterWrapper a.Project").each(function(b){var c=b.title,a=$("ie6msg");if(!a||a.length===0){b.observe("click",function(d){if(typeof(_gaq)!=="undefined"){try{if(!_gaq.push(["_trackEvent","Project","View",c])){}else{}}catch(f){if(typeof(window.console)!=="undefined"){window.console.error("Event tracking for Viewing "+c+" threw exception: "+f)}}}ExamplesRepeater.click(d)},true)}});if(typeof(ExamplesRepeaterAutoSelect)!=="undefined"&&ExamplesRepeaterAutoSelect&&ExamplesRepeaterAutoSelect>0){ExamplesRepeater.show(ExamplesRepeaterAutoSelect)}},false);function SetInitialImage(b,e,d){var c=document.getElementById(b),a=new Element("img");a.alt=d;a.observe("load",function(f){if(a.getDimensions){var h=a.getDimensions(),g=c.parentNode.getDimensions();if(g.width<h.width){c.parentNode.style.width=h.width+"px"}if(g.height<h.height){c.parentNode.style.height=h.height+"px"}}});c.appendChild(a);a.src=e}function LoadFlashDefaultMsg(d,i,f,a,h,g,c,b,e){return LoadFlash(d,i,f,a,h,g,c,b,e,'You need to install Flash, or at least a newer version of it, to view this. <a href="http://www.macromedia.com/go/getflashplayer/" target="_blank">Get the latest Flash player</a>.')}function LoadFlash(f,m,j,b,l,k,d,c,h,a){var e=document.getElementById(f),g=e.parentNode.getDimensions(),i="";if(e){i='<object id="'+f+'_flash" type="application/x-shockwave-flash" width="'+b+'" height="'+l+'" data="'+m+'">\n<param name="classid" value="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" />\n<param name="codebase" value="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" />\n<param name="movie" value="'+m+'" />\n<param name="flashvars" value="'+j+'" />\n<param name="quality" value="'+k+'" />\n<param name="scale" value="'+d+'" />\n<param name="play" value="'+c+'" />\n<param name="loop" value="'+h+'" />\n<param name="allowFullScreen" value="true" />\n<param name="allowScriptAccess" value="sameDomain" />\n<param name="pluginurl" value="http://www.adobe.com/go/getflashplayer" />\n<param name="wmode" value="transparent"/>\n<embed href="'+m+'" quality="'+k+'" width="'+b+'" height="'+l+'" flashvars="'+j+'" name="myMovieName" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed><noembed>'+a+"<noembed></object>";e.innerHTML=i;if(g.width<b){e.parentNode.style.width=b+"px"}if(g.height<l){e.parentNode.style.height=l+"px"}}return i}function LoadMediaElementDefaultMsg(f,s,m,o,l,h,v,j,t,g,w){var b=document.getElementById(f),q=b.parentNode.getDimensions(),p="",d=null,k,e,c="You must have a modern HTML5-enabled browser or Flash to watch this video.",a=w&&w.length>0?w.split(";"):[],n,r,u;if(b){if(typeof(window.console)!=="undefined"){console.log("Sources for",f,a)}if(!g){k=$(b).parentNode.parentNode.parentNode;if(k&&parseInt(k.id.substr(16))>0){e=jQuery("#ProjectImage"+k.id.substr(16)+" img");if(e){g=e.attr("src")}}}p='<video id="'+f+'_html5video" width="'+o+'" height="'+l+'" controls="controls" preload="none">\n';for(r=0;r<a.length;r++){n=a[r];u=n.indexOf("|")>0?n.split("|"):[n];p+='  <source src="'+u[0]+'"'+(u.length>1?" type='"+u[1]+"'":"")+" />\n"}p+='  <object id="'+f+'_flash" type="application/x-shockwave-flash" width="'+o+'" height="'+l+'" data="'+s+'">\n    <param name="classid" value="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" />\n    <param name="codebase" value="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" />\n    <param name="movie" value="'+s+'" />\n    <param name="flashvars" value="'+m+(g?"&amp;poster="+g:"")+'" />\n    <param name="quality" value="'+h+'" />\n    <param name="scale" value="'+v+'" />\n    <param name="play" value="'+j+'" />\n    <param name="loop" value="'+t+'" />\n    <param name="allowFullScreen" value="true" />\n    <param name="allowScriptAccess" value="sameDomain" />\n    <param name="pluginurl" value="http://www.adobe.com/go/getflashplayer" />\n    <param name="wmode" value="transparent"/>\n'+c+'\n    <embed href="'+s+'" quality="'+h+'" width="'+o+'" height="'+l+'" flashvars="'+m+(g?"&amp;poster="+g:"")+'" name="myMovieName" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed><noembed>'+c+"</noembed>\n  </object>\n</video>\n";b.innerHTML=p;d='<script type="text/javascript">   var '+f+"_player = new MediaElementPlayer('#"+f+"_html5video', {\n";if(g){d+='            poster: "'+g+'",\n'}d+="            // remove or reorder to change plugin priority\n            plugins: ['silverlight','flash'],\n            timerRate: 275\n        });\n<\/script>";jQuery(b).append(d);if(q.width<o){b.parentNode.style.width=o+"px"}if(q.height<l){b.parentNode.style.height=l+"px"}}return p}function LoadVideoDefaultMsg(e,l,i,a,k,j,c,b,g){var d=document.getElementById(e),f=d.parentNode.getDimensions(),h="";if(d){h='<video width="'+a+'" height="'+(k-40)+'" controls\n<source src="/flowplayer/Volunteer_Energy_1080p_HiMotion-iPod.mp4" type=\'video/mp4\' />\n<source src="/flowplayer/Volunteer_Energy_1280x720.mp4" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' />\n<source src="/flowplayer/Volunteer_Energy_1080p_HiMotion-iPod.mp4" />\n<object id="'+e+'_flash" type="application/x-shockwave-flash" width="'+a+'" height="'+k+'" data="'+l+'">\n<param name="classid" value="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" />\n<param name="codebase" value="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" />\n<param name="movie" value="'+l+'" />\n<param name="flashvars" value="'+i+'" />\n<param name="quality" value="'+j+'" />\n<param name="scale" value="'+c+'" />\n<param name="play" value="'+b+'" />\n<param name="loop" value="'+g+'" />\n<param name="allowFullScreen" value="true" />\n<param name="allowScriptAccess" value="sameDomain" />\n<param name="pluginurl" value="http://www.adobe.com/go/getflashplayer" />\n<param name="wmode" value="transparent"/>\n<embed href="'+l+'" quality="'+j+'" width="'+a+'" height="'+k+'" flashvars="'+i+'" name="myMovieName" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed><noembed>'+contentText+"<noembed></object></video>";d.innerHTML=h;if(f.width<a){d.parentNode.style.width=a+"px"}if(f.height<k){d.parentNode.style.height=k+"px"}}return h};
