(function(){var e,a,b,d,c;
/*
  # Copyright (c) 2010 Alan Plum <ap@apsq.de>
  #
  # Permission is hereby granted, free of charge, to any person obtaining a copy
  # of this software and associated documentation files (the "Software"), to deal
  # in the Software without restriction, including without limitation the rights
  # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  # copies of the Software, and to permit persons to whom the Software is
  # furnished to do so, subject to the following conditions:
  #
  # The above copyright notice and this permission notice shall be included in
  # all copies or substantial portions of the Software.
  #
  # The Software shall be used for Good, not Evil.
  #
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  # THE SOFTWARE.
  */
b=function(f){var g;g=f.getElement("a");g.set("href",null);g.addEvent("click",function(h){h.preventDefault();if(f.hasClass("active")){return f.removeClass("active")}else{($$(".active")).each(function(i){return i.removeClass("active")});return f.addClass("active")}});f.addEvent("mouseenter",function(h){if(!(window.getSize().x>480)){return null}return f.addClass("hover")});return f.addEvent("mouseleave",function(h){return f.removeClass("hover")})};a=function(g){var f;f=function(){var n,i,j,k,m,o,l,p,r,s,q;if(Modernizr.video){if(!g.error||(g.getStyle("display"))==="none"){if(g.readyState&&(g.getStyle("display"))!=="none"){return null}return f.delay(200)}}l=(typeof(n=((g.getElement('source[type="video/mp4"]'))))==="undefined"||n===null)?undefined:n.get("src");m=(typeof(n=((g.getElement('source[type="video/x-flv"]'))))==="undefined"||n===null)?undefined:n.get("src");k=l||m;s=(typeof(n=((g.getElement('source[type="application/x-shockwave-flash"]'))))==="undefined"||n===null)?undefined:n.get("src");if(Browser.Plugins.Flash.version){i=((typeof(n=((g.get("data-aspect"))))==="undefined"||n===null)?undefined:n.toFloat())||(3/4);q=g.getSize().x||(g.getStyle("width"))||(g.get("width"))||320;q=q.toInt();o=q*i;if(k){p="flowplay-"+(Math.random()*1000).toInt();j=new Element("div",{id:p});j.setStyles({width:q,height:o});j.setStyle("float",g.getStyle("float"));j.setStyle("margin",g.getStyle("margin"));j.replaces(g);return $f(p,"/en/js/flowplayer-3.2.2.swf",{clip:{url:k,autoPlay:false,autoBuffering:true,controls:{all:false,play:true,volume:true,mute:true,scrubber:true,fullscreen:true}}})}else{if(s){r=new Swiff(s,{width:g.get("width"),height:g.get("height")});return r.replaces(g)}}}};return f()};c=function(j){var i,k,g,f;k=j.get("data-swf-path");if(Browser.Plugins.Flash.version&&k){f=j.getSize().x;i=f*(3/4);g=new Swiff(k,{width:f,height:i});return g.replaces(j)}};d=function(f){var g;g=function(h){var i;i=h.getElement(".details");(i.get("reveal")).cancel();return i.setStyle("display",null)};f.addEvent("mouseleave",function(h){return(f.getElements(".reference")).each(g)});return(f.getElements(".reference")).each(function(h){var i;i=h.getElement(".details");i.set("reveal",{duration:"short"});return h.addEvent("mouseenter",function(j){(f.getElements(".reference")).each(g);return i.reveal()})})};e=function(h){var g,f,i;f=h.get("href");if(h.hasClass("more-link")){i=$(f.substr(1));i.set("reveal",{duration:"normal",styles:[]});h.set("href",null);if(h.get("data-text-hide")){h.set("data-text-show",h.get("text"));return h.addEvent("click",function(k){var j;if((i.get("fade"))==="in"){(i.get("reveal")).cancel();h.set("text",h.get("data-text-show"));i.set("fade","out");(typeof(j=((i.getParent().getElement(".image"))))==="undefined"||j===null)?undefined:j.removeClass("expanded");i.dissolve()}else{(i.get("dissolve")).cancel();h.set("text",h.get("data-text-hide"));i.set("fade","in");(typeof(j=((i.getParent().getElement(".image"))))==="undefined"||j===null)?undefined:j.addClass("expanded");i.reveal()}return k.preventDefault()})}else{g=function(j){h.removeEvent("click",g);h.dispose();i.reveal();return j.preventDefault()};return h.addEvent("click",g)}}};window.addEvent("domready",function(){($$("#page-nav-top>ul>li")).each(function(f){return f.getElement("ul")?b(f):null});($$("a[href]")).each(e);($$("#references")).each(d);($$("video")).each(a);return($$(".swf")).each(c)})}).call(this);
