var lightbox_video=function(){var s;var e;var j;var l;var r;var P;var K;var w;var k;var B;var n;var Q;var N;var x;var L;var v=0;var f;var p=true;var t=false;var z;var y;function q(S){if(document.documentElement.getBoundingClientRect&&navigator.userAgent.indexOf("MSIE 6")==-1){var T=S.getBoundingClientRect();return[Math.round(T.left),Math.round(T.top)]}else{var U=S;var R=0;var V=0;do{R+=U.offsetLeft;V+=U.offsetTop}while(U=U.offsetParent);return[R,V]}}function D(R,T,S){if(R.attachEvent){R.attachEvent("on"+T,S)}else{R.addEventListener(T,S,true)}}function a(){if(window.innerHeight){return[window.innerWidth-18,window.innerHeight]}if(document.documentElement.clientHeight){return[document.documentElement.clientWidth,document.documentElement.clientHeight]}if(document.body.clientHeight){return[document.body.clientWidth,document.body.clientHeight]}}function C(){var R,S;if(window.innerHeight&&window.scrollMaxY){R=window.innerWidth+window.scrollMaxX;S=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){R=document.body.scrollWidth;S=document.body.scrollHeight}else{R=document.body.offsetWidth;S=document.body.offsetHeight}}return[R,S]}function J(){var S,R;R=document.body.scrollTop;S=document.body.scrollLeft;if(R==0){if(window.pageYOffset){R=window.pageYOffset;S=window.pageXOffset}else{R=(document.body.parentElement)?document.body.parentElement.scrollTop:0;S=(document.body.parentElement)?document.body.parentElement.scrollLeft:0}}return[parseInt(S),parseInt(R)]}function o(R){if(!R.complete){return false}if(typeof R.naturalWidth!="undefined"&&R.naturalWidth==0){return false}return true}function m(S,R){R=Math.max(0,Math.min(1,R));S.style.opacity=R;S.style.MozOpacity=R;S.style.KhtmlOpacity=R;S.style.filter=(R!=1?"alpha(opacity="+(R*100)+")":"")}function i(S,R,T){if(!s){s=[[],[],[]]}s[R].push([S,T]);F()}function F(){var S;var R;var T;if(!e){while(A()){}}}function A(){var S;var R;var T;for(S=0;S<s.length;S++){if(s[S].length!=0){R=s[S].pop();T=new Image();T.src=R[0];if(o(T)){if(typeof(R[1])!="undefined"){R[1]()}return true;break}D(T,"load",function(){O(R[1])});e=true;return false;break}}return false}function O(R){e=false;if(typeof(R)!="undefined"){R()}F()}function h(U){var T;var X;var R="";var S,V,W;S=U.href?U.href:window.location.href;V=S.split("/");V.pop();if(S=V.join("/")){S+="/"}X=U.cssRules?U.cssRules:U.rules;for(T=0;T<X.length;T++){if(X[T].style&&X[T].style.cssText&&X[T].style.cssText.toLowerCase().indexOf("url")!=-1){R+=X[T].style.cssText}else{if(X[T].styleSheet){h(X[T].styleSheet)}}}images=R.match(/[^\("]+\.(gif|jpe?g|png)/g);if(images){for(T=0;T<images.length;T++){W=(images[T].charAt(0)=="/"||images[T].match("://")?"":S)+images[T];i(W,0)}}if(U.imports&&U.imports.length){for(T=0;T<U.imports.length;T++){h(U.imports[T])}}}function I(){var R;lightbox_preload=new Array();for(R=0;R<document.styleSheets.length;R++){h(document.styleSheets[R])}}function b(){var R;if(document.getElementById){I();j=document.getElementById("lightbox-video");r=document.getElementById("lightbox-video-tint");l=document.getElementById("lightbox-video-main");P=document.getElementById("lightbox-video-wrap");k=document.getElementById("lightbox-video-image");w=document.getElementById("lightbox-video-caption");K=document.getElementById("lightbox-video-header");B=document.getElementById("lightbox-video-flash");if(navigator.appName=="Microsoft Internet Explorer"){p=false}if(R=document.getElementById("lightbox-video-close")){D(R,"click",M)}}}function u(S,R){H();m(j,0);j.style.display="block";l.style.display="block";E(B);d(100);if(!p){l.style.display="none"}G(j,function(){if(!p){l.style.display="block"}if(B){B.style.visibility="visible";try{if(R){w.innerHTML=R}if(S){B.LoadMovie(0,S)}B.startPlayer()}catch(T){}}})}function M(){if(B){B.style.visibility="hidden";try{B.stopPlayer()}catch(R){}}if(!p){l.style.display="none"}c(j,function(){j.style.display="none"})}function H(){var S,R;if(navigator.userAgent.indexOf("MSIE 6")!=-1){if(!t){t=true;j.style.position="absolute";l.style.position="absolute";S=q(j);z=S[0];y=S[1];window.attachEvent("onscroll",H)}R=J();j.style.left=(-z+R[0])+"px";j.style.top=(-y+R[1])+"px";j.style.width=(a()[0])+"px";j.style.height=(a()[1])+"px";r.style.width=(a()[0])+"px";r.style.height=(a()[1])+"px"}}function E(S){var T,R,U;n=l.style.width.replace("px","")*1;N=l.style.height.replace("px","")*1;Q=parseInt(S.width)+P.offsetWidth-P.clientWidth;x=parseInt(S.height)+K.offsetHeight+P.offsetHeight-P.clientHeight}function d(S){var U;var R;var T;S=Math.sqrt(100*100-(100-S)*(100-S));l.style.width=(n+(Q-n)*S/100)+"px";l.style.height=(N+(x-N)*S/100)+"px";P.style.width=(n+(Q-n)*S/100-(P.offsetWidth-P.clientWidth))+"px";P.style.height=(N+(x-N)*S/100-(P.offsetHeight-P.clientHeight))+"px";U=q(j);T=a();if(navigator.userAgent.indexOf("MSIE 6")==-1){R=[];R[0]=0;R[1]=0}else{R=J()}l.style.left=((T[0]-l.offsetWidth)/2+R[0])+"px";l.style.top=((T[1]-l.offsetHeight)/2+R[1]-U[1])+"px"}function G(S,T){S.style.opacity=0;f=S;for(var R=1;R<=20;R+=1){setTimeout(g(R/20),25*R)}if(T){setTimeout(T,25*R)}}function c(S,T){S.style.opacity=1;f=S;for(var R=1;R<=20;R+=1){setTimeout(g(1-R/20),25*R)}if(T){setTimeout(T,25*R)}}function g(R){return function(){m(f,R)}}return{attach:D,init:b,open:u,close:M}}();