﻿var standard_alt_text=$("#slide-show img").attr("alt");var rotateSpeed=4000;var $slides;var els;var current_slide;var prev_slide;var animationSpeed=1200;function rotateSlides_v2(){var a=(current_slide==(els.length-1))?0:current_slide+1;$(els[prev_slide]).css("z-index",0);$(els[a]).hide().css("z-index",2);$(els[current_slide]).css("z-index",1);prev_slide=current_slide;$(els[a]).fadeIn(animationSpeed,function(){current_slide=a})}$(document).ready(function(){var a=$("#slide-show li a").length+$("#slide-show img").length;var b=$("#slide-show img").length;$("#slide-show li a").each(function(){var e=$(this).attr("href");var c=standard_alt_text;if($(this).attr("title")){c=$(this).attr("title")}var f=new Image();$(f).attr("alt",c);var d=$(this).attr("rel");$(f).load(function(){$("#slide-show").prepend(this);if(d!=""){$(this).wrap('<a class="slide-img-link" href='+d+"></a>")}b++;if((b==a)&&(a>1)){$("#slide-show ul").remove();$slides=$("#slide-show").find("img");els=$slides.get();current_slide=els.length-1;prev_slide=els.length-2;$(els[current_slide]).css("z-index",2);if($.browser.msie){els[current_slide].style.removeAttribute("filter")}$(els).autoRotate=setInterval("rotateSlides_v2()",rotateSpeed)}}).error(function(){a=a-1}).attr("src",e)});jQuery.each($("a.mb"),function(){if($(this).attr("href").match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)){$(this).colorbox({rel:"nofollow"})}else{$(this).colorbox({iframe:true,innerWidth:740,innerHeight:600,rel:"nofollow"})}});$("form#contact_form input").focus(function(){$(this).parent().addClass("curFocus")});$("form#contact_form input").blur(function(){$(this).parent().removeClass("curFocus")});$("form#contact_form textarea").focus(function(){$(this).parent().addClass("curFocus")});$("form#contact_form textarea").blur(function(){$(this).parent().removeClass("curFocus")})});(function(I){var D="colorbox",O="hover",q=true,e=false,T,G=I.browser.msie&&!I.support.opacity,V=G&&I.browser.version<7,g="cbox_open",u="cbox_load",o="cbox_complete",s="cbox_cleanup",L="cbox_closed",P="resize.cbox_resize",v,k,z,c,h,l,S,K,E,f,t,p,Q,U,b,w,j,R,H,W,A,x,i,C,n,m,d,N,a,J,r={transition:"elastic",speed:350,width:e,height:e,innerWidth:e,innerHeight:e,initialWidth:"400",initialHeight:"400",maxWidth:e,maxHeight:e,scalePhotos:q,scrolling:q,inline:e,html:e,iframe:e,photo:e,href:e,title:e,rel:e,opacity:0.9,preloading:q,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:e,overlayClose:q,slideshow:e,slideshowAuto:q,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:e,onLoad:e,onComplete:e,onCleanup:e,onClosed:e};function y(X,Y){Y=Y==="x"?f.width():f.height();return(typeof X==="string")?Math.round((X.match(/%/)?(Y/100)*parseInt(X,10):parseInt(X,10))):X}function B(X){X=I.isFunction(X)?X.call(n):X;return N.photo||X.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function M(){for(var X in N){if(I.isFunction(N[X])&&X.substring(0,2)!=="on"){N[X]=N[X].call(n)}}N.rel=N.rel||n.rel;N.href=N.href||n.href;N.title=N.title||n.title}function F(X){n=X;N=I.extend({},I(n).data(D));M();if(N.rel&&N.rel!=="nofollow"){E=I(".cboxElement").filter(function(){var Y=I(this).data(D).rel||this.rel;return(Y===N.rel)});d=E.index(n);if(d<0){E=E.add(n);d=E.length-1}}else{E=I(n);d=0}if(!a){a=q;J=q;m=n;m.blur();I(document).bind("keydown.cbox_close",function(Y){if(Y.keyCode===27){Y.preventDefault();T.close()}}).bind("keydown.cbox_arrows",function(Y){if(E.length>1){if(Y.keyCode===37){Y.preventDefault();H.click()}else{if(Y.keyCode===39){Y.preventDefault();R.click()}}}});if(N.overlayClose){v.css({cursor:"pointer"}).one("click",T.close)}I.event.trigger(g);if(N.onOpen){N.onOpen.call(n)}v.css({opacity:N.opacity}).show();N.w=y(N.initialWidth,"x");N.h=y(N.initialHeight,"y");T.position(0);if(V){f.bind("resize.cboxie6 scroll.cboxie6",function(){v.css({width:f.width(),height:f.height(),top:f.scrollTop(),left:f.scrollLeft()})}).trigger("scroll.cboxie6")}}w.add(H).add(R).add(j).add(b).hide();W.html(N.close).show();T.slideshow();T.load()}T=I.fn.colorbox=function(Z,X){var Y=this;if(!Y.length){if(Y.selector===""){Y=I("<a/>");Z.open=q}else{return this}}Y.each(function(){var aa=I.extend({},I(this).data(D)?I(this).data(D):r,Z);I(this).data(D,aa).addClass("cboxElement");if(X){I(this).data(D).onComplete=X}});if(Z&&Z.open){F(Y)}return this};T.init=function(){function X(Y){return I('<div id="cbox'+Y+'"/>')}f=I(window);k=I('<div id="colorbox"/>');v=X("Overlay").hide();z=X("Wrapper");c=X("Content").append(t=X("LoadedContent").css({width:0,height:0}),Q=X("LoadingOverlay"),U=X("LoadingGraphic"),b=X("Title"),w=X("Current"),j=X("Slideshow"),R=X("Next"),H=X("Previous"),W=X("Close"));z.append(I("<div/>").append(X("TopLeft"),h=X("TopCenter"),X("TopRight")),I("<div/>").append(l=X("MiddleLeft"),c,S=X("MiddleRight")),I("<div/>").append(X("BottomLeft"),K=X("BottomCenter"),X("BottomRight"))).children().children().css({"float":"left"});p=I("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");I("body").prepend(v,k.append(z,p));if(G){k.addClass("cboxIE");if(V){v.css("position","absolute")}}c.children().bind("mouseover mouseout",function(){I(this).toggleClass(O)}).addClass(O);A=h.height()+K.height()+c.outerHeight(q)-c.height();x=l.width()+S.width()+c.outerWidth(q)-c.width();i=t.outerHeight(q);C=t.outerWidth(q);k.css({"padding-bottom":A,"padding-right":x}).hide();R.click(T.next);H.click(T.prev);W.click(T.close);c.children().removeClass(O);I(".cboxElement").live("click",function(Y){if(Y.button!==0&&typeof Y.button!=="undefined"){return q}else{F(this);return e}})};T.position=function(X,Z){var ac,ab=f.height(),aa=Math.max(ab-N.h-i-A,0)/2+f.scrollTop(),Y=Math.max(document.documentElement.clientWidth-N.w-C-x,0)/2+f.scrollLeft();ac=(k.width()===N.w+C&&k.height()===N.h+i)?0:X;z[0].style.width=z[0].style.height="9999px";function ad(ae){h[0].style.width=K[0].style.width=c[0].style.width=ae.style.width;U[0].style.height=Q[0].style.height=c[0].style.height=l[0].style.height=S[0].style.height=ae.style.height}k.dequeue().animate({width:N.w+C,height:N.h+i,top:aa,left:Y},{duration:ac,complete:function(){ad(this);J=e;z[0].style.width=(N.w+C+x)+"px";z[0].style.height=(N.h+i+A)+"px";if(Z){Z()}},step:function(){ad(this)}})};T.resize=function(ag){if(!a){return}var ad,ae,af,ai,ah,aa,Z,ab=N.transition==="none"?0:N.speed;f.unbind(P);if(!ag){Z=setTimeout(function(){var aj=t.wrapInner("<div style='overflow:auto'></div>").children();N.h=aj.height();t.css({height:N.h});aj.replaceWith(aj.children());T.position(ab)},1);return}t.remove();t=I('<div id="cboxLoadedContent"/>').html(ag);function ac(){N.w=N.w||t.width();N.w=N.mw&&N.mw<N.w?N.mw:N.w;return N.w}function X(){N.h=N.h||t.height();N.h=N.mh&&N.mh<N.h?N.mh:N.h;return N.h}t.hide().appendTo(p).css({width:ac(),overflow:N.scrolling?"auto":"hidden"}).css({height:X()}).prependTo(c);I("#cboxPhoto").css({cssFloat:"none"});if(V){I("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(s,function(){this.style.visibility="inherit"})}function Y(aj){T.position(aj,function(){if(!a){return}if(G){if(aa){t.fadeIn(100)}k[0].style.removeAttribute("filter")}if(N.iframe){t.append("<iframe id='cboxIframe'"+(N.scrolling?" ":"scrolling='no'")+" name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+N.href+"' "+(G?"allowtransparency='true'":"")+" />")}t.show();b.show().html(N.title);if(E.length>1){w.html(N.current.replace(/\{current\}/,d+1).replace(/\{total\}/,E.length)).show();R.html(N.next).show();H.html(N.previous).show();if(N.slideshow){j.show()}}Q.hide();U.hide();I.event.trigger(o);if(N.onComplete){N.onComplete.call(n)}if(N.transition==="fade"){k.fadeTo(ab,1,function(){if(G){k[0].style.removeAttribute("filter")}})}f.bind(P,function(){T.position(0)})})}if((N.transition==="fade"&&k.fadeTo(ab,0,function(){Y(0)}))||Y(ab)){}if(N.preloading&&E.length>1){ae=d>0?E[d-1]:E[E.length-1];ai=d<E.length-1?E[d+1]:E[0];ah=I(ai).data(D).href||ai.href;af=I(ae).data(D).href||ae.href;if(B(ah)){I("<img />").attr("src",ah)}if(B(af)){I("<img />").attr("src",af)}}};T.load=function(){var X,aa,Y,Z=T.resize;J=q;n=E[d];N=I.extend({},I(n).data(D));M();I.event.trigger(u);if(N.onLoad){N.onLoad.call(n)}N.h=N.height?y(N.height,"y")-i-A:N.innerHeight?y(N.innerHeight,"y"):e;N.w=N.width?y(N.width,"x")-C-x:N.innerWidth?y(N.innerWidth,"x"):e;N.mw=N.w;N.mh=N.h;if(N.maxWidth){N.mw=y(N.maxWidth,"x")-C-x;N.mw=N.w&&N.w<N.mw?N.w:N.mw}if(N.maxHeight){N.mh=y(N.maxHeight,"y")-i-A;N.mh=N.h&&N.h<N.mh?N.h:N.mh}X=N.href;Q.show();U.show();if(N.inline){I('<div id="cboxInlineTemp" />').hide().insertBefore(I(X)[0]).bind(u+" "+s,function(){I(this).replaceWith(t.children())});Z(I(X))}else{if(N.iframe){Z(" ")}else{if(N.html){Z(N.html)}else{if(B(X)){aa=new Image();aa.onload=function(){var ab;aa.onload=null;aa.id="cboxPhoto";I(aa).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(N.scalePhotos){Y=function(){aa.height-=aa.height*ab;aa.width-=aa.width*ab};if(N.mw&&aa.width>N.mw){ab=(aa.width-N.mw)/aa.width;Y()}if(N.mh&&aa.height>N.mh){ab=(aa.height-N.mh)/aa.height;Y()}}if(N.h){aa.style.marginTop=Math.max(N.h-aa.height,0)/2+"px"}Z(aa);if(E.length>1){I(aa).css({cursor:"pointer"}).click(T.next)}if(G){aa.style.msInterpolationMode="bicubic"}};aa.src=X}else{I("<div />").appendTo(p).load(X,function(ac,ab){if(ab==="success"){Z(this)}else{Z(I("<p>Request unsuccessful.</p>"))}})}}}}};T.next=function(){if(!J){d=d<E.length-1?d+1:0;T.load()}};T.prev=function(){if(!J){d=d>0?d-1:E.length-1;T.load()}};T.slideshow=function(){var Z,Y,X="cboxSlideshow_";j.bind(L,function(){j.unbind();clearTimeout(Y);k.removeClass(X+"off "+X+"on")});function aa(){j.text(N.slideshowStop).bind(o,function(){Y=setTimeout(T.next,N.slideshowSpeed)}).bind(u,function(){clearTimeout(Y)}).one("click",function(){Z();I(this).removeClass(O)});k.removeClass(X+"off").addClass(X+"on")}Z=function(){clearTimeout(Y);j.text(N.slideshowStart).unbind(o+" "+u).one("click",function(){aa();Y=setTimeout(T.next,N.slideshowSpeed);I(this).removeClass(O)});k.removeClass(X+"on").addClass(X+"off")};if(N.slideshow&&E.length>1){if(N.slideshowAuto){aa()}else{Z()}}};T.close=function(){I.event.trigger(s);if(N.onCleanup){N.onCleanup.call(n)}a=e;I(document).unbind("keydown.cbox_close keydown.cbox_arrows");f.unbind(P+" resize.cboxie6 scroll.cboxie6");v.css({cursor:"auto"}).fadeOut("fast");k.stop(q,e).fadeOut("fast",function(){I("#colorbox iframe").attr("src","about:blank");t.remove();k.css({opacity:1});try{m.focus()}catch(X){}I.event.trigger(L);if(N.onClosed){N.onClosed.call(n)}})};T.element=function(){return I(n)};T.settings=r;I(T.init)}(jQuery));var standard_alt_text=$(".slideShow img").attr("alt");var rotateSpeed=4000;var $slides;var els;var current_slide;var prev_slide;var animationSpeed=1200;function rotateSlides_v2(){var a=(current_slide==(els.length-1))?0:current_slide+1;$(els[prev_slide]).css("z-index",0);$(els[a]).hide().css("z-index",2);$(els[current_slide]).css("z-index",1);prev_slide=current_slide;$(els[a]).fadeIn(animationSpeed,function(){current_slide=a})}$(document).ready(function(){var a=$(".slideShow li a").length+$(".slideShow img").length;var c=$(".slideShow img").length;if((c==a)&&(a>1)){$slides=$(".slideShow").find("img");els=$slides.get();current_slide=els.length-1;prev_slide=els.length-2;$(els[current_slide]).css("z-index",2);if($.browser.msie){els[current_slide].style.removeAttribute("filter")}$(els).autoRotate=setInterval("rotateSlides_v2()",rotateSpeed)}else{$(".slideShow li a").each(function(){var f=$(this).attr("href");var d=standard_alt_text;if($(this).attr("title")){d=$(this).attr("title")}var g=new Image();$(g).attr("alt",d);var e=$(this).attr("rel");$(g).load(function(){$(".slideShow").prepend(this);if(e!=""){$(this).wrap("<a href="+e+"></a>")}c++;if((c==a)&&(a>1)){$(".slideShow ul").remove();$slides=$(".slideShow").find("img");els=$slides.get();current_slide=els.length-1;prev_slide=els.length-2;$(els[current_slide]).css("z-index",2);if($.browser.msie){els[current_slide].style.removeAttribute("filter")}$(els).autoRotate=setInterval("rotateSlides_v2()",rotateSpeed)}}).error(function(){a=a-1}).attr("src",f)})}jQuery.each($("a.mb"),function(){if($(this).attr("href").match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)){$(this).colorbox({rel:"nofollow"})}else{rel_string=$(this).attr("rel");if(typeof rel_string==="undefined"){$(this).colorbox({iframe:true,innerWidth:740,innerHeight:600,rel:"nofollow"})}else{var d=rel_string.split(",");if((typeof d[0]==="undefined")||(typeof d[1]==="undefined")){$(this).colorbox({iframe:true,innerWidth:740,innerHeight:600,rel:"nofollow"})}else{substr_w=d[0].split(":");substr_h=d[1].split(":");if(isNaN(substr_w[1])||isNaN(substr_h[1])){$(this).colorbox({iframe:true,innerWidth:740,innerHeight:600,rel:"nofollow"})}else{$(this).colorbox({iframe:true,innerWidth:substr_w[1],innerHeight:substr_h[1],rel:"nofollow"})}}}}});$("form#contact_form input").focus(function(){$(this).parent().addClass("curFocus")});$("form#contact_form input").blur(function(){$(this).parent().removeClass("curFocus")});$("form#contact_form textarea").focus(function(){$(this).parent().addClass("curFocus")});$("form#contact_form textarea").blur(function(){$(this).parent().removeClass("curFocus")});$(".sectionDiv:last-child").addClass("last");if($(".topMenuLinks a").length>0){var b=document.location.href?document.location.href.toLowerCase():document.location.toLowerCase();if(b==document.location.host){b=document.location.host+"/index.html"}$(".topMenuLinks a").each(function(){if(this.href.toLowerCase()==b){$(this).parent().addClass("current")}})}});
