function cuselScrollToCurent(f){var e=null;if(f.find(".cuselOptHover").eq(0).is("span")){e=f.find(".cuselOptHover").eq(0)}else{if(f.find(".cuselActive").eq(0).is("span")){e=f.find(".cuselActive").eq(0)}}if(f.find(".jScrollPaneTrack").eq(0).is("div")&&e){var h=e.position(),g=f.find(".cusel-scroll-pane").eq(0).attr("id");jQuery("#"+g)[0].scrollTo(h.top)}}function cuselShowList(e){var d=e.parent(".cusel");if(e.css("display")=="none"){$(".cusel-scroll-wrap").css("display","none");d.addClass("cuselOpen");e.css("display","block");var f=false;if(d.prop("class").indexOf("cuselScrollArrows")!=-1){f=true}if(!e.find(".jScrollPaneContainer").eq(0).is("div")){e.find("div").eq(0).jScrollPaneCusel({showArrows:f})}cuselScrollToCurent(e)}else{e.css("display","none");d.removeClass("cuselOpen")}}function cuSelRefresh(j){var h=j.refreshEl.split(","),o=h.length,n;for(n=0;n<o;n++){var m=jQuery(h[n]).parents(".cusel").find(".cusel-scroll-wrap").eq(0);m.find(".cusel-scroll-pane").jScrollPaneRemoveCusel();m.css({visibility:"hidden",display:"block"});var l=m.find("span"),k=l.eq(0).outerHeight();if(l.length>j.visRows){m.css({height:k*j.visRows+"px",display:"none",visibility:"visible"}).children(".cusel-scroll-pane").css("height",k*j.visRows+"px")}else{m.css({display:"none",visibility:"visible"})}}}function cuSel(d){function c(){jQuery("html").unbind("click");jQuery("html").click(function(h){var g=jQuery(h.target),m=g.attr("id"),l=g.prop("class");if((l.indexOf("cuselText")!=-1||l.indexOf("cuselFrameRight")!=-1)&&g.parent().prop("class").indexOf("classDisCusel")==-1){var k=g.parent().find(".cusel-scroll-wrap").eq(0);cuselShowList(k)}else{if(l.indexOf("cusel")!=-1&&l.indexOf("classDisCusel")==-1&&g.is("div")){var k=g.find(".cusel-scroll-wrap").eq(0);cuselShowList(k)}else{if(g.is(".cusel-scroll-wrap span")&&l.indexOf("cuselActive")==-1){var j;g.attr("val")==undefined?j=g.text():j=g.attr("val");g.parents(".cusel-scroll-wrap").find(".cuselActive").eq(0).removeClass("cuselActive").end().parents(".cusel-scroll-wrap").next().val(j).end().prev().text(g.text()).end().css("display","none").parent(".cusel").removeClass("cuselOpen");g.addClass("cuselActive");g.parents(".cusel-scroll-wrap").find(".cuselOptHover").removeClass("cuselOptHover");if(l.indexOf("cuselActive")==-1){g.parents(".cusel").find(".cusel-scroll-wrap").eq(0).next("input").change()}}else{if(g.parents(".cusel-scroll-wrap").is("div")){return}else{jQuery(".cusel-scroll-wrap").css("display","none").parent(".cusel").removeClass("cuselOpen")}}}}});jQuery(".cusel").unbind("keydown");jQuery(".cusel").keydown(function(t){var s,r;if(window.event){s=window.event.keyCode}else{if(t){s=t.which}}if(s==null||s==0||s==9){return true}if(jQuery(this).prop("class").indexOf("classDisCusel")!=-1){return false}if(s==40){var q=jQuery(this).find(".cuselOptHover").eq(0);if(!q.is("span")){var p=jQuery(this).find(".cuselActive").eq(0)}else{var p=q}var o=p.next();if(o.is("span")){jQuery(this).find(".cuselText").eq(0).text(o.text());p.removeClass("cuselOptHover");o.addClass("cuselOptHover");$(this).find("input").eq(0).val(o.attr("val"));cuselScrollToCurent($(this).find(".cusel-scroll-wrap").eq(0));return false}else{return false}}if(s==38){var q=$(this).find(".cuselOptHover").eq(0);if(!q.is("span")){var p=$(this).find(".cuselActive").eq(0)}else{var p=q}cuselActivePrev=p.prev();if(cuselActivePrev.is("span")){$(this).find(".cuselText").eq(0).text(cuselActivePrev.text());p.removeClass("cuselOptHover");cuselActivePrev.addClass("cuselOptHover");$(this).find("input").eq(0).val(cuselActivePrev.attr("val"));cuselScrollToCurent($(this).find(".cusel-scroll-wrap").eq(0));return false}else{return false}}if(s==27){var n=$(this).find(".cuselActive").eq(0).text();$(this).removeClass("cuselOpen").find(".cusel-scroll-wrap").eq(0).css("display","none").end().find(".cuselOptHover").eq(0).removeClass("cuselOptHover");$(this).find(".cuselText").eq(0).text(n)}if(s==13){var m=$(this).find(".cuselOptHover").eq(0);if(m.is("span")){$(this).find(".cuselActive").removeClass("cuselActive");m.addClass("cuselActive")}else{var l=$(this).find(".cuselActive").attr("val")}$(this).removeClass("cuselOpen").find(".cusel-scroll-wrap").eq(0).css("display","none").end().find(".cuselOptHover").eq(0).removeClass("cuselOptHover");$(this).find("input").eq(0).change()}if(s==32&&$.browser.opera){var k=$(this).find(".cusel-scroll-wrap").eq(0);cuselShowList(k)}if($.browser.opera){return false}});var b=[];jQuery(".cusel").keypress(function(a){function h(){var e=[];for(var t in b){if(window.event){e[t]=b[t].keyCode}else{if(b[t]){e[t]=b[t].which}}e[t]=String.fromCharCode(e[t]).toUpperCase()}var s=jQuery(k).find("span"),r=s.length,q,p;for(q=0;q<r;q++){var o=true;for(var n in b){p=s.eq(q).text().charAt(n).toUpperCase();if(p!=e[n]){o=false}}if(o){jQuery(k).find(".cuselOptHover").removeClass("cuselOptHover").end().find("span").eq(q).addClass("cuselOptHover").end().end().find(".cuselText").eq(0).text(s.eq(q).text());cuselScrollToCurent($(k).find(".cusel-scroll-wrap").eq(0));b=b.splice;b=[];break;return true}}b=b.splice;b=[]}var m,l;if(window.event){m=window.event.keyCode}else{if(a){m=a.which}}if(m==null||m==0||m==9){return true}if(jQuery(this).prop("class").indexOf("classDisCusel")!=-1){return false}var k=this;b.push(a);clearTimeout(jQuery.data(this,"timer"));var j=setTimeout(function(){h()},500);jQuery(this).data("timer",j);if(jQuery.browser.opera&&window.event.keyCode!=9){return false}})}jQuery(d.changedEl).each(function(U){var T=jQuery(this),S=T.outerWidth(),R=T.prop("class"),Q=T.prop("id"),P=T.prop("name"),O=T.val(),N=T.find("option[value='"+O+"']").eq(0),M=N.text(),L=T.prop("disabled"),K=d.scrollArrows,J=T.prop("onchange"),I=T.prop("tabindex"),H=T.prop("multiple");if(!Q||H){return false}if(!L){classDisCuselText="",classDisCusel=""}else{classDisCuselText="classDisCuselLabel";classDisCusel="classDisCusel"}if(K){classDisCusel+=" cuselScrollArrows"}N.addClass("cuselActive");var G=T.html(),F=G.replace(/option/ig,"span").replace(/value=/ig,"val=");if($.browser.msie&&parseInt($.browser.version)<9){var E=/(val=)(.*?)(>)/g;F=F.replace(E,"$1'$2'$3")}var D='<div class="cusel '+R+" "+classDisCusel+'" id=cuselFrame-'+Q+' style="width:'+S+'px" tabindex="'+I+'"><div class="cuselFrameRight"></div><div class="cuselText">'+M+'</div><div class="cusel-scroll-wrap"><div class="cusel-scroll-pane" id="cusel-scroll-'+Q+'">'+F+'</div></div><input type="hidden" id="'+Q+'" name="'+P+'" value="'+O+'" /></div>';T.replaceWith(D);if(J){jQuery("#"+Q).bind("change",J)}var C=jQuery("#cuselFrame-"+Q),B=C.find("span"),A;if(!B.eq(0).text()){A=B.eq(1).innerHeight();B.eq(0).css("height",B.eq(1).height())}else{A=B.eq(0).innerHeight()}if(B.length>d.visRows){C.find(".cusel-scroll-wrap").eq(0).css({height:A*d.visRows+"px",display:"none",visibility:"visible"}).children(".cusel-scroll-pane").css("height",A*d.visRows+"px")}else{C.find(".cusel-scroll-wrap").eq(0).css({display:"none",visibility:"visible"})}var b=jQuery("#cusel-scroll-"+Q).find("span[addTags]"),a=b.length;for(i=0;i<a;i++){b.eq(i).append(b.eq(i).attr("addTags")).removeAttr("addTags")}c()});jQuery(".cusel").focus(function(){jQuery(this).addClass("cuselFocus")});jQuery(".cusel").blur(function(){jQuery(this).removeClass("cuselFocus")});jQuery(".cusel").hover(function(){jQuery(this).addClass("cuselFocus")},function(){jQuery(this).removeClass("cuselFocus")})}(function(b){b.jScrollPaneCusel={active:[]};b.fn.jScrollPaneCusel=function(a){a=b.extend({},b.fn.jScrollPaneCusel.defaults,a);var d=function(){return false};return this.each(function(){var aW=b(this);var aV=this.parentNode.offsetWidth;aW.css("overflow","hidden");var aU=this;if(b(this).parent().is(".jScrollPaneContainer")){var aT=a.maintainPosition?aW.position().top:0;var aS=b(this).parent();var aR=aV;var aQ=aS.outerHeight();var aP=aQ;b(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",aS).remove();aW.css({top:0})}else{var aT=0;this.originalPadding=aW.css("paddingTop")+" "+aW.css("paddingRight")+" "+aW.css("paddingBottom")+" "+aW.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(aW.css("paddingLeft"))||0)+(parseInt(aW.css("paddingRight"))||0);var aR=aV;var aQ=aW.innerHeight();var aP=aQ;aW.wrap("<div class='jScrollPaneContainer'></div>").parent().css({height:aQ+"px",width:aR+"px"});if(!window.navigator.userProfile){var aO=parseInt(b(this).parent().css("border-left-width"))+parseInt(b(this).parent().css("border-right-width"));aR-=aO;b(this).css("width",aR+"px").parent().css("width",aR+"px")}b(document).bind("emchange",function(f,h,g){aW.jScrollPaneCusel(a)})}if(a.reinitialiseOnImageLoad){var aN=b.data(aU,"jScrollPaneImagesToLoad")||b("img",aW);var aM=[];if(aN.length){aN.each(function(g,f){b(this).bind("load",function(){if(b.inArray(g,aM)==-1){aM.push(f);aN=b.grep(aN,function(h,e){return h!=f});b.data(aU,"jScrollPaneImagesToLoad",aN);a.reinitialiseOnImageLoad=false;aW.jScrollPaneCusel(a)}}).each(function(h,e){if(this.complete||this.complete===undefined){this.src=this.src}})})}}var aL=this.originalSidePaddingTotal;var aK={height:"auto",width:aR-a.scrollbarWidth-a.scrollbarMargin-aL+"px"};if(a.scrollbarOnLeft){aK.paddingLeft=a.scrollbarMargin+a.scrollbarWidth+"px"}else{aK.paddingRight=a.scrollbarMargin+"px"}aW.css(aK);var aJ=aW.outerHeight();var aI=aQ/aJ;if(aI<0.99){var aH=aW.parent();aH.append(b('<div class="jScrollPaneTrack"></div>').css({width:a.scrollbarWidth+"px"}).append(b('<div class="jScrollPaneDrag"></div>').css({width:a.scrollbarWidth+"px"}).append(b('<div class="jScrollPaneDragTop"></div>').css({width:a.scrollbarWidth+"px"}),b('<div class="jScrollPaneDragBottom"></div>').css({width:a.scrollbarWidth+"px"}))));var aG=b(">.jScrollPaneTrack",aH);var aF=b(">.jScrollPaneTrack .jScrollPaneDrag",aH);if(a.showArrows){var aE;var aD;var aC;var aB;var aA=function(){if(aB>4||aB%4==0){ai(ap+aD*aq)}aB++};var az=function(e){b("html").unbind("mouseup",az);aE.removeClass("jScrollActiveArrowButton");clearInterval(aC)};var ay=function(){b("html").bind("mouseup",az);aE.addClass("jScrollActiveArrowButton");aB=0;aA();aC=setInterval(aA,100)};aH.append(b("<div></div>").attr({"class":"jScrollArrowUp"}).css({width:a.scrollbarWidth+"px"}).bind("mousedown",function(){aE=b(this);aD=-1;ay();this.blur();return false}).bind("click",d),b("<div></div>").attr({"class":"jScrollArrowDown"}).css({width:a.scrollbarWidth+"px"}).bind("mousedown",function(){aE=b(this);aD=1;ay();this.blur();return false}).bind("click",d));var ax=b(">.jScrollArrowUp",aH);var aw=b(">.jScrollArrowDown",aH);if(a.arrowSize){aP=aQ-a.arrowSize-a.arrowSize;aG.css({height:aP+"px",top:a.arrowSize+"px"})}else{var av=ax.height();a.arrowSize=av;aP=aQ-av-aw.height();aG.css({height:aP+"px",top:av+"px"})}}var au=b(this).css({position:"absolute",overflow:"visible"});var at;var ar;var aq;var ap=0;var ao=aI*aQ/2;var an=function(f,e){var g=e=="X"?"Left":"Top";return f["page"+e]||f["client"+e]+(document.documentElement["scroll"+g]||document.body["scroll"+g])||0};var am=function(){return false};var al=function(){aY();at=aF.offset(false);at.top-=ap;ar=aP-aF[0].offsetHeight;aq=2*a.wheelSpeed*ar/aJ};var ak=function(e){al();ao=an(e,"Y")-ap-at.top;b("html").bind("mouseup",aj).bind("mousemove",ah);if(b.browser.msie){b("html").bind("dragstart",am).bind("selectstart",am)}return false};var aj=function(){b("html").unbind("mouseup",aj).unbind("mousemove",ah);ao=aI*aQ/2;if(b.browser.msie){b("html").unbind("dragstart",am).unbind("selectstart",am)}};var ai=function(e){e=e<0?0:e>ar?ar:e;ap=e;aF.css({top:e+"px"});var f=e/ar;au.css({top:(aQ-aJ)*f+"px"});aW.trigger("scroll");if(a.showArrows){ax[e==0?"addClass":"removeClass"]("disabled");aw[e==ar?"addClass":"removeClass"]("disabled")}};var ah=function(e){ai(an(e,"Y")-at.top-ao)};var ag=Math.max(Math.min(aI*(aQ-a.arrowSize*2),a.dragMaxHeight),a.dragMinHeight);aF.css({height:ag+"px"}).bind("mousedown",ak);var af;var ae;var ad;var ac=function(){if(ae>8||ae%4==0){ai(ap-(ap-ad)/2)}ae++};var ab=function(){clearInterval(af);b("html").unbind("mouseup",ab).unbind("mousemove",aa)};var aa=function(e){ad=an(e,"Y")-at.top-ao};var c=function(e){al();aa(e);ae=0;b("html").bind("mouseup",ab).bind("mousemove",aa);af=setInterval(ac,100);ac()};aG.bind("mousedown",c);aH.bind("mousewheel",function(f,e){al();aY();var h=ap;ai(ap-e*aq);var g=h!=ap;return false});var a1;var a0;function aZ(){var e=(a1-ap)/a.animateStep;if(e>1||e<-1){ai(ap+e)}else{ai(a1);aY()}}var aY=function(){if(a0){clearInterval(a0);delete a1}};var aX=function(j,h){if(typeof j=="string"){$e=b(j,aW);if(!$e.length){return}j=$e.offset().top-aW.offset().top}aH.scrollTop(0);aY();var g=-j/(aQ-aJ)*ar;if(h||!a.animateTo){ai(g)}else{a1=g;a0=setInterval(aZ,a.animateInterval)}};aW[0].scrollTo=aX;aW[0].scrollBy=function(f){var e=-parseInt(au.css("top"))||0;aX(e+f)};al();aX(-aT,true);b("*",this).bind("focus",function(q){var p=b(this);var o=0;while(p[0]!=aW[0]){o+=p.position().top;p=p.offsetParent()}var n=-parseInt(au.css("top"))||0;var m=n+aQ;var l=o>n&&o<m;if(!l){var j=o-a.scrollbarMargin;if(o>n){j+=b(this).height()+15+a.scrollbarMargin-aQ}aX(j)}});if(location.hash){aX(location.hash)}b(document).bind("click",function(e){$target=b(e.target);if($target.is("a")){var f=$target.attr("href");if(f.substr(0,1)=="#"){aX(f)}}});b.jScrollPaneCusel.active.push(aW[0])}else{aW.css({height:aQ+"px",width:aR-this.originalSidePaddingTotal+"px",padding:this.originalPadding});aW.parent().unbind("mousewheel")}})};b.fn.jScrollPaneRemoveCusel=function(){b(this).each(function(){$this=b(this);var a=$this.parent();if(a.is(".jScrollPaneContainer")){$this.css({top:"",height:"",width:"",padding:"",overflow:"",position:""});$this.attr("style",$this.data("originalStyleTag"));a.after($this).remove()}})};b.fn.jScrollPaneCusel.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};b(window).bind("unload",function(){var a=b.jScrollPaneCusel.active;for(var d=0;d<a.length;d++){a[d].scrollTo=a[d].scrollBy=null}})})(jQuery);(function(b){b.event.special.mousewheel={setup:function(){var a=b.event.special.mousewheel.handler;if(b.browser.mozilla){b(this).bind("mousemove.mousewheel",function(c){b.data(this,"mwcursorposdata",{pageX:c.pageX,pageY:c.pageY,clientX:c.clientX,clientY:c.clientY})})}if(this.addEventListener){this.addEventListener(b.browser.mozilla?"DOMMouseScroll":"mousewheel",a,false)}else{this.onmousewheel=a}},teardown:function(){var a=b.event.special.mousewheel.handler;b(this).unbind("mousemove.mousewheel");if(this.removeEventListener){this.removeEventListener(b.browser.mozilla?"DOMMouseScroll":"mousewheel",a,false)}else{this.onmousewheel=function(){}}b.removeData(this,"mwcursorposdata")},handler:function(a){var h=Array.prototype.slice.call(arguments,1);a=b.event.fix(a||window.event);b.extend(a,b.data(this,"mwcursorposdata")||{});var g=0,f=true;if(a.wheelDelta){g=a.wheelDelta/120}if(a.detail){g=-a.detail/3}a.data=a.data||{};a.type="mousewheel";h.unshift(g);h.unshift(a);return b.event.handle.apply(this,h)}};b.fn.extend({mousewheel:function(c){return c?this.bind("mousewheel",c):this.trigger("mousewheel")},unmousewheel:function(c){return this.unbind("mousewheel",c)}})})(jQuery);

(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.substring(0,q)||"*";var o=s.substring(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).substring(2,10)}var h=function(t,r,s){var q=this;var p={};var u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.substring(0,v.length-1);var w="onBefore"+v.substring(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}if(r!=-1){A=q}if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(v=="onStart"||v=="onUpdate"){i(A,y);if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var s={};var o=this;var u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},_fireEvent:function(w,v){if(w=="onUpdate"){var x=q._api().fp_getPlugin(p);if(!x){return}i(o,x);delete o.methods;if(!u){m(x.methods,function(){var z=""+this;o[z]=function(){var A=[].slice.call(arguments);var B=q._api().fp_invoke(p,z,A);return B=="undefined"?o:B}});u=true}}var y=s[w];if(y){y.call(o,v);if(w.substring(0,1)=="_"){delete s[w]}}}})};function b(o,t,z){var E=this,y=null,x,u,p=[],s={},B={},r,v,w,D,A,q;i(E,{id:function(){return r},isLoaded:function(){return(y!==null)},getParent:function(){return o},hide:function(F){if(F){o.style.height="0px"}if(y){y.style.height="0px"}return E},show:function(){o.style.height=q+"px";if(y){y.style.height=A+"px"}return E},isHidden:function(){return y&&parseInt(y.style.height,10)===0},load:function(F){if(!y&&E._fireEvent("onBeforeLoad")!==false){m(a,function(){this.unload()});x=o.innerHTML;flashembed(o,t,{config:z});if(F){F.cached=true;j(B,"onLoad",F)}}return E},unload:function(){try{if(y&&y.fp_isFullscreen()){}}catch(F){return}if(y&&x.replace(/\s/g,"")!==""&&!y.fp_isFullscreen()&&E._fireEvent("onBeforeUnload")!==false){y.fp_close();o.innerHTML=x;E._fireEvent("onUnload");y=null}return E},getClip:function(F){if(F===undefined){F=D}return p[F]},getCommonClip:function(){return u},getPlaylist:function(){return p},getPlugin:function(F){var H=s[F];if(!H&&E.isLoaded()){var G=E._api().fp_getPlugin(F);if(G){H=new l(F,G,E);s[F]=H}}return H},getScreen:function(){return E.getPlugin("screen")},getControls:function(){return E.getPlugin("controls")},getConfig:function(F){return F?k(z):z},getFlashParams:function(){return t},loadPlugin:function(I,H,K,J){if(typeof K=="function"){J=K;K={}}var G=J?e():"_";E._api().fp_loadPlugin(I,H,K,G);var F={};F[G]=J;var L=new l(I,null,E,F);s[I]=L;return L},getState:function(){return y?y.fp_getState():-1},play:function(F){function G(){if(F!==undefined){E._api().fp_play(F)}else{E._api().fp_play()}}if(y){G()}else{E.load(function(){G()})}return E},getVersion:function(){var G="flowplayer.js 3.0.3";if(y){var F=y.fp_getVersion();F.push(G);return F}return G},_api:function(){if(!y){throw"Flowplayer "+E.id()+" not loaded. Try moving your call to player's onLoad event"}return y},_dump:function(){console.log(B)},setClip:function(F){E.setPlaylist([F])},getIndex:function(){return w}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,Fullscreen*,FullscreenExit,Error").split(","),function(){var F="on"+this;if(F.indexOf("*")!=-1){F=F.substring(0,F.length-1);var G="onBefore"+F.substring(2);E[G]=function(H){j(B,G,H);return E}}E[F]=function(H){j(B,F,H);return E}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,reset,close,setPlaylist").split(","),function(){var F=this;E[F]=function(G){if(!y){return E}var H=(G===undefined)?y["fp_"+F]():y["fp_"+F](G);return H=="undefined"?E:H}});E._fireEvent=function(O,L,K,J){if(z.debug){g(arguments)}if(!y&&O=="onLoad"&&L=="player"){y=y||c(v);A=y.clientHeight;m(p,function(){this._fireEvent("onLoad")});m(s,function(P,Q){Q._fireEvent("onUpdate")});u._fireEvent("onLoad")}if(O=="onLoad"&&L!="player"){return}if(O=="onError"){if(typeof L=="string"||(typeof L=="number"&&typeof K=="number")){L=K;K=J}}if(O=="onContextMenu"){m(z.contextMenu[L],function(P,Q){Q.call(E)});return}if(O=="onPluginEvent"){var F=L.name||L;var G=s[F];if(G){G._fireEvent("onUpdate",L);G._fireEvent(K)}return}if(O=="onPlaylistReplace"){p=[];var M=0;m(L,function(){p.push(new h(this,M++,E))})}var N=true;if(L===0||(L&&L>=0&&L<p.length)){D=L;var H=p[L];if(H){N=H._fireEvent(O,K,J)}if(!H||N!==false){N=u._fireEvent(O,K,J,H)}}var I=0;m(B[O],function(){N=this.call(E,L,K);if(this.cached){B[O].splice(I,1)}if(N===false){return false}I++});return N};function C(){if($f(o)){$f(o).getParent().innerHTML="";w=$f(o).getIndex();a[w]=E}else{a.push(E);w=a.length-1}q=parseInt(o.style.height,10)||o.clientHeight;if(typeof t=="string"){t={src:t}}r=o.id||"fp"+e();v=t.id||r+"_api";t.id=v;z.playerId=r;if(typeof z=="string"){z={clip:{url:z}}}z.clip=z.clip||{};if(o.getAttribute("href",2)&&!z.clip.url){z.clip.url=o.getAttribute("href",2)}u=new h(z.clip,-1,E);z.playlist=z.playlist||[z.clip];var F=0;m(z.playlist,function(){var H=this;if(typeof H=="object"&&H.length){H=""+H}if(!H.url&&typeof H=="string"){H={url:H}}m(z.clip,function(I,J){if(H[I]===undefined&&typeof J!="function"){H[I]=J}});z.playlist[F]=H;H=new h(H,F,E);p.push(H);F++});m(z,function(H,I){if(typeof I=="function"){j(B,H,I);delete z[H]}});m(z.plugins,function(H,I){if(I){s[H]=new l(H,I,E)}});if(!z.plugins||z.plugins.controls===undefined){s.controls=new l("controls",null,E)}t.bgcolor=t.bgcolor||"#000000";t.version=t.version||[9,0];t.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function G(H){if(!E.isLoaded()&&E._fireEvent("onBeforeClick")!==false){E.load()}return f(H)}x=o.innerHTML;if(x.replace(/\s/g,"")!==""){if(o.addEventListener){o.addEventListener("click",G,false)}else{if(o.attachEvent){o.attachEvent("onclick",G)}}}else{if(o.addEventListener){o.addEventListener("click",f,false)}E.load()}}if(typeof o=="string"){flashembed.domReady(function(){var F=c(o);if(!F){throw"Flowplayer cannot access element: "+o}else{o=F;C()}})}else{C()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var r=arguments[1];var q=(arguments.length==3)?arguments[2]:{};if(typeof o=="string"){if(o.indexOf(".")!=-1){var t=[];m(n(o),function(){t.push(new b(this,k(r),k(q)))});return new d(t)}else{var s=c(o);return new b(s!==null?s:o,r,q)}}else{if(o){return new b(o,r,q)}}}return null};i(window.$f,{fireEvent:function(u,r,s,q,o){var t=$f(u);return t?t._fireEvent(r,s,q,o):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(document.all){window.onbeforeunload=function(){$f("*").each(function(){if(this.isLoaded()){this.close()}})}}if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var f=typeof jQuery=="function";function l(){if(d.done){return false}var n=document;if(n&&n.getElementsByTagName&&n.getElementById&&n.body){clearInterval(d.timer);d.timer=null;for(var m=0;m<d.ready.length;m++){d.ready[m].call()}d.ready=null;d.done=true}}var d=f?jQuery:function(m){if(d.done){return m()}if(d.timer){d.ready.push(m)}else{d.ready=[m];d.timer=setInterval(l,13)}};function h(n,m){if(m){for(key in m){if(m.hasOwnProperty(key)){n[key]=m[key]}}}return n}function e(o){var m="";for(var n in o){if(o[n]){m+=[n]+"="+i(o[n])+"&"}}return m.substring(0,m.length-1)}function i(m){switch(k(m)){case"string":m=m.replace(new RegExp('(["\\\\])',"g"),"\\$1");m=m.replace(/^\s?(\d+)%/,"$1pct");return'"'+m+'"';case"array":return"["+c(m,function(p){return i(p)}).join(",")+"]";case"function":return'"function()"';case"object":var n=[];for(var o in m){if(m.hasOwnProperty(o)){n.push('"'+o+'":'+i(m[o]))}}return"{"+n.join(",")+"}"}return String(m).replace(/\s/g," ").replace(/\'/g,'"')}function k(n){if(n===null||n===undefined){return false}var m=typeof n;return(m=="object"&&n.push)?"array":m}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function c(m,p){var o=[];for(var n in m){if(m.hasOwnProperty(n)){o[n]=p(m[n])}}return o}function g(o,q){var n='<embed type="application/x-shockwave-flash" ';if(o.id){h(o,{name:o.id})}for(var m in o){if(o[m]!==null){n+=m+'="'+o[m]+'"\n\t'}}if(q){n+="flashvars='"+e(q)+"'"}n+="/>";return n}function b(r,s,n){var o='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';o+='width="'+r.width+'" height="'+r.height+'"';if(!r.id&&document.all){r.id="_"+(""+Math.random()).substring(5)}if(r.id){o+=' id="'+r.id+'"'}o+=">";if(document.all){r.src+=((r.src.indexOf("?")!=-1?"&":"?")+Math.random())}o+='\n\t<param name="movie" value="'+r.src+'" />';var q=h({},r);q.id=q.width=q.height=q.src=null;for(var m in q){if(q[m]!==null){o+='\n\t<param name="'+m+'" value="'+q[m]+'" />'}}if(s){o+='\n\t<param name="flashvars" value=\''+e(s)+"' />"}if(n){o+=g(r,s)}o+="</object>";return o}function j(m,n){return b(m,n,true)}function a(n,o){var m=navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length;return(m)?g(n,o):b(n,o)}window.flashembed=function(u,v,p){var q={src:"#",width:"100%",height:"100%",version:null,onFail:null,expressInstall:null,debug:false,allowfullscreen:true,allowscriptaccess:"always",quality:"high",type:"application/x-shockwave-flash",pluginspage:"http://www.adobe.com/go/getflashplayer"};if(typeof v=="string"){v={src:v}}h(q,v);var s=flashembed.getVersion();var t=q.version;var n=q.expressInstall;var m=q.debug;if(typeof u=="string"){var o=document.getElementById(u);if(o){u=o}else{d(function(){flashembed(u,v,p)});return}}if(!u){return}if(!t||flashembed.isSupported(t)){q.onFail=q.version=q.expressInstall=q.debug=null;u.innerHTML=a(q,p);return u.firstChild}else{if(q.onFail){var r=q.onFail.call(q,flashembed.getVersion(),p);if(r===true){u.innerHTML=r}}else{if(t&&n&&flashembed.isSupported([6,65])){h(q,{src:n});p={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};u.innerHTML=a(q,p)}else{if(u.innerHTML.replace(/\s/g,"")!==""){}else{u.innerHTML="<h2>Flash version "+t+" or greater is required</h2><h3>"+(s[0]>0?"Your version is "+s:"You have no flash plugin installed")+"</h3><p>Download latest version from <a href='"+q.pluginspage+"'>here</a></p>"}}}}return u};h(window.flashembed,{getVersion:function(){var o=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var n=navigator.plugins["Shockwave Flash"].description;if(typeof n!="undefined"){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var p=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);var t=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0;o=[p,t]}}else{if(window.ActiveXObject){try{var r=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(s){try{r=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");o=[6,0];r.AllowScriptAccess="always"}catch(m){if(o[0]==6){return}}try{r=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(q){}}if(typeof r=="object"){n=r.GetVariable("$version");if(typeof n!="undefined"){n=n.replace(/^\S+\s+(.*)$/,"$1").split(",");o=[parseInt(n[0],10),parseInt(n[2],10)]}}}}return o},isSupported:function(m){var o=flashembed.getVersion();var n=(o[0]>m[0])||(o[0]==m[0]&&o[1]>=m[1]);return n},domReady:d,asString:i,getHTML:a,getFullHTML:j});if(f){jQuery.prototype.flashembed=function(n,m){return this.each(function(){flashembed(this,n,m)})}}})();

/* Hover with delay */
(function($) {
	$.fn.hoverIntent = function(f,g) {
		var cfg = {
			sensitivity: 7,
			interval: 100,
			timeout: 0
		};
		cfg = $.extend(cfg, g ? { over: f, out: g } : f );
        
		var cX, cY, pX, pY;

		var track = function(ev) {
			cX = ev.pageX;
			cY = ev.pageY;
		};

		var compare = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
				$(ob).unbind("mousemove",track);
				ob.hoverIntent_s = 1;
				return cfg.over.apply(ob,[ev]);
			} else {
				pX = cX; pY = cY;
				ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
			}
		};

		var delay = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			ob.hoverIntent_s = 0;
			return cfg.out.apply(ob,[ev]);
		};

		var handleHover = function(e) {
			var ev = jQuery.extend({},e);
			var ob = this;

			if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

			if (e.type == "mouseenter") {
				pX = ev.pageX; pY = ev.pageY;
				$(ob).bind("mousemove",track);
				if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
			} else {
				$(ob).unbind("mousemove",track);
				if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
			}
		};

		return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover);
	};
})(jQuery);
/* /Hover with delay */

/* Timer */
jQuery.fn.extend ({
    everyTime : function (interval, label, fn, times, belay)
    {
        return this.each (function ()
        {
            jQuery.timer.add (this, interval, label, fn, times, belay);
        });
    },
    oneTime : function (interval, label, fn)
    {
        return this.each (function ()
        {
            jQuery.timer.add (this, interval, label, fn, 1);
        });
    },
    stopTime : function (label, fn)
    {
        return this.each (function ()
        {
            jQuery.timer.remove (this, label, fn);
        });
    }
});

jQuery.extend ({
    timer : {
        guid : 1,
        global : {},
        regex : /^([0-9]+)\s*(.*s)?$/,
        powers : {
            'ms' : 1,
            'cs' : 10,
            'ds' : 100,
            's' : 1000,
            'das' : 10000,
            'hs' : 100000,
            'ks' : 1000000
        },
        timeParse : function (value)
        {
            if (value == undefined || value == null)
                return null;
            var result = this.regex.exec (jQuery.trim (value.toString ()));
            if (result[ 2 ]) {
                var num = parseInt (result[ 1 ], 10);
                var mult = this.powers[ result[ 2 ] ] || 1;
                return num * mult;
            } else {
                return value;
            }
        },
        add : function (element, interval, label, fn, times, belay)
        {
            var counter = 0;
            
            if (jQuery.isFunction (label)) {
                if ( !times)
                    times = fn;
                fn = label;
                label = interval;
            }
            
            interval = jQuery.timer.timeParse (interval);
            
            if ( typeof interval != 'number' || isNaN (interval) || interval <= 0)
                return;
            
            if (times && times.constructor != Number) {
                belay = ! !times;
                times = 0;
            }
            
            times = times || 0;
            belay = belay || false;
            
            if ( !element.$timers)
                element.$timers = {};
            
            if ( !element.$timers[ label ])
                element.$timers[ label ] = {};
            
            fn.$timerID = fn.$timerID || this.guid ++ ;
            
            var handler = function ()
            {
                if (belay && this.inProgress)
                    return;
                this.inProgress = true;
                if ((++ counter > times && times !== 0) || fn.call (element, counter) === false)
                    jQuery.timer.remove (element, label, fn);
                this.inProgress = false;
            };
            
            handler.$timerID = fn.$timerID;
            
            if ( !element.$timers[ label ][ fn.$timerID ])
                element.$timers[ label ][ fn.$timerID ] = window.setInterval (handler, interval);
            
            if ( !this.global[ label ])
                this.global[ label ] = [];
            this.global[ label ].push (element);
            
        },
        remove : function (element, label, fn)
        {
            var timers = element.$timers, ret;
            
            if (timers) {
                
                if ( !label) {
                    for (label in timers)
                        this.remove (element, label, fn);
                } else if (timers[ label ]) {
                    if (fn) {
                        if (fn.$timerID) {
                            window.clearInterval (timers[ label ][ fn.$timerID ]);
                            delete timers[ label ][ fn.$timerID ];
                        }
                    } else {
                        for ( var fn in timers[ label ]) {
                            window.clearInterval (timers[ label ][ fn ]);
                            delete timers[ label ][ fn ];
                        }
                    }
                    
                    for (ret in timers[ label ])
                        break;
                    if ( !ret) {
                        ret = null;
                        delete timers[ label ];
                    }
                }
                
                for (ret in timers)
                    break;
                if ( !ret)
                    element.$timers = null;
            }
        }
    }
});

if (jQuery.browser.msie)
    jQuery (window).one ("unload", function ()
    {
        var global = jQuery.timer.global;
        for ( var label in global) {
            var els = global[ label ], i = els.length;
            while (-- i)
                jQuery.timer.remove (els[ i ], label);
        }
    });

/* Map */
function viewCountry (id)
{
    $ ('.j-spoiler').each (function ()
    {
        if ($ (this).hasClass ('j-spoiler-opened')) {
            $ ('.j-spoiler-link', $ (this)).trigger ('click');
        }
    })

    if ( !$ ('#country' + id).hasClass ('j-spoiler-opened'))
        $ ('#country' + id + ' .j-spoiler-link').trigger ('click');
    $.scrollTo ('#country' + id, 500);
}

$ (window).load (function ()
{
    $ ('.image').each (function ()
    {
        $ (this).width ($ (this).find ('img').width () + 28);
    });
    var nPHeight = 0
    $ (".news-dynamic-block .news-img-container .news-img").each (function ()
    {
        var nPTemp = $ (this).parent ().height () - 230;
        if (nPTemp > nPHeight)
            nPHeight = nPTemp;
    });
    $ (".news-dynamic-block .news-img-container .news-img td").height (nPHeight);
});

$ (document).ready (function ()
{
    if ($.trim ($ ('.interesting-container').text ()) == "")
        $ ('.interesting-container').remove ();
    $ ('.sidebar-block').each (function ()
    {
        if ($.trim ($ (this).text ()) == "")
            $ (this).remove ();
    });
    /* Content tables */
    $ (".c-table thead td:first-child").addClass ("first-child");
    $ (".c-table-stripes thead td:first-child").addClass ("first-child");
    $ (".c-table-borderless thead td:first-child").addClass ("first-child");
    $ (".c-table thead td:last-child").addClass ("last-child");
    $ (".c-table-stripes thead td:last-child").addClass ("last-child");
    $ (".c-table-borderless thead td:last-child").addClass ("last-child");
    $ (".c-table-borderless tbody tr:last-child").addClass ("last-child");
    $ (".c-table-borderless tbody tr td:last-child").addClass ("last-child");
    $ (".c-table p:last-child").addClass ("last-child");
    $ (".c-table p:last-child").addClass ("last-child");
    $ (".c-table-stripes p:last-child").addClass ("last-child");
    $ (".c-table-borderless p:last-child").addClass ("last-child");
    $ (".c-table-stripes tbody tr:odd").addClass ("odd");
    /* /Content tables */

    new DynamicSlideshow ($ ('#j-slideshow'), 0, 1);
    
    $ ('.news-dynamic-block').each (function ()
    {
        new DynamicNewsBlock (this, 0, 0);
    });
    
    $ ('.j-spoiler').each (function ()
    {
        new Spoiler (this);
    });
    new SpoilerLink ($ ('#j-spoiler-control'), $ ('.schedule-spoiler'), "Свернуть все", "Развернуть все");
    new SpoilerLink ($ ('#j-spoiler-inst'), $ ('.institute-spoiler'), "Свернуть все", "Развернуть все");
    if($ ('#j-partners-spoiler').text() == "Развернуть все"){
        new SpoilerLink ($ ('#j-partners-spoiler'), $ ('.j-spoiler'), "Свернуть все", "Развернуть все");
    } else {
        new SpoilerLink ($ ('#j-partners-spoiler'), $ ('.j-spoiler'), "Close all", "Show all");
    }
    new SpoilerLink ($ ('#j-spoiler-eng-inst'), $ ('.institute-spoiler'), "Close all", "Show all");
    
    $ ('.j-county-block').prepend ('<a title="Назад" class="country-top" href="#top">Назад</a>')

    $ ('.j-text-field').each (function ()
    {
        new TextField (this, $ (this).attr ('class'));
    });
    
    $ ('.j-textarea').each (function ()
    {
        new TextArea (this, $ (this).attr ('class'));
    });
    
    $ (".scrollable").scrollable ({
        vertical : true,
        circular : true
    });
    
    $ ("#main-page").css ({
        height : $ ("#main-page").height () - 66 + "px"
    });
    if (document.documentElement.clientHeight > $ ("#mainarea").height ()) {
        var pdd = ($ (".interesting").height () ? parseInt ($ (".interesting").height ()) : 0);
        $ ("#mainarea").css ({
            minHeight : $ ("#mainarea").parent ().height () - $ ("#header").height () - 129 - pdd + "px"
        });
        $ ("#main").css ({
            minHeight : $ ("#mainarea").height () + "px"
        });
        $ (".content").css ({
            minHeight : $ ("#mainarea").height () - 60 + "px"
        });
        
    }
    $ (".alone .content .l-main").css ({
        minHeight : $ ("#mainarea").height () - 94 + "px"
    });
    
    var galleries = $ ('.ad-gallery').adGallery ();
    $ ("a[rel='imageListHref']").colorbox ();
    /* Popup images */
    $ ("a.cbox-popup").attr ('rel', 'slideshow');
    $ ("a.cbox-popup").colorbox ({
        title : function ()
        {
            return $ (this).attr ('title')
        }
    });
    
    var lambda = 0;
    if ($.browser.msie && parseInt ($.browser.version) < 8) {
        lambda = 25;
    }
    $ ("a[rel='iframe-3d']").colorbox ({
        current : false,
        iframe : true,
        width : 837 + "px",
        height : 660 + lambda + "px",
        title : function ()
        {
            return $ (this).attr ('title')
        }
    });
    $ ("a[rel='iframe-museum']").colorbox ({
        iframe : true,
        width : 690 + "px",
        height : 660 + lambda + "px",
        title : function ()
        {
            return $ (this).attr ('title')
        }
    });
    $ ("a[rel='iframe-tomsk']").colorbox ({
        iframe : true,
        width : 837 + "px",
        height : 660 + lambda + "px",
        title : function ()
        {
            return $ (this).attr ('title')
        }
    });
    $ ("a[rel='iframe-campus']").colorbox ({
        iframe : true,
        width : "839px",
        height : "656px",
        scrolling : false,
        title : function ()
        {
            return $ (this).attr ('title')
        }
    });
    /*
     * $(window).resize(function() { $.colorbox.resize({ width:"75%",
     * height:"75%" }); });
     */

    var zIndex = 20;
    $ ("select").each (function ()
    {
        new SelectField (this, zIndex);
        zIndex -- ;
    })

    if ($.browser.mozilla) {
        $ ('#menu > li a').css ({
            paddingLeft : "24px"
        });
        $ ('#menu li:last-child a').css ({
            paddingRight : "22px"
        });
    }
    
    $ (".j-search-link").click (function ()
    {
        $ (".head-search-form").toggle ();
        return false;
    });
    
    $ ("#j-search-form .close").click (function ()
    {
        $ ("#j-search-form").hide ();
        return false;
    });
    
    var maxTDHeight = 0;
    var maxTDWidth = 0;
    $ ('.c-table.schedule tbody td').each (function ()
    {
        if ($ (this).height () > maxTDHeight)
            maxTDHeight = $ (this).height ();
        if ($ (this).width () > maxTDWidth)
            maxTDWidth = $ (this).width ();
    });
    $ ('.c-table.schedule tbody td').height (maxTDHeight);
    $ ('.c-table.schedule tbody td').width (maxTDWidth);
    $ ('.c-table.schedule tbody td:first-child').width (40).css ({
        verticalAlign : 'middle'
    });
    $ ('.c-table.schedule tbody td:empty').height (maxTDHeight + 16);
    
    $ (window).load (imgLoad ());
    
    $('#menu').css({fontSize: "14px"});
    
    if($('#menu td:last-child').hasClass('separator')){
        $('#menu td:last-child').remove();
        $('#menu td:last-child').addClass("last-child");
    }
    
    $('#menu td').hoverIntent(function(){
        $ (this).find ('ul').fadeIn (300);
    },function(){
        $ (this).find ('ul').hide ();
    });
    
    $ ('#menu td > div').mouseover (function ()
    {
        $ (this).parent ().prev ().addClass ('hover-sep');
        $ (this).parent ().next ().addClass ('hover-sep');
    });
    $ ('#menu td > div').mouseout (function ()
    {
        $ (this).parent ().prev ().removeClass ('hover-sep');
        $ (this).parent ().next ().removeClass ('hover-sep');
    });
    $ ('#menu td.active').each (function ()
    {
        $ (this).prev ().addClass ('active-sep');
        $ (this).next ().addClass ('active-sep');
    });
    
    /* IE6 fixes */
    if ($.browser.msie && parseInt ($.browser.version) < 7) {
        $ ('#menu td div > a').addClass ('ie6-menu-a');
        $ ('#menu td').mouseenter (function ()
        {
            $ (this).addClass ('ie6-menu-hover');
        });
        $ ('#menu td').mouseleave (function ()
        {
            $ (this).removeClass ('ie6-menu-hover');
        });
        $ ('#menu td div').mouseenter (function ()
        {
            $ (this).addClass ('ie6-menu-div-hover');
        });
        $ ('#menu td div').mouseleave (function ()
        {
            $ (this).removeClass ('ie6-menu-div-hover');
        });
    }
    if ($.browser.webkit){
        $("#main").css({position: "relative", left: "1px"})
        $("#header").css({position: "relative", left: "1px"})
        $("#footer").css({position: "relative", left: "1px"})
    }
});

function imgLoad ()
{
    var myImg = $ (".logo a img").attr ("src", $ (".logo a img").attr ("src") + "?" + new Date ().getTime ());
    $ (myImg).load (function ()
    {
        $ ("#j-search-form").css ({
            backgroundColor : "transparent",
            backgroundImage : "url(/i/site/Default/controls/search.png)"
        });
        $ ("#j-search-form.en").css ({
            backgroundColor : "transparent",
            backgroundImage : "url(/i/site/Default/controls/search1.png)"
        });
        $ ("#j-search-form .search-text").css ({
            border : "0",
            background : "none"
        });
    });
}

/* Dynamic slideshow block */
function DynamicSlideshow (container, first, auto)
{
    var _this = this;

    this.container = $ (container);
    this.slideshow = this.container.find ('.slideshow');
    this.currentItem = first;
    this.auto = auto;
    
    this.slideshow.before ('<a href="#" class="slideshow-next"></a><a href="#" class="slideshow-prev"></a>');
    this.slideshow.after ('<div class="carousel-shadow"></div>');
    
    $ (".item:eq(" + this.currentItem + ")", this.slideshow).addClass ('active-item');
    
    $ ('.slideshow-next', this.container).click (function ()
    {
        _this.Next ();
        /* msie7 */
        if ($.browser.msie && parseInt ($.browser.version) < 8) {
            _this.CorrectHeight ($ (".item:eq(" + _this.currentItem + ") .ie-cell", _this.slideshow));
        }
        return false;
    });
    $ ('.slideshow-prev', this.container).click (function ()
    {
        _this.Back ();
        /* msie7 */
        if ($.browser.msie && parseInt ($.browser.version) < 8) {
            _this.CorrectHeight ($ (".item:eq(" + _this.currentItem + ") .ie-cell", _this.slideshow));
        }
        return false;
    });
    if (this.auto == 1) {
        _this.StartAuto (_this);
        this.container.mouseenter (function ()
        {
            _this.StopAuto ();
        });
        this.container.mouseleave (function ()
        {
            _this.StartAuto (_this);
        });
        $ (window).blur (function ()
        {
            _this.StopAuto ();
        });
        $ (window).focus (function ()
        {
            _this.StartAuto (_this);
        });
    }
}

DynamicSlideshow.prototype.Next = function ()
{
    if ( !$ (".item:eq(" + this.currentItem + ")", this.slideshow).is (":animated")) {
        if ($.browser.msie && parseInt ($.browser.version) < 7) {
            $ (".item:eq(" + this.currentItem + ")", this.slideshow).fadeOut (300);
        } else {
            $ (".item:eq(" + this.currentItem + ")", this.slideshow).stop ().animate ({
                opacity : '0'
            }, 1000);
        }
        this.currentItem = this.GetIndex (this.currentItem, "next");
        if ($.browser.msie && parseInt ($.browser.version) < 7) {
            $ (".item:eq(" + this.currentItem + ")", this.slideshow).fadeIn (300);
        } else {
            $ (".item:eq(" + this.currentItem + ")", this.slideshow).stop ().animate ({
                opacity : '1'
            }, 1000);
        }
    }
}

DynamicSlideshow.prototype.Back = function ()
{
    if ( !$ (".item:eq(" + this.currentItem + ")", this.slideshow).is (":animated")) {
        if ($.browser.msie && parseInt ($.browser.version) < 7) {
            $ (".item:eq(" + this.currentItem + ")", this.slideshow).fadeOut (300);
        } else {
            $ (".item:eq(" + this.currentItem + ")", this.slideshow).stop ().animate ({
                opacity : '0'
            }, 1000);
        }
        this.currentItem = this.GetIndex (this.currentItem, "prev");
        if ($.browser.msie && parseInt ($.browser.version) < 7) {
            $ (".item:eq(" + this.currentItem + ")", this.slideshow).fadeIn (300);
        } else {
            $ (".item:eq(" + this.currentItem + ")", this.slideshow).stop ().animate ({
                opacity : '1'
            }, 1000);
        }
    }
}

DynamicSlideshow.prototype.GetIndex = function (ind, status)
{
    if (status == "next") {
        if (ind < $ (".item:last-child", this.slideshow).index ()) {
            ++ ind;
        } else {
            ind = 0;
        }
    } else {
        if (ind > 0) {
            -- ind;
        } else {
            ind = $ (".item:last-child", this.slideshow).index ();
        }
    }
    
    return ind;
}

DynamicSlideshow.prototype.CorrectHeight = function (handler)
{
    var ieHeight = handler.height ();
    var ieParentHeight = handler.parent ().height ();
    var pd = (ieParentHeight - ieHeight) / 2;
    if (pd > 0)
        handler.css ({
            paddingTop : pd + "px"
        });
}

DynamicSlideshow.prototype.StartAuto = function (instance)
{
    $ (document).everyTime (6000, "SlideAuto", function ()
    {
        instance.Next ();
    });
}

DynamicSlideshow.prototype.StopAuto = function ()
{
    $ (document).stopTime ("SlideAuto");
}

/* Custom select using */
function SelectField (select, zInd)
{
    var _this = this;
    
    this.select = $ (select);
    var id = this.select.attr ('id');
    
    var params = {
        changedEl : "#" + id,
        visRows : 15
    }
    cuSel (params);
    
    $ ("#cuselFrame-" + id).css ({
        zIndex : zInd
    });
    $ ("#cuselFrame-" + id + " .cusel-scroll-wrap").css ({
        zIndex : zInd
    });
    $ ("#cuselFrame-" + id + " .cuselText").css ({
        zIndex : zInd
    });
}

/* Custom text field */
function TextField (container, className)
{
    var _this = this;
    
    this.container = $ (container);
    this.container.wrap ('<div class="text-field-container ' + className + '"><div></div></div>')
}

/* Custom textarea */
function TextArea (container, className)
{
    var _this = this;
    
    this.container = $ (container);
    this.container.wrap ('<div class="textarea ' + className + '"><div class="ta-outer"><div class="ta-inner"></div></div></div>');
    var taInner = this.container.parent ();
    taInner.before ('<div class="ta-top"><div class="ta-right"></div></div>');
    taInner.after ('<div class="ta-bottom"><div class="ta-right"></div></div>');
}

/* Dynamic news block */
function DynamicNewsBlock (container, item, auto)
{
    var _this = this;
    
    this.container = $ (container);
    this.news_img = this.container.find ('.news-img-container');
    this.auto = auto;
    this.current_item = item;
    
    $ ('.news-img:eq(' + item + ')', this.news_img).addClass ('active');
    $ ('#news-item-container' + item, this.container).addClass ('active');
    
    $ ('.news-item', this.container).append ('<div class="news-pointer"></div>');
    
    $ ('.news-item', this.container).mouseover (function ()
    {
        _this.current_item = $ (this).attr ('rel');
        _this.switchItem (this);
    });
    if (this.auto == 1) {
        _this.startAuto (_this);
        this.container.mouseenter (function ()
        {
            _this.stopAuto ();
        });
        this.container.mouseleave (function ()
        {
            _this.startAuto (_this);
        });
    }
}

DynamicNewsBlock.prototype.switchItem = function (handler)
{
    handler = $ (handler);
    if ( !$ (handler).parent ().hasClass ('active')) {
        $ ('.active', this.container).removeClass ('active');
        $ ('.news-img:eq(' + handler.attr ('rel') + ')', this.news_img).addClass ('active');
        handler.parent ().addClass ('active');
    }
};

DynamicNewsBlock.prototype.getNext = function ()
{
    if (this.current_item == ($ ('.news-item', this.container).length - 1))
        this.current_item = 0;
    else
        this.current_item ++ ;
    return this.current_item;
}

DynamicNewsBlock.prototype.startAuto = function (instance)
{
    $ (document).everyTime (3000, "sAuto", function ()
    {
        instance.switchItem ($ ('.news-item:eq(' + instance.getNext () + ')', this.container));
    });
}

DynamicNewsBlock.prototype.stopAuto = function ()
{
    $ (document).stopTime ("sAuto");
}

/* Spoiler link */
function SpoilerLink (container, target, ot, ct)
{
    var _this = this;
    this.opened = 1;
    this.openedText = ot;
    this.closed = 2;
    this.closedText = ct;
    
    this.container = $ (container);
    this.target = $ (target);
    
    this.status = this.container.attr ('rel');
    
    this.container.click (function ()
    {
        if (_this.status == _this.closed) {
            _this.openAll ();
        } else {
            _this.closeAll ();
        }
        _this.changeStatus ();
        return false;
    });
}

SpoilerLink.prototype.openAll = function ()
{
    this.target.each (function ()
    {
        if ( !$ (this).hasClass ('j-spoiler-opened')) {
            var elem = $ (this).find ('.j-spoiler-element');
            elem.slideDown (300);
            $ (this).addClass ('j-spoiler-opened');
        }
    });
};

SpoilerLink.prototype.closeAll = function ()
{
    this.target.each (function ()
    {
        if ($ (this).hasClass ('j-spoiler-opened')) {
            var elem = $ (this).find ('.j-spoiler-element');
            elem.slideUp (300);
            $ (this).removeClass ('j-spoiler-opened');
        }
    });
};

SpoilerLink.prototype.changeStatus = function ()
{
    if (this.status == this.opened) {
        this.status = this.closed;
        this.container.text (this.closedText);
    } else {
        this.status = this.opened;
        this.container.text (this.openedText);
    }
};

/* Spoiler */
function Spoiler (container)
{
    var _this = this;
    
    this.container = $ (container);
    this.link = this.container.find ('.j-spoiler-link');
    this.block = this.container.find ('.j-spoiler-element');
    
    this.link.find ('.j-spoiler-br').append ('<div class="j-spoiler-toggler"></div>');
    
    this.link.click (function ()
    {
        _this.toggleFold ();
    });
}

Spoiler.prototype.toggleFold = function ()
{
    if (this.container.hasClass ('j-spoiler-opened')) {
        this.block.slideUp (300);
    } else {
        this.block.slideDown (300);
    }
    this.container.toggleClass ('j-spoiler-opened');
};

showSiteCommentForm = function ()
{
    closeDialogForm ('fs_dialogForm');
    closeDialogForm ('fs_login');
    var width = 456;
    var height = 246;
    
    $.post ('/site_comment/', {}, function (data)
    {
        $ (data).appendTo ("body");
        showDialogForm ('fs_dialogForm', width, height);
    });
};

$ (document).ready (function ()
{
    $ (document).keypress (function (event)
    {
        if ( !(event.ctrlKey && (event.keyCode == 0xA || event.keyCode == 0xD))) {
            return true;
        }
        
        showSiteCommentForm ();
        
        return false;
    });
});

(function(g){g.fn.adGallery=function(j){var l={loader_image:"loader.gif",start_at_index:0,description_wrapper:g(".ad-custom-description-wrapper"),thumb_opacity:1,animate_first_image:false,animation_speed:400,width:false,height:false,display_next_and_prev:true,display_back_and_forward:true,scroll_jump:0,slideshow:{enable:true,autostart:false,speed:5000,start_label:"Start",stop_label:"Stop",stop_on_scroll:true,countdown_prefix:"(",countdown_sufix:")",onStart:false,onStop:false},effect:"slide-hori",enable_keyboard_move:true,cycle:true,callbacks:{init:false,afterImageVisible:false,beforeImageVisible:false}};var k=g.extend(false,l,j);if(j&&j.slideshow){k.slideshow=g.extend(false,l.slideshow,j.slideshow)}if(!k.slideshow.enable){k.slideshow.autostart=false}var i=[];g(this).each(function(){var m=new c(this,k);i[i.length]=m});return i};function f(j,k,l){var m=parseInt(j.css("top"),10);if(k=="left"){var i="-"+this.image_wrapper_height+"px";j.css("top",this.image_wrapper_height+"px")}else{var i=this.image_wrapper_height+"px";j.css("top","-"+this.image_wrapper_height+"px")}if(l){l.css("bottom","-"+l[0].offsetHeight+"px");l.animate({bottom:0},this.settings.animation_speed*2)}if(this.current_description){this.current_description.animate({bottom:"-"+this.current_description[0].offsetHeight+"px"},this.settings.animation_speed*2)}return{old_image:{top:i},new_image:{top:m}}}function e(j,k,m){var l=parseInt(j.css("left"),10);if(k=="left"){var i="-"+this.image_wrapper_width+"px";j.css("left",this.image_wrapper_width+"px")}else{var i=this.image_wrapper_width+"px";j.css("left","-"+this.image_wrapper_width+"px")}if(m){m.css("bottom","-"+m[0].offsetHeight+"px");m.animate({bottom:0},this.settings.animation_speed*2)}if(this.current_description){this.current_description.animate({bottom:"-"+this.current_description[0].offsetHeight+"px"},this.settings.animation_speed*2)}return{old_image:{left:i},new_image:{left:l}}}function d(k,l,n){var j=k.width();var i=k.height();var m=parseInt(k.css("left"),10);var o=parseInt(k.css("top"),10);k.css({width:0,height:0,top:this.image_wrapper_height/2,left:this.image_wrapper_width/2});return{old_image:{width:0,height:0,top:this.image_wrapper_height/2,left:this.image_wrapper_width/2},new_image:{width:j,height:i,top:o,left:m}}}function b(i,j,k){i.css("opacity",0);return{old_image:{opacity:0},new_image:{opacity:1}}}function h(i,j,k){i.css("opacity",0);return{old_image:{opacity:0},new_image:{opacity:1},speed:0}}function c(j,i){this.init(j,i)}c.prototype={wrapper:false,image_wrapper:false,gallery_info:false,nav:false,loader:false,preloads:false,thumbs_wrapper:false,scroll_back:false,scroll_forward:false,next_link:false,prev_link:false,slideshow:false,image_wrapper_width:0,image_wrapper_height:0,current_index:0,current_image:false,current_description:false,nav_display_width:0,settings:false,images:false,in_transition:false,animations:false,init:function(m,l){var k=this;this.wrapper=g(m);this.settings=l;this.setupElements();this.setupAnimations();if(this.settings.width){this.image_wrapper_width=this.settings.width;this.image_wrapper.width(this.settings.width);this.wrapper.width(this.settings.width)}else{this.image_wrapper_width=this.image_wrapper.width()}if(this.settings.height){this.image_wrapper_height=this.settings.height;this.image_wrapper.height(this.settings.height)}else{this.image_wrapper_height=this.image_wrapper.height()}this.nav_display_width=this.nav.width();this.current_index=0;this.current_image=false;this.current_description=false;this.in_transition=false;this.findImages();if(this.settings.display_next_and_prev){this.initNextAndPrev()}var i=function(n){return k.nextImage(n)};this.slideshow=new a(i,this.settings.slideshow);this.controls.append(this.slideshow.create());if(this.settings.slideshow.enable){this.slideshow.enable()}else{this.slideshow.disable()}if(this.settings.display_back_and_forward){this.initBackAndForward()}if(this.settings.enable_keyboard_move){this.initKeyEvents()}var j=parseInt(this.settings.start_at_index,10);if(window.location.hash&&window.location.hash.indexOf("#ad-image")===0){j=window.location.hash.replace(/[^0-9]+/g,"");if((j*1)!=j){j=this.settings.start_at_index}}this.loading(true);this.showImage(j,function(){if(k.settings.slideshow.autostart){k.preloadImage(j+1);k.slideshow.start()}});this.fireCallback(this.settings.callbacks.init)},setupAnimations:function(){this.animations={"slide-vert":f,"slide-hori":e,resize:d,fade:b,none:h}},setupElements:function(){this.controls=this.wrapper.find(".ad-controls");this.gallery_info=g('<p class="ad-info"></p>');this.controls.append(this.gallery_info);this.image_wrapper=this.wrapper.find(".ad-image-wrapper");this.image_wrapper.empty();this.nav=this.wrapper.find(".ad-nav");this.thumbs_wrapper=this.nav.find(".ad-thumbs");this.preloads=g('<div class="ad-preloads"></div>');this.loader=g('<img class="ad-loader" src="'+this.settings.loader_image+'">');this.image_wrapper.append(this.loader);this.loader.hide();g(document.body).append(this.preloads)},loading:function(i){if(i){this.loader.show()}else{this.loader.hide()}},addAnimation:function(i,j){if(g.isFunction(j)){this.animations[i]=j}},findImages:function(){var n=this;this.images=[];var m=0;var l=0;var k=this.thumbs_wrapper.find("a");var j=k.length;if(this.settings.thumb_opacity<1){k.find("img").css("opacity",this.settings.thumb_opacity)}k.each(function(p){var r=g(this);var q=r.attr("href");var o=r.find("img");if(!n.isImageLoaded(o[0])){o.load(function(){m+=this.parentNode.parentNode.offsetWidth;l++})}else{m+=o[0].parentNode.parentNode.offsetWidth;l++}r.addClass("ad-thumb"+p);r.click(function(){n.showImage(p);n.slideshow.stop();return false}).hover(function(){if(!g(this).is(".ad-active")&&n.settings.thumb_opacity<1){g(this).find("img").fadeTo(300,1)}n.preloadImage(p)},function(){if(!g(this).is(".ad-active")&&n.settings.thumb_opacity<1){g(this).find("img").fadeTo(300,n.settings.thumb_opacity)}});var r=false;if(o.data("ad-link")){r=o.data("ad-link")}else{if(o.attr("longdesc")&&o.attr("longdesc").length){r=o.attr("longdesc")}}var t=false;if(o.data("ad-desc")){t=o.data("ad-desc")}else{if(o.attr("alt")&&o.attr("alt").length){t=o.attr("alt")}}var s=false;if(o.data("ad-title")){s=o.data("ad-title")}else{if(o.attr("title")&&o.attr("title").length){s=o.attr("title")}}n.images[p]={thumb:o.attr("src"),image:q,error:false,preloaded:false,desc:t,title:s,size:false,link:r}});var i=setInterval(function(){if(j==l){m-=100;var q=n.nav.find(".ad-thumb-list");q.css("width",m+"px");var p=1;var o=q.height();while(p<201){q.css("width",(m+p)+"px");if(o!=q.height()){break}o=q.height();p++}clearInterval(i)}},100)},initKeyEvents:function(){var i=this;g(document).keydown(function(j){if(j.keyCode==39){i.nextImage();i.slideshow.stop()}else{if(j.keyCode==37){i.prevImage();i.slideshow.stop()}}})},initNextAndPrev:function(){this.next_link=g('<div class="ad-next"><div class="ad-next-image"></div></div>');this.prev_link=g('<div class="ad-prev"><div class="ad-prev-image"></div></div>');this.image_wrapper.append(this.next_link);this.image_wrapper.append(this.prev_link);var i=this;this.prev_link.add(this.next_link).mouseover(function(j){g(this).css("height",i.image_wrapper_height)}).mouseout(function(j){}).click(function(){if(g(this).is(".ad-next")){i.nextImage();i.slideshow.stop()}else{i.prevImage();i.slideshow.stop()}})},initBackAndForward:function(){var k=this;this.scroll_forward=g('<div class="ad-forward"></div>');this.scroll_back=g('<div class="ad-back"></div>');this.nav.append(this.scroll_forward);this.nav.prepend(this.scroll_back);var j=0;var i=false;g(this.scroll_back).add(this.scroll_forward).click(function(){var l=k.nav_display_width-50;if(k.settings.scroll_jump>0){var l=k.settings.scroll_jump}if(g(this).is(".ad-forward")){var m=k.thumbs_wrapper.scrollLeft()+l}else{var m=k.thumbs_wrapper.scrollLeft()-l}if(k.settings.slideshow.stop_on_scroll){k.slideshow.stop()}k.thumbs_wrapper.animate({scrollLeft:m+"px"});return false}).css("opacity",0.6).hover(function(){var l="left";if(g(this).is(".ad-forward")){l="right"}i=setInterval(function(){j++;if(j>30&&k.settings.slideshow.stop_on_scroll){k.slideshow.stop()}var m=k.thumbs_wrapper.scrollLeft()+1;if(l=="left"){m=k.thumbs_wrapper.scrollLeft()-1}k.thumbs_wrapper.scrollLeft(m)},10);g(this).css("opacity",1)},function(){j=0;clearInterval(i);g(this).css("opacity",0.6)})},_afterShow:function(){this.gallery_info.html((this.current_index+1)+" / "+this.images.length);if(!this.settings.cycle){this.prev_link.show().css("height",this.image_wrapper_height);this.next_link.show().css("height",this.image_wrapper_height);if(this.current_index==(this.images.length-1)){this.next_link.hide()}if(this.current_index==0){this.prev_link.hide()}}this.fireCallback(this.settings.callbacks.afterImageVisible)},_getContainedImageSize:function(j,i){if(i>this.image_wrapper_height){var k=j/i;i=this.image_wrapper_height;j=this.image_wrapper_height*k}if(j>this.image_wrapper_width){var k=i/j;j=this.image_wrapper_width;i=this.image_wrapper_width*k}return{width:j,height:i}},_centerImage:function(l,j,i){l.css("top","0px");if(i<this.image_wrapper_height){var k=this.image_wrapper_height-i;l.css("top",(k/2)+"px")}l.css("left","0px");if(j<this.image_wrapper_width){var k=this.image_wrapper_width-j;l.css("left",(k/2)+"px")}},_getDescription:function(i){var k=false;if(i.desc.length||i.title.length){var j="";if(i.title.length){j='<strong class="ad-description-title">'+i.title+"</strong>"}var k="";if(i.desc.length){k="<span>"+i.desc+"</span>"}k=g('<p class="ad-image-description">'+j+k+"</p>")}return k},showImage:function(i,l){if(this.images[i]&&!this.in_transition){var j=this;var k=this.images[i];this.in_transition=true;if(!k.preloaded){this.loading(true);this.preloadImage(i,function(){j.loading(false);j._showWhenLoaded(i,l)})}else{this._showWhenLoaded(i,l)}}},_showWhenLoaded:function(q,w){if(this.images[q]){var j=this;var l=this.images[q];var m=g(document.createElement("div")).addClass("ad-image");var o=g(new Image()).attr("src",l.image);if(l.link){var t=g('<a href="'+l.link+'" target="_blank"></a>');t.append(o);m.append(t)}else{m.append(o)}this.image_wrapper.prepend(m);var x=this._getContainedImageSize(l.size.width,l.size.height);o.attr("width",x.width);o.attr("height",x.height);m.css({width:x.width+"px",height:x.height+"px"});this._centerImage(m,x.width,x.height);var p=this._getDescription(l,m);if(p){if(!this.settings.description_wrapper){m.append(p);var i=x.width-parseInt(p.css("padding-left"),10)-parseInt(p.css("padding-right"),10);p.css("width",i+"px")}else{this.settings.description_wrapper.append(p)}}this.highLightThumb(this.nav.find(".ad-thumb"+q));var u="right";if(this.current_index<q){u="left"}this.fireCallback(this.settings.callbacks.beforeImageVisible);if(this.current_image||this.settings.animate_first_image){var v=this.settings.animation_speed;var s="swing";var n=this.animations[this.settings.effect].call(this,m,u,p);if(typeof n.speed!="undefined"){v=n.speed}if(typeof n.easing!="undefined"){s=n.easing}if(this.current_image){var k=this.current_image;var r=this.current_description;k.animate(n.old_image,v,s,function(){k.remove();if(r){r.remove()}})}m.animate(n.new_image,v,s,function(){j.current_index=q;j.current_image=m;j.current_description=p;j.in_transition=false;j._afterShow();j.fireCallback(w)})}else{this.current_index=q;this.current_image=m;j.current_description=p;this.in_transition=false;j._afterShow();this.fireCallback(w)}}},nextIndex:function(){if(this.current_index==(this.images.length-1)){if(!this.settings.cycle){return false}var i=0}else{var i=this.current_index+1}return i},nextImage:function(j){var i=this.nextIndex();if(i===false){return false}this.preloadImage(i+1);this.showImage(i,j);return true},prevIndex:function(){if(this.current_index==0){if(!this.settings.cycle){return false}var i=this.images.length-1}else{var i=this.current_index-1}return i},prevImage:function(j){var i=this.prevIndex();if(i===false){return false}this.preloadImage(i-1);this.showImage(i,j);return true},preloadAll:function(){var k=this;var j=0;function l(){if(j<k.images.length){j++;k.preloadImage(j,l)}}k.preloadImage(j,l)},preloadImage:function(j,m){if(this.images[j]){var l=this.images[j];if(!this.images[j].preloaded){var i=g(new Image());i.attr("src",l.image);if(!this.isImageLoaded(i[0])){this.preloads.append(i);var k=this;i.load(function(){l.preloaded=true;l.size={width:this.width,height:this.height};k.fireCallback(m)}).error(function(){l.error=true;l.preloaded=false;l.size=false})}else{l.preloaded=true;l.size={width:i[0].width,height:i[0].height};this.fireCallback(m)}}else{this.fireCallback(m)}}},isImageLoaded:function(i){if(typeof i.complete!="undefined"&&!i.complete){return false}if(typeof i.naturalWidth!="undefined"&&i.naturalWidth==0){return false}return true},highLightThumb:function(i){this.thumbs_wrapper.find(".ad-active").removeClass("ad-active");i.addClass("ad-active");if(this.settings.thumb_opacity<1){this.thumbs_wrapper.find("a:not(.ad-active) img").fadeTo(300,this.settings.thumb_opacity);i.find("img").fadeTo(300,1)}var j=i[0].parentNode.offsetLeft;j-=(this.nav_display_width/2)-(i[0].offsetWidth/2);this.thumbs_wrapper.animate({scrollLeft:j+"px"})},fireCallback:function(i){if(g.isFunction(i)){i.call(this)}}};function a(i,j){this.init(i,j)}a.prototype={start_link:false,stop_link:false,countdown:false,controls:false,settings:false,nextimage_callback:false,enabled:false,running:false,countdown_interval:false,init:function(i,k){var j=this;this.nextimage_callback=i;this.settings=k},create:function(){this.start_link=g('<span class="ad-slideshow-start">'+this.settings.start_label+"</span>");this.stop_link=g('<span class="ad-slideshow-stop">'+this.settings.stop_label+"</span>");this.countdown=g('<span class="ad-slideshow-countdown"></span>');this.controls=g('<div class="ad-slideshow-controls"></div>');this.controls.append(this.start_link).append(this.stop_link).append(this.countdown);this.countdown.hide();var i=this;this.start_link.click(function(){i.start()});this.stop_link.click(function(){i.stop()});g(document).keydown(function(j){if(j.keyCode==83){if(i.running){i.stop()}else{i.start()}}});return this.controls},disable:function(){this.enabled=false;this.stop();this.controls.hide()},enable:function(){this.enabled=true;this.controls.show()},toggle:function(){if(this.enabled){this.disable()}else{this.enable()}},start:function(){if(this.running||!this.enabled){return false}var i=this;this.running=true;this.controls.addClass("ad-slideshow-running");this._next();this.fireCallback(this.settings.onStart);return true},stop:function(){if(!this.running){return false}this.running=false;this.countdown.hide();this.controls.removeClass("ad-slideshow-running");clearInterval(this.countdown_interval);this.fireCallback(this.settings.onStop);return true},_next:function(){var k=this;var l=this.settings.countdown_prefix;var j=this.settings.countdown_sufix;clearInterval(k.countdown_interval);this.countdown.show().html(l+(this.settings.speed/1000)+j);var i=0;this.countdown_interval=setInterval(function(){i+=1000;if(i>=k.settings.speed){var n=function(){if(k.running){k._next()}i=0};if(!k.nextimage_callback(n)){k.stop()}i=0}var m=parseInt(k.countdown.text().replace(/[^0-9]/g,""),10);m--;if(m>0){k.countdown.html(l+m+j)}},1000)},fireCallback:function(i){if(g.isFunction(i)){i.call(this)}}}})(jQuery);

(function(b){var d={vertical:!1,rtl:!1,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},a=!1;b(window).bind("load.jcarousel",function(){a=!0});b.jcarousel=function(r,p){this.options=b.extend({},d,p||{});this.autoStopped=this.locked=!1;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!p||p.rtl===void 0){this.options.rtl=(b(r).attr("dir")||b("html").attr("dir")||"").toLowerCase()=="rtl"}this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl?"right":"left":"top";for(var q="",o=r.className.split(" "),m=0;m<o.length;m++){if(o[m].indexOf("jcarousel-skin")!=-1){b(r).removeClass(o[m]);q=o[m];break}}r.nodeName.toUpperCase()=="UL"||r.nodeName.toUpperCase()=="OL"?(this.list=b(r),this.clip=this.list.parents(".jcarousel-clip"),this.container=this.list.parents(".jcarousel-container")):(this.container=b(r),this.list=this.container.find("ul,ol").eq(0),this.clip=this.container.find(".jcarousel-clip"));if(this.clip.size()===0){this.clip=this.list.wrap("<div></div>").parent()}if(this.container.size()===0){this.container=this.clip.wrap("<div></div>").parent()}q!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+q+'"></div>');this.buttonPrev=b(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null){this.buttonPrev=b(this.options.buttonPrevHTML).appendTo(this.container)}this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext=b(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null){this.buttonNext=b(this.options.buttonNextHTML).appendTo(this.container)}this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var g=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null,q=this.list.children("li"),n=this;if(q.size()>0){var l=0,k=this.options.offset;q.each(function(){n.format(this,k++);l+=n.dimension(this,g)});this.list.css(this.wh,l+100+"px");if(!p||p.size===void 0){this.options.size=q.size()}}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){n.next()};this.funcPrev=function(){n.prev()};this.funcResize=function(){n.resizeTimer&&clearTimeout(n.resizeTimer);n.resizeTimer=setTimeout(function(){n.reload()},100)};this.options.initCallback!==null&&this.options.initCallback(this,"init");!a&&b.browser.safari?(this.buttons(!1,!1),b(window).bind("load.jcarousel",function(){n.setup()})):this.setup()};var c=b.jcarousel;c.fn=c.prototype={jcarousel:"0.2.8"};c.fn.extend=c.extend=b.extend;c.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=!1;this.tail=this.resizeTimer=this.timer=null;this.inTail=!1;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var e=this.pos(this.options.start,!0);this.prevFirst=this.prevLast=null;this.animate(e,!1);b(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize);this.options.setupCallback!==null&&this.options.setupCallback(this)}},reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,c.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=!1;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var f=this,h=Math.ceil(this.clipping()/this.options.visible),e=0,g=0;this.list.children("li").each(function(i){e+=f.dimension(this,h);i+1<f.first&&(g=e)});this.list.css(this.wh,e+"px");this.list.css(this.lt,-g+"px")}this.scroll(this.first,!1)},lock:function(){this.locked=!0;this.buttons()},unlock:function(){this.locked=!1;this.buttons()},size:function(e){if(e!==void 0){this.options.size=e,this.locked||this.buttons()}return this.options.size},has:function(f,h){if(h===void 0||!h){h=f}if(this.options.size!==null&&h>this.options.size){h=this.options.size}for(var e=f;e<=h;e++){var g=this.get(e);if(!g.length||g.hasClass("jcarousel-item-placeholder")){return !1}}return !0},get:function(e){return b(">.jcarousel-item-"+e,this.list)},add:function(g,m){var f=this.get(g),l=0,k=b(m);if(f.length===0){for(var h,i=c.intval(g),f=this.create(g);;){if(h=this.get(--i),i<=0||h.length){i<=0?this.list.prepend(f):h.after(f);break}}}else{l=this.dimension(f)}k.get(0).nodeName.toUpperCase()=="LI"?(f.replaceWith(k),f=k):f.empty().append(m);this.format(f.removeClass(this.className("jcarousel-item-placeholder")),g);k=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;l=this.dimension(f,k)-l;g>0&&g<this.first&&this.list.css(this.lt,c.intval(this.list.css(this.lt))-l+"px");this.list.css(this.wh,c.intval(this.list.css(this.wh))+l+"px");return f},remove:function(f){var g=this.get(f);if(g.length&&!(f>=this.first&&f<=this.last)){var e=this.dimension(g);f<this.first&&this.list.css(this.lt,c.intval(this.list.css(this.lt))+e+"px");g.remove();this.list.css(this.wh,c.intval(this.list.css(this.wh))-e+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(!1):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(!0):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(e){if(!this.locked&&!this.animating&&this.tail){this.pauseAuto();var f=c.intval(this.list.css(this.lt)),f=!e?f-this.tail:f+this.tail;this.inTail=!e;this.prevFirst=this.first;this.prevLast=this.last;this.animate(f)}},scroll:function(e,f){!this.locked&&!this.animating&&(this.pauseAuto(),this.animate(this.pos(e),f))},pos:function(B,z){var A=c.intval(this.list.css(this.lt));if(this.locked||this.animating){return A}this.options.wrap!="circular"&&(B=B<1?1:this.options.size&&B>this.options.size?this.options.size:B);for(var y=this.first>B,w=this.options.wrap!="circular"&&this.first<=1?1:this.first,t=y?this.get(w):this.get(this.last),x=y?w:w-1,v=null,u=0,s=!1,r=0;y?--x>=B:++x<B;){v=this.get(x);s=!v.length;if(v.length===0&&(v=this.create(x).addClass(this.className("jcarousel-item-placeholder")),t[y?"before":"after"](v),this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(x<=0||x>this.options.size))){t=this.get(this.index(x)),t.length&&(v=this.add(x,t.clone(!0)))}t=v;r=this.dimension(v);s&&(u+=r);if(this.first!==null&&(this.options.wrap=="circular"||x>=1&&(this.options.size===null||x<=this.options.size))){A=y?A+r:A-r}}for(var w=this.clipping(),q=[],f=0,p=0,t=this.get(B-1),x=B;++f;){v=this.get(x);s=!v.length;if(v.length===0){v=this.create(x).addClass(this.className("jcarousel-item-placeholder"));if(t.length===0){this.list.prepend(v)}else{t[y?"before":"after"](v)}if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(x<=0||x>this.options.size)){t=this.get(this.index(x)),t.length&&(v=this.add(x,t.clone(!0)))}}t=v;r=this.dimension(v);if(r===0){throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...")}this.options.wrap!="circular"&&this.options.size!==null&&x>this.options.size?q.push(v):s&&(u+=r);p+=r;if(p>=w){break}x++}for(v=0;v<q.length;v++){q[v].remove()}u>0&&(this.list.css(this.wh,this.dimension(this.list)+u+"px"),y&&(A-=u,this.list.css(this.lt,c.intval(this.list.css(this.lt))-u+"px")));u=B+f-1;if(this.options.wrap!="circular"&&this.options.size&&u>this.options.size){u=this.options.size}if(x>u){f=0;x=u;for(p=0;++f;){v=this.get(x--);if(!v.length){break}p+=this.dimension(v);if(p>=w){break}}}x=u-f+1;this.options.wrap!="circular"&&x<1&&(x=1);if(this.inTail&&y){A+=this.tail,this.inTail=!1}this.tail=null;if(this.options.wrap!="circular"&&u==this.options.size&&u-f+1>=1&&(y=c.intval(this.get(u).css(!this.options.vertical?"marginRight":"marginBottom")),p-y>w)){this.tail=p-w-y}if(z&&B===this.options.size&&this.tail){A-=this.tail,this.inTail=!0}for(;B-->x;){A+=this.dimension(this.get(B))}this.prevFirst=this.first;this.prevLast=this.last;this.first=x;this.last=u;return A},animate:function(g,j){if(!this.locked&&!this.animating){this.animating=!0;var e=this,i=function(){e.animating=!1;g===0&&e.list.css(e.lt,0);!e.autoStopped&&(e.options.wrap=="circular"||e.options.wrap=="both"||e.options.wrap=="last"||e.options.size===null||e.last<e.options.size||e.last==e.options.size&&e.tail!==null&&!e.inTail)&&e.startAuto();e.buttons();e.notify("onAfterAnimation");if(e.options.wrap=="circular"&&e.options.size!==null){for(var f=e.prevFirst;f<=e.prevLast;f++){f!==null&&!(f>=e.first&&f<=e.last)&&(f<1||f>e.options.size)&&e.remove(f)}}};this.notify("onBeforeAnimation");if(!this.options.animation||j===!1){this.list.css(this.lt,g+"px"),i()}else{var h=!this.options.vertical?this.options.rtl?{right:g}:{left:g}:{top:g},i={duration:this.options.animation,easing:this.options.easing,complete:i};if(b.isFunction(this.options.animationStepCallback)){i.step=this.options.animationStepCallback}this.list.animate(h,i)}}},startAuto:function(e){if(e!==void 0){this.options.auto=e}if(this.options.auto===0){return this.stopAuto()}if(this.timer===null){this.autoStopped=!1;var f=this;this.timer=window.setTimeout(function(){f.next()},this.options.auto*1000)}},stopAuto:function(){this.pauseAuto();this.autoStopped=!0},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer),this.timer=null}},buttons:function(f,g){if(f==null&&(f=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size),!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!==null&&this.last>=this.options.size)){f=this.tail!==null&&!this.inTail}if(g==null&&(g=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1),!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)){g=this.tail!==null&&this.inTail}var e=this;this.buttonNext.size()>0?(this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext),f&&this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext),this.buttonNext[f?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",f?!1:!0),this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=f&&this.buttonNext.each(function(){e.options.buttonNextCallback(e,this,f)}).data("jcarouselstate",f)):this.options.buttonNextCallback!==null&&this.buttonNextState!=f&&this.options.buttonNextCallback(e,null,f);this.buttonPrev.size()>0?(this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),g&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),this.buttonPrev[g?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",g?!1:!0),this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=g&&this.buttonPrev.each(function(){e.options.buttonPrevCallback(e,this,g)}).data("jcarouselstate",g)):this.options.buttonPrevCallback!==null&&this.buttonPrevState!=g&&this.options.buttonPrevCallback(e,null,g);this.buttonNextState=f;this.buttonPrevState=g},notify:function(e){var f=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",e,f);this.prevFirst!==this.first&&(this.callback("itemFirstInCallback",e,f,this.first),this.callback("itemFirstOutCallback",e,f,this.prevFirst));this.prevLast!==this.last&&(this.callback("itemLastInCallback",e,f,this.last),this.callback("itemLastOutCallback",e,f,this.prevLast));this.callback("itemVisibleInCallback",e,f,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",e,f,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(t,r,s,q,o,l,p){if(!(this.options[t]==null||typeof this.options[t]!="object"&&r!="onAfterAnimation")){var n=typeof this.options[t]=="object"?this.options[t][r]:this.options[t];if(b.isFunction(n)){var m=this;if(q===void 0){n(m,s,r)}else{if(o===void 0){this.get(q).each(function(){n(m,this,q,s,r)})}else{for(var t=function(e){m.get(e).each(function(){n(m,this,e,s,r)})},g=q;g<=o;g++){g!==null&&!(g>=l&&g<=p)&&t(g)}}}}}},create:function(e){return this.format("<li></li>",e)},format:function(f,h){for(var f=b(f),e=f.get(0).className.split(" "),g=0;g<e.length;g++){e[g].indexOf("jcarousel-")!=-1&&f.removeClass(e[g])}f.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+h)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",h);return f},className:function(e){return e+" "+e+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(f,h){var e=b(f);if(h==null){return !this.options.vertical?e.outerWidth(!0)||c.intval(this.options.itemFallbackDimension):e.outerHeight(!0)||c.intval(this.options.itemFallbackDimension)}else{var g=!this.options.vertical?h-c.intval(e.css("marginLeft"))-c.intval(e.css("marginRight")):h-c.intval(e.css("marginTop"))-c.intval(e.css("marginBottom"));b(e).css(this.wh,g+"px");return this.dimension(e)}},clipping:function(){return !this.options.vertical?this.clip[0].offsetWidth-c.intval(this.clip.css("borderLeftWidth"))-c.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-c.intval(this.clip.css("borderTopWidth"))-c.intval(this.clip.css("borderBottomWidth"))},index:function(e,f){if(f==null){f=this.options.size}return Math.round(((e-1)/f-Math.floor((e-1)/f))*f)+1}});c.extend({defaults:function(e){return b.extend(d,e||{})},intval:function(e){e=parseInt(e,10);return isNaN(e)?0:e},windowLoaded:function(){a=!0}});b.fn.jcarousel=function(f){if(typeof f=="string"){var g=b(this).data("jcarousel"),e=Array.prototype.slice.call(arguments,1);return g[f].apply(g,e)}else{return this.each(function(){var h=b(this).data("jcarousel");h?(f&&b.extend(h.options,f),h.reload()):b(this).data("jcarousel",new c(this,f))})}}})(jQuery);

(function(c){var a=c.scrollTo=function(d,f,g){c(window).scrollTo(d,f,g)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var d=this,f=!d.nodeName||c.inArray(d.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!f){return d}var g=(d.contentWindow||d).document||d.ownerDocument||d;return c.browser.safari||g.compatMode=="BackCompat"?g.body:g.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var n=this,l=c(n),m=f,j,k={},h=l.is("html,body");switch(typeof m){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(m)){m=b(m);break}m=c(m,this);case"object":if(m.is||m.style){j=(m=c(m)).offset()}}c.each(d.axis.split(""),function(q,r){var t=r=="x"?"Left":"Top",s=t.toLowerCase(),v="scroll"+t,p=n[v],g=a.max(n,r);if(j){k[v]=j[s]+(h?0:p-l.offset()[s]);if(d.margin){k[v]-=parseInt(m.css("margin"+t))||0;k[v]-=parseInt(m.css("border"+t+"Width"))||0}k[v]+=d.offset[s]||0;if(d.over[s]){k[v]+=m[r=="x"?"width":"height"]()*d.over[s]}}else{var u=m[s];k[v]=u.slice&&u.slice(-1)=="%"?parseFloat(u)/100*g:u}if(/^\d+$/.test(k[v])){k[v]=k[v]<=0?0:Math.min(k[v],g)}if(!q&&d.queue){if(p!=k[v]){i(d.onAfterFirst)}delete k[v]}});i(d.onAfter);function i(g){l.animate(k,e,d.easing,g&&function(){g.call(this,f,d)})}}).end()};a.max=function(g,j){var n=j=="x"?"Width":"Height",k="scroll"+n;if(!c(g).is("html,body")){return g[k]-c(g)[n.toLowerCase()]()}var o="client"+n,f=g.ownerDocument.documentElement,d=g.ownerDocument.body;return Math.max(f[k],d[k])-Math.min(f[o],d[o])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);

(function(g){g.tools=g.tools||{version:"v1.2.5"},g.tools.scrollable={conf:{activeClass:"active",circular:!1,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:!0,mousewheel:!1,next:".next",prev:".prev",speed:400,vertical:!1,touch:!0,wheelSpeed:0}};function f(k,e){var m=parseInt(k.css(e),10);if(m){return m}var l=k[0].currentStyle;return l&&l.width&&parseInt(l.width,10)}function j(a,k){var e=g(k);return e.length<2?e:a.parent().find(k)}var i;function h(x,w){var v=this,u=x.add(v),t=x.children(),s=0,r=w.vertical;i||(i=v),t.length>1&&(t=g(w.items,x)),g.extend(v,{getConf:function(){return w},getIndex:function(){return s},getSize:function(){return v.getItems().size()},getNaviButtons:function(){return d.add(c)},getRoot:function(){return x},getItemWrap:function(){return t},getItems:function(){return t.children(w.item).not("."+w.clonedClass)},move:function(k,e){return v.seekTo(s+k,e)},next:function(b){return v.move(1,b)},prev:function(b){return v.move(-1,b)},begin:function(b){return v.seekTo(0,b)},end:function(b){return v.seekTo(v.getSize()-1,b)},focus:function(){i=v;return v},addItem:function(e){e=g(e),w.circular?(t.children("."+w.clonedClass+":last").before(e),t.children("."+w.clonedClass+":first").replaceWith(e.clone().addClass(w.clonedClass))):t.append(e),u.trigger("onAddItem",[e]);return v},seekTo:function(o,B,z){o.jquery||(o*=1);if(w.circular&&o===0&&s==-1&&B!==0){return v}if(!w.circular&&o<0||o>v.getSize()||o<-1){return v}var y=o;o.jquery?o=v.getItems().index(o):y=v.getItems().eq(o);var e=g.Event("onBeforeSeek");if(!z){u.trigger(e,[o,B]);if(e.isDefaultPrevented()||!y.length){return v}}var A=r?{top:-y.position().top}:{left:-y.position().left};s=o,i=v,B===undefined&&(B=w.speed),t.animate(A,B,w.easing,z||function(){u.trigger("onSeek",[o])});return v}}),g.each(["onBeforeSeek","onSeek","onAddItem"],function(e,k){g.isFunction(w[k])&&g(v).bind(k,w[k]),v[k]=function(l){l&&g(v).bind(k,l);return v}});if(w.circular){var q=v.getItems().slice(-1).clone().prependTo(t),p=v.getItems().eq(1).clone().appendTo(t);q.add(p).addClass(w.clonedClass),v.onBeforeSeek(function(k,e,l){if(!k.isDefaultPrevented()){if(e==-1){v.seekTo(q,l,function(){v.end(0)});return k.preventDefault()}e==v.getSize()&&v.seekTo(p,l,function(){v.begin(0)})}}),v.seekTo(0,0,function(){})}var d=j(x,w.prev).click(function(){v.prev()}),c=j(x,w.next).click(function(){v.next()});!w.circular&&v.getSize()>1&&(v.onBeforeSeek(function(k,e){setTimeout(function(){k.isDefaultPrevented()||(d.toggleClass(w.disabledClass,e<=0),c.toggleClass(w.disabledClass,e>=v.getSize()-1))},1)}),w.initialIndex||d.addClass(w.disabledClass)),w.mousewheel&&g.fn.mousewheel&&x.mousewheel(function(k,e){if(w.mousewheel){v.move(e<0?1:-1,w.wheelSpeed||50);return !1}});if(w.touch){var a={};t[0].ontouchstart=function(k){var e=k.touches[0];a.x=e.clientX,a.y=e.clientY},t[0].ontouchmove=function(k){if(k.touches.length==1&&!t.is(":animated")){var e=k.touches[0],m=a.x-e.clientX,l=a.y-e.clientY;v[r&&l>0||!r&&m>0?"next":"prev"](),k.preventDefault()}}}w.keyboard&&g(document).bind("keydown.scrollable",function(e){if(w.keyboard&&!e.altKey&&!e.ctrlKey&&!g(e.target).is(":input")){if(w.keyboard!="static"&&i!=v){return}var k=e.keyCode;if(r&&(k==38||k==40)){v.move(k==38?-1:1);return e.preventDefault()}if(!r&&(k==37||k==39)){v.move(k==37?-1:1);return e.preventDefault()}}}),w.initialIndex&&v.seekTo(w.initialIndex,0,function(){})}g.fn.scrollable=function(a){var d=this.data("scrollable");if(d){return d}a=g.extend({},g.tools.scrollable.conf,a),this.each(function(){d=new h(g(this),a),g(this).data("scrollable",d)});return a.api?d:this}})(jQuery);(function(d){var c=d.tools.scrollable;c.autoscroll={conf:{autoplay:!0,interval:3000,autopause:!0}},d.fn.autoscroll=function(f){typeof f=="number"&&(f={interval:f});var b=d.extend({},c.autoscroll.conf,f),a;this.each(function(){var e=d(this).data("scrollable");e&&(a=e);var h,g=!0;e.play=function(){h||(g=!1,h=setInterval(function(){e.next()},b.interval))},e.pause=function(){h=clearInterval(h)},e.stop=function(){e.pause(),g=!0},b.autopause&&e.getRoot().add(e.getNaviButtons()).hover(e.pause,e.play),b.autoplay&&e.play()});return b.api?a:this}})(jQuery);

var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,e=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(e),j=c?/mac/.test(c):/mac/.test(e),g=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",f=[0,0,0],k=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){k=aB.plugins[ab].description;if(k&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");f[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);f[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);f[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var i=new ActiveXObject(X);if(i){k=i.GetVariable("$version");if(k){d=true;k=k.split(" ")[1].split(",");f=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]}}}catch(b){}}}return{w3:a,pv:f,wk:g,ie:d,win:h,mac:j}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b)}catch(a){return}ak=true;var d=Z.length;for(var c=0;c<d;c++){Z[c]()}}function aj(a){if(ak){a()}else{Z[Z.length]=a}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)}else{if(typeof af.onload=="function"){var b=af.onload;af.onload=function(){b();a()}}else{af.onload=a}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var d=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=d.appendChild(b);if(a){var c=0;(function(){if(typeof a.GetVariable!=aq){var e=a.GetVariable("$version");if(e){e=e.split(" ")[1].split(",");ah.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}d.removeChild(b);a=null;am()})()}else{am()}}function am(){var g=aG.length;if(g>0){for(var h=0;h<g;h++){var c=aG[h].id;var l=aG[h].callbackFn;var a={success:false,id:c};if(ah.pv[0]>0){var i=aS(c);if(i){if(ao(aG[h].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(l){a.success=true;a.ref=av(c);l(a)}}else{if(aG[h].expressInstall&&au()){var e={};e.data=aG[h].expressInstall;e.width=i.getAttribute("width")||"0";e.height=i.getAttribute("height")||"0";if(i.getAttribute("class")){e.styleclass=i.getAttribute("class")}if(i.getAttribute("align")){e.align=i.getAttribute("align")}var f={};var d=i.getElementsByTagName("param");var k=d.length;for(var j=0;j<k;j++){if(d[j].getAttribute("name").toLowerCase()!="movie"){f[d[j].getAttribute("name")]=d[j].getAttribute("value")}}ae(e,f,c,l)}else{aF(i);if(l){l(a)}}}}}else{ay(c,true);if(l){var b=av(c);if(b&&typeof b.SetVariable!=aq){a.success=true;a.ref=b}l(a)}}}}}function av(b){var d=null;var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c}else{var a=c.getElementsByTagName(aD)[0];if(a){d=a}}}return d}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(f,d,h,e){aU=true;ap=e||null;at={success:false,id:h};var a=aS(h);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=h}f.id=ac;if(typeof f.width==aq||(!/%$/.test(f.width)&&parseInt(f.width,10)<310)){f.width="310"}if(typeof f.height==aq||(!/%$/.test(f.height)&&parseInt(f.height,10)<137)){f.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof d.flashvars!=aq){d.flashvars+="&"+c}else{d.flashvars=c}if(ah.ie&&ah.win&&a.readyState!=4){var g=ar("div");h+="SWFObjectNew";g.setAttribute("id",h);a.parentNode.insertBefore(g,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}aA(f,d,h)}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(aO(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(aO(a),a)}}function aO(b){var d=ar("div");if(ah.win&&ah.ie){d.innerHTML=b.innerHTML}else{var e=b.getElementsByTagName(aD)[0];if(e){var a=e.childNodes;if(a){var f=a.length;for(var c=0;c<f;c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))}}}}}return d}function aA(e,g,c){var d,a=aS(c);if(ah.wk&&ah.wk<312){return d}if(a){if(typeof e.id==aq){e.id=c}if(ah.ie&&ah.win){var f="";for(var i in e){if(e[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){g.movie=e[i]}else{if(i.toLowerCase()=="styleclass"){f+=' class="'+e[i]+'"'}else{if(i.toLowerCase()!="classid"){f+=" "+i+'="'+e[i]+'"'}}}}}var h="";for(var j in g){if(g[j]!=Object.prototype[j]){h+='<param name="'+j+'" value="'+g[j]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+f+">"+h+"</object>";ag[ag.length]=e.id;d=aS(e.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var k in e){if(e[k]!=Object.prototype[k]){if(k.toLowerCase()=="styleclass"){b.setAttribute("class",e[k])}else{if(k.toLowerCase()!="classid"){b.setAttribute(k,e[k])}}}}for(var l in g){if(g[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){aQ(b,l,g[l])}}a.parentNode.replaceChild(b,a);d=b}}return d}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);b.appendChild(a)}function aw(a){var b=aS(a);if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function aT(a){var b=aS(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function aS(a){var c=null;try{c=aL.getElementById(a)}catch(b){}return c}function ar(a){return aL.createElement(a)}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b]}function ao(a){var b=ah.pv,c=a.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false}function az(b,f,a,c){if(ah.ie&&ah.mac){return}var e=aL.getElementsByTagName("head")[0];if(!e){return}var g=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null}if(!aH||an!=g){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",g);aH=e.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=g}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,f)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+f+"}"))}}}function ay(a,c){if(!aI){return}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;for(var b=0;b<a;b++){al[b][0].detachEvent(al[b][1],al[b][2])}var d=ag.length;for(var c=0;c<d;c++){aw(ag[c])}for(var e in ah){ah[e]=null}ah=null;for(var f in swfobject){swfobject[f]=null}swfobject=null})}}();return{registerObject:function(a,e,c,b){if(ah.w3&&a&&e){var d={};d.id=a;d.swfVersion=e;d.expressInstall=c;d.callbackFn=b;aG[aG.length]=d;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(k,e,h,f,c,a,b,i,g,j){var d={success:false,id:e};if(ah.w3&&!(ah.wk&&ah.wk<312)&&k&&e&&h&&f&&c){ay(e,false);aj(function(){h+="";f+="";var q={};if(g&&typeof g===aD){for(var o in g){q[o]=g[o]}}q.data=k;q.width=h;q.height=f;var n={};if(i&&typeof i===aD){for(var p in i){n[p]=i[p]}}if(b&&typeof b===aD){for(var l in b){if(typeof n.flashvars!=aq){n.flashvars+="&"+l+"="+b[l]}else{n.flashvars=l+"="+b[l]}}}if(ao(c)){var m=aA(q,n,e);if(q.id==e){ay(e,true)}d.success=true;d.ref=m}else{if(a&&au()){q.data=a;ae(q,n,e,j);return}else{ay(e,true)}}if(j){j(d)}})}else{if(j){j(d)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(a,b,c){if(ah.w3){return aA(a,b,c)}else{return undefined}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;if(a){if(/\?/.test(a)){a=a.split("?")[1]}if(b==null){return ai(a)}var c=a.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var a=aS(ac);if(a&&aJ){a.parentNode.replaceChild(aJ,a);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();

(function(a,b,c){function Y(c,d,e){var g=b.createElement(c);return d&&(g.id=f+d),e&&(g.style.cssText=e),a(g)}function Z(a){var b=y.length,c=(Q+a)%b;return c<0?b+c:c}function $(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function _(a){return K.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a)}function ba(){var b;K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.slice(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function bb(b,c){a.event.trigger(b),c&&c.call(P)}function bc(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(W.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(W.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,function(){W.next(),d()}),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function bd(b){if(!U){P=b,ba(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=$(K.initialWidth,"x"),K.h=$(K.initialHeight,"y"),W.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),bb(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}W.load(!0)}}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"Изображение {current} из {total}",previous:"предыдущее",next:"следующее",close:"закрыть",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X="div";W=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{},W.init();if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}return c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bd(f[0]),f},W.init=function(){if(!r){if(!a("body")[0]){a(W.init);return}z=a(c),r=Y(X).attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y(X,"Overlay",o?"position:absolute":"").hide(),s=Y(X,"Wrapper"),t=Y(X,"Content").append(A=Y(X,"LoadedContent","width:0; height:0; overflow:hidden"),C=Y(X,"LoadingOverlay").add(Y(X,"LoadingGraphic")),D=Y(X,"Title"),E=Y(X,"Current"),G=Y(X,"Next"),H=Y(X,"Previous"),F=Y(X,"Slideshow").bind(h,bc),I=Y(X,"Close")),s.append(Y(X).append(Y(X,"TopLeft"),u=Y(X,"TopCenter"),Y(X,"TopRight")),Y(X,!1,"clear:left").append(v=Y(X,"MiddleLeft"),t,w=Y(X,"MiddleRight")),Y(X,!1,"clear:left").append(Y(X,"BottomLeft"),x=Y(X,"BottomCenter"),Y(X,"BottomRight"))).find("div div").css({"float":"left"}),B=Y(X,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){W.next()}),H.click(function(){W.prev()}),I.click(function(){W.close()}),J=G.add(H).add(E).add(F),q.click(function(){K.overlayClose&&W.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),W.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})}},W.remove=function(){r.add(q).remove(),r=null,a("."+g).removeData(e).removeClass(g)},W.position=function(a,b){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var c=0,d=0,e=r.offset();z.unbind("resize."+f),r.css({top:-99999,left:-99999}),K.fixed&&!o?r.css({position:"fixed"}):(c=z.scrollTop(),d=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?d+=Math.max(z.width()-K.w-O-M-$(K.right,"x"),0):K.left!==!1?d+=$(K.left,"x"):d+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?c+=Math.max(z.height()-K.h-N-L-$(K.bottom,"y"),0):K.top!==!1?c+=$(K.top,"y"):c+=Math.round(Math.max(z.height()-K.h-N-L,0)/2),r.css({top:e.top,left:e.left}),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:c,left:d},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",b&&b(),setTimeout(function(){z.bind("resize."+f,W.position)},1)},step:function(){g(this)}})},W.resize=function(a){S&&(a=a||{},a.width&&(K.w=$(a.width,"x")-O-M),a.innerWidth&&(K.w=$(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=$(a.height,"y")-N-L),a.innerHeight&&(K.h=$(a.innerHeight,"y")),!a.innerHeight&&!a.height&&(A.css({height:"auto"}),K.h=A.height()),A.css({height:K.h}),W.position(K.transition==="none"?0:K.speed))},W.prep=function(b){function g(){return K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w,K.w}function h(){return K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h,K.h}if(!S)return;var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y(X,"LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function q(){n&&r[0].style.removeAttribute("filter")}var b,c,g=y.length,h,i="frameBorder",k="allowTransparency",l,o,p;if(!S)return;l=function(){clearTimeout(V),C.hide(),bb(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show();if(g>1){typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",g)).show(),G[K.loop||Q<g-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),K.slideshow&&F.show();if(K.preloading){b=[Z(-1),Z(1)];while(c=y[b.pop()])o=a.data(c,e).href||c.href,a.isFunction(o)&&(o=o.call(c)),_(o)&&(p=new Image,p.src=o)}}else J.hide();K.iframe?(h=Y("iframe")[0],i in h&&(h[i]=0),k in h&&(h[k]="true"),h.name=f+ +(new Date),K.fastIframe?l():a(h).one("load",l),h.src=K.href,K.scrolling||(h.scrolling="no"),a(h).addClass(f+"Iframe").appendTo(A).one(m,function(){h.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,q):q()},K.transition==="fade"?r.fadeTo(d,0,function(){W.position(0,c)}):W.position(d,c)},W.load=function(b){var c,d,e=W.prep;T=!0,R=!1,P=y[Q],b||ba(),bb(m),bb(i,K.onLoad),K.h=K.height?$(K.height,"y")-N-L:K.innerHeight&&$(K.innerHeight,"y"),K.w=K.width?$(K.width,"x")-O-M:K.innerWidth&&$(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=$(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=$(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,V=setTimeout(function(){C.show()},100),K.inline?(Y(X).hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):_(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y(X,"Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){W.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y(X,"Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},W.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Z(1),W.load())},W.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Z(-1),W.load())},W.close=function(){S&&!U&&(U=!0,S=!1,bb(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),bb(m),A.remove(),setTimeout(function(){U=!1,bb(l,K.onClosed)},1)}))},W.element=function(){return a(P)},W.settings=d,a("."+g,b).live("click",function(a){a.which>1||a.shiftKey||a.altKey||a.metaKey||(a.preventDefault(),bd(this))}),W.init()})(jQuery,document,this);


