var clickX=new Array();var clickY=new Array();var clickDrag=new Array();var clickSize=new Array();var canvasWidth=684;var canvasHeight=539;var paint;var canvas;var context;var curSize="medium";var trackedDoodlePad=false;function prepareCanvas(){var a=document.getElementById("doodlePadCanvas");canvas=document.createElement("canvas");canvas.setAttribute("width",canvasWidth);canvas.setAttribute("height",canvasHeight);canvas.setAttribute("id","canvas");a.appendChild(canvas);if(typeof G_vmlCanvasManager!="undefined"){canvas=G_vmlCanvasManager.initElement(canvas)}context=canvas.getContext("2d");$("#canvas").bind("touchstart",function(d){var c=navigator.userAgent.toLowerCase();var b=c.match(/(android)/);if(b){d.preventDefault()}if(trackedDoodlePad==false){trackEvent("Used HTML5 Doodle Pad","Used HTML 5 Doodle Pad");trackedDoodlePad=true}paint=true;var f=d.originalEvent.touches[0]||d.originalEvent.changedTouches[0];var d=$(this).offset();var g=f.pageX-d.left;var h=f.pageY-d.top;addClick(g,h,false);redraw();$("#canvas").bind("touchmove",function(i){i.preventDefault();var k=i.originalEvent.touches[0]||i.originalEvent.changedTouches[0];var j=$(this).offset();var l=k.pageX-j.left;var m=k.pageY-j.top;addClick(l,m,true);redraw()})});$("#canvas").bind("touchend",function(){$("#canvas").unbind("touchmove");paint=false});$("#small").mousedown(function(b){curSize="small";$(this).addClass("on");$("#medium").removeClass("on");$("#large").removeClass("on")});$("#medium").mousedown(function(b){curSize="medium";$("#small").removeClass("on");$(this).addClass("on");$("#large").removeClass("on")});$("#large").mousedown(function(b){curSize="large";$("#small").removeClass("on");$("#medium").removeClass("on");$(this).addClass("on")});$("#clear").mousedown(function(b){clickX=new Array();clickY=new Array();clickDrag=new Array();clickSize=new Array();clearCanvas()});$("#save").click(function(){$("#doodleSubmitForm").show();$("#doodlePad").hide()});$("#gallery").click(function(){$("#DoodleGallery").show();$("#doodlePad").hide()});$("#returnDraw").click(function(){$("#doodlePad").show();$("#DoodleGallery").hide()});$("#submitReturn").click(function(){$("#doodlePad").show();$("#doodleSubmitForm").hide()})}function addClick(b,c,a){clickX.push(b);clickY.push(c);clickDrag.push(a);clickSize.push(curSize)}function clearCanvas(){context.fillStyle="#ffffff";context.fillRect(0,0,canvasWidth,canvasHeight);canvas.width=canvas.width}function redraw(){clearCanvas();var b;context.strokeStyle="#c67500";context.lineJoin="round";for(var a=0;a<clickX.length;a++){if(clickSize[a]=="small"){b=2;$("#medium").removeClass("on")}else{if(clickSize[a]=="medium"){b=4;$("#small").removeClass("on")}else{if(clickSize[a]=="large"){b=8;$("#small").removeClass("on")}}}context.beginPath();if(clickDrag[a]&&a){context.moveTo(clickX[a-1],clickY[a-1])}else{context.moveTo(clickX[a]-1,clickY[a])}context.lineTo(clickX[a],clickY[a]);context.closePath();context.lineWidth=b;context.stroke()}};var currentSlide=1;$(document).ready(function(){$(".show").click(function(){$("div#dudesHome").css("display","none");$("div#dudesMain").css("display","block");$("#dudes .prevDudes").css("display","block");$("#dudes .nextDudes").css("display","block");if($(this).parent().attr("id")=="dudesMap"){var d=$("#speakerRight").offset().top;$("#speakerRight").animate({top:d-150+"px"},500,"swing");$("#speakerLeft").animate({top:d-150+"px"},500,"swing");trackEvent("Clicked on Dudes","Clicked on Dudes")}var b=$(this).attr("id");if(b.indexOf("-map")>-1){b=b.substr(0,b.indexOf("-map"))}$("#dudesSlides ."+b).css("display","block");$("#dudesSlides ."+b).addClass("active");var c=$("#dudesSlides .slide");for(var a=0;a<=c.length;a++){if($(c[a]).hasClass("active")){currentSlide=a+1}}})});function nextSlide(){currentSlide++;if(currentSlide>4){currentSlide=1}$("#dudesSlides .slide").removeClass("active").css("display","none");var b=$("#dudesSlides .slide");for(var a=0;a<=b.length;a++){if(a==currentSlide-1){$(b[a]).addClass("active").css("display","block")}}}function previousSlide(){currentSlide--;if(currentSlide<1){currentSlide=4}$("#dudesSlides .slide").removeClass("active").css("display","none");var b=$("#dudesSlides .slide");for(var a=0;a<=b.length;a++){if(a==currentSlide-1){$(b[a]).addClass("active").css("display","block")}}};(function(a){var q="2.99";if(a.support==undefined){a.support={opacity:!(a.browser.msie)}}function f(r){a.fn.cycle.debug&&l(r)}function l(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}a.expr[":"].paused=function(r){return r.cyclePause};a.fn.cycle=function(t,r){var s={s:this.selector,c:this.context};if(this.length===0&&t!="stop"){if(!a.isReady&&s.s){l("DOM not ready, queuing slideshow");a(function(){a(s.s,s.c).cycle(t,r)});return this}l("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var x=k(this,t,r);if(x===false){return}x.updateActivePagerLink=x.updateActivePagerLink||a.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var u=a(this);var v=x.slideExpr?a(x.slideExpr,this):u.children();var w=v.get();if(w.length<2){l("terminating; too few slides: "+w.length);return}var y=c(u,v,w,x,s);if(y===false){return}var z=y.continuous?10:i(w[y.currSlide],w[y.nextSlide],y,!y.backwards);if(z){z+=(y.delay||0);if(z<10){z=10}f("first timeout: "+z);this.cycleTimeout=setTimeout(function(){j(w,y,0,!x.backwards)},z)}})};function k(t,v,r){if(t.cycleStop==undefined){t.cycleStop=0}if(v===undefined||v===null){v={}}if(v.constructor==String){switch(v){case"destroy":case"stop":var w=a(t).data("cycle.opts");if(!w){return false}t.cycleStop++;if(t.cycleTimeout){clearTimeout(t.cycleTimeout)}t.cycleTimeout=0;a(t).removeData("cycle.opts");if(v=="destroy"){g(w)}return false;case"toggle":t.cyclePause=(t.cyclePause===1)?0:1;s(t.cyclePause,r,t);return false;case"pause":t.cyclePause=1;return false;case"resume":t.cyclePause=0;s(false,r,t);return false;case"prev":case"next":var w=a(t).data("cycle.opts");if(!w){l('options not found, "prev/next" ignored');return false}a.fn.cycle[v](w);return false;default:v={fx:v}}return v}else{if(v.constructor==Number){var u=v;v=a(t).data("cycle.opts");if(!v){l("options not found, can not advance slide");return false}if(u<0||u>=v.elements.length){l("invalid slide index: "+u);return false}v.nextSlide=u;if(t.cycleTimeout){clearTimeout(t.cycleTimeout);t.cycleTimeout=0}if(typeof r=="string"){v.oneTimeFx=r}j(v.elements,v,1,u>=v.currSlide);return false}}return v;function s(z,x,y){if(!z&&x===true){var A=a(y).data("cycle.opts");if(!A){l("options not found, can not resume");return false}if(y.cycleTimeout){clearTimeout(y.cycleTimeout);y.cycleTimeout=0}j(A.elements,A,1,!A.backwards)}}}function m(r,s){if(!a.support.opacity&&s.cleartype&&r.style.filter){try{r.style.removeAttribute("filter")}catch(t){}}}function g(r){if(r.next){a(r.next).unbind(r.prevNextEvent)}if(r.prev){a(r.prev).unbind(r.prevNextEvent)}if(r.pager||r.pagerAnchorBuilder){a.each(r.pagerAnchors||[],function(){this.unbind().remove()})}r.pagerAnchors=null;if(r.destroy){r.destroy(r)}}function c(r,t,z,I,H){var J=a.extend({},a.fn.cycle.defaults,I||{},a.metadata?r.metadata():a.meta?r.data():{});if(J.autostop){J.countdown=J.autostopCount||z.length}var v=r[0];r.data("cycle.opts",J);J.$cont=r;J.stopCount=v.cycleStop;J.elements=z;J.before=J.before?[J.before]:[];J.after=J.after?[J.after]:[];if(!a.support.opacity&&J.cleartype){J.after.push(function(){m(this,J)})}if(J.continuous){J.after.push(function(){j(z,J,0,!J.backwards)})}n(J);if(!a.support.opacity&&J.cleartype&&!J.cleartypeNoBg){e(t)}if(r.css("position")=="static"){r.css("position","relative")}if(J.width){r.width(J.width)}if(J.height&&J.height!="auto"){r.height(J.height)}if(J.startingSlide){J.startingSlide=parseInt(J.startingSlide)}else{if(J.backwards){J.startingSlide=z.length-1}}if(J.random){J.randomMap=[];for(var C=0;C<z.length;C++){J.randomMap.push(C)}J.randomMap.sort(function(w,N){return Math.random()-0.5});J.randomIndex=1;J.startingSlide=J.randomMap[1]}else{if(J.startingSlide>=z.length){J.startingSlide=0}}J.currSlide=J.startingSlide||0;var A=J.startingSlide;t.css({position:"absolute",top:0,left:0}).hide().each(function(w){var N;if(J.backwards){N=A?w<=A?z.length+(w-A):A-w:z.length-w}else{N=A?w>=A?z.length-(w-A):A-w:z.length-w}a(this).css("z-index",N)});a(z[A]).css("opacity",1).show();m(z[A],J);if(J.fit&&J.width){t.width(J.width)}if(J.fit&&J.height&&J.height!="auto"){t.height(J.height)}var L=J.containerResize&&!r.innerHeight();if(L){var G=0,F=0;for(var E=0;E<z.length;E++){var s=a(z[E]),x=s[0],M=s.outerWidth(),B=s.outerHeight();if(!M){M=x.offsetWidth||x.width||s.attr("width")}if(!B){B=x.offsetHeight||x.height||s.attr("height")}G=M>G?M:G;F=B>F?B:F}if(G>0&&F>0){r.css({width:G+"px",height:F+"px"})}}if(J.pause){r.hover(function(){this.cyclePause++},function(){this.cyclePause--})}if(o(J)===false){return false}var K=false;I.requeueAttempts=I.requeueAttempts||0;t.each(function(){var w=a(this);this.cycleH=(J.fit&&J.height)?J.height:(w.height()||this.offsetHeight||this.height||w.attr("height")||0);this.cycleW=(J.fit&&J.width)?J.width:(w.width()||this.offsetWidth||this.width||w.attr("width")||0);if(w.is("img")){var O=(a.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var N=(a.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var P=(a.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var Q=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(O||N||P||Q){if(H.s&&J.requeueOnImageNotLoaded&&++I.requeueAttempts<100){l(I.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){a(H.s,H.c).cycle(I)},J.requeueTimeout);K=true;return false}else{l("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(K){return false}J.cssBefore=J.cssBefore||{};J.cssAfter=J.cssAfter||{};J.cssFirst=J.cssFirst||{};J.animIn=J.animIn||{};J.animOut=J.animOut||{};t.not(":eq("+A+")").css(J.cssBefore);a(t[A]).css(J.cssFirst);if(J.timeout){J.timeout=parseInt(J.timeout);if(J.speed.constructor==String){J.speed=a.fx.speeds[J.speed]||parseInt(J.speed)}if(!J.sync){J.speed=J.speed/2}var u=J.fx=="none"?0:J.fx=="shuffle"?500:250;while((J.timeout-J.speed)<u){J.timeout+=J.speed}}if(J.easing){J.easeIn=J.easeOut=J.easing}if(!J.speedIn){J.speedIn=J.speed}if(!J.speedOut){J.speedOut=J.speed}J.slideCount=z.length;J.currSlide=J.lastSlide=A;if(J.random){if(++J.randomIndex==z.length){J.randomIndex=0}J.nextSlide=J.randomMap[J.randomIndex]}else{if(J.backwards){J.nextSlide=J.startingSlide==0?(z.length-1):J.startingSlide-1}else{J.nextSlide=J.startingSlide>=(z.length-1)?0:J.startingSlide+1}}if(!J.multiFx){var D=a.fn.cycle.transitions[J.fx];if(a.isFunction(D)){D(r,t,J)}else{if(J.fx!="custom"&&!J.multiFx){l("unknown transition: "+J.fx,"; slideshow terminating");return false}}}var y=t[A];if(J.before.length){J.before[0].apply(y,[y,y,J,true])}if(J.after.length){J.after[0].apply(y,[y,y,J,true])}if(J.next){a(J.next).bind(J.prevNextEvent,function(){return b(J,1)})}if(J.prev){a(J.prev).bind(J.prevNextEvent,function(){return b(J,0)})}if(J.pager||J.pagerAnchorBuilder){d(z,J)}h(J,z);return J}function n(r){r.original={before:[],after:[]};r.original.cssBefore=a.extend({},r.cssBefore);r.original.cssAfter=a.extend({},r.cssAfter);r.original.animIn=a.extend({},r.animIn);r.original.animOut=a.extend({},r.animOut);a.each(r.before,function(){r.original.before.push(this)});a.each(r.after,function(){r.original.after.push(this)})}function o(t){var s,w,x=a.fn.cycle.transitions;if(t.fx.indexOf(",")>0){t.multiFx=true;t.fxs=t.fx.replace(/\s*/g,"").split(",");for(s=0;s<t.fxs.length;s++){var r=t.fxs[s];w=x[r];if(!w||!x.hasOwnProperty(r)||!a.isFunction(w)){l("discarding unknown transition: ",r);t.fxs.splice(s,1);s--}}if(!t.fxs.length){l("No valid transitions named; slideshow terminating.");return false}}else{if(t.fx=="all"){t.multiFx=true;t.fxs=[];for(p in x){w=x[p];if(x.hasOwnProperty(p)&&a.isFunction(w)){t.fxs.push(p)}}}}if(t.multiFx&&t.randomizeEffects){var u=Math.floor(Math.random()*20)+30;for(s=0;s<u;s++){var v=Math.floor(Math.random()*t.fxs.length);t.fxs.push(t.fxs.splice(v,1)[0])}f("randomized fx sequence: ",t.fxs)}return true}function h(s,r){s.addSlide=function(u,v){var t=a(u),w=t[0];if(!s.autostopCount){s.countdown++}r[v?"unshift":"push"](w);if(s.els){s.els[v?"unshift":"push"](w)}s.slideCount=r.length;t.css("position","absolute");t[v?"prependTo":"appendTo"](s.$cont);if(v){s.currSlide++;s.nextSlide++}if(!a.support.opacity&&s.cleartype&&!s.cleartypeNoBg){e(t)}if(s.fit&&s.width){t.width(s.width)}if(s.fit&&s.height&&s.height!="auto"){t.height(s.height)}w.cycleH=(s.fit&&s.height)?s.height:t.height();w.cycleW=(s.fit&&s.width)?s.width:t.width();t.css(s.cssBefore);if(s.pager||s.pagerAnchorBuilder){a.fn.cycle.createPagerAnchor(r.length-1,w,a(s.pager),r,s)}if(a.isFunction(s.onAddSlide)){s.onAddSlide(t)}else{t.hide()}}}a.fn.cycle.resetState=function(t,r){r=r||t.fx;t.before=[];t.after=[];t.cssBefore=a.extend({},t.original.cssBefore);t.cssAfter=a.extend({},t.original.cssAfter);t.animIn=a.extend({},t.original.animIn);t.animOut=a.extend({},t.original.animOut);t.fxFn=null;a.each(t.original.before,function(){t.before.push(this)});a.each(t.original.after,function(){t.after.push(this)});var s=a.fn.cycle.transitions[r];if(a.isFunction(s)){s(t.$cont,a(t.elements),t)}};function j(u,A,x,v){if(x&&A.busy&&A.manualTrump){f("manualTrump in go(), stopping active transition");a(u).stop(true,true);A.busy=0}if(A.busy){f("transition active, ignoring new tx request");return}var B=A.$cont[0],t=u[A.currSlide],z=u[A.nextSlide];if(B.cycleStop!=A.stopCount||B.cycleTimeout===0&&!x){return}if(!x&&!B.cyclePause&&!A.bounce&&((A.autostop&&(--A.countdown<=0))||(A.nowrap&&!A.random&&A.nextSlide<A.currSlide))){if(A.end){A.end(A)}return}var s=false;if((x||!B.cyclePause)&&(A.nextSlide!=A.currSlide)){s=true;var w=A.fx;t.cycleH=t.cycleH||a(t).height();t.cycleW=t.cycleW||a(t).width();z.cycleH=z.cycleH||a(z).height();z.cycleW=z.cycleW||a(z).width();if(A.multiFx){if(A.lastFx==undefined||++A.lastFx>=A.fxs.length){A.lastFx=0}w=A.fxs[A.lastFx];A.currFx=w}if(A.oneTimeFx){w=A.oneTimeFx;A.oneTimeFx=null}a.fn.cycle.resetState(A,w);if(A.before.length){a.each(A.before,function(D,E){if(B.cycleStop!=A.stopCount){return}E.apply(z,[t,z,A,v])})}var r=function(){A.busy=0;a.each(A.after,function(D,E){if(B.cycleStop!=A.stopCount){return}E.apply(z,[t,z,A,v])})};f("tx firing("+w+"); currSlide: "+A.currSlide+"; nextSlide: "+A.nextSlide);A.busy=1;if(A.fxFn){A.fxFn(t,z,A,r,v,x&&A.fastOnEvent)}else{if(a.isFunction(a.fn.cycle[A.fx])){a.fn.cycle[A.fx](t,z,A,r,v,x&&A.fastOnEvent)}else{a.fn.cycle.custom(t,z,A,r,v,x&&A.fastOnEvent)}}}if(s||A.nextSlide==A.currSlide){A.lastSlide=A.currSlide;if(A.random){A.currSlide=A.nextSlide;if(++A.randomIndex==u.length){A.randomIndex=0}A.nextSlide=A.randomMap[A.randomIndex];if(A.nextSlide==A.currSlide){A.nextSlide=(A.currSlide==A.slideCount-1)?0:A.currSlide+1}}else{if(A.backwards){var C=(A.nextSlide-1)<0;if(C&&A.bounce){A.backwards=!A.backwards;A.nextSlide=1;A.currSlide=0}else{A.nextSlide=C?(u.length-1):A.nextSlide-1;A.currSlide=C?0:A.nextSlide+1}}else{var C=(A.nextSlide+1)==u.length;if(C&&A.bounce){A.backwards=!A.backwards;A.nextSlide=u.length-2;A.currSlide=u.length-1}else{A.nextSlide=C?0:A.nextSlide+1;A.currSlide=C?u.length-1:A.nextSlide-1}}}}if(s&&A.pager){A.updateActivePagerLink(A.pager,A.currSlide,A.activePagerClass)}var y=0;if(A.timeout&&!A.continuous){y=i(u[A.currSlide],u[A.nextSlide],A,v)}else{if(A.continuous&&B.cyclePause){y=10}}if(y>0){B.cycleTimeout=setTimeout(function(){j(u,A,0,!A.backwards)},y)}}a.fn.cycle.updateActivePagerLink=function(t,s,r){a(t).each(function(){a(this).children().removeClass(r).eq(s).addClass(r)})};function i(r,u,v,s){if(v.timeoutFn){var w=v.timeoutFn.call(r,r,u,v,s);while(v.fx!="none"&&(w-v.speed)<250){w+=v.speed}f("calculated timeout: "+w+"; speed: "+v.speed);if(w!==false){return w}}return v.timeout}a.fn.cycle.next=function(r){b(r,1)};a.fn.cycle.prev=function(r){b(r,0)};function b(u,t){var x=t?1:-1;var s=u.elements;var v=u.$cont[0],w=v.cycleTimeout;if(w){clearTimeout(w);v.cycleTimeout=0}if(u.random&&x<0){u.randomIndex--;if(--u.randomIndex==-2){u.randomIndex=s.length-2}else{if(u.randomIndex==-1){u.randomIndex=s.length-1}}u.nextSlide=u.randomMap[u.randomIndex]}else{if(u.random){u.nextSlide=u.randomMap[u.randomIndex]}else{u.nextSlide=u.currSlide+x;if(u.nextSlide<0){if(u.nowrap){return false}u.nextSlide=s.length-1}else{if(u.nextSlide>=s.length){if(u.nowrap){return false}u.nextSlide=0}}}}var r=u.onPrevNextEvent||u.prevNextClick;if(a.isFunction(r)){r(x>0,u.nextSlide,s[u.nextSlide])}j(s,u,1,t);return false}function d(s,t){var r=a(t.pager);a.each(s,function(u,v){a.fn.cycle.createPagerAnchor(u,v,r,s,t)});t.updateActivePagerLink(t.pager,t.startingSlide,t.activePagerClass)}a.fn.cycle.createPagerAnchor=function(x,v,s,w,y){var t;if(a.isFunction(y.pagerAnchorBuilder)){t=y.pagerAnchorBuilder(x,v);f("pagerAnchorBuilder("+x+", el) returned: "+t)}else{t='<a href="#">'+(x+1)+"</a>"}if(!t){return}var r=a(t);if(r.parents("body").length===0){var u=[];if(s.length>1){s.each(function(){var z=r.clone(true);a(this).append(z);u.push(z[0])});r=a(u)}else{r.appendTo(s)}}y.pagerAnchors=y.pagerAnchors||[];y.pagerAnchors.push(r);r.bind(y.pagerEvent,function(A){A.preventDefault();y.nextSlide=x;var B=y.$cont[0],C=B.cycleTimeout;if(C){clearTimeout(C);B.cycleTimeout=0}var z=y.onPagerEvent||y.pagerClick;if(a.isFunction(z)){z(y.nextSlide,w[y.nextSlide])}j(w,y,1,y.currSlide<x)});if(!/^click/.test(y.pagerEvent)&&!y.allowPagerClickBubble){r.bind("click.cycle",function(){return false})}if(y.pauseOnPagerHover){r.hover(function(){y.$cont[0].cyclePause++},function(){y.$cont[0].cyclePause--})}};a.fn.cycle.hopsFromLast=function(v,s){var t,u=v.lastSlide,r=v.currSlide;if(s){t=r>u?r-u:v.slideCount-u}else{t=r<u?u-r:u+v.slideCount-r}return t};function e(r){f("applying clearType background-color hack");function t(u){u=parseInt(u).toString(16);return u.length<2?"0"+u:u}function s(u){for(;u&&u.nodeName.toLowerCase()!="html";u=u.parentNode){var x=a.css(u,"background-color");if(x&&x.indexOf("rgb")>=0){var w=x.match(/\d+/g);return"#"+t(w[0])+t(w[1])+t(w[2])}if(x&&x!="transparent"){return x}}return"#ffffff"}r.each(function(){a(this).css("background-color",s(this))})}a.fn.cycle.commonReset=function(r,t,u,x,s,v){a(u.elements).not(r).hide();if(typeof u.cssBefore.opacity=="undefined"){u.cssBefore.opacity=1}u.cssBefore.display="block";if(u.slideResize&&x!==false&&t.cycleW>0){u.cssBefore.width=t.cycleW}if(u.slideResize&&s!==false&&t.cycleH>0){u.cssBefore.height=t.cycleH}u.cssAfter=u.cssAfter||{};u.cssAfter.display="none";a(r).css("zIndex",u.slideCount+(v===true?1:0));a(t).css("zIndex",u.slideCount+(v===true?0:1))};a.fn.cycle.custom=function(u,z,A,t,y,D){var r=a(u),s=a(z);var B=A.speedIn,C=A.speedOut,v=A.easeIn,w=A.easeOut;s.css(A.cssBefore);if(D){if(typeof D=="number"){B=C=D}else{B=C=1}v=w=null}var x=function(){s.animate(A.animIn,B,v,function(){t()})};r.animate(A.animOut,C,w,function(){r.css(A.cssAfter);if(!A.sync){x()}});if(A.sync){x()}};a.fn.cycle.transitions={fade:function(r,s,t){s.not(":eq("+t.currSlide+")").css("opacity",0);t.before.push(function(u,v,w){a.fn.cycle.commonReset(u,v,w);w.cssBefore.opacity=0});t.animIn={opacity:1};t.animOut={opacity:0};t.cssBefore={top:0,left:0}}};a.fn.cycle.ver=function(){return q};a.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animOut:null,autostop:0,autostopCount:0,backwards:false,before:null,cleartype:!a.support.opacity,cleartypeNoBg:false,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,slideExpr:null,slideResize:1,speed:1000,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4000,timeoutFn:null,updateActivePagerLink:null}})(jQuery);(function(a){a.fn.cycle.transitions.none=function(b,c,d){d.fxFn=function(f,g,h,e){a(g).show();a(f).hide();e()}};a.fn.cycle.transitions.fadeout=function(b,c,d){c.not(":eq("+d.currSlide+")").css({display:"block",opacity:1});d.before.push(function(e,g,i,k,f,j){a(e).css("zIndex",i.slideCount+(!j===true?1:0));a(g).css("zIndex",i.slideCount+(!j===true?0:1))});d.animIn.opacity=1;d.animOut.opacity=0;d.cssBefore.opacity=1;d.cssBefore.display="block";d.cssAfter.zIndex=0};a.fn.cycle.transitions.scrollUp=function(b,c,e){b.css("overflow","hidden");e.before.push(a.fn.cycle.commonReset);var d=b.height();e.cssBefore.top=d;e.cssBefore.left=0;e.cssFirst.top=0;e.animIn.top=0;e.animOut.top=-d};a.fn.cycle.transitions.scrollDown=function(b,c,e){b.css("overflow","hidden");e.before.push(a.fn.cycle.commonReset);var d=b.height();e.cssFirst.top=0;e.cssBefore.top=-d;e.cssBefore.left=0;e.animIn.top=0;e.animOut.top=d};a.fn.cycle.transitions.scrollLeft=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=0-e};a.fn.cycle.transitions.scrollRight=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=-e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.scrollHorz=function(b,c,d){b.css("overflow","hidden").width();d.before.push(function(e,g,h,f){if(h.rev){f=!f}a.fn.cycle.commonReset(e,g,h);h.cssBefore.left=f?(g.cycleW-1):(1-g.cycleW);h.animOut.left=f?-e.cycleW:e.cycleW});d.cssFirst.left=0;d.cssBefore.top=0;d.animIn.left=0;d.animOut.top=0};a.fn.cycle.transitions.scrollVert=function(b,c,d){b.css("overflow","hidden");d.before.push(function(e,g,h,f){if(h.rev){f=!f}a.fn.cycle.commonReset(e,g,h);h.cssBefore.top=f?(1-g.cycleH):(g.cycleH-1);h.animOut.top=f?e.cycleH:-e.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.animIn.top=0;d.animOut.left=0};a.fn.cycle.transitions.slideX=function(b,c,d){d.before.push(function(e,f,g){a(g.elements).not(e).hide();a.fn.cycle.commonReset(e,f,g,false,true);g.animIn.width=f.cycleW});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.width="show";d.animOut.width=0};a.fn.cycle.transitions.slideY=function(b,c,d){d.before.push(function(e,f,g){a(g.elements).not(e).hide();a.fn.cycle.commonReset(e,f,g,true,false);g.animIn.height=f.cycleH});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animIn.height="show";d.animOut.height=0};a.fn.cycle.transitions.shuffle=function(b,c,e){var d,f=b.css("overflow","visible").width();c.css({left:0,top:0});e.before.push(function(g,h,i){a.fn.cycle.commonReset(g,h,i,true,true,true)});if(!e.speedAdjusted){e.speed=e.speed/2;e.speedAdjusted=true}e.random=0;e.shuffle=e.shuffle||{left:-f,top:15};e.els=[];for(d=0;d<c.length;d++){e.els.push(c[d])}for(d=0;d<e.currSlide;d++){e.els.push(e.els.shift())}e.fxFn=function(j,l,m,h,k){if(m.rev){k=!k}var g=k?a(j):a(l);a(l).css(m.cssBefore);var i=m.slideCount;g.animate(m.shuffle,m.speedIn,m.easeIn,function(){var n=a.fn.cycle.hopsFromLast(m,k);for(var q=0;q<n;q++){k?m.els.push(m.els.shift()):m.els.unshift(m.els.pop())}if(k){for(var o=0,r=m.els.length;o<r;o++){a(m.els[o]).css("z-index",r-o+i)}}else{var s=a(j).css("z-index");g.css("z-index",parseInt(s)+1+i)}g.animate({left:0,top:0},m.speedOut,m.easeOut,function(){a(k?this:j).hide();if(h){h()}})})};a.extend(e.cssBefore,{display:"block",opacity:1,top:0,left:0})};a.fn.cycle.transitions.turnUp=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,true,false);g.cssBefore.top=f.cycleH;g.animIn.height=f.cycleH;g.animOut.width=f.cycleW});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.height=0;d.animIn.top=0;d.animOut.height=0};a.fn.cycle.transitions.turnDown=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,true,false);g.animIn.height=f.cycleH;g.animOut.top=e.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animOut.height=0};a.fn.cycle.transitions.turnLeft=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,true);g.cssBefore.left=f.cycleW;g.animIn.width=f.cycleW});d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.turnRight=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,true);g.animIn.width=f.cycleW;g.animOut.left=e.cycleW});a.extend(d.cssBefore,{top:0,left:0,width:0});d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.zoom=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,false,true);g.cssBefore.top=f.cycleH/2;g.cssBefore.left=f.cycleW/2;a.extend(g.animIn,{top:0,left:0,width:f.cycleW,height:f.cycleH});a.extend(g.animOut,{width:0,height:0,top:e.cycleH/2,left:e.cycleW/2})});d.cssFirst.top=0;d.cssFirst.left=0;d.cssBefore.width=0;d.cssBefore.height=0};a.fn.cycle.transitions.fadeZoom=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,false);g.cssBefore.left=f.cycleW/2;g.cssBefore.top=f.cycleH/2;a.extend(g.animIn,{top:0,left:0,width:f.cycleW,height:f.cycleH})});d.cssBefore.width=0;d.cssBefore.height=0;d.animOut.opacity=0};a.fn.cycle.transitions.blindX=function(b,c,d){var e=b.css("overflow","hidden").width();d.before.push(function(f,g,h){a.fn.cycle.commonReset(f,g,h);h.animIn.width=g.cycleW;h.animOut.left=f.cycleW});d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.blindY=function(b,c,e){var d=b.css("overflow","hidden").height();e.before.push(function(f,g,h){a.fn.cycle.commonReset(f,g,h);h.animIn.height=g.cycleH;h.animOut.top=f.cycleH});e.cssBefore.top=d;e.cssBefore.left=0;e.animIn.top=0;e.animOut.top=d};a.fn.cycle.transitions.blindZ=function(b,c,e){var d=b.css("overflow","hidden").height();var f=b.width();e.before.push(function(g,h,i){a.fn.cycle.commonReset(g,h,i);i.animIn.height=h.cycleH;i.animOut.top=g.cycleH});e.cssBefore.top=d;e.cssBefore.left=f;e.animIn.top=0;e.animIn.left=0;e.animOut.top=d;e.animOut.left=f};a.fn.cycle.transitions.growX=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,true);g.cssBefore.left=this.cycleW/2;g.animIn.left=0;g.animIn.width=this.cycleW;g.animOut.left=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.growY=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,true,false);g.cssBefore.top=this.cycleH/2;g.animIn.top=0;g.animIn.height=this.cycleH;g.animOut.top=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.curtainX=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,true,true);g.cssBefore.left=f.cycleW/2;g.animIn.left=0;g.animIn.width=this.cycleW;g.animOut.left=e.cycleW/2;g.animOut.width=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.curtainY=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,true,false,true);g.cssBefore.top=f.cycleH/2;g.animIn.top=0;g.animIn.height=f.cycleH;g.animOut.top=e.cycleH/2;g.animOut.height=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.cover=function(b,c,g){var e=g.direction||"left";var i=b.css("overflow","hidden").width();var f=b.height();g.before.push(function(d,h,j){a.fn.cycle.commonReset(d,h,j);if(e=="right"){j.cssBefore.left=-i}else{if(e=="up"){j.cssBefore.top=f}else{if(e=="down"){j.cssBefore.top=-f}else{j.cssBefore.left=i}}}});g.animIn.left=0;g.animIn.top=0;g.cssBefore.top=0;g.cssBefore.left=0};a.fn.cycle.transitions.uncover=function(b,c,g){var e=g.direction||"left";var i=b.css("overflow","hidden").width();var f=b.height();g.before.push(function(d,h,j){a.fn.cycle.commonReset(d,h,j,true,true,true);if(e=="right"){j.animOut.left=i}else{if(e=="up"){j.animOut.top=-f}else{if(e=="down"){j.animOut.top=f}else{j.animOut.left=-i}}}});g.animIn.left=0;g.animIn.top=0;g.cssBefore.top=0;g.cssBefore.left=0};a.fn.cycle.transitions.toss=function(b,c,e){var f=b.css("overflow","visible").width();var d=b.height();e.before.push(function(g,h,i){a.fn.cycle.commonReset(g,h,i,true,true,true);if(!i.animOut.left&&!i.animOut.top){a.extend(i.animOut,{left:f*2,top:-d/2,opacity:0})}else{i.animOut.opacity=0}});e.cssBefore.left=0;e.cssBefore.top=0;e.animIn.left=0};a.fn.cycle.transitions.wipe=function(c,e,n){var u=c.css("overflow","hidden").width();var j=c.height();n.cssBefore=n.cssBefore||{};var g;if(n.clip){if(/l2r/.test(n.clip)){g="rect(0px 0px "+j+"px 0px)"}else{if(/r2l/.test(n.clip)){g="rect(0px "+u+"px "+j+"px "+u+"px)"}else{if(/t2b/.test(n.clip)){g="rect(0px "+u+"px 0px 0px)"}else{if(/b2t/.test(n.clip)){g="rect("+j+"px "+u+"px "+j+"px 0px)"}else{if(/zoom/.test(n.clip)){var s=parseInt(j/2);var m=parseInt(u/2);g="rect("+s+"px "+m+"px "+s+"px "+m+"px)"}}}}}}n.cssBefore.clip=n.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var i=n.cssBefore.clip.match(/(\d+)/g);var q=parseInt(i[0]),o=parseInt(i[1]),f=parseInt(i[2]),k=parseInt(i[3]);n.before.push(function(l,t,v){if(l==t){return}var b=a(l),d=a(t);a.fn.cycle.commonReset(l,t,v,true,true,false);v.cssAfter.display="block";var w=1,h=parseInt((v.speedIn/13))-1;(function r(){var A=q?q-parseInt(w*(q/h)):0;var y=k?k-parseInt(w*(k/h)):0;var x=f<j?f+parseInt(w*((j-f)/h||1)):j;var z=o<u?o+parseInt(w*((u-o)/h||1)):u;d.css({clip:"rect("+A+"px "+z+"px "+x+"px "+y+"px)"});(w++<=h)?setTimeout(r,13):b.css("display","none")})()});a.extend(n.cssBefore,{display:"block",opacity:1,top:0,left:0});n.animIn={left:0};n.animOut={left:0}}})(jQuery);(function(a){function b(c,e){this.jqObj=c;switch(e.speed){case"super":this.steps=3;break;case"fast":this.steps=5;break;case"normal":this.steps=10;break;case"slow":this.steps=20;break;default:this.steps=10}var d=this.jqObj.offset();this.currentX=d.left;this.currentY=d.top;this.width=this.jqObj.width();this.height=this.jqObj.height();this.alwaysVisible=e.alwaysVisible;this.alwaysTop=e.alwaysTop;this.origX=typeof(e.x)=="string"?this.currentX:e.x;this.origY=typeof(e.y)=="string"?this.currentY:e.y;this.jqObj.css({position:"absolute",top:this.currentY,left:this.currentX})}b.prototype.updateLocation=function(){this.updatedX=a(window).scrollLeft()+this.origX;if(this.alwaysTop==false){this.updatedY=a(window).scrollTop()+this.origY;if(this.alwaysVisible){if(this.origX+this.width>this.windowWidth()){this.updatedX=this.windowWidth()-this.width+a(window).scrollLeft()}if(this.origY+this.height>this.windowHeight()){this.updatedY=a(window).scrollTop()+this.windowHeight()-this.height;if(this.updatedY<this.origY){this.updatedY=this.origY}}}}else{if(a(window).scrollTop()>this.origY){this.updatedY=a(window).scrollTop()+5}else{this.updatedY=this.origY+5}}this.dx=Math.abs(this.updatedX-this.currentX);this.dy=Math.abs(this.updatedY-this.currentY);return this.dx||this.dy};b.prototype.windowHeight=function(){var c=document.documentElement;return self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight};b.prototype.windowWidth=function(){var c=document.documentElement;return self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth};b.prototype.move=function(){if(this.jqObj.css("position")!="absolute"){return}var c=0;var d=0;if(this.dx>0){if(this.dx<this.steps/2){c=(this.dx>=1)?1:0}else{c=Math.round(this.dx/this.steps)}if(this.currentX<this.updatedX){this.currentX+=c}else{this.currentX-=c}}if(this.dy>0){if(this.dy<this.steps/2){d=(this.dy>=1)?1:0}else{d=Math.round(this.dy/this.steps)}if(this.currentY<this.updatedY){this.currentY+=d}else{this.currentY-=d}}this.jqObj.css({left:this.currentX,top:this.currentY})};a.floatMgr={FOArray:new Array(),timer:null,initializeFO:function(c,e){var f=a.extend({x:0,y:0,speed:"normal",alwaysVisible:false,alwaysTop:false},e||{});var d=new b(c,f);a.floatMgr.FOArray.push(d);if(!a.floatMgr.timer){a.floatMgr.adjustFO()}if(!a.floatMgr.registeredEvents){a(window).bind("resize",a.floatMgr.onChange);a(window).bind("scroll",a.floatMgr.onChange);a.floatMgr.registeredEvents=true}},adjustFO:function(){a.floatMgr.timer=null;var d=false;for(var c=0;c<a.floatMgr.FOArray.length;c++){FO=a.floatMgr.FOArray[c];if(FO.updateLocation()){d=true}}if(d){for(var c=0;c<a.floatMgr.FOArray.length;c++){FO=a.floatMgr.FOArray[c];FO.move()}if(!a.floatMgr.timer){a.floatMgr.timer=setTimeout(a.floatMgr.adjustFO,50)}}},stopFloatChk:false,onChange:function(){if(!a.floatMgr.timer&&!a.floatMgr.stopFloatChk){a.floatMgr.adjustFO()}}};a.fn.makeFloat=function(d){var c=this.eq(0);a.floatMgr.initializeFO(c,d);if(a.floatMgr.timer==null){a.floatMgr.adjustFO()}return c};a.fn.stopFloat=function(c){a.floatMgr.stopFloatChk=true};a.fn.restartFloat=function(c){a.floatMgr.stopFloatChk=false}})(jQuery);/*
* Marquee jQuery Plug-in
*
* Copyright 2009 Giva, Inc. (http://www.givainc.com/labs/) 
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 
* 	http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Date: 2009-05-20
* Rev:  1.0.01
*/
(function(a){a.marquee={version:"1.0.01"};a.fn.marquee=function(d){var c=typeof arguments[0]=="string"&&arguments[0];var b=c&&Array.prototype.slice.call(arguments,1)||arguments;var f=(this.length==0)?null:a.data(this[0],"marquee");if(f&&c&&this.length){if(c.toLowerCase()=="object"){return f}else{if(f[c]){var e;this.each(function(g){var h=a.data(this,"marquee")[c].apply(f,b);if(g==0&&h){if(!!h.jquery){e=a([]).add(h)}else{e=h;return false}}else{if(!!h&&!!h.jquery){e=e.add(h)}}});return e||this}else{return this}}}else{return this.each(function(){new a.Marquee(this,d)})}};a.Marquee=function(i,j){j=a.extend({},a.Marquee.defaults,j);var o=this,c=a(i),b=c.find("> li"),d=-1,g=false,l=false,h=0;a.data(c[0],"marquee",o);this.pause=function(){g=true;k()};this.resume=function(){g=false;m()};this.update=function(){var r=b.length;b=c.find("> li");if(r<=1){m()}};function p(s){if(b.filter("."+j.cssShowing).length>0){return false}var r=b.eq(s);if(a.isFunction(j.beforeshow)){j.beforeshow.apply(o,[c,r])}var t={top:(j.yScroll=="top"?"-":"+")+r.outerHeight()+"px",left:0};c.data("marquee.showing",true);r.addClass(j.cssShowing);r.css(t).animate({top:"0px"},j.showSpeed,j.fxEasingShow,function(){if(a.isFunction(j.show)){j.show.apply(o,[c,r])}c.data("marquee.showing",false);n(r)})}function n(r,s){if(l==true){return false}s=s||j.pauseSpeed;if(e(r)){setTimeout(function(){if(l==true){return false}var v=r.outerWidth(),u=v*-1,t=parseInt(r.css("left"),10);r.animate({left:u+"px"},((v+t)*j.scrollSpeed),j.fxEasingScroll,function(){f(r)})},s)}else{if(b.length>1){setTimeout(function(){if(l==true){return false}r.animate({top:(j.yScroll=="top"?"+":"-")+c.innerHeight()+"px"},j.showSpeed,j.fxEasingScroll);f(r)},s)}}}function f(r){if(a.isFunction(j.aftershow)){j.aftershow.apply(o,[c,r])}r.removeClass(j.cssShowing);q()}function k(){l=true;if(c.data("marquee.showing")!=true){b.filter("."+j.cssShowing).dequeue().stop()}}function m(){l=false;if(c.data("marquee.showing")!=true){n(b.filter("."+j.cssShowing),1)}}if(j.pauseOnHover){c.hover(function(){if(g){return false}k()},function(){if(g){return false}m()})}function e(r){return(r.outerWidth()>c.innerWidth())}function q(){d++;if(d>=b.length){if(!isNaN(j.loop)&&j.loop>0&&(++h>=j.loop)){return false}d=0}p(d)}if(a.isFunction(j.init)){j.init.apply(o,[c,j])}q()};a.Marquee.defaults={yScroll:"top",showSpeed:850,scrollSpeed:12,pauseSpeed:5000,pauseOnHover:true,loop:-1,fxEasingShow:"swing",fxEasingScroll:"linear",cssShowing:"marquee-showing",init:null,beforeshow:null,show:null,aftershow:null}})(jQuery);var swfobject=function(){var ae="undefined",aG="object",aJ="Shockwave Flash",aR="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",aH="SWFObjectExprInst",aS="onreadystatechange",aB=window,ap=document,aK=navigator,aL=false,aN=[al],aA=[],az=[],ao=[],au,aF,ag,aa,aq=false,X=false,ay,ak,aw=true,ax=function(){var a=typeof ap.getElementById!=ae&&typeof ap.getElementsByTagName!=ae&&typeof ap.createElement!=ae,h=aK.userAgent.toLowerCase(),j=aK.platform.toLowerCase(),e=j?/win/.test(j):/win/.test(h),c=j?/mac/.test(j):/mac/.test(h),f=/webkit/.test(h)?parseFloat(h.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=!+"\v1",g=[0,0,0],b=null;if(typeof aK.plugins!=ae&&typeof aK.plugins[aJ]==aG){b=aK.plugins[aJ].description;if(b&&!(typeof aK.mimeTypes!=ae&&aK.mimeTypes[aE]&&!aK.mimeTypes[aE].enabledPlugin)){aL=true;i=false;b=b.replace(/^.*\s+(\S+\s+\S+$)/,"$1");g[0]=parseInt(b.replace(/^(.*)\..*$/,"$1"),10);g[1]=parseInt(b.replace(/^.*\.(.*)\s.*$/,"$1"),10);g[2]=/[a-zA-Z]/.test(b)?parseInt(b.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof aB.ActiveXObject!=ae){try{var d=new ActiveXObject(aR);if(d){b=d.GetVariable("$version");if(b){i=true;b=b.split(" ")[1].split(",");g=[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10)]}}}catch(k){}}}return{w3:a,pv:g,wk:f,ie:i,win:e,mac:c}}(),ar=function(){if(!ax.w3){return}if((typeof ap.readyState!=ae&&ap.readyState=="complete")||(typeof ap.readyState==ae&&(ap.getElementsByTagName("body")[0]||ap.body))){ah()}if(!aq){if(typeof ap.addEventListener!=ae){ap.addEventListener("DOMContentLoaded",ah,false)}if(ax.ie&&ax.win){ap.attachEvent(aS,function(){if(ap.readyState=="complete"){ap.detachEvent(aS,arguments.callee);ah()}});if(aB==top){(function(){if(aq){return}try{ap.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}ah()})()}}if(ax.wk){(function(){if(aq){return}if(!/loaded|complete/.test(ap.readyState)){setTimeout(arguments.callee,0);return}ah()})()}aI(ah)}}();function ah(){if(aq){return}try{var d=ap.getElementsByTagName("body")[0].appendChild(ac("span"));d.parentNode.removeChild(d)}catch(a){return}aq=true;var b=aN.length;for(var c=0;c<b;c++){aN[c]()}}function at(a){if(aq){a()}else{aN[aN.length]=a}}function aI(b){if(typeof aB.addEventListener!=ae){aB.addEventListener("load",b,false)}else{if(typeof ap.addEventListener!=ae){ap.addEventListener("load",b,false)}else{if(typeof aB.attachEvent!=ae){an(aB,"onload",b)}else{if(typeof aB.onload=="function"){var a=aB.onload;aB.onload=function(){a();b()}}else{aB.onload=b}}}}}function al(){if(aL){aP()}else{am()}}function aP(){var b=ap.getElementsByTagName("body")[0];var a=ac(aG);a.setAttribute("type",aE);var d=b.appendChild(a);if(d){var c=0;(function(){if(typeof d.GetVariable!=ae){var e=d.GetVariable("$version");if(e){e=e.split(" ")[1].split(",");ax.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}b.removeChild(a);d=null;am()})()}else{am()}}function am(){var g=aA.length;if(g>0){for(var f=0;f<g;f++){var k=aA[f].id;var b=aA[f].callbackFn;var a={success:false,id:k};if(ax.pv[0]>0){var e=ab(k);if(e){if(ai(aA[f].swfVersion)&&!(ax.wk&&ax.wk<312)){aQ(k,true);if(b){a.success=true;a.ref=aU(k);b(a)}}else{if(aA[f].expressInstall&&Y()){var i={};i.data=aA[f].expressInstall;i.width=e.getAttribute("width")||"0";i.height=e.getAttribute("height")||"0";if(e.getAttribute("class")){i.styleclass=e.getAttribute("class")}if(e.getAttribute("align")){i.align=e.getAttribute("align")}var h={};var j=e.getElementsByTagName("param");var c=j.length;for(var d=0;d<c;d++){if(j[d].getAttribute("name").toLowerCase()!="movie"){h[j[d].getAttribute("name")]=j[d].getAttribute("value")}}aD(i,h,k,b)}else{aC(e);if(b){b(a)}}}}}else{aQ(k,true);if(b){var l=aU(k);if(l&&typeof l.SetVariable!=ae){a.success=true;a.ref=l}b(a)}}}}}function aU(a){var b=null;var c=ab(a);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=ae){b=c}else{var d=c.getElementsByTagName(aG)[0];if(d){b=d}}}return b}function Y(){return !X&&ai("6.0.65")&&(ax.win||ax.mac)&&!(ax.wk&&ax.wk<312)}function aD(a,b,f,h){X=true;ag=h||null;aa={success:false,id:f};var e=ab(f);if(e){if(e.nodeName=="OBJECT"){au=aj(e);aF=null}else{au=e;aF=f}a.id=aH;if(typeof a.width==ae||(!/%$/.test(a.width)&&parseInt(a.width,10)<310)){a.width="310"}if(typeof a.height==ae||(!/%$/.test(a.height)&&parseInt(a.height,10)<137)){a.height="137"}ap.title=ap.title.slice(0,47)+" - Flash Player Installation";var d=ax.ie&&ax.win?"ActiveX":"PlugIn",c="MMredirectURL="+aB.location.toString().replace(/&/g,"%26")+"&MMplayerType="+d+"&MMdoctitle="+ap.title;if(typeof b.flashvars!=ae){b.flashvars+="&"+c}else{b.flashvars=c}if(ax.ie&&ax.win&&e.readyState!=4){var g=ac("div");f+="SWFObjectNew";g.setAttribute("id",f);e.parentNode.insertBefore(g,e);e.style.display="none";(function(){if(e.readyState==4){e.parentNode.removeChild(e)}else{setTimeout(arguments.callee,10)}})()}aM(a,b,f)}}function aC(b){if(ax.ie&&ax.win&&b.readyState!=4){var a=ac("div");b.parentNode.insertBefore(a,b);a.parentNode.replaceChild(aj(b),a);b.style.display="none";(function(){if(b.readyState==4){b.parentNode.removeChild(b)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.replaceChild(aj(b),b)}}function aj(b){var a=ac("div");if(ax.win&&ax.ie){a.innerHTML=b.innerHTML}else{var e=b.getElementsByTagName(aG)[0];if(e){var c=e.childNodes;if(c){var d=c.length;for(var f=0;f<d;f++){if(!(c[f].nodeType==1&&c[f].nodeName=="PARAM")&&!(c[f].nodeType==8)){a.appendChild(c[f].cloneNode(true))}}}}}return a}function aM(i,g,k){var j,a=ab(k);if(ax.wk&&ax.wk<312){return j}if(a){if(typeof i.id==ae){i.id=k}if(ax.ie&&ax.win){var h="";for(var e in i){if(i[e]!=Object.prototype[e]){if(e.toLowerCase()=="data"){g.movie=i[e]}else{if(e.toLowerCase()=="styleclass"){h+=' class="'+i[e]+'"'}else{if(e.toLowerCase()!="classid"){h+=" "+e+'="'+i[e]+'"'}}}}}var f="";for(var d in g){if(g[d]!=Object.prototype[d]){f+='<param name="'+d+'" value="'+g[d]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+h+">"+f+"</object>";az[az.length]=i.id;j=ab(i.id)}else{var l=ac(aG);l.setAttribute("type",aE);for(var c in i){if(i[c]!=Object.prototype[c]){if(c.toLowerCase()=="styleclass"){l.setAttribute("class",i[c])}else{if(c.toLowerCase()!="classid"){l.setAttribute(c,i[c])}}}}for(var b in g){if(g[b]!=Object.prototype[b]&&b.toLowerCase()!="movie"){af(l,b,g[b])}}a.parentNode.replaceChild(l,a);j=l}}return j}function af(d,b,c){var a=ac("param");a.setAttribute("name",b);a.setAttribute("value",c);d.appendChild(a)}function aT(b){var a=ab(b);if(a&&a.nodeName=="OBJECT"){if(ax.ie&&ax.win){a.style.display="none";(function(){if(a.readyState==4){Z(b)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.removeChild(a)}}}function Z(c){var b=ab(c);if(b){for(var a in b){if(typeof b[a]=="function"){b[a]=null}}b.parentNode.removeChild(b)}}function ab(c){var a=null;try{a=ap.getElementById(c)}catch(b){}return a}function ac(a){return ap.createElement(a)}function an(c,a,b){c.attachEvent(a,b);ao[ao.length]=[c,a,b]}function ai(c){var b=ax.pv,a=c.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return(b[0]>a[0]||(b[0]==a[0]&&b[1]>a[1])||(b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]))?true:false}function aO(c,f,d,b){if(ax.ie&&ax.mac){return}var a=ap.getElementsByTagName("head")[0];if(!a){return}var e=(d&&typeof d=="string")?d:"screen";if(b){ay=null;ak=null}if(!ay||ak!=e){var g=ac("style");g.setAttribute("type","text/css");g.setAttribute("media",e);ay=a.appendChild(g);if(ax.ie&&ax.win&&typeof ap.styleSheets!=ae&&ap.styleSheets.length>0){ay=ap.styleSheets[ap.styleSheets.length-1]}ak=e}if(ax.ie&&ax.win){if(ay&&typeof ay.addRule==aG){ay.addRule(c,f)}}else{if(ay&&typeof ap.createTextNode!=ae){ay.appendChild(ap.createTextNode(c+" {"+f+"}"))}}}function aQ(c,a){if(!aw){return}var b=a?"visible":"hidden";if(aq&&ab(c)){ab(c).style.visibility=b}else{aO("#"+c,"visibility:"+b)}}function av(b){var c=/[\\\"<>\.;]/;var a=c.exec(b)!=null;return a&&typeof encodeURIComponent!=ae?encodeURIComponent(b):b}var ad=function(){if(ax.ie&&ax.win){window.attachEvent("onunload",function(){var c=ao.length;for(var b=0;b<c;b++){ao[b][0].detachEvent(ao[b][1],ao[b][2])}var f=az.length;for(var a=0;a<f;a++){aT(az[a])}for(var e in ax){ax[e]=null}ax=null;for(var d in swfobject){swfobject[d]=null}swfobject=null})}}();return{registerObject:function(b,c,a,e){if(ax.w3&&b&&c){var d={};d.id=b;d.swfVersion=c;d.expressInstall=a;d.callbackFn=e;aA[aA.length]=d;aQ(b,false)}else{if(e){e({success:false,id:b})}}},getObjectById:function(a){if(ax.w3){return aU(a)}},embedSWF:function(b,h,e,g,j,a,k,d,f,c){var i={success:false,id:h};if(ax.w3&&!(ax.wk&&ax.wk<312)&&b&&h&&e&&g&&j){aQ(h,false);at(function(){e+="";g+="";var m={};if(f&&typeof f===aG){for(var o in f){m[o]=f[o]}}m.data=b;m.width=e;m.height=g;var p={};if(d&&typeof d===aG){for(var n in d){p[n]=d[n]}}if(k&&typeof k===aG){for(var l in k){if(typeof p.flashvars!=ae){p.flashvars+="&"+l+"="+k[l]}else{p.flashvars=l+"="+k[l]}}}if(ai(j)){var q=aM(m,p,h);if(m.id==h){aQ(h,true)}i.success=true;i.ref=q}else{if(a&&Y()){m.data=a;aD(m,p,h,c);return}else{aQ(h,true)}}if(c){c(i)}})}else{if(c){c(i)}}},switchOffAutoHideShow:function(){aw=false},ua:ax,getFlashPlayerVersion:function(){return{major:ax.pv[0],minor:ax.pv[1],release:ax.pv[2]}},hasFlashPlayerVersion:ai,createSWF:function(c,b,a){if(ax.w3){return aM(c,b,a)}else{return undefined}},showExpressInstall:function(d,a,b,c){if(ax.w3&&Y()){aD(d,a,b,c)}},removeSWF:function(a){if(ax.w3){aT(a)}},createCSS:function(a,d,c,b){if(ax.w3){aO(a,d,c,b)}},addDomLoadEvent:at,addLoadEvent:aI,getQueryParamValue:function(a){var d=ap.location.search||ap.location.hash;if(d){if(/\?/.test(d)){d=d.split("?")[1]}if(a==null){return av(d)}var c=d.split("&");for(var b=0;b<c.length;b++){if(c[b].substring(0,c[b].indexOf("="))==a){return av(c[b].substring((c[b].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(X){var a=ab(aH);if(a&&au){a.parentNode.replaceChild(au,a);if(aF){aQ(aF,true);if(ax.ie&&ax.win){au.style.display="block"}}if(ag){ag(aa)}}X=false}}}}();function detectIsMobile(){var b=navigator.userAgent.toLowerCase();var a=b.match(/(iphone|ipod|ipad|android)/);if(a){return true}return false}function detectIsSafari(){var b=navigator.userAgent.toLowerCase();var a=b.match(/(iphone|ipod|ipad|safari)/);if(a){if(b.match(/(chrome)/)){return false}else{return true}}return false}function getInternetExplorerVersion(){var b=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var a=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(a.exec(c)!=null){b=parseFloat(RegExp.$1)}}return b}function getFlashMovieObject(a){if(window.document[a]){return window.document[a]}if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[a]){return document.embeds[a]}}else{return document.getElementById(a)}}function saveImagePass(a){$("[id *= 'DoodleData']").val(a)}function CollectImageData(){if(!(($.browser.msie)&&($.browser.version<"9.0"))){$("[id *= 'DoodleData']").val(document.getElementById("canvas").toDataURL("image/png"))}}var climberTimeout;var dinosaurTimeout;var spaceshipTimeout;var randomFlybyTimeout;var tedTimeout;var explodeTimeout;var climberIsActive=false;var jetpackIsActive=false;var dinosaurIsActive=false;var teethAreActive=false;var painterIsActive=false;var pipesAreActive=false;var whistleIsActive=false;var topIsActive=false;var canvasLoaded=false;var trackedClimber=false;var trackedDinosaur=false;var pageY=0;var lastPageY=0;var windowHeight=0;var windowWidth=0;var aniCount=0;var isFirst=true;var animations=new Array();var animationPulse;var framerate=(24/60)*100;var animating=false;var numDoodles=20;var dropCount=0;var explodeCount=0;var isCPressed=false;$(document).ready(function(){var c=$("#form1").height();updateWindowHeight();updateWindowWidth();updateScrollTop();if(!detectIsMobile()){setUpAnimations();startAnimating()}$(window).bind("resize",updateWindowHeight);$(window).bind("resize",updateWindowWidth);$(window).bind("scroll",updateScrollTop);if(!detectIsMobile()){$("#wiseSnacksLink").click(function(){spaceshipClick()})}$("#goatHoverActivate").hover(function(){goatHover()},function(){goatOut()});if($(window).width()>1024){$("#floatNav").makeFloat({x:930,speed:"super"})}else{if($(window).width()<=1024){$("#floatNav").makeFloat({x:900,speed:"super"})}}var f=0;var g=0;var b=0;var e=$("#footer").width();function a(){$("#footer ul li").each(function(){g=$(this).width();f+=g});b=(e-f)/2;if(getInternetExplorerVersion()!=-1){f+=20}$("#footer ul").css("width",f+"px");$("#footer ul").css("margin-left",b+"px");$("#footer ul").css("margin-right",0+"px");$("#footer ul").css("margin-top",20+"px");$("#footer ul").css("margin-bottom",20+"px")}a();$("#tickerTape").marquee({yScroll:"bottom",pauseOnHover:true,pauseSpeed:1000,scrollSpeed:17,loop:-1}).mousemove(function(h){if($(this).data("drag")==true){this.scrollLeft=$(this).data("scrollX")+($(this).data("x")-h.clientX)}}).mousedown(function(h){$(this).data("drag",true).data("x",h.clientX).data("scrollX",this.scrollLeft)}).mouseup(function(){$(this).data("drag",false)});$("#chewSlides").cycle({speed:1000,fx:"fade",timeout:0,next:"#chewNext",prev:"#chewPrev",after:function(){trackEvent("Chew On This Click","Chew On This Click")}});$("#footSlides").cycle({speed:1000,fx:"fade",timeout:7000});$("#conveyor_video").bind("ended",playCheezVideo);$(document).keydown(function(h){var j=$("#noBottomScroll").height();if(h.keyCode=="67"){if(!isCPressed){if(pageY<j-1500){generateDoodles();trackEvent("Pressed C Key","Pressed C Key")}else{generateDoodlesAndRunTed();trackEvent("Pressed C Key for Ted","Pressed C Key for Ted")}}}});if($("#conveyorBackup").size()>0){var d=false;var d={};d.video="/media/video/conveyer/conveyor.flv";d.poster="/media/video/conveyer/conveyor.jpg";d.width=801;d.height=394;swfobject.embedSWF("/flash/VideoPlayer.swf","conveyorBackup","801","394","10.0.0","media/swf/expressInstall.swf",d,{name:"conveyorBackup",allowscriptaccess:"sameDomain",wmode:"transparent"},false)}$(".loading-placeholder").bind("load",imageLoaded);$(".loading-placeholder").each(function(){var h=$(this).attr("title");$(this).attr("src",h)});if(getInternetExplorerVersion()==-1&&!detectIsMobile()){randomFlyby(pageY)}$("#navigation .saveNow a").click(function(){trackEvent("Clicked Save Now","Clicked Save Now")});$("#navigation .contactUs a").click(function(){trackEvent("Clicked Contact Us","Clicked Contact Us")});$("#navigation .wiseStore a").click(function(){trackEvent("Clicked Wise Store","Clicked Wise Store")});$("#navigation .fb a").click(function(){trackEvent("Clicked Navigation Facebook","Clicked Navigation Facebook")})});function playCheezVideo(){$("#conveyor_video")[0].play()}function playFeastVideo(){$("#feast_video")[0].play()}function imageLoaded(a){if($(a.currentTarget).attr("src")!=="/images/animations/placeholder.png"){$(a.currentTarget).removeClass("loading-placeholder")}}function generateDoodles(){isCPressed=true;dropCount=0;for(i=0;i<numDoodles;i++){var a="doodleDrop"+i;var b=105;var j=pageY-b;var g=j-1500;var c=Math.floor(j+(Math.random()*(g-j)));var h=pageY+windowHeight+b;var f=pageY+windowHeight+b+1500;var d=Math.floor(h+(Math.random()*(f-h)));var k=Math.floor(Math.random()*(windowWidth+400)-400);var e=$("#noBottomScroll").height();$("#droppedDoodles").append("<div class='doodle-drop doodleDrop"+i+"' style='display:none'><span class='drop-height'>"+d+"</span><img src='/images/ted/doodleDrop2.png' alt='Falling Cheez Doodle' /></div>");$("#droppedDoodles").css("width",windowWidth+"px");$("#droppedDoodles").css("height",e+"px");$("#droppedDoodles").css("overflow-x","hidden");$("."+a).css("display","block");$("."+a).css("left",k+"px");$("."+a).css("top",c+"px")}$(".doodle-drop").each(function(){var l=$(this).find(".drop-height").text()+"px";$(this).animate({top:l},2000,"linear",function(){countDroppedDoodles()})})}function countDroppedDoodles(){dropCount++;if(dropCount>=numDoodles){$("#droppedDoodles").empty();$("#droppedDoodles").css("width",0+"px");$("#droppedDoodles").css("height",0+"px");isCPressed=false}}function generateDoodlesAndRunTed(){isCPressed=true;dropCount=0;for(i=0;i<numDoodles;i++){var b="doodleDrop"+i;var a=$(document).height();var c=150;var k=pageY-c;var h=k-1500;var d=Math.floor(k+(Math.random()*(h-k)));var j=a-580;var g=a-350;var e=Math.floor(j+(Math.random()*(g-j)));var l=Math.floor(Math.random()*(windowWidth+400)-400);var f=$("#noBottomScroll").height();if(getInternetExplorerVersion()!=-1){$("#droppedDoodles").append("<div class='doodle-drop doodleDrop"+i+"' style='display:none'><span class='drop-height'>"+e+"</span><img src='/images/ted/doodleDrop2.png' class='still' alt='Falling Cheez Doodle' /></div>");$(".doodleDrop"+i).append("<div id='doodleAni"+i+"' class='doodle-explosion-ie' style='display:none'><span class='width'>263</span><div class='animation-wrap'><img src='/images/animations/ie_dust.png' alt='Cheez Doodle Explosion' /></div></div>")}else{$("#droppedDoodles").append("<div class='doodle-drop doodleDrop"+i+"' style='display:none'><span class='drop-height'>"+e+"</span><img src='/images/ted/doodleDrop2.png' class='still' alt='Falling Cheez Doodle' /></div>");$(".doodleDrop"+i).append("<div id='doodleAni"+i+"' class='doodle-explosion' style='display:none'><span class='width'>600</span><div class='animation-wrap'><img src='/images/ted/doodle-explode-new.png' alt='Cheez Doodle Explosion' /></div></div>")}$("#droppedDoodles").css("width",windowWidth+"px");$("#droppedDoodles").css("height",f+"px");$("#droppedDoodles").css("overflow-x","hidden");$("."+b).css("display","block");$("."+b).css("left",l+"px");$("."+b).css("top",d+"px")}$(".doodle-drop").each(function(){var m=$(this).find(".drop-height").text()+"px";$(this).animate({top:m},1000,"linear",function(){countDroppedDoodlesAndRunTed()})})}function countDroppedDoodlesAndRunTed(){dropCount++;if(dropCount>=numDoodles){tedAnimation()}}function tedAnimation(){$("#tedPlaceholder").css("display","none");$("#tedEyes").css("display","block");$("#tedEyes").addClass("animation");$("#tedEyes img").removeClass("final-frame");$("#tedEyes img").addClass("once");$("#tedEyes").addClass("animation-active");$(".doodleLarge .placeholder").each(function(){$(this).css("display","none")});$(".doodleLarge .shake").each(function(){$(this).css("display","block");$(this).addClass("animation");$(this).addClass("animation-active")});tedEyesOnce()}function tedEyesOnce(){if($("#tedEyes img").hasClass("final-frame")){$("#tedEyes").css("display","none");$("#tedEyes").removeClass("animation");$("#tedEyes").removeClass("animation-active");$("#tedEyes img").removeClass("once");$("#tedEyes img").removeClass("final-frame");$("#tedEyes img").css("left",0+"px");$("#tedPlaceholder").css("display","block");clearTimeout(tedTimeout);doodlesExplode()}else{tedTimeout=setTimeout(tedEyesOnce,framerate)}}function doodlesExplode(){$(".doodleLarge .placeholder").each(function(){$(this).css("display","block")});$(".doodleLarge .shake").each(function(){$(this).css("display","none");$(this).removeClass("animation");$(this).removeClass("animation-active")});for(i=0;i<numDoodles;i++){var b="doodleDrop"+i;var a="doodleAni"+i;$("."+b+" .still").css("display","none");$("."+b+" #"+a).css("display","block");$("."+b+" #"+a).addClass("animation");$("."+b+" #"+a).addClass("animation-active");$("."+b+" #"+a+" img").addClass("once")}explodeTimeout=setTimeout(explodeOnce,3000)}function explodeOnce(){if($("#droppedDoodles .final-frame").size()>0){clearTimeout(explodeTimeout);$("#droppedDoodles").empty();$("#droppedDoodles").css("width",0+"px");$("#droppedDoodles").css("height",0+"px");isCPressed=false}else{explodeTimeout=setTimeout(explodeOnce,framerate)}}function spaceshipClick(){$("#spaceshipClick").css("display","block");$("#spaceshipClick img").addClass("once");$("#spaceshipClick").addClass("animation");$("#spaceshipClick").addClass("animation-active");$("#spaceshipRollover").css("display","none");$("#goatPlaceholder").css("display","none");$("#goatHoverActivate").css("display","none");spaceshipTimeout=setTimeout(a,framerate);function a(){if($("#spaceshipClick img").hasClass("once final-frame")){spaceshipOut()}else{spaceshipTimeout=setTimeout(a,framerate)}}}function spaceshipOut(){trackEvent("Click to Wise Snacks Home","Wise Snacks Home");window.open("http://www.wisesnacks.com","_blank");$("#spaceshipClick").css("display","none");$("#spaceshipClick img").removeClass("once");$("#spaceshipClick img").removeClass("final-frame");$("#spaceshipClick").removeClass("animation");$("#spaceshipClick").removeClass("animation-active");$("#spaceshipClick img").css("left",0+"px");$("#spaceshipReturn").css("display","block");$("#spaceshipReturn img").addClass("once");$("#spaceshipReturn").addClass("animation");$("#spaceshipReturn").addClass("animation-active");spaceshipTimeout=setTimeout(a,framerate);function a(){if($("#spaceshipReturn img").hasClass("once final-frame")){$("#spaceshipReturn").css("display","none");$("#spaceshipReturn img").removeClass("once");$("#spaceshipReturn img").removeClass("final-frame");$("#spaceshipReturn").removeClass("animation");$("#spaceshipReturn").removeClass("animation-active");$("#spaceshipReturn img").css("left",0+"px");$("#goatHoverActivate").css("display","block");$("#spaceshipRollover").css("display","block");$("#goatPlaceholder").css("display","block")}else{spaceshipTimeout=setTimeout(a,framerate)}}}function goatHover(){$("#goatPlaceholder").css("display","none");$("#goatOn").css("display","block");$("#goatOn img").addClass("once");$("#goatOn").addClass("animation");$("#goatOn").addClass("animation-active")}function goatOut(){$("#goatOn").css("display","none");$("#goatOn img").removeClass("once");$("#goatOn img").removeClass("final-frame");$("#goatOn").removeClass("animation");$("#goatOn").removeClass("animation-active");$("#goatOn img").css("left",0);$("#goatOff").css("display","block");$("#goatOff img").addClass("once");$("#goatOff").addClass("animation");$("#goatOff").addClass("animation-active");setTimeout(goatReturnOnce,framerate)}function goatReturnOnce(){if($("#goatOff img").hasClass("once final-frame")){$("#goatOff").css("display","none");$("#goatOff img").removeClass("once");$("#goatOff img").removeClass("final-frame");$("#goatOff").removeClass("animation");$("#goatOff").removeClass("animation-active");$("#goatOff img").css("left",0);$("#goatPlaceholder").css("display","block")}else{setTimeout(goatReturnOnce,framerate)}}function dinoLaser(){if(dinosaurIsActive){$("#dinosaurIdle").css("display","none");$("#dinosaurIdle").removeClass("animation");$("#dinosaurIdle").removeClass("animation-active");$("#dinosaurLaser").css("display","block");$("#dinosaurLaser").addClass("animation");$("#dinosaurLaser").addClass("animation-active");$("#dinosaurLaser img").addClass("once");dinosaurTimeout=setTimeout(dinoLaserOnce,framerate)}}function dinoLaserOnce(){if(dinosaurIsActive){if($("#dinosaurLaser img").hasClass("once final-frame")){$("#dinosaurLaser").css("display","none");$("#dinosaurLaser").removeClass("animation");$("#dinosaurLaser").removeClass("animation-active");$("#dinosaurLaser img").removeClass("final-frame");$("#dinosaurLaser img").css("left",0+"px");$("#dinosaurIdle").css("display","block");$("#dinosaurIdle").addClass("animation");$("#dinosaurIdle").addClass("animation-active");dinosaurTimeout=setTimeout(dinoLaser,7000)}else{dinosaurTimeout=setTimeout(dinoLaserOnce,framerate)}}}function climber(){climberUp()}function climberUp(){if(climberIsActive){$("#climber").css("display","none");$("#climberUp").css("display","block");$("#climberUp").addClass("animation");$("#climberUp").addClass("animation-active");climberTimeout=setTimeout(climberUpOnce,framerate)}}function climberUpOnce(){if($("#climberUp img").hasClass("once final-frame")){climberDown()}else{climberTimeout=setTimeout(climberUpOnce,framerate)}}function climberDown(){if(climberIsActive){$("#climberUp").css("display","none");$("#climberUp").removeClass("animation");$("#climberUp").removeClass("animation-active");$("#climberUp img").removeClass("final-frame");$("#climberUp img").css("left",0+"px");$("#climberDown").css("display","block");$("#climberDown").addClass("animation");$("#climberDown").addClass("animation-active");climberTimeout=setTimeout(climberDownOnce,framerate)}}function climberDownOnce(){if($("#climberDown img").hasClass("once final-frame")){climberTimeout=setTimeout(function(){$("#climberDown").css("display","none");$("#climberDown").removeClass("animation");$("#climberDown").removeClass("animation-active");$("#climberDown img").removeClass("final-frame");$("#climberDown img").css("left",0+"px");if(climberIsActive){climberUp()}},2000)}else{climberTimeout=setTimeout(climberDownOnce,framerate)}}function jetpack(){if(jetpackIsActive){$("#jetpack").animate({top:"1780px"},6000,"swing",function(){if(jetpackIsActive){jetpackDown()}})}}function jetpackDown(){if(jetpackIsActive){$("#jetpack").animate({top:"1380px"},6000,"swing",function(){if(jetpackIsActive){jetpack()}})}}var dir="";function flyby(c,e,a){if(a=="rtl"){var b=c.width();var d=c.css("left",windowWidth+b+"px");$(this).css("left",d+"px");c.animate({left:-b+"px"},e,"linear",function(){$(this).css("display","none");$(this).removeClass("animation");$(this).removeClass("animation-active");pageY=$(window).scrollTop();if(getInternetExplorerVersion()==-1){randomFlybyTimeout=setTimeout(function(){randomFlyby(pageY)},5000)}})}else{if(a=="lft"){var b=c.width();var d=c.css("left",-b+"px");$(this).css("left",-b+"px");c.animate({left:windowWidth+b+"px"},e,"linear",function(){$(this).css("left",-b+"px");flyby($(this),e,"lft")})}else{if(a=="up"){c.animate({top:"-=500"},e,"linear",function(){c.animate({top:"+=500"},e,"linear",function(){if($(this).attr("id")=="jetpack"&&jetpackIsActive==true){flyby($(this),e,"up")}})})}else{if(a=="down"){c.animate({top:"+=500"},e,"linear",function(){c.animate({top:"-=500"},e,"linear",function(){flyby($(this),e,"down")})})}else{if(a=="backForth"){c.animate({left:"+=500"},e,"linear",function(){c.animate({left:"-=500"},e,"linear",function(){flyby($(this),e,"backForth")})})}else{if(a=="forthBack"){c.animate({left:"-=500"},e,"linear",function(){c.animate({left:"+=500"},e,"linear",function(){flyby($(this),e,"forthBack")})})}}}}}}}function randomFlyby(f){if(getInternetExplorerVersion()==-1){var g=["unicorn","blimp","pteradactyl"];var g=g[Math.floor(Math.random()*g.length)];var h=$("#"+g).height();var d=(f+windowHeight)-h;var e=f;var a=d-e+1;var j=Math.floor(Math.random()*a)+e;if(detectIsSafari()){var c=$(".feastHeight").offset().top;var b=$(".cheezHeight").offset().top;if(j>c-h&&j<c+365){j+=365+h}else{if(j>b-h&&j<b+394){j+=394+h}}}if(g=="unicorn"){$("#unicorn").css("display","block");$("#unicorn").addClass("animation");$("#unicorn").addClass("animation-active");$("#unicorn").css("top",j+"px");flyby($("#unicorn"),7000,"rtl")}else{if(g=="blimp"){$("#blimp").css("display","block");$("#blimp").addClass("animation");$("#blimp").addClass("animation-active");$("#blimp").css("top",j+"px");flyby($("#blimp"),25000,"rtl")}else{if(g=="pteradactyl"){$("#pteradactyl").css("display","block");$("#pteradactyl").addClass("animation");$("#pteradactyl").addClass("animation-active");$("#pteradactyl").css("top",j+"px");flyby($("#pteradactyl"),6000,"rtl")}}}}}function goToByScroll(a){$("html,body").animate({scrollTop:$("#"+a).offset().top},"slow")}function updateWindowHeight(a){windowHeight=$(window).height();$("#debug .window-height").text(windowHeight)}function updateWindowWidth(a){windowWidth=$(window).width();$("#debug .window-width").text(windowWidth)}function setUpAnimations(){$(".animation").each(function(){var a=new Object();a.element=this;a.yoffset=$(this).offset().top;a.bottom=a.yoffset+$(this).height();animations.push(a)})}function startAnimating(){animating=true;animationPulse=setTimeout(animate,framerate)}function stopAnimating(){animating=false}function animate(){if(animating){$(".animation-active").each(function(){var g=$(this).find(".animation-target");var e=$(this).find(".once");if($(this).find("loading-placeholder").size()==0){var j=$(g).width();var f=$(e).width();var a=parseInt($(g).parent().parent().find(".width").text());var b=parseInt($(e).parent().parent().find(".width").text());var h=$(g).css("left");var d=$(e).css("left");var c=b-f;$(g).each(function(){if(h.indexOf("px")){h=h.substr(0,h.indexOf("px"))}h=parseInt(h);var k=h-a;if(Math.abs(k)>=j){k=0}$(g).css("left",k+"px")});$(e).each(function(){if(d.indexOf("px")){d=d.substr(0,d.indexOf("px"))}d=parseInt(d);var k=d-b;if(Math.abs(k)>=f){k=c;$(this).parent().parent().removeClass("animation-active");$(this).addClass("final-frame")}$(e).css("left",k+"px")})}});animationPulse=setTimeout(animate,framerate)}}function updateScrollTop(a){lastPageY=pageY;pageY=$(window).scrollTop();if(!canvasLoaded&&$("#doodlePadCanvas").size()>0){prepareCanvas();canvasLoaded=true}if(!detectIsMobile()){if(pageY>=0&&pageY<456&&topIsActive==false){topIsActive=true;$("#spaceshipClick").css("display","none");$("#spaceshipClick img").removeClass("once");$("#spaceshipClick img").removeClass("final-frame");$("#spaceshipClick").removeClass("animation");$("#spaceshipClick").removeClass("animation-active");$("#spaceshipClick img").css("left",0+"px");$("#spaceshipReturn").css("display","none");$("#spaceshipReturn img").removeClass("once");$("#spaceshipReturn").removeClass("animation");$("#spaceshipReturn").removeClass("animation-active");$("#spaceshipRollover").css("display","block");$("#spaceshipRollover").addClass("animation-active");$("#twitter-bird").addClass("animation-active");$("#twitterHead marquee").trigger("start")}if(pageY>=456){topIsActive=false;clearTimeout(spaceshipTimeout);$("#spaceshipClick").css("display","none");$("#spaceshipClick img").removeClass("once");$("#spaceshipClick img").removeClass("final-frame");$("#spaceshipClick").removeClass("animation");$("#spaceshipClick").removeClass("animation-active");$("#spaceshipClick img").css("left",0+"px");$("#spaceshipReturn").css("display","none");$("#spaceshipReturn img").removeClass("once");$("#spaceshipReturn").removeClass("animation");$("#spaceshipReturn").removeClass("animation-active");$("#spaceshipRollover").css("display","block");$("#spaceshipRollover").removeClass("animation-active");$("#goatHoverActivate").css("display","block");$("#spaceshipRollover").css("display","block");$("#goatPlaceholder").css("display","block");$("#twitter-bird").removeClass("animation-active");$("#twitterHead marquee").trigger("stop")}if(pageY>220&&pageY<800&&climberIsActive==false){climberIsActive=true;climber();if(trackedClimber==false){trackEvent("Saw Climber","Saw Climber");trackedClimber=true}}if(pageY<=220||pageY>=800){climberIsActive=false;clearTimeout(climberTimeout);$("#climber").css("display","none");$("#climberUp").css("display","block");$("#climberUp").addClass("animation");$("#climberUp").addClass("animation-active");$("#climberDown").css("display","none");$("#climberDown").removeClass("animation");$("#climberDown").removeClass("animation-active");$("#climberDown img").removeClass("final-frame");$("#climberDown img").css("left",0+"px")}if(pageY>926&&pageY<2952&&dinosaurIsActive==false){dinosaurIsActive=true;$("#dinosaurIdle").addClass("animation");$("#dinosaurIdle").addClass("animation-active");dinoLaser();if(trackedDinosaur==false){trackEvent("Saw Dinosaur","Saw Dinosaur");trackedDinosaur=true}}if(pageY<=926||pageY>=2952){dinosaurIsActive=false;$("#dinosaurIdle").removeClass("animation");$("#dinosaurIdle").removeClass("animation-active");clearTimeout(dinosaurTimeout)}if(pageY>600&&pageY<2900&&jetpackIsActive==false){jetpackIsActive=true;$("#jetpack").addClass("animation-active");$("#speakerLeft").addClass("animation-active");$("#speakerRight").addClass("animation-active");var d=$("#jetpack").css("top");d=d.substr(0,d.indexOf("px"));var c=parseFloat(d);if(d<1230){jetpackDown()}if(d>=1230){jetpack()}}if(pageY<=600||pageY>=2900){jetpackIsActive=false;$("#jetpack").removeClass("animation-active");$("#speakerLeft").removeClass("animation-active");$("#speakerRight").removeClass("animation-active");if($("#feast_video").size()>0){$("#feast_video")[0].pause()}}if(pageY>2166&&pageY<3306&&teethAreActive==false){teethAreActive=true;$("#teeth1").addClass("animation-active");$("#teeth2").addClass("animation-active");$("#teeth3").addClass("animation-active");$("#teeth4").addClass("animation-active");$("#teeth5").addClass("animation-active")}if(pageY<=2166||pageY>=3306){teethAreActive=false;$("#teeth1").removeClass("animation-active");$("#teeth2").removeClass("animation-active");$("#teeth3").removeClass("animation-active");$("#teeth4").removeClass("animation-active");$("#teeth5").removeClass("animation-active")}if(pageY>3078&&pageY<3990&&painterIsActive==false){painterIsActive=true;$("#painter").addClass("animation-active")}if(pageY<=3078||pageY>=3990){painterIsActive=false;$("#painter").removeClass("animation-active")}if(pageY>3876&&pageY<5130&&whistleIsActive==false){whistleIsActive=true;$("#whistle").addClass("animation-active")}if(pageY<=3876||pageY>=5130){whistleIsActive=false;$("#whistle").removeClass("animation-active")}if(pageY>3876&&pageY<5130&&pipesAreActive==false){pipesAreActive=true;$("#pipes").addClass("animation-active");if($("#conveyor_video").size()>0){$("#conveyor_video")[0].play()}if($("#conveyorBackup").size()>0){var b=getFlashMovieObject("conveyorBackup");if(b!=undefined){if(b.nodeName.toLowerCase()!=="div"){getFlashMovieObject("conveyorBackup").playVideo()}}}}if(pageY<=3876||pageY>=5130){pipesAreActive=false;$("#pipes").removeClass("animation-active");if($("#conveyor_video").size()>0){$("#conveyor_video")[0].pause()}if($("#conveyorBackup").size()>0){var b=getFlashMovieObject("conveyorBackup");if(b!=undefined){if(b.nodeName.toLowerCase()!=="div"){getFlashMovieObject("conveyorBackup").pauseVideo()}}}}}}var feastTransition=false;function showFeastHelp(){if(!feastTransition){feastTransition=true;trackEvent("Got Feast Your Eyes Help","Got Feast Your Eyes Help");$("#feast-help").animate({bottom:"-40px"},500,"swing");$("#feast-close-help").animate({bottom:"10px"},500,"swing");$("#feast-instruction-slide").css("bottom","-400px");$("#feast-instruction-slide").animate({bottom:"0px"},500,"swing",function(){feastTransition=false})}}function closeFeastHelp(){if(!feastTransition){feastTransition=true;$("#feast-help").animate({bottom:"10px"},500,"swing");$("#feast-close-help").animate({bottom:"-40px"},500,"swing");$("#feast-instruction-slide").animate({bottom:"-400px"},500,"swing",function(){feastTransition=false});$("#feast-solution").animate({bottom:"-400px"},500,"swing",function(){feastTransition=false})}}function showFeastSolution(){if(!feastTransition){feastTransition=true;trackEvent("Got Feast Your Eyes Solution","Got Feast Your Eyes Solution");$("#feast-help").animate({bottom:"-40px"},500,"swing");$("#feast-close-help").animate({bottom:"10px"},500,"swing");$("#feast-instruction-slide").animate({bottom:"-400px"},500,"swing",function(){feastTransition=false});$("#feast-solution").animate({bottom:"0px"},500,"swing",function(){feastTransition=false})}};var currentProductSlide=1;function pSlideShow(b){$("#ProductHeaderPanel").css("display","none");$("#ProductDetailPanel").css("display","block");$("#ProductDetailPanel .prev").css("display","block");$("#ProductDetailPanel .next").css("display","block");$("#ProductSlides ."+b).css("display","block");$("#ProductSlides ."+b).addClass("active");var d=$("#ProductSlides .slide");for(var a=0;a<=d.length;a++){if($(d[a]).hasClass("active")){currentProductSlide=a+1}}var c=$("#"+b+" img").attr("alt");trackEvent("Clicked "+c,"Clicked "+c)}function nextpSlide(){currentProductSlide++;if(currentProductSlide>6){currentProductSlide=1}$("#ProductSlides .slide").removeClass("active").css("display","none");var b=$("#ProductSlides .slide");for(var a=0;a<=b.length;a++){if(a==currentProductSlide-1){$(b[a]).addClass("active").css("display","block")}}trackEvent("Product Navigation Next","Product Navigation Next")}function previouspSlide(){currentProductSlide--;if(currentProductSlide<1){currentProductSlide=6}$("#ProductSlides .slide").removeClass("active").css("display","none");var b=$("#ProductSlides .slide");for(var a=0;a<=b.length;a++){if(a==currentProductSlide-1){$(b[a]).addClass("active").css("display","block")}}trackEvent("Product Navigation Previous","Product Navigation Previous")}function ClosePOverlay(){$("#ProductHeaderPanel").css("display","block");$("#ProductDetailPanel").css("display","none");$("#ProductDetailPanel .prev").css("display","none");$("#ProductDetailPanel .next").css("display","none");var b=$("#ProductSlides .slide");for(var a=0;a<=b.length;a++){$(b[a]).removeClass("active").css("display","none")}};(function(window,undefined){var S={version:"3.0.3"};var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")>-1||ua.indexOf("win32")>-1){S.isWindows=true}else{if(ua.indexOf("macintosh")>-1||ua.indexOf("mac os x")>-1){S.isMac=true}else{if(ua.indexOf("linux")>-1){S.isLinux=true}}}S.isIE=ua.indexOf("msie")>-1;S.isIE6=ua.indexOf("msie 6")>-1;S.isIE7=ua.indexOf("msie 7")>-1;S.isGecko=ua.indexOf("gecko")>-1&&ua.indexOf("safari")==-1;S.isWebKit=ua.indexOf("applewebkit/")>-1;var inlineId=/#(.+)$/,galleryName=/^(light|shadow)box\[(.*?)\]/i,inlineParam=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,fileExtension=/[0-9a-z]+$/i,scriptPath=/(.+\/)shadowbox\.js/i;var open=false,initialized=false,lastOptions={},slideDelay=0,slideStart,slideTimer;S.current=-1;S.dimensions=null;S.ease=function(state){return 1+Math.pow(state-1,3)};S.errorInfo={fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}};S.gallery=[];S.onReady=noop;S.path=null;S.player=null;S.playerId="sb-player";S.options={animate:true,animateFade:true,autoplayMovies:true,continuous:false,enableKeys:true,flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",onChange:noop,onClose:noop,onFinish:noop,onOpen:noop,showMovieControls:true,skipSetup:false,slideshowDelay:0,viewportPadding:20};S.getCurrent=function(){return S.current>-1?S.gallery[S.current]:null};S.hasNext=function(){return S.gallery.length>1&&(S.current!=S.gallery.length-1||S.options.continuous)};S.isOpen=function(){return open};S.isPaused=function(){return slideTimer=="pause"};S.applyOptions=function(options){lastOptions=apply({},S.options);apply(S.options,options)};S.revertOptions=function(){apply(S.options,lastOptions)};S.init=function(options,callback){if(initialized){return}initialized=true;if(S.skin.options){apply(S.options,S.skin.options)}if(options){apply(S.options,options)}if(!S.path){var path,scripts=document.getElementsByTagName("script");for(var i=0,len=scripts.length;i<len;++i){path=scriptPath.exec(scripts[i].src);if(path){S.path=path[1];break}}}if(callback){S.onReady=callback}bindLoad()};S.open=function(obj){if(open){return}var gc=S.makeGallery(obj);S.gallery=gc[0];S.current=gc[1];obj=S.getCurrent();if(obj==null){return}S.applyOptions(obj.options||{});filterGallery();if(S.gallery.length){obj=S.getCurrent();if(S.options.onOpen(obj)===false){return}open=true;S.skin.onOpen(obj,load)}};S.close=function(){if(!open){return}open=false;if(S.player){S.player.remove();S.player=null}if(typeof slideTimer=="number"){clearTimeout(slideTimer);slideTimer=null}slideDelay=0;listenKeys(false);S.options.onClose(S.getCurrent());S.skin.onClose();S.revertOptions()};S.play=function(){if(!S.hasNext()){return}if(!slideDelay){slideDelay=S.options.slideshowDelay*1000}if(slideDelay){slideStart=now();slideTimer=setTimeout(function(){slideDelay=slideStart=0;S.next()},slideDelay);if(S.skin.onPlay){S.skin.onPlay()}}};S.pause=function(){if(typeof slideTimer!="number"){return}slideDelay=Math.max(0,slideDelay-(now()-slideStart));if(slideDelay){clearTimeout(slideTimer);slideTimer="pause";if(S.skin.onPause){S.skin.onPause()}}};S.change=function(index){if(!(index in S.gallery)){if(S.options.continuous){index=(index<0?S.gallery.length+index:0);if(!(index in S.gallery)){return}}else{return}}S.current=index;if(typeof slideTimer=="number"){clearTimeout(slideTimer);slideTimer=null;slideDelay=slideStart=0}S.options.onChange(S.getCurrent());load(true)};S.next=function(){S.change(S.current+1)};S.previous=function(){S.change(S.current-1)};S.setDimensions=function(height,width,maxHeight,maxWidth,topBottom,leftRight,padding,preserveAspect){var originalHeight=height,originalWidth=width;var extraHeight=2*padding+topBottom;if(height+extraHeight>maxHeight){height=maxHeight-extraHeight}var extraWidth=2*padding+leftRight;if(width+extraWidth>maxWidth){width=maxWidth-extraWidth}var changeHeight=(originalHeight-height)/originalHeight,changeWidth=(originalWidth-width)/originalWidth,oversized=(changeHeight>0||changeWidth>0);if(preserveAspect&&oversized){if(changeHeight>changeWidth){width=Math.round((originalWidth/originalHeight)*height)}else{if(changeWidth>changeHeight){height=Math.round((originalHeight/originalWidth)*width)}}}S.dimensions={height:height+topBottom,width:width+leftRight,innerHeight:height,innerWidth:width,top:Math.floor((maxHeight-(height+extraHeight))/2+padding),left:Math.floor((maxWidth-(width+extraWidth))/2+padding),oversized:oversized};return S.dimensions};S.makeGallery=function(obj){var gallery=[],current=-1;if(typeof obj=="string"){obj=[obj]}if(typeof obj.length=="number"){each(obj,function(i,o){if(o.content){gallery[i]=o}else{gallery[i]={content:o}}});current=0}else{if(obj.tagName){var cacheObj=S.getCache(obj);obj=cacheObj?cacheObj:S.makeObject(obj)}if(obj.gallery){gallery=[];var o;for(var key in S.cache){o=S.cache[key];if(o.gallery&&o.gallery==obj.gallery){if(current==-1&&o.content==obj.content){current=gallery.length}gallery.push(o)}}if(current==-1){gallery.unshift(obj);current=0}}else{gallery=[obj];current=0}}each(gallery,function(i,o){gallery[i]=apply({},o)});return[gallery,current]};S.makeObject=function(link,options){var obj={content:link.href,title:link.getAttribute("title")||"",link:link};if(options){options=apply({},options);each(["player","title","height","width","gallery"],function(i,o){if(typeof options[o]!="undefined"){obj[o]=options[o];delete options[o]}});obj.options=options}else{obj.options={}}if(!obj.player){obj.player=S.getPlayer(obj.content)}var rel=link.getAttribute("rel");if(rel){var match=rel.match(galleryName);if(match){obj.gallery=escape(match[2])}each(rel.split(";"),function(i,p){match=p.match(inlineParam);if(match){obj[match[1]]=match[2]}})}return obj};S.getPlayer=function(content){if(content.indexOf("#")>-1&&content.indexOf(document.location.href)==0){return"inline"}var q=content.indexOf("?");if(q>-1){content=content.substring(0,q)}var ext,m=content.match(fileExtension);if(m){ext=m[0].toLowerCase()}if(ext){if(S.img&&S.img.ext.indexOf(ext)>-1){return"img"}if(S.swf&&S.swf.ext.indexOf(ext)>-1){return"swf"}if(S.flv&&S.flv.ext.indexOf(ext)>-1){return"flv"}if(S.qt&&S.qt.ext.indexOf(ext)>-1){if(S.wmp&&S.wmp.ext.indexOf(ext)>-1){return"qtwmp"}else{return"qt"}}if(S.wmp&&S.wmp.ext.indexOf(ext)>-1){return"wmp"}}return"iframe"};function filterGallery(){var err=S.errorInfo,plugins=S.plugins,obj,remove,needed,m,format,replace,inlineEl,flashVersion;for(var i=0;i<S.gallery.length;++i){obj=S.gallery[i];remove=false;needed=null;switch(obj.player){case"flv":case"swf":if(!plugins.fla){needed="fla"}break;case"qt":if(!plugins.qt){needed="qt"}break;case"wmp":if(S.isMac){if(plugins.qt&&plugins.f4m){obj.player="qt"}else{needed="qtf4m"}}else{if(!plugins.wmp){needed="wmp"}}break;case"qtwmp":if(plugins.qt){obj.player="qt"}else{if(plugins.wmp){obj.player="wmp"}else{needed="qtwmp"}}break}if(needed){if(S.options.handleUnsupported=="link"){switch(needed){case"qtf4m":format="shared";replace=[err.qt.url,err.qt.name,err.f4m.url,err.f4m.name];break;case"qtwmp":format="either";replace=[err.qt.url,err.qt.name,err.wmp.url,err.wmp.name];break;default:format="single";replace=[err[needed].url,err[needed].name]}obj.player="html";obj.content='<div class="sb-message">'+sprintf(S.lang.errors[format],replace)+"</div>"}else{remove=true}}else{if(obj.player=="inline"){m=inlineId.exec(obj.content);if(m){inlineEl=get(m[1]);if(inlineEl){obj.content=inlineEl.innerHTML}else{remove=true}}else{remove=true}}else{if(obj.player=="swf"||obj.player=="flv"){flashVersion=(obj.options&&obj.options.flashVersion)||S.options.flashVersion;if(S.flash&&!S.flash.hasFlashPlayerVersion(flashVersion)){obj.width=310;obj.height=177}}}}if(remove){S.gallery.splice(i,1);if(i<S.current){--S.current}else{if(i==S.current){S.current=i>0?i-1:i}}--i}}}function listenKeys(on){if(!S.options.enableKeys){return}(on?addEvent:removeEvent)(document,"keydown",handleKey)}function handleKey(e){if(e.metaKey||e.shiftKey||e.altKey||e.ctrlKey){return}var code=keyCode(e),handler;switch(code){case 81:case 88:case 27:handler=S.close;break;case 37:handler=S.previous;break;case 39:handler=S.next;break;case 32:handler=typeof slideTimer=="number"?S.pause:S.play;break}if(handler){preventDefault(e);handler()}}function load(changing){listenKeys(false);var obj=S.getCurrent();var player=(obj.player=="inline"?"html":obj.player);if(typeof S[player]!="function"){throw"unknown player "+player}if(changing){S.player.remove();S.revertOptions();S.applyOptions(obj.options||{})}S.player=new S[player](obj,S.playerId);if(S.gallery.length>1){var next=S.gallery[S.current+1]||S.gallery[0];if(next.player=="img"){var a=new Image();a.src=next.content}var prev=S.gallery[S.current-1]||S.gallery[S.gallery.length-1];if(prev.player=="img"){var b=new Image();b.src=prev.content}}S.skin.onLoad(changing,waitReady)}function waitReady(){if(!open){return}if(typeof S.player.ready!="undefined"){var timer=setInterval(function(){if(open){if(S.player.ready){clearInterval(timer);timer=null;S.skin.onReady(show)}}else{clearInterval(timer);timer=null}},10)}else{S.skin.onReady(show)}}function show(){if(!open){return}S.player.append(S.skin.body,S.dimensions);S.skin.onShow(finish)}function finish(){if(!open){return}if(S.player.onLoad){S.player.onLoad()}S.options.onFinish(S.getCurrent());if(!S.isPaused()){S.play()}listenKeys(true)}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(obj,from){var len=this.length>>>0;from=from||0;if(from<0){from+=len}for(;from<len;++from){if(from in this&&this[from]===obj){return from}}return -1}}function now(){return(new Date).getTime()}function apply(original,extension){for(var property in extension){original[property]=extension[property]}return original}function each(obj,callback){var i=0,len=obj.length;for(var value=obj[0];i<len&&callback.call(value,i,value)!==false;value=obj[++i]){}}function sprintf(str,replace){return str.replace(/\{(\w+?)\}/g,function(match,i){return replace[i]})}function noop(){}function get(id){return document.getElementById(id)}function remove(el){el.parentNode.removeChild(el)}var supportsOpacity=true,supportsFixed=true;function checkSupport(){var body=document.body,div=document.createElement("div");supportsOpacity=typeof div.style.opacity==="string";div.style.position="fixed";div.style.margin=0;div.style.top="20px";body.appendChild(div,body.firstChild);supportsFixed=div.offsetTop==20;body.removeChild(div)}S.getStyle=(function(){var opacity=/opacity=([^)]*)/,getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle;return function(el,style){var ret;if(!supportsOpacity&&style=="opacity"&&el.currentStyle){ret=opacity.test(el.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret}if(getComputedStyle){var computedStyle=getComputedStyle(el,null);if(computedStyle){ret=computedStyle[style]}if(style=="opacity"&&ret==""){ret="1"}}else{ret=el.currentStyle[style]}return ret}})();S.appendHTML=function(el,html){if(el.insertAdjacentHTML){el.insertAdjacentHTML("BeforeEnd",html)}else{if(el.lastChild){var range=el.ownerDocument.createRange();range.setStartAfter(el.lastChild);var frag=range.createContextualFragment(html);el.appendChild(frag)}else{el.innerHTML=html}}};S.getWindowSize=function(dimension){if(document.compatMode==="CSS1Compat"){return document.documentElement["client"+dimension]}return document.body["client"+dimension]};S.setOpacity=function(el,opacity){var style=el.style;if(supportsOpacity){style.opacity=(opacity==1?"":opacity)}else{style.zoom=1;if(opacity==1){if(typeof style.filter=="string"&&(/alpha/i).test(style.filter)){style.filter=style.filter.replace(/\s*[\w\.]*alpha\([^\)]*\);?/gi,"")}}else{style.filter=(style.filter||"").replace(/\s*[\w\.]*alpha\([^\)]*\)/gi,"")+" alpha(opacity="+(opacity*100)+")"}}};S.clearOpacity=function(el){S.setOpacity(el,1)};function getTarget(e){var target=e.target?e.target:e.srcElement;return target.nodeType==3?target.parentNode:target}function getPageXY(e){var x=e.pageX||(e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y=e.pageY||(e.clientY+(document.documentElement.scrollTop||document.body.scrollTop));return[x,y]}function preventDefault(e){e.preventDefault()}function keyCode(e){return e.which?e.which:e.keyCode}function addEvent(el,type,handler){if(el.addEventListener){el.addEventListener(type,handler,false)}else{if(el.nodeType===3||el.nodeType===8){return}if(el.setInterval&&(el!==window&&!el.frameElement)){el=window}if(!handler.__guid){handler.__guid=addEvent.guid++}if(!el.events){el.events={}}var handlers=el.events[type];if(!handlers){handlers=el.events[type]={};if(el["on"+type]){handlers[0]=el["on"+type]}}handlers[handler.__guid]=handler;el["on"+type]=addEvent.handleEvent}}addEvent.guid=1;addEvent.handleEvent=function(event){var result=true;event=event||addEvent.fixEvent(((this.ownerDocument||this.document||this).parentWindow||window).event);var handlers=this.events[event.type];for(var i in handlers){this.__handleEvent=handlers[i];if(this.__handleEvent(event)===false){result=false}}return result};addEvent.preventDefault=function(){this.returnValue=false};addEvent.stopPropagation=function(){this.cancelBubble=true};addEvent.fixEvent=function(e){e.preventDefault=addEvent.preventDefault;e.stopPropagation=addEvent.stopPropagation;return e};function removeEvent(el,type,handler){if(el.removeEventListener){el.removeEventListener(type,handler,false)}else{if(el.events&&el.events[type]){delete el.events[type][handler.__guid]}}}var loaded=false,DOMContentLoaded;if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);S.load()}}else{if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);S.load()}}}}function doScrollCheck(){if(loaded){return}try{document.documentElement.doScroll("left")}catch(e){setTimeout(doScrollCheck,1);return}S.load()}function bindLoad(){if(document.readyState==="complete"){return S.load()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",S.load,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",S.load);var topLevel=false;try{topLevel=window.frameElement===null}catch(e){}if(document.documentElement.doScroll&&topLevel){doScrollCheck()}}}}S.load=function(){if(loaded){return}if(!document.body){return setTimeout(S.load,13)}loaded=true;checkSupport();S.onReady();if(!S.options.skipSetup){S.setup()}S.skin.init()};S.plugins={};if(navigator.plugins&&navigator.plugins.length){var names=[];each(navigator.plugins,function(i,p){names.push(p.name)});names=names.join(",");var f4m=names.indexOf("Flip4Mac")>-1;S.plugins={fla:names.indexOf("Shockwave Flash")>-1,qt:names.indexOf("QuickTime")>-1,wmp:!f4m&&names.indexOf("Windows Media")>-1,f4m:f4m}}else{var detectPlugin=function(name){var axo;try{axo=new ActiveXObject(name)}catch(e){}return !!axo};S.plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}}var relAttr=/^(light|shadow)box/i,expando="shadowboxCacheKey",cacheKey=1;S.cache={};S.select=function(selector){var links=[];if(!selector){var rel;each(document.getElementsByTagName("a"),function(i,el){rel=el.getAttribute("rel");if(rel&&relAttr.test(rel)){links.push(el)}})}else{var length=selector.length;if(length){if(typeof selector=="string"){if(S.find){links=S.find(selector)}}else{if(length==2&&typeof selector[0]=="string"&&selector[1].nodeType){if(S.find){links=S.find(selector[0],selector[1])}}else{for(var i=0;i<length;++i){links[i]=selector[i]}}}}else{links.push(selector)}}return links};S.setup=function(selector,options){each(S.select(selector),function(i,link){S.addCache(link,options)})};S.teardown=function(selector){each(S.select(selector),function(i,link){S.removeCache(link)})};S.addCache=function(link,options){var key=link[expando];if(key==undefined){key=cacheKey++;link[expando]=key;addEvent(link,"click",handleClick)}S.cache[key]=S.makeObject(link,options)};S.removeCache=function(link){removeEvent(link,"click",handleClick);delete S.cache[link[expando]];link[expando]=null};S.getCache=function(link){var key=link[expando];return(key in S.cache&&S.cache[key])};S.clearCache=function(){for(var key in S.cache){S.removeCache(S.cache[key].link)}S.cache={}};function handleClick(e){S.open(this);if(S.gallery.length){preventDefault(e)}}S.find=(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[]}if(!selector||typeof selector!=="string"){return results}var parts=[],m,set,checkSet,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift()}set=posProcess(selector,set)}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0]}if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,contextXML)}}else{checkSet=parts=[]}}if(!checkSet){checkSet=set}if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else{if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i])}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}}else{makeArray(checkSet,results)}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results)}return results};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}return results};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop===result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else{if(match===true){continue}}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else{if(pass){result.push(item);anyFound=true}}}}}if(found!==undefined){if(!inplace){curLoop=result}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[]}break}}}if(expr===old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr}else{break}}old=expr}return curLoop};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">":function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Sizzle.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[]}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem)}}else{if(inplace){curLoop[i]=false}}}}return false},ID:function(match){return match[1].replace(/\\/g,"")},TAG:function(match,curLoop){return match[1].toLowerCase()},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0}match[0]=done++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]}if(match[2]==="~="){match[4]=" "+match[4]+" "}return match},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop)}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret)}return false}}else{if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true}}return match},POS:function(match){match.unshift(true);return match}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"},disabled:function(elem){return elem.disabled===true},checked:function(elem){return elem.checked===true},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true},parent:function(elem){return !!elem.firstChild},empty:function(elem){return !elem.firstChild},has:function(elem,i,match){return !!Sizzle(match[3],elem).length},header:function(elem){return/h\d/i.test(elem.nodeName)},text:function(elem){return"text"===elem.type},radio:function(elem){return"radio"===elem.type},checkbox:function(elem){return"checkbox"===elem.type},file:function(elem){return"file"===elem.type},password:function(elem){return"password"===elem.type},submit:function(elem){return"submit"===elem.type},image:function(elem){return"image"===elem.type},reset:function(elem){return"reset"===elem.type},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button"},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName)}},setFilters:{first:function(elem,i){return i===0},last:function(elem,i,match,array){return i===array.length-1},even:function(elem,i){return i%2===0},odd:function(elem,i){return i%2===1},lt:function(elem,i,match){return i<match[3]-0},gt:function(elem,i,match){return i>match[3]-0},nth:function(elem,i,match){return match[3]-0===i},eq:function(elem,i,match){return match[3]-0===i}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array)}else{if(name==="contains"){return(elem.textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0}else{if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false}}return true}else{throw"Syntax error, unrecognized expression: "+name}}}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while((node=node.previousSibling)){if(node.nodeType===1){return false}}if(type==="first"){return true}node=elem;case"last":while((node=node.nextSibling)){if(node.nodeType===1){return false}}return true;case"nth":var first=match[2],last=match[3];if(first===1&&last===0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first===0){return diff===0}else{return(diff%first===0&&diff/first>=0)}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array)}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source)}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results}return array};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i])}}else{for(var i=0;array[i];i++){ret.push(array[i])}}}return ret}}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true}return a.compareDocumentPosition?-1:1}var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true}return ret}}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true}return a.sourceIndex?-1:1}var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true}return ret}}else{if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true}return a.ownerDocument?-1:1}var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}return ret}}}}function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue}else{if(elem.nodeType!==8){ret+=getText(elem.childNodes)}}}return ret}(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match}}root.removeChild(form);root=form=null})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i])}}results=tmp}return results}}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)}}div=null})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return}Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)}catch(e){}}return oldSizzle(query,context,extra,seed)};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop]}div=null})()}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return}div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}};div=null})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName.toLowerCase()===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i}if(typeof cur!=="string"){if(elem===cur){match=true;break}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;break}}}elem=elem[dir]}checkSet[i]=match}}}var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};var isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"")}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet)}return Sizzle.filter(later,tmpSet)};return Sizzle})();S.flash=(function(){var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return}addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src=//:></script>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState)}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return}if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return}}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id)}else{win.attachEvent("onload",function(){removeObjectInIE(id)})}}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return}var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return}var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return}widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){att[i]=attObj[i]}}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j]}}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]}else{par.flashvars=k+"="+flashvarsObj[k]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr)}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q)}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();return swfobject})();S.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};var pre,proxyId="sb-drag-proxy",dragData,dragProxy,dragTarget;function resetDrag(){dragData={x:0,y:0,startX:null,startY:null}}function updateProxy(){var dims=S.dimensions;apply(dragProxy.style,{height:dims.innerHeight+"px",width:dims.innerWidth+"px"})}function enableDrag(){resetDrag();var style=["position:absolute","cursor:"+(S.isGecko?"-moz-grab":"move"),"background-color:"+(S.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");S.appendHTML(S.skin.body,'<div id="'+proxyId+'" style="'+style+'"></div>');dragProxy=get(proxyId);updateProxy();addEvent(dragProxy,"mousedown",startDrag)}function disableDrag(){if(dragProxy){removeEvent(dragProxy,"mousedown",startDrag);remove(dragProxy);dragProxy=null}dragTarget=null}function startDrag(e){preventDefault(e);var xy=getPageXY(e);dragData.startX=xy[0];dragData.startY=xy[1];dragTarget=get(S.player.id);addEvent(document,"mousemove",positionDrag);addEvent(document,"mouseup",endDrag);if(S.isGecko){dragProxy.style.cursor="-moz-grabbing"}}function positionDrag(e){var player=S.player,dims=S.dimensions,xy=getPageXY(e);var moveX=xy[0]-dragData.startX;dragData.startX+=moveX;dragData.x=Math.max(Math.min(0,dragData.x+moveX),dims.innerWidth-player.width);var moveY=xy[1]-dragData.startY;dragData.startY+=moveY;dragData.y=Math.max(Math.min(0,dragData.y+moveY),dims.innerHeight-player.height);apply(dragTarget.style,{left:dragData.x+"px",top:dragData.y+"px"})}function endDrag(){removeEvent(document,"mousemove",positionDrag);removeEvent(document,"mouseup",endDrag);if(S.isGecko){dragProxy.style.cursor="-moz-grab"}}S.img=function(obj,id){this.obj=obj;this.id=id;this.ready=false;var self=this;pre=new Image();pre.onload=function(){self.height=obj.height?parseInt(obj.height,10):pre.height;self.width=obj.width?parseInt(obj.width,10):pre.width;self.ready=true;pre.onload=null;pre=null};pre.src=obj.content};S.img.ext=["bmp","gif","jpg","jpeg","png"];S.img.prototype={append:function(body,dims){var img=document.createElement("img");img.id=this.id;img.src=this.obj.content;img.style.position="absolute";var height,width;if(dims.oversized&&S.options.handleOversize=="resize"){height=dims.innerHeight;width=dims.innerWidth}else{height=this.height;width=this.width}img.setAttribute("height",height);img.setAttribute("width",width);body.appendChild(img)},remove:function(){var el=get(this.id);if(el){remove(el)}disableDrag();if(pre){pre.onload=null;pre=null}},onLoad:function(){var dims=S.dimensions;if(dims.oversized&&S.options.handleOversize=="drag"){enableDrag()}},onWindowResize:function(){var dims=S.dimensions;switch(S.options.handleOversize){case"resize":var el=get(this.id);el.height=dims.innerHeight;el.width=dims.innerWidth;break;case"drag":if(dragTarget){var top=parseInt(S.getStyle(dragTarget,"top")),left=parseInt(S.getStyle(dragTarget,"left"));if(top+this.height<dims.innerHeight){dragTarget.style.top=dims.innerHeight-this.height+"px"}if(left+this.width<dims.innerWidth){dragTarget.style.left=dims.innerWidth-this.width+"px"}updateProxy()}break}}};S.iframe=function(obj,id){this.obj=obj;this.id=id;var overlay=get("sb-overlay");this.height=obj.height?parseInt(obj.height,10):overlay.offsetHeight;this.width=obj.width?parseInt(obj.width,10):overlay.offsetWidth};S.iframe.prototype={append:function(body,dims){var html='<iframe id="'+this.id+'" name="'+this.id+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" style="visibility:hidden" onload="this.style.visibility=\'visible\'" scrolling="auto"';if(S.isIE){html+=' allowtransparency="true"';if(S.isIE6){html+=" src=\"javascript:false;document.write('');\""}}html+="></iframe>";body.innerHTML=html},remove:function(){var el=get(this.id);if(el){remove(el);if(S.isGecko){delete window.frames[this.id]}}},onLoad:function(){var win=S.isIE?get(this.id).contentWindow:window.frames[this.id];win.location.href=this.obj.content}};S.html=function(obj,id){this.obj=obj;this.id=id;this.height=obj.height?parseInt(obj.height,10):300;this.width=obj.width?parseInt(obj.width,10):500};S.html.prototype={append:function(body,dims){var div=document.createElement("div");div.id=this.id;div.className="html";div.innerHTML=this.obj.content;body.appendChild(div)},remove:function(){var el=get(this.id);if(el){remove(el)}}};S.swf=function(obj,id){this.obj=obj;this.id=id;this.height=obj.height?parseInt(obj.height,10):300;this.width=obj.width?parseInt(obj.width,10):300};S.swf.ext=["swf"];S.swf.prototype={append:function(body,dims){var tmp=document.createElement("div");tmp.id=this.id;body.appendChild(tmp);var height=dims.innerHeight,width=dims.innerWidth,swf=this.obj.content,version=S.options.flashVersion,express=S.path+"expressInstall.swf",flashvars=S.options.flashVars,params=S.options.flashParams;S.flash.embedSWF(swf,this.id,width,height,version,express,flashvars,params)},remove:function(){S.flash.expressInstallCallback();S.flash.removeSWF(this.id)},onWindowResize:function(){var dims=S.dimensions,el=get(this.id);el.height=dims.innerHeight;el.width=dims.innerWidth}};var jwControllerHeight=20;S.flv=function(obj,id){this.obj=obj;this.id=id;this.height=obj.height?parseInt(obj.height,10):300;if(S.options.showMovieControls){this.height+=jwControllerHeight}this.width=obj.width?parseInt(obj.width,10):300};S.flv.ext=["flv","m4v"];S.flv.prototype={append:function(body,dims){var tmp=document.createElement("div");tmp.id=this.id;body.appendChild(tmp);var height=dims.innerHeight,width=dims.innerWidth,swf=S.path+"player.swf",version=S.options.flashVersion,express=S.path+"expressInstall.swf",flashvars=apply({file:this.obj.content,height:height,width:width,autostart:(S.options.autoplayMovies?"true":"false"),controlbar:(S.options.showMovieControls?"bottom":"none"),backcolor:"0x000000",frontcolor:"0xCCCCCC",lightcolor:"0x557722"},S.options.flashVars),params=S.options.flashParams;S.flash.embedSWF(swf,this.id,width,height,version,express,flashvars,params)},remove:function(){S.flash.expressInstallCallback();S.flash.removeSWF(this.id)},onWindowResize:function(){var dims=S.dimensions,el=get(this.id);el.height=dims.innerHeight;el.width=dims.innerWidth}};var qtControllerHeight=16;S.qt=function(obj,id){this.obj=obj;this.id=id;this.height=obj.height?parseInt(obj.height,10):300;if(S.options.showMovieControls){this.height+=qtControllerHeight}this.width=obj.width?parseInt(obj.width,10):300};S.qt.ext=["dv","mov","moov","movie","mp4","avi","mpg","mpeg"];S.qt.prototype={append:function(body,dims){var opt=S.options,autoplay=String(opt.autoplayMovies),controls=String(opt.showMovieControls);var html="<object",movie={id:this.id,name:this.id,height:this.height,width:this.width,kioskmode:"true"};if(S.isIE){movie.classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";movie.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"}else{movie.type="video/quicktime";movie.data=this.obj.content}for(var m in movie){html+=" "+m+'="'+movie[m]+'"'}html+=">";var params={src:this.obj.content,scale:"aspect",controller:controls,autoplay:autoplay};for(var p in params){html+='<param name="'+p+'" value="'+params[p]+'">'}html+="</object>";body.innerHTML=html},remove:function(){try{document[this.id].Stop()}catch(e){}var el=get(this.id);if(el){remove(el)}}};var wmpControllerHeight=(S.isIE?70:45);S.wmp=function(obj,id){this.obj=obj;this.id=id;this.height=obj.height?parseInt(obj.height,10):300;if(S.options.showMovieControls){this.height+=wmpControllerHeight}this.width=obj.width?parseInt(obj.width,10):300};S.wmp.ext=["asf","avi","mpg","mpeg","wm","wmv"];S.wmp.prototype={append:function(body,dims){var opt=S.options,autoplay=opt.autoplayMovies?1:0;var movie='<object id="'+this.id+'" name="'+this.id+'" height="'+this.height+'" width="'+this.width+'"',params={autostart:opt.autoplayMovies?1:0};if(S.isIE){movie+=' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"';params.url=this.obj.content;params.uimode=opt.showMovieControls?"full":"none"}else{movie+=' type="video/x-ms-wmv"';movie+=' data="'+this.obj.content+'"';params.showcontrols=opt.showMovieControls?1:0}movie+=">";for(var p in params){movie+='<param name="'+p+'" value="'+params[p]+'">'}movie+="</object>";body.innerHTML=movie},remove:function(){if(S.isIE){try{window[this.id].controls.stop();window[this.id].URL="movie"+now()+".wmv";window[this.id]=function(){}}catch(e){}}var el=get(this.id);if(el){setTimeout(function(){remove(el)},10)}}};var overlayOn=false,visibilityCache=[],pngIds=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],container,overlay,wrapper,doWindowResize=true;function animate(el,property,to,duration,callback){var isOpacity=(property=="opacity"),anim=isOpacity?S.setOpacity:function(el,value){el.style[property]=""+value+"px"};if(duration==0||(!isOpacity&&!S.options.animate)||(isOpacity&&!S.options.animateFade)){anim(el,to);if(callback){callback()}return}var from=parseFloat(S.getStyle(el,property))||0;var delta=to-from;if(delta==0){if(callback){callback()}return}duration*=1000;var begin=now(),ease=S.ease,end=begin+duration,time;var interval=setInterval(function(){time=now();if(time>=end){clearInterval(interval);interval=null;anim(el,to);if(callback){callback()}}else{anim(el,from+ease((time-begin)/duration)*delta)}},10)}function setSize(){container.style.height=S.getWindowSize("Height")+"px";container.style.width=S.getWindowSize("Width")+"px"}function setPosition(){container.style.top=document.documentElement.scrollTop+"px";container.style.left=document.documentElement.scrollLeft+"px"}function toggleTroubleElements(on){if(on){each(visibilityCache,function(i,el){el[0].style.visibility=el[1]||""})}else{visibilityCache=[];each(S.options.troubleElements,function(i,tag){each(document.getElementsByTagName(tag),function(j,el){visibilityCache.push([el,el.style.visibility]);el.style.visibility="hidden"})})}}function toggleNav(id,on){var el=get("sb-nav-"+id);if(el){el.style.display=on?"":"none"}}function toggleLoading(on,callback){var loading=get("sb-loading"),playerName=S.getCurrent().player,anim=(playerName=="img"||playerName=="html");if(on){S.setOpacity(loading,0);loading.style.display="block";var wrapped=function(){S.clearOpacity(loading);if(callback){callback()}};if(anim){animate(loading,"opacity",1,S.options.fadeDuration,wrapped)}else{wrapped()}}else{var wrapped=function(){loading.style.display="none";S.clearOpacity(loading);if(callback){callback()}};if(anim){animate(loading,"opacity",0,S.options.fadeDuration,wrapped)}else{wrapped()}}}function buildBars(callback){var obj=S.getCurrent();get("sb-title-inner").innerHTML=obj.title||"";var close,next,play,pause,previous;if(S.options.displayNav){close=true;var len=S.gallery.length;if(len>1){if(S.options.continuous){next=previous=true}else{next=(len-1)>S.current;previous=S.current>0}}if(S.options.slideshowDelay>0&&S.hasNext()){pause=!S.isPaused();play=!pause}}else{close=next=play=pause=previous=false}toggleNav("close",close);toggleNav("next",next);toggleNav("play",play);toggleNav("pause",pause);toggleNav("previous",previous);var counter="";if(S.options.displayCounter&&S.gallery.length>1){var len=S.gallery.length;if(S.options.counterType=="skip"){var i=0,end=len,limit=parseInt(S.options.counterLimit)||0;if(limit<len&&limit>2){var h=Math.floor(limit/2);i=S.current-h;if(i<0){i+=len}end=S.current+(limit-h);if(end>len){end-=len}}while(i!=end){if(i==len){i=0}counter+='<a onclick="Shadowbox.change('+i+');"';if(i==S.current){counter+=' class="sb-counter-current"'}counter+=">"+(++i)+"</a>"}}else{counter=[S.current+1,S.lang.of,len].join(" ")}}get("sb-counter").innerHTML=counter;callback()}function showBars(callback){var titleInner=get("sb-title-inner"),infoInner=get("sb-info-inner"),duration=0.35;titleInner.style.visibility=infoInner.style.visibility="";if(titleInner.innerHTML!=""){animate(titleInner,"marginTop",0,duration)}animate(infoInner,"marginTop",0,duration,callback)}function hideBars(anim,callback){var title=get("sb-title"),info=get("sb-info"),titleHeight=title.offsetHeight,infoHeight=info.offsetHeight,titleInner=get("sb-title-inner"),infoInner=get("sb-info-inner"),duration=(anim?0.35:0);animate(titleInner,"marginTop",titleHeight,duration);animate(infoInner,"marginTop",infoHeight*-1,duration,function(){titleInner.style.visibility=infoInner.style.visibility="hidden";callback()})}function adjustHeight(height,top,anim,callback){var wrapperInner=get("sb-wrapper-inner"),duration=(anim?S.options.resizeDuration:0);animate(wrapper,"top",top,duration);animate(wrapperInner,"height",height,duration,callback)}function adjustWidth(width,left,anim,callback){var duration=(anim?S.options.resizeDuration:0);animate(wrapper,"left",left,duration);animate(wrapper,"width",width,duration,callback)}function setDimensions(height,width){var bodyInner=get("sb-body-inner"),height=parseInt(height),width=parseInt(width),topBottom=wrapper.offsetHeight-bodyInner.offsetHeight,leftRight=wrapper.offsetWidth-bodyInner.offsetWidth,maxHeight=overlay.offsetHeight,maxWidth=overlay.offsetWidth,padding=parseInt(S.options.viewportPadding)||20,preserveAspect=(S.player&&S.options.handleOversize!="drag");return S.setDimensions(height,width,maxHeight,maxWidth,topBottom,leftRight,padding,preserveAspect)}var K={};K.markup='<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-wrapper-inner"><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><div id="sb-loading-inner"><span>{loading}</span></div></div></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div></div></div></div></div>';K.options={animSequence:"sync",counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.5,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]};K.init=function(){S.appendHTML(document.body,sprintf(K.markup,S.lang));K.body=get("sb-body-inner");container=get("sb-container");overlay=get("sb-overlay");wrapper=get("sb-wrapper");if(!supportsFixed){container.style.position="absolute"}if(!supportsOpacity){var el,m,re=/url\("(.*\.png)"\)/;each(pngIds,function(i,id){el=get(id);if(el){m=S.getStyle(el,"backgroundImage").match(re);if(m){el.style.backgroundImage="none";el.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+m[1]+",sizingMethod=scale);"}}})}var timer;addEvent(window,"resize",function(){if(timer){clearTimeout(timer);timer=null}if(open){timer=setTimeout(K.onWindowResize,10)}})};K.onOpen=function(obj,callback){doWindowResize=false;container.style.display="block";setSize();var dims=setDimensions(S.options.initialHeight,S.options.initialWidth);adjustHeight(dims.innerHeight,dims.top);adjustWidth(dims.width,dims.left);if(S.options.showOverlay){overlay.style.backgroundColor=S.options.overlayColor;S.setOpacity(overlay,0);if(!S.options.modal){addEvent(overlay,"click",S.close)}overlayOn=true}if(!supportsFixed){setPosition();addEvent(window,"scroll",setPosition)}toggleTroubleElements();container.style.visibility="visible";if(overlayOn){animate(overlay,"opacity",S.options.overlayOpacity,S.options.fadeDuration,callback)}else{callback()}};K.onLoad=function(changing,callback){toggleLoading(true);while(K.body.firstChild){remove(K.body.firstChild)}hideBars(changing,function(){if(!open){return}if(!changing){wrapper.style.visibility="visible"}buildBars(callback)})};K.onReady=function(callback){if(!open){return}var player=S.player,dims=setDimensions(player.height,player.width);var wrapped=function(){showBars(callback)};switch(S.options.animSequence){case"hw":adjustHeight(dims.innerHeight,dims.top,true,function(){adjustWidth(dims.width,dims.left,true,wrapped)});break;case"wh":adjustWidth(dims.width,dims.left,true,function(){adjustHeight(dims.innerHeight,dims.top,true,wrapped)});break;default:adjustWidth(dims.width,dims.left,true);adjustHeight(dims.innerHeight,dims.top,true,wrapped)}};K.onShow=function(callback){toggleLoading(false,callback);doWindowResize=true};K.onClose=function(){if(!supportsFixed){removeEvent(window,"scroll",setPosition)}removeEvent(overlay,"click",S.close);wrapper.style.visibility="hidden";var callback=function(){container.style.visibility="hidden";container.style.display="none";toggleTroubleElements(true)};if(overlayOn){animate(overlay,"opacity",0,S.options.fadeDuration,callback)}else{callback()}};K.onPlay=function(){toggleNav("play",false);toggleNav("pause",true)};K.onPause=function(){toggleNav("pause",false);toggleNav("play",true)};K.onWindowResize=function(){if(!doWindowResize){return}setSize();var player=S.player,dims=setDimensions(player.height,player.width);adjustWidth(dims.width,dims.left);adjustHeight(dims.innerHeight,dims.top);if(player.onWindowResize){player.onWindowResize()}};S.skin=K;window.Shadowbox=S})(window);function css_browser_selector(l){var n=l.toLowerCase(),f=function(b){return n.indexOf(b)>-1},d="gecko",p="webkit",k="safari",j="opera",i="mobile",e=document.documentElement,a=[(!(/opera|webtv/i.test(n))&&/msie\s(\d)/.test(n))?("ie ie"+RegExp.$1):f("firefox/2")?d+" ff2":f("firefox/3.5")?d+" ff3 ff3_5":f("firefox/3.6")?d+" ff3 ff3_6":f("firefox/3")?d+" ff3":f("gecko/")?d:f("opera")?j+(/version\/(\d+)/.test(n)?" "+j+RegExp.$1:(/opera(\s|\/)(\d+)/.test(n)?" "+j+RegExp.$2:"")):f("konqueror")?"konqueror":f("blackberry")?i+" blackberry":f("android")?i+" android":f("chrome")?p+" chrome":f("iron")?p+" iron":f("applewebkit/")?p+" "+k+(/version\/(\d+)/.test(n)?" "+k+RegExp.$1:""):f("mozilla/")?d:"",f("j2me")?i+" j2me":f("iphone")?i+" iphone":f("ipod")?i+" ipod":f("ipad")?i+" ipad":f("mac")?"mac":f("darwin")?"mac":f("webtv")?"webtv":f("win")?"win"+(f("windows nt 6.0")?" vista":""):f("freebsd")?"freebsd":(f("x11")||f("linux"))?"linux":"","js"];c=a.join(" ");e.className+=" "+c;return c}css_browser_selector(navigator.userAgent);
