function checkActiveMenu(a){$("nav a").removeClass("selected");if(a.offset().top<3305){$("#tobox0").toggleClass("selected")}else if(a.offset().top>=3305&&a.offset().top<7303){$("#tobox1").toggleClass("selected")}else if(a.offset().top>=7303&&a.offset().top<9e3){$("#tobox2").toggleClass("selected")}else if(a.offset().top>=9e3){$("#tobox3").toggleClass("selected")}}function processJson(a){if(a.result=="errors"){if(a.errors!="500"){$("span.result").text("Please, fill in the required fields, marked with the red asterisk");var b=a.errors.split(",");$.each(b,function(a,b){$("#"+b).addClass("error")})}else{$("span.result").text("Unable to send email, please try again later")}}else if(a.result=="ok"){$("span.result").text("Your message has been sent.")}}(function($){var supportedCSS,styles=document.getElementsByTagName("head")[0].style,toCheck="transformProperty WebkitTransform OTransform msTransform MozTransform".split(" ");for(var a=0;a<toCheck.length;a++)if(styles[toCheck[a]]!==undefined)supportedCSS=toCheck[a];var IE=eval('"v"==""');jQuery.fn.extend({ImageRotate:function(a){if(this.Wilq32&&this.Wilq32.PhotoEffect)return;var b=$.extend(true,{},a);return(new Wilq32.PhotoEffect(this.get(0),b))._rootObj},rotate:function(a){if(this.length===0||typeof a=="undefined")return;if(typeof a=="number")a={angle:a};var b=[];for(var c=0,d=this.length;c<d;c++){var e=this.get(c);if(typeof e.Wilq32=="undefined")b.push($($(e).ImageRotate(a)));else e.Wilq32.PhotoEffect._handleRotation(a)}return b}});Wilq32=window.Wilq32||{};Wilq32.PhotoEffect=function(){if(supportedCSS){return function(a,b){a.Wilq32={PhotoEffect:this};this._img=this._rootObj=this._eventObj=a;this._handleRotation(b)}}else{return function(a,b){this._img=a;this._rootObj=document.createElement("span");this._rootObj.style.display="inline-block";this._rootObj.Wilq32={PhotoEffect:this};a.parentNode.insertBefore(this._rootObj,a);if(a.complete){this._Loader(b)}else{var c=this;jQuery(this._img).bind("load",function(){c._Loader(b)})}}}}();Wilq32.PhotoEffect.prototype={_setupParameters:function(a){this._parameters=this._parameters||{};if(typeof this._angle!=="number")this._angle=0;if(typeof a.angle==="number")this._angle=a.angle;this._parameters.animateTo=typeof a.animateTo==="number"?a.animateTo:this._angle;this._parameters.easing=a.easing||this._parameters.easing||function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c};this._parameters.duration=a.duration||this._parameters.duration||1e3;this._parameters.callback=a.callback||this._parameters.callback||function(){};if(a.bind&&a.bind!=this._parameters.bind)this._BindEvents(a.bind)},_handleRotation:function(a){this._setupParameters(a);if(this._angle==this._parameters.animateTo){this._rotate(this._angle)}else{this._animateStart()}},_BindEvents:function(a){if(a&&this._eventObj){if(this._parameters.bind){var b=this._parameters.bind;for(var c in b)if(b.hasOwnProperty(c))jQuery(this._eventObj).unbind(c,b[c])}this._parameters.bind=a;for(var c in a)if(a.hasOwnProperty(c))jQuery(this._eventObj).bind(c,a[c])}},_Loader:function(){if(IE)return function(a){var b=this._img.width;var c=this._img.height;this._img.parentNode.removeChild(this._img);this._vimage=this.createVMLNode("image");this._vimage.src=this._img.src;this._vimage.style.height=c+"px";this._vimage.style.width=b+"px";this._vimage.style.position="absolute";this._vimage.style.top="0px";this._vimage.style.left="0px";this._container=this.createVMLNode("group");this._container.style.width=b;this._container.style.height=c;this._container.style.position="absolute";this._container.setAttribute("coordsize",b-1+","+(c-1));this._container.appendChild(this._vimage);this._rootObj.appendChild(this._container);this._rootObj.style.position="absolute";this._rootObj.style.width=b+"px";this._rootObj.style.height=c+"px";this._rootObj.setAttribute("id",this._img.getAttribute("id"));this._rootObj.className=this._img.className;this._eventObj=this._rootObj;this._handleRotation(a)};else return function(a){this._rootObj.setAttribute("id",this._img.getAttribute("id"));this._rootObj.className=this._img.className;this._width=this._img.width;this._height=this._img.height;this._widthHalf=this._width/2;this._heightHalf=this._height/2;var b=Math.sqrt(this._height*this._height+this._width*this._width);this._widthAdd=b-this._width;this._heightAdd=b-this._height;this._widthAddHalf=this._widthAdd/2;this._heightAddHalf=this._heightAdd/2;this._img.parentNode.removeChild(this._img);this._aspectW=(parseInt(this._img.style.width,10)||this._width)/this._img.width;this._aspectH=(parseInt(this._img.style.height,10)||this._height)/this._img.height;this._canvas=document.createElement("canvas");this._canvas.setAttribute("width",this._width);this._canvas.style.position="relative";this._canvas.style.left=-this._widthAddHalf+"px";this._canvas.style.top=-this._heightAddHalf+"px";this._canvas.Wilq32=this._rootObj.Wilq32;this._rootObj.appendChild(this._canvas);this._rootObj.style.width=this._width+"px";this._rootObj.style.height=this._height+"px";this._eventObj=this._canvas;this._cnv=this._canvas.getContext("2d");this._handleRotation(a)}}(),_animateStart:function(){if(this._checkEnd==false)return;if(this._timer){clearTimeout(this._timer)}this._animateStartTime=+(new Date);this._animateStartAngle=this._angle;this._animate()},_animate:function(){var a=+(new Date);var b=a-this._animateStartTime>this._parameters.duration;this._checkEnd=b;if(b&&!this._parameters.animatedGif){clearTimeout(this._timer)}else{if(this._canvas||this._vimage||this._img){var c=this._parameters.easing(0,a-this._animateStartTime,this._animateStartAngle,this._parameters.animateTo-this._animateStartAngle,this._parameters.duration);this._rotate(~~(c*10)/10)}var d=this;this._timer=setTimeout(function(){d._animate.call(d)},10)}if(this._parameters.callback&&b){this._angle=this._parameters.animateTo;this._rotate(this._angle);this._parameters.callback.call(this._rootObj)}},_rotate:function(){var a=Math.PI/180;if(IE)return function(a){this._angle=a;this._container.style.rotation=a%360+"deg"};else if(supportedCSS)return function(a){this._angle=a;this._img.style[supportedCSS]="rotate("+a%360+"deg)"};else return function(b){this._angle=b;b=b%360*a;this._canvas.width=this._width+this._widthAdd;this._canvas.height=this._height+this._heightAdd;this._cnv.translate(this._widthAddHalf,this._heightAddHalf);this._cnv.translate(this._widthHalf,this._heightHalf);this._cnv.rotate(b);this._cnv.translate(-this._widthHalf,-this._heightHalf);this._cnv.scale(this._aspectW,this._aspectH);this._cnv.drawImage(this._img,0,0)}}()};if(IE){Wilq32.PhotoEffect.prototype.createVMLNode=function(){document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!document.namespaces.rvml&&document.namespaces.add("rvml","urn:schemas-microsoft-com:vml");return function(a){return document.createElement("<rvml:"+a+' class="rvml">')}}catch(a){return function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}}()}})(jQuery);(function(a,b,c,d,e){function o(){var b=f.scrollTop(),d=b>h,e=a.grep(g,function(a,c){return d?a.offset>h&&a.offset<=b:a.offset<=h&&a.offset>b});if(!h||!b){a[c]("refresh")}h=b;if(!e.length)return;if(a[c].settings.continuous){a.each(d?e:e.reverse(),function(a,b){n(b,[d?"down":"up"])})}else{n(e[d?e.length-1:0],[d?"down":"up"])}}function n(a,c){a.element.trigger(k,c);if(a.options.triggerOnce){a.element[b]("destroy")}}function m(a){var b=g.length-1;while(b>=0&&g[b].element[0]!==a[0]){b-=1}return b}"$:nomunge";var f=a(d),g=[],h=-99999,i=false,j=false,k="waypoint.reached",l={init:function(d,e){this.each(function(){var f=a(this),h=m(f),i=h<0?a.fn[b].defaults:g[h].options,j=a.extend({},i,e);j.offset=j.offset==="bottom-in-view"?function(){return a[c]("viewportHeight")-a(this).outerHeight()}:j.offset;if(h<0){g.push({element:f,offset:f.offset().top,options:j})}else{g[h].options=j}d&&f.bind(k,d)});a[c]("refresh");return this},remove:function(){return this.each(function(){var b=m(a(this));if(b>=0){g.splice(b,1)}})},destroy:function(){return this.unbind(k)[b]("remove")}};a.fn[b]=function(c){if(l[c]){return l[c].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof c==="function"||!c){return l.init.apply(this,arguments)}else if(typeof c==="object"){return l.init.apply(this,[null,c])}else{a.error("Method "+c+" does not exist on jQuery"+b)}};a.fn[b].defaults={offset:0,triggerOnce:false};var p={refresh:function(){a.each(g,function(b,d){var e=0,f=d.offset;if(typeof d.options.offset==="function"){e=d.options.offset.apply(d.element)}else if(typeof d.options.offset==="string"){var g=parseFloat(d.options.offset),e=d.options.offset.indexOf("%")?Math.ceil(a[c]("viewportHeight")*(g/100)):g}else{e=d.options.offset}d.offset=d.element.offset().top-e;if(h>f&&h<=d.offset){n(d,["up"])}else if(h<f&&h>=d.offset){n(d,["down"])}});g.sort(function(a,b){return a.offset-b.offset})},viewportHeight:function(){return d.innerHeight?d.innerHeight:f.height()},aggregate:function(){var b=a();a.each(g,function(a,c){b=b.add(c.element)});return b}};a[c]=function(a){if(p[a]){return p[a].apply(this)}else{return p["aggregate"]()}};a[c].settings={continuous:true,resizeThrottle:200,scrollThrottle:100};f.scroll(function(){if(!i){i=true;d.setTimeout(function(){o();i=false},a[c].settings.scrollThrottle)}}).resize(function(){if(!j){j=true;d.setTimeout(function(){a[c]("refresh");j=false},a[c].settings.resizeThrottle)}}).load(function(){a[c]("refresh");o()})})(jQuery,"waypoint","waypoints",this);(function(a){function c(a){return typeof a=="object"?a:{top:a,left:a}}var b=a.scrollTo=function(b,c,e){a(window).scrollTo(b,c,e)};b.defaults={axis:"xy",duration:parseFloat(a.fn.jquery)>=1.3?0:1};b.window=function(b){return a(window)._scrollable()};a.fn._scrollable=function(){return this.map(function(){var b=this,c=!b.nodeName||a.inArray(b.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!c)return b;var e=(b.contentWindow||b).document||b.ownerDocument||b;return a.browser.safari||e.compatMode=="BackCompat"?e.body:e.documentElement})};a.fn.scrollTo=function(e,f,g){if(typeof f=="object"){g=f;f=0}if(typeof g=="function")g={onAfter:g};if(e=="max")e=9e9;g=a.extend({},b.defaults,g);f=f||g.speed||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=c(g.offset);g.over=c(g.over);return this._scrollable().each(function(){function r(a){i.animate(o,f,g.easing,a&&function(){a.call(this,e,g)})}var h=this,i=a(h),l=e,m,o={},q=i.is("html,body");switch(typeof l){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(l)){l=c(l);break}l=a(l,this);case"object":if(l.is||l.style)m=(l=a(l)).offset()}a.each(g.axis.split(""),function(a,c){var d=c=="x"?"Left":"Top",e=d.toLowerCase(),f="scroll"+d,j=h[f],n=b.max(h,c);if(m){o[f]=m[e]+(q?0:j-i.offset()[e]);if(g.margin){o[f]-=parseInt(l.css("margin"+d))||0;o[f]-=parseInt(l.css("border"+d+"Width"))||0}o[f]+=g.offset[e]||0;if(g.over[e])o[f]+=l[c=="x"?"width":"height"]()*g.over[e]}else{var p=l[e];o[f]=p.slice&&p.slice(-1)=="%"?parseFloat(p)/100*n:p}if(/^\d+$/.test(o[f]))o[f]=o[f]<=0?0:Math.min(o[f],n);if(!a&&g.queue){if(j!=o[f])r(g.onAfterFirst);delete o[f]}});r(g.onAfter)}).end()};b.max=function(b,c){var e=c=="x"?"Width":"Height",f="scroll"+e;if(!a(b).is("html,body"))return b[f]-a(b)[e.toLowerCase()]();var g="client"+e,h=b.ownerDocument.documentElement,i=b.ownerDocument.body;return Math.max(h[f],i[f])-Math.min(h[g],i[g])}})(jQuery);(function(a){function b(){var a="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(a)}else if(window.opera&&window.opera.postError){window.opera.postError(a)}}a.fn.ajaxSubmit=function(c){function t(e){function C(c){if(o.aborted||B){return}try{z=w(n)}catch(d){b("cannot access response document: ",d);c=v}if(c===u&&o){o.abort("timeout");return}else if(c==v&&o){o.abort("server abort");return}if(!z||z.location.href==j.iframeSrc){if(!r)return}n.detachEvent?n.detachEvent("onload",C):n.removeEventListener("load",C,false);var e="success",f;try{if(r){throw"timeout"}var g=j.dataType=="xml"||z.XMLDocument||a.isXMLDoc(z);b("isXml="+g);if(!g&&window.opera&&(z.body==null||z.body.innerHTML=="")){if(--A){b("requeing onLoad callback, DOM not available");setTimeout(C,250);return}}var h=z.body?z.body:z.documentElement;o.responseText=h?h.innerHTML:null;o.responseXML=z.XMLDocument?z.XMLDocument:z;if(g)j.dataType="xml";o.getResponseHeader=function(a){var b={"content-type":j.dataType};return b[a]};if(h){o.status=Number(h.getAttribute("status"))||o.status;o.statusText=h.getAttribute("statusText")||o.statusText}var i=j.dataType||"";var l=/(json|script|text)/.test(i.toLowerCase());if(l||j.textarea){var p=z.getElementsByTagName("textarea")[0];if(p){o.responseText=p.value;o.status=Number(p.getAttribute("status"))||o.status;o.statusText=p.getAttribute("statusText")||o.statusText}else if(l){var q=z.getElementsByTagName("pre")[0];var t=z.getElementsByTagName("body")[0];if(q){o.responseText=q.textContent?q.textContent:q.innerHTML}else if(t){o.responseText=t.innerHTML}}}else if(j.dataType=="xml"&&!o.responseXML&&o.responseText!=null){o.responseXML=D(o.responseText)}try{y=F(o,j.dataType,j)}catch(c){e="parsererror";o.error=f=c||e}}catch(c){b("error caught: ",c);e="error";o.error=f=c||e}if(o.aborted){b("upload aborted");e=null}if(o.status){e=o.status>=200&&o.status<300||o.status===304?"success":"error"}if(e==="success"){j.success&&j.success.call(j.context,y,"success",o);k&&a.event.trigger("ajaxSuccess",[o,j])}else if(e){if(f==undefined)f=o.statusText;j.error&&j.error.call(j.context,o,e,f);k&&a.event.trigger("ajaxError",[o,j,f])}k&&a.event.trigger("ajaxComplete",[o,j]);if(k&&!--a.active){a.event.trigger("ajaxStop")}j.complete&&j.complete.call(j.context,o,e);B=true;if(j.timeout)clearTimeout(s);setTimeout(function(){if(!j.iframeTarget)m.remove();o.responseXML=null},100)}function x(){function h(){try{var a=w(n).readyState;b("state = "+a);if(a.toLowerCase()=="uninitialized")setTimeout(h,50)}catch(c){b("Server abort: ",c," (",c.name,")");C(v);s&&clearTimeout(s);s=undefined}}var c=g.attr("target"),e=g.attr("action");f.setAttribute("target",l);if(!d){f.setAttribute("method","POST")}if(e!=j.url){f.setAttribute("action",j.url)}if(!j.skipEncodingOverride&&(!d||/post/i.test(d))){g.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(j.timeout){s=setTimeout(function(){r=true;C(u)},j.timeout)}var i=[];try{if(j.extraData){for(var k in j.extraData){i.push(a('<input type="hidden" name="'+k+'" />').attr("value",j.extraData[k]).appendTo(f)[0])}}if(!j.iframeTarget){m.appendTo("body");n.attachEvent?n.attachEvent("onload",C):n.addEventListener("load",C,false)}setTimeout(h,15);f.submit()}finally{f.setAttribute("action",e);if(c){f.setAttribute("target",c)}else{g.removeAttr("target")}a(i).remove()}}function w(a){var b=a.contentWindow?a.contentWindow.document:a.contentDocument?a.contentDocument:a.document;return b}var f=g[0],h,i,j,k,l,m,n,o,p,q,r,s;var t=!!a.fn.prop;if(e){for(i=0;i<e.length;i++){h=a(f[e[i].name]);h[t?"prop":"attr"]("disabled",false)}}if(a(":input[name=submit],:input[id=submit]",f).length){alert('Error: Form elements must not have name or id of "submit".');return}j=a.extend(true,{},a.ajaxSettings,c);j.context=j.context||j;l="jqFormIO"+(new Date).getTime();if(j.iframeTarget){m=a(j.iframeTarget);q=m.attr("name");if(q==null)m.attr("name",l);else l=q}else{m=a('<iframe name="'+l+'" src="'+j.iframeSrc+'" />');m.css({position:"absolute",top:"-1000px",left:"-1000px"})}n=m[0];o={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(c){var d=c==="timeout"?"timeout":"aborted";b("aborting upload... "+d);this.aborted=1;m.attr("src",j.iframeSrc);o.error=d;j.error&&j.error.call(j.context,o,d,c);k&&a.event.trigger("ajaxError",[o,j,d]);j.complete&&j.complete.call(j.context,o,d)}};k=j.global;if(k&&!(a.active++)){a.event.trigger("ajaxStart")}if(k){a.event.trigger("ajaxSend",[o,j])}if(j.beforeSend&&j.beforeSend.call(j.context,o,j)===false){if(j.global){a.active--}return}if(o.aborted){return}p=f.clk;if(p){q=p.name;if(q&&!p.disabled){j.extraData=j.extraData||{};j.extraData[q]=p.value;if(p.type=="image"){j.extraData[q+".x"]=f.clk_x;j.extraData[q+".y"]=f.clk_y}}}var u=1;var v=2;if(j.forceSync){x()}else{setTimeout(x,10)}var y,z,A=50,B;var D=a.parseXML||function(a,b){if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a)}else{b=(new DOMParser).parseFromString(a,"text/xml")}return b&&b.documentElement&&b.documentElement.nodeName!="parsererror"?b:null};var E=a.parseJSON||function(a){return window["eval"]("("+a+")")};var F=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f=c==="xml"||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;if(f&&g.documentElement.nodeName==="parsererror"){a.error&&a.error("parsererror")}if(d&&d.dataFilter){g=d.dataFilter(g,c)}if(typeof g==="string"){if(c==="json"||!c&&e.indexOf("json")>=0){g=E(g)}else if(c==="script"||!c&&e.indexOf("javascript")>=0){a.globalEval(g)}}return g}}if(!this.length){b("ajaxSubmit: skipping submit process - no element selected");return this}var d,e,f,g=this;if(typeof c=="function"){c={success:c}}d=this.attr("method");e=this.attr("action");f=typeof e==="string"?a.trim(e):"";f=f||window.location.href||"";if(f){f=(f.match(/^([^#]+)/)||[])[1]}c=a.extend(true,{url:f,success:a.ajaxSettings.success,type:d||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},c);var h={};this.trigger("form-pre-serialize",[this,c,h]);if(h.veto){b("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(c.beforeSerialize&&c.beforeSerialize(this,c)===false){b("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var i,j,k=this.formToArray(c.semantic);if(c.data){c.extraData=c.data;for(i in c.data){if(c.data[i]instanceof Array){for(var l in c.data[i]){k.push({name:i,value:c.data[i][l]})}}else{j=c.data[i];j=a.isFunction(j)?j():j;k.push({name:i,value:j})}}}if(c.beforeSubmit&&c.beforeSubmit(k,this,c)===false){b("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[k,this,c,h]);if(h.veto){b("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var m=a.param(k);if(c.type.toUpperCase()=="GET"){c.url+=(c.url.indexOf("?")>=0?"&":"?")+m;c.data=null}else{c.data=m}var n=[];if(c.resetForm){n.push(function(){g.resetForm()})}if(c.clearForm){n.push(function(){g.clearForm()})}if(!c.dataType&&c.target){var o=c.success||function(){};n.push(function(b){var d=c.replaceTarget?"replaceWith":"html";a(c.target)[d](b).each(o,arguments)})}else if(c.success){n.push(c.success)}c.success=function(a,b,d){var e=c.context||c;for(var f=0,h=n.length;f<h;f++){n[f].apply(e,[a,b,d||g,g])}};var p=a("input:file",this).length>0;var q="multipart/form-data";var r=g.attr("enctype")==q||g.attr("encoding")==q;if(c.iframe!==false&&(p||c.iframe||r)){if(c.closeKeepAlive){a.get(c.closeKeepAlive,function(){t(k)})}else{t(k)}}else{if(a.browser.msie&&d=="get"){var s=g[0].getAttribute("method");if(typeof s==="string")c.type=s}a.ajax(c)}this.trigger("form-submit-notify",[this,c]);return this};a.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};if(!a.isReady&&d.s){b("DOM not ready, queuing ajaxForm");a(function(){a(d.s,d.c).ajaxForm(c)});return this}b("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(b){if(!b.isDefaultPrevented()){b.preventDefault();a(this).ajaxSubmit(c)}}).bind("click.form-plugin",function(b){var c=b.target;var d=a(c);if(!d.is(":submit,input:image")){var e=d.closest(":submit");if(e.length==0){return}c=e[0]}var f=this;f.clk=c;if(c.type=="image"){if(b.offsetX!=undefined){f.clk_x=b.offsetX;f.clk_y=b.offsetY}else if(typeof a.fn.offset=="function"){var g=d.offset();f.clk_x=b.pageX-g.left;f.clk_y=b.pageY-g.top}else{f.clk_x=b.pageX-c.offsetLeft;f.clk_y=b.pageY-c.offsetTop}}setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)})};a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(b){var c=[];if(this.length===0){return c}var d=this[0];var e=b?d.getElementsByTagName("*"):d.elements;if(!e){return c}var f,g,h,i,j,k,l;for(f=0,k=e.length;f<k;f++){j=e[f];h=j.name;if(!h){continue}if(b&&d.clk&&j.type=="image"){if(!j.disabled&&d.clk==j){c.push({name:h,value:a(j).val()});c.push({name:h+".x",value:d.clk_x},{name:h+".y",value:d.clk_y})}continue}i=a.fieldValue(j,true);if(i&&i.constructor==Array){for(g=0,l=i.length;g<l;g++){c.push({name:h,value:i[g]})}}else if(i!==null&&typeof i!="undefined"){c.push({name:h,value:i})}}if(!b&&d.clk){var m=a(d.clk),n=m[0];h=n.name;if(h&&!n.disabled&&n.type=="image"){c.push({name:h,value:m.val()});c.push({name:h+".x",value:d.clk_x},{name:h+".y",value:d.clk_y})}}return c};a.fn.formSerialize=function(b){return a.param(this.formToArray(b))};a.fn.fieldSerialize=function(b){var c=[];this.each(function(){var d=this.name;if(!d){return}var e=a.fieldValue(this,b);if(e&&e.constructor==Array){for(var f=0,g=e.length;f<g;f++){c.push({name:d,value:e[f]})}}else if(e!==null&&typeof e!="undefined"){c.push({name:this.name,value:e})}});return a.param(c)};a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;d<e;d++){var f=this[d];var g=a.fieldValue(f,b);if(g===null||typeof g=="undefined"||g.constructor==Array&&!g.length){continue}g.constructor==Array?a.merge(c,g):c.push(g)}return c};a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();if(c===undefined){c=true}if(c&&(!d||b.disabled||e=="reset"||e=="button"||(e=="checkbox"||e=="radio")&&!b.checked||(e=="submit"||e=="image")&&b.form&&b.form.clk!=b||f=="select"&&b.selectedIndex==-1)){return null}if(f=="select"){var g=b.selectedIndex;if(g<0){return null}var h=[],i=b.options;var j=e=="select-one";var k=j?g+1:i.length;for(var l=j?g:0;l<k;l++){var m=i[l];if(m.selected){var n=m.value;if(!n){n=m.attributes&&m.attributes["value"]&&!m.attributes["value"].specified?m.text:m.value}if(j){return n}h.push(n)}}return h}return a(b).val()};a.fn.clearForm=function(){return this.each(function(){a("input,select,textarea",this).clearFields()})};a.fn.clearFields=a.fn.clearInputs=function(){var a=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var b=this.type,c=this.tagName.toLowerCase();if(a.test(b)||c=="textarea"){this.value=""}else if(b=="checkbox"||b=="radio"){this.checked=false}else if(c=="select"){this.selectedIndex=-1}})};a.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType){this.reset()}})};a.fn.enable=function(a){if(a===undefined){a=true}return this.each(function(){this.disabled=!a})};a.fn.selected=function(b){if(b===undefined){b=true}return this.each(function(){var c=this.type;if(c=="checkbox"||c=="radio"){this.checked=b}else if(this.tagName.toLowerCase()=="option"){var d=a(this).parent("select");if(b&&d[0]&&d[0].type=="select-one"){d.find("option").selected(false)}this.selected=b}})};})(jQuery);(function(a){var b={init:function(b){var c={width:0,height:0},d=a.extend({},c,b);return this.each(function(){var b=a(this);var c="getContext"in document.createElement("canvas");var e=0;var f=b.find("li");var g=function(a){var b=document.createElement("canvas"),c=b.getContext("2d");b.width=d.width;b.height=d.height;c.drawImage(a,0,0);var e=c.getImageData(0,0,b.width,b.height),f=e.data;for(var g=0,h=f.length;g<h;g++){f[g]=f[g]<128?2*f[g]*f[g]/255:255-2*(255-f[g])*(255-f[g])/255;f[++g]=f[g]<128?2*f[g]*f[g]/255:255-2*(255-f[g])*(255-f[g])/255;f[++g]=f[g]<128?2*f[g]*f[g]/255:255-2*(255-f[g])*(255-f[g])/255;++g}c.putImageData(e,0,0);a.parentNode.insertBefore(b,a)};setTimeout(function(){if(c){b.find("img").each(function(){if(!d.width){d.width=this.width?this.width:d.width;d.height=this.height?this.height:d.height}g(this)})}b.find(".arrow").click(function(){var b=f.eq(e),d=b.find("canvas"),g=0;if(a(this).hasClass("next")){g=e>=f.length-1?0:e+1}else{g=e<=0?f.length-1:e-1}var h=f.eq(g);if(c){d.fadeIn(function(){h.show();e=g;b.fadeOut(function(){b.removeClass("slideActive");d.hide();h.addClass("slideActive")})})}else{e=g;h.addClass("slideActive").show();b.removeClass("slideActive").hide()}})})})}};a.fn.slideshow=function(c){if(b[c]){return b[c].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof c==="object"||!c){return b.init.apply(this,arguments)}else{a.error("Method "+c+" does not exist in plugin.")}}})(jQuery);$(document).ready(function(){var a=$.browser;if(a.msie&&a.version.slice(0,3)=="9.0")$("h2").css({"line-height":"30px"});jQuery.fn.backgroundPosition=function(){var a=$(this).css("background-position");if(typeof a==="undefined")return $(this).css("background-position-x")+" "+$(this).css("background-position-y");else return a};checkActiveMenu($("header"));var b=0;var c=0;var d=0;$(window).scroll(function(){checkActiveMenu($("header"));if($("#scrolldown").css("display")!="none")$("#scrolldown").fadeOut("slow",function(){});d+=3;$(".imgrot").rotate({angle:0,animateTo:180,easing:function(a,b,c,d,e){return d*(b/e)+c}});$(".imgrotneg").rotate({angle:0,animateTo:-180,easing:function(a,b,c,d,e){return d*(b/e)+c}});var a=$("#bars");if(a.is(":animated")){return}c=$(window).scrollTop();var e=null,f=a.backgroundPosition().split(" ");if(c>=b){if(parseInt(f[0])>-40)a.css("backgroundPosition","-405px 0");e="+=14px 0"}else{if(parseInt(f[0])<-405)a.css("backgroundPosition","-40px 0");e="-=14px 0"}a.animate({backgroundPosition:e},1800,"linear",function(){b=$(window).scrollTop()})});$.waypoints.settings.scrollThrottle=30;$("#work").waypoint(function(a,b){$(".slider").toggleClass("toabsolute",b==="down");$("header").toggleClass("smaller");a.stopPropagation()},{offset:897});$("#logo").click(function(a){a.preventDefault();$.scrollTo($("body"),3500)});$("nav a").each(function(a){$(this).click(function(b){if($(this).hasClass("spot"))return true;jQuery.scrollTo.window().queue([]).stop();b.preventDefault();$(window).scrollTo($("#box"+a),4500,{offset:-135,stop:true})})});$("#contactform").ajaxForm({dataType:"json",clearForm:true,success:processJson});$("label.required").find("input").add("textarea").focus(function(){if($(this).hasClass("error"))$(this).removeClass("error")});$(".slideshow").slideshow({width:583,height:476});$("a.external").attr("target","_blank");$("#scrolldown").fadeIn("slow")})
