(function(a){a.fn.extend({mousewheel:function(c){if(!c.guid)c.guid=a.event.guid++;if(!a.event._mwCache)a.event._mwCache=[];return this.each(function(){if(this._mwHandlers)return this._mwHandlers.push(c);else this._mwHandlers=[];this._mwHandlers.push(c);var f=this;this._mwHandler=function(d){d=a.event.fix(d||window.event);a.extend(d,this._mwCursorPos||{});var g=0,k=true;if(d.wheelDelta)g=d.wheelDelta/120;if(d.detail)g=-d.detail/3;if(window.opera)g=-d.wheelDelta;for(var t=0;t<f._mwHandlers.length;t++)if(f._mwHandlers[t])if(f._mwHandlers[t].call(f,
d,g)===false){k=false;d.preventDefault();d.stopPropagation()}return k};if(a.browser.mozilla&&!this._mwFixCursorPos){this._mwFixCursorPos=function(d){this._mwCursorPos={pageX:d.pageX,pageY:d.pageY,clientX:d.clientX,clientY:d.clientY}};a(this).bind("mousemove",this._mwFixCursorPos)}if(this.addEventListener)a.browser.mozilla?this.addEventListener("DOMMouseScroll",this._mwHandler,false):this.addEventListener("mousewheel",this._mwHandler,false);else this.onmousewheel=this._mwHandler;a.event._mwCache.push(a(this))})},
unmousewheel:function(c){return this.each(function(){if(c&&this._mwHandlers)for(var f=0;f<this._mwHandlers.length;f++)this._mwHandlers[f]&&this._mwHandlers[f].guid==c.guid&&delete this._mwHandlers[f];else{a.browser.mozilla&&!this._mwFixCursorPos&&a(this).unbind("mousemove",this._mwFixCursorPos);if(this.addEventListener)a.browser.mozilla?this.removeEventListener("DOMMouseScroll",this._mwHandler,false):this.removeEventListener("mousewheel",this._mwHandler,false);else this.onmousewheel=null;this._mwHandlers=
this._mwHandler=this._mwFixCursorPos=this._mwCursorPos=null}})}});a(window).one("unload",function(){for(var c=a.event._mwCache||[],f=0;f<c.length;f++)c[f].unmousewheel()})})(jQuery);var IE6=navigator.userAgent.indexOf("MSIE 6")>=0?true:false;jQuery.extend(jQuery.easing,{easeInOutQuart:function(a,c,f,d,g){if((c/=g/2)<1)return d/2*c*c*c*c+f;return-d/2*((c-=2)*c*c*c-2)+f}});
(function(a){$$=a.fn.loadmailer=function(){function c(e){return e.indexOf(".")>2&&e.indexOf("@")>0}function f(e){e.style.backgroundColor="#F88"}function d(e){e.style.backgroundColor="#FFF"}function g(e){if(!e.value||e.value.length==0){f(e);return false}d(e);return true}function k(){w.css("display","none");u.css("display","block")}function t(){u.css("display","none");q.css("display","block")}function D(){var e=true;g(l.find("#name")[0])||(e=false);var n=l.find("#from")[0];if(!g(n)||!c(n.value)){f(n);
e=false}n=l.find("#subject")[0];g(n)||(e=false);n=l.find("#message")[0];g(n)||(e=false);if(e){e=l.serialize();k();a.ajax({type:"post",url:"send.php",data:e,success:function(){t()}})}return false}function h(){w.css({display:"block",opacity:1});u.css("display","none");q.css("display","none");l.find("#name")[0].value="";l.find("#from")[0].value="";l.find("#subject")[0].value="";l.find("#message")[0].value=""}var r=a(this),w=r.find("#msg"),u=r.find("#sd"),q=r.find("#st"),l=r.find("form");window.resetMail=
h;r.find("a").bind("click",D)}})(jQuery);
(function(a){$$=a.fn.loadgallery=function(c,f){function d(){E=false;if(x){x=false;h.removeClass("tdragcur");h.addClass("thovercur")}}function g(b,j){if(e){var s=e;e.animate({opacity:0},400,function(){s.remove()});w[A].removeClass("selected")}e=b;h.stop().animate({scrollTop:q[j]},400,function(){f.append(b);b.stop().animate({opacity:1},400,function(){a.browser.msie&&this.style.removeAttribute("filter")})});w[j].addClass("selected");A=j}function k(){if(i!=r.length){var b=i,j=a(r.get(i));w[i]=j;u[i]=
a("<div class='g-view'></div>");l[i]=j.children("span");l[i].remove();u[i].append(l[i]);var s=u[i],F=i*70+10;q[i]=i*70-230;if(q[i]<0)q[i]=0;if(q[i]>y)q[i]=y;i++;var G=a(new Image),H=a(new Image),J="gallery/"+j.attr("src")+".jpg",z="gallery/t"+j.attr("src")+".jpg";H.load(function(){G.load(function(){n++;var v=this.width,B=this.height;s.append(G);j.prepend(H);s.css({left:t/2-v/2-8,top:D/2-B/2-5,opacity:0});j.css({top:F});window.setTimeout(k,10);if(a.browser.msie){G.fadeIn(function(){this.style.removeAttribute("filter")});
j.fadeIn(function(){this.style.removeAttribute("filter")})}else j.fadeIn();j.bind("mouseup",function(){if(!x){c();g(s,b)}});j.prepend(a("<div class='bbr sprite bord'></div><div class='bbl sprite bord'></div><div class='btr sprite bord'></div><div class='btl sprite bord'></div><div class='tb spriteud bord'></div><div class='tt spriteud bord'></div><div class='tl spritelr bord'></div><div class='tr spritelr bord'></div>"));var o="<div class='bbr sprite bord'></div><div class='bbl sprite bord'></div><div class='btr sprite bord'></div><div class='btl sprite bord'></div>";
o=o+"<div class='tb spriteud bord' style='width:"+(v-2)+"px'></div>";o=o+"<div class='tt spriteud bord' style='width:"+(v-2)+"px'></div>";o=o+"<div class='tl spritelr bord' style='height:"+(B+7)+"px'></div>";o=o+"<div class='tr spritelr bord' style='height:"+(B+7)+"px'></div>";s.prepend(a(o))}).attr("src",J)}).attr("src",z)}}var t=800,D=400,h=a(this),r=h.find("li"),w=[],u=[],q=[],l=[],e=false,n=0,A=false,i=0,y=r.length*70-500,E=false,x=false,C,m;h.bind("mousedown",function(b){C=b.clientY;E=true;return false});
a("body").mousewheel(function(b,j){m=h.scrollTop()-j*20;if(m<0)m=0;else if(m>=y)m=y;h.scrollTop(m)});h.bind("mousemove",function(b){if(E)if(x){m=h.scrollTop()+(C-b.clientY);if(m<0)m=0;else if(m>=y)m=y;h.scrollTop(m);C=b.clientY}else{b=C-b.clientY;if(b>5||b<-5){x=true;h.removeClass("thovercur");h.addClass("tdragcur")}}});h.addClass("thovercur");h.bind("mouseup",function(b){d(b);return false});h.bind("mouseleave",function(b){d(b);return false});a("#next").bind("click",function(){var b=A+1;if(b>=n)b=
0;g(u[b],b);return false});a("#prev").bind("click",function(){var b=A-1;if(b<0)b=n-1;g(u[b],b);return false});window.setTimeout(k,10);window.setTimeout(k,10);window.setTimeout(k,10)}})(jQuery);$(document).ready(function(){IE6&&document.execCommand("BackgroundImageCache",false,true);$("*").each(function(){tthis=$(this);tthis[0].oncontextmenu=function(){return false};$.browser.msie&&tthis.bind("dragstart",function(){return false})})});
$(window).load(function(){function a(){o.stop().animate({height:0},400,function(){o.css("display","none")});v&&z.stop().animate({opacity:0})}function c(){o.stop().css("display","block").animate({height:500},400);v&&z.stop().animate({opacity:0.5})}function f(){if(F){var p=F;s&&s.removeClass("chosen");p.stop();p.animate({height:0},600,"linear",function(){p.css("display","none")})}}function d(p){if(G)J.stop().animate({backgroundPosition:p+"px 0px",opacity:1},1500,"easeInOutQuart");else H=p}function g(p,
K,M,N){if(F!=K){f();F=K;s=p;d(M,N);s&&s.addClass("chosen");K.stop().css({display:"block",height:0}).animate({height:400},3E3,"easeInOutQuart")}}function k(){v&&z.stop().animate({opacity:0},function(){v=false;z.css("display","none")})}function t(){k();g(E,e,0,368)}function D(){k();g(x,n,-400,252)}function h(){k();g(C,i,-1010,147)}function r(){k();g(m,y,-1470,50)}function w(){k();g(b,j,-1250,50)}function u(){if(v)z.css("display","block").stop().animate({opacity:0.5},2E3);else{z.css({opacity:0,display:"block"}).animate({opacity:0.5},
2E3);v=true}g(null,A,-600,200)}function q(){I&&I.css("display","none");var p=Math.floor(Math.random()*L.length);I=$(L[p]);I.fadeIn(500);window.setTimeout(l,1E4)}function l(){I.fadeOut(500,q)}var e=$("#infopage"),n=$("#facipage"),A=$("#gallerypage"),i=$("#actipage"),y=$("#contpage"),E=$("#ainfo"),x=$("#afaci");x=$("#afaci");var C=$("#aacti"),m=$("#acont"),b=$("#atari"),j=$("#tari"),s=false,F=false,G=false,H=0,J=$("#backpic"),z=$("#backfade"),v=false,B=$("#background-view"),o=$("#mainstuff");$("<img />").load(function(){J.css({display:"none",
backgroundImage:"url(images/back4.jpg)",backgroundPosition:H+"px 0px"}).fadeIn(2E3,function(){$.browser.msie&&this.style.removeAttribute("filter")});B.fadeIn(200);var p=$("#background-load");p.fadeOut(200,function(){p.remove()});G=true}).attr("src","images/back4.jpg");B.bind("mouseover",a);B.bind("mouseout",c);E.bind("click",function(){t();return false});x.bind("click",function(){D();return false});C.bind("click",function(){h();return false});b.bind("click",function(){w();return false});m.bind("click",
function(){eval("resetMail()");r();return false});var L=$("#comments").children("span"),I=false;window.setTimeout(q,20);window.showInfo=t;window.showFaci=D;window.showActi=h;window.showCont=r;window.showTari=w;$("#gallery").loadgallery(u,A);$("#mail").loadmailer();IE6&&document.execCommand("BackgroundImageCache",false,true)});

