(function(b){var a=b.scrollTo=function(f,d,g){b(window).scrollTo(f,d,g)};a.defaults={axis:"xy",duration:parseFloat(b.fn.jquery)>=1.3?0:1};a.window=function(d){return b(window)._scrollable()};b.fn._scrollable=function(){return this.map(function(){var f=this,d=!f.nodeName||b.inArray(f.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return f}var g=(f.contentWindow||f).document||f.ownerDocument||f;return b.browser.safari||g.compatMode=="BackCompat"?g.body:g.documentElement})};b.fn.scrollTo=function(f,d,e){if(typeof d=="object"){e=d;d=0}if(typeof e=="function"){e={onAfter:e}}if(f=="max"){f=9000000000}e=b.extend({},a.defaults,e);d=d||e.speed||e.duration;e.queue=e.queue&&e.axis.length>1;if(e.queue){d/=2}e.offset=c(e.offset);e.over=c(e.over);return this._scrollable().each(function(){var h=this,i=b(h),l=f,j,m={},n=i.is("html,body");switch(typeof l){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(l)){l=c(l);break}l=b(l,this);case"object":if(l.is||l.style){j=(l=b(l)).offset()}}b.each(e.axis.split(""),function(t,p){var v=p=="x"?"Left":"Top",g=v.toLowerCase(),u="scroll"+v,q=h[u],r=a.max(h,p);if(j){m[u]=j[g]+(n?0:q-i.offset()[g]);if(e.margin){m[u]-=parseInt(l.css("margin"+v))||0;m[u]-=parseInt(l.css("border"+v+"Width"))||0}m[u]+=e.offset[g]||0;if(e.over[g]){m[u]+=l[p=="x"?"width":"height"]()*e.over[g]}}else{var s=l[g];m[u]=s.slice&&s.slice(-1)=="%"?parseFloat(s)/100*r:s}if(/^\d+$/.test(m[u])){m[u]=m[u]<=0?0:Math.min(m[u],r)}if(!t&&e.queue){if(q!=m[u]){k(e.onAfterFirst)}delete m[u]}});k(e.onAfter);function k(g){i.animate(m,d,e.easing,g&&function(){g.call(this,f,e)})}}).end()};a.max=function(k,f){var o=f=="x"?"Width":"Height",d="scroll"+o;if(!b(k).is("html,body")){return k[d]-b(k)[o.toLowerCase()]()}var n="client"+o,g=k.ownerDocument.documentElement,j=k.ownerDocument.body;return Math.max(g[d],j[d])-Math.min(g[n],j[n])};function c(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);$(document).ready(function(){$(".searchBox").val($("span.hidden").text());$("#forward").mousedown(function(){$("#scroll").scrollTo("+=120px",500)});$("#backward").mousedown(function(){$("#scroll").scrollTo("-=120px",500)});var a=0;$("#langlist").find("a").each(function(){a+=$(this).width()+6});$("#scroll").scroll(function(b){$("#backward").toggleClass("disabled");if($("#scroll").scrollLeft()==0){$("#backward").addClass("disabled")}else{$("#backward").removeClass("disabled")}if($("#scroll").width()+$("#scroll").scrollLeft()<a){$("#forward").removeClass("disabled")}else{if($("#scroll").width()+$("#scroll").scrollLeft()>a){$("#forward").addClass("disabled")}else{$("#forward").addClass("disabled2")}}})});(function(a){var b=-1;a.fn.extend({autocomplete:function(c,e){var d=typeof c=="string";e=a.extend({},a.Autocompleter.defaults,{url:d?c:null,data:d?null:c,delay:d?a.Autocompleter.defaults.delay:10,max:e&&!e.scroll?10:150},e);e.highlight=e.highlight||function(f){return f};e.formatMatch=e.formatMatch||e.formatItem;return this.each(function(){new a.Autocompleter(this,e)})},result:function(c){return this.bind("result",c)},search:function(c){return this.trigger("search",[c])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(c){return this.trigger("setOptions",[c])},unautocomplete:function(){return this.trigger("unautocomplete")}});a.Autocompleter=function(w,u){var v={LEFT:37,UP:38,RIGHT:39,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var o=a(w).attr("autocomplete","off").addClass(u.inputClass);var r;var l="";var c=a.Autocompleter.Cache(u);var p=0;var h;var q={mouseDownOnSelect:false};var t=a.Autocompleter.Select(u,w,n,q);var m;a.browser.opera&&a(w.form).bind("submit.autocomplete",function(){if(m){m=false;return false}});o.bind((a.browser.opera?"keypress":"keydown")+".autocomplete",function(z){p=1;h=z.keyCode;switch(z.keyCode){case v.UP:z.preventDefault();if(t.visible()){t.prev()}else{g(0,true)}break;case v.DOWN:z.preventDefault();if(t.visible()){t.next()}else{g(0,true)}break;case v.PAGEUP:z.preventDefault();if(t.visible()){t.pageUp()}else{g(0,true)}break;case v.PAGEDOWN:z.preventDefault();if(t.visible()){t.pageDown()}else{g(0,true)}break;case u.multiple&&a.trim(u.multipleSeparator)==","&&v.COMMA:case v.RETURN:if(n()){z.preventDefault();m=true;return false}break;case v.TAB:case v.ESC:t.hide();break;case v.LEFT:case v.RIGHT:break;default:b=-1;clearTimeout(r);r=setTimeout(g,u.delay);break}}).focus(function(){p++}).blur(function(){p=0;if(!q.mouseDownOnSelect){f()}}).click(function(){if(p++>=1&&!t.visible()){g(0,true)}}).bind("search",function(){var z=(arguments.length>1)?arguments[1]:null;function A(B,C){var D;if(C&&C.length){for(var E=0;E<C.length;E++){if(C[E].result.toLowerCase()==B.toLowerCase()){D=C[E];break}}}if(typeof z=="function"){z(D)}else{o.trigger("result",D&&[D.data,D.value])}}a.each(j(o.val()),function(B,C){s(C,A,A)})}).bind("flushCache",function(){c.flush()}).bind("setOptions",function(){a.extend(u,arguments[1]);if("data" in arguments[1]){c.populate()}}).bind("unautocomplete",function(){t.unbind();o.unbind();a(w.form).unbind(".autocomplete")});function n(){var B=t.selected();if(!B){return false}var F=B.result;l=F;if(u.multiple){var C=j(o.val());if(C.length>1){var E=u.multipleSeparator.length;var D=a(w).selection().start;var z,A=0;a.each(C,function(G,H){A+=H.length;if(D<=A){z=G;return false}A+=E});C[z]=F;F=C.join(u.multipleSeparator)}F+=u.multipleSeparator}o.val(F);x();o.trigger("result",[B.data,B.value]);return true}function g(z,B){if(h==v.DEL){t.hide();return}var A=o.val();if(!B&&A==l){return}l=A;A=e(A);if(A.length>=u.minChars){o.addClass(u.loadingClass);if(!u.matchCase){A=A.toLowerCase()}s(A,k,x)}else{i();t.hide()}}function j(z){if(!z){return[""]}if(!u.multiple){return[a.trim(z)]}return a.map(z.split(u.multipleSeparator),function(A){return a.trim(z).length?a.trim(A):null})}function e(z){if(!u.multiple){return z}var A=j(z);if(A.length==1){return A[0]}var B=a(w).selection().start;if(B==z.length){A=j(z)}else{A=j(z.replace(z.substring(B),""))}return A[A.length-1]}function y(A,z){if(u.autoFill&&(e(o.val()).toLowerCase()==A.toLowerCase())&&h!=v.BACKSPACE){o.val(o.val()+z.substring(e(l).length));a(w).selection(l.length,l.length+z.length)}}function f(){clearTimeout(r);r=setTimeout(x,200)}function x(){var z=t.visible();t.hide();clearTimeout(r);i();if(u.mustMatch){o.search(function(A){if(!A){if(u.multiple){var B=j(o.val()).slice(0,-1);o.val(B.join(u.multipleSeparator)+(B.length?u.multipleSeparator:""))}else{o.val("");o.trigger("result",null)}}})}}function k(A,z){if(z&&z.length&&p){i();t.display(z,A);y(A,z[0].value);t.show()}else{x()}}function s(B,C,z){if(!u.matchCase){B=B.toLowerCase()}var A=c.load(B);if(A&&A.length){C(B,A)}else{if((typeof u.url=="string")&&(u.url.length>0)){var D={timestamp:+new Date()};a.each(u.extraParams,function(E,F){D[E]=typeof F=="function"?F():F});a.ajax({mode:"abort",port:"autocomplete"+w.name,dataType:u.dataType,url:u.url,data:a.extend({q:e(B),limit:u.max},D),success:function(E){var F=u.parse&&u.parse(E)||d(E);c.add(B,F);C(B,F)}})}else{t.emptyList();z(B)}}}function d(A){var B=[];for(var C=0;C<rows.length;C++){var z=a.trim(rows[C]);if(z){z=z.split("|");B[B.length]={data:z,value:z[0],result:u.formatResult&&u.formatResult(z,z[0])||z[0]}}}return B}function i(){o.removeClass(u.loadingClass)}};a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(c){return c[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(d,c){return d.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+c.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180};a.Autocompleter.Cache=function(d){var c={};var h=0;function e(k,l){if(!d.matchCase){k=k.toLowerCase()}var j=k.indexOf(l);if(d.matchContains=="word"){j=k.toLowerCase().search("\\b"+l.toLowerCase())}if(j==-1){return false}return j==0||d.matchContains}function g(k,j){if(h>d.cacheLength){i()}if(!c[k]){h++}c[k]=j}function f(){if(!d.data){return false}var o={},p=0;if(!d.url){d.cacheLength=1}o[""]=[];for(var k=0,n=d.data.length;k<n;k++){var l=d.data[k];l=(typeof l=="string")?[l]:l;var j=d.formatMatch(l,k+1,d.data.length);if(j===false){continue}var m=j.charAt(0).toLowerCase();if(!o[m]){o[m]=[]}var q={value:j,data:l,result:d.formatResult&&d.formatResult(l)||j};o[m].push(q);if(p++<d.max){o[""].push(q)}}a.each(o,function(r,s){d.cacheLength++;g(r,s)})}setTimeout(f,25);function i(){c={};h=0}return{flush:i,add:g,populate:f,load:function(j){if(!d.cacheLength||!h){return null}if(!d.url&&d.matchContains){var o=[];for(var m in c){if(m.length>0){var n=c[m];a.each(n,function(k,p){if(e(p.value,j)){o.push(p)}})}}return o}else{if(c[j]){return c[j]}else{if(d.matchSubset){for(var l=j.length-1;l>=d.minChars;l--){var n=c[j.substr(0,l)];if(n){var o=[];a.each(n,function(k,p){if(e(p.value,j)){o[o.length]=p}});return o}}}}}return null}}};a.Autocompleter.Select=function(r,s,q,m){var f={ACTIVE:"ac_over"};var o="";var j,l=-1,c,h="",n=true,g,p;function k(){if(!n){return}g=a("<div/>").hide().addClass(r.resultsClass).css("position","absolute").appendTo(document.body);p=a("<ul/>").appendTo(g).mouseover(function(v){if(t(v).nodeName&&t(v).nodeName.toUpperCase()=="LI"){l=a("li",p).removeClass(f.ACTIVE).index(t(v));a(t(v)).addClass(f.ACTIVE)}}).click(function(v){a(t(v)).addClass(f.ACTIVE);q();s.focus();return false}).mousedown(function(){m.mouseDownOnSelect=true}).mouseup(function(){m.mouseDownOnSelect=false});if(r.width>0){g.css("width",r.width)}n=false}function t(w){var v=w.target;while(v&&v.tagName!="LI"){v=v.parentNode}if(!v){return[]}return v}function e(w){j.slice(l,l+1).removeClass(f.ACTIVE);d(w);var v=j.slice(l,l+1).addClass(f.ACTIVE);if(r.scroll){var x=0;j.slice(0,l).each(function(){x+=this.offsetHeight});if((x+v[0].offsetHeight-p.scrollTop())>p[0].clientHeight){p.scrollTop(x+v[0].offsetHeight-p.innerHeight())}else{if(x<p.scrollTop()){p.scrollTop(x)}}}}function d(v){if(b==-1){l=-1}if(l==-1){o=s.value}l+=v;if(l<-1){l=j.size()-1}else{if(l>=j.size()){l=-1}}if(l>=0){if(c[l].data){s.value=c[l].data.suggestion}}else{s.value=o}b=l}function u(v){return r.max&&r.max<v?r.max:v}function i(){p.empty();var y=u(c.length);for(var v=0;v<y;v++){if(!c[v]||!c[v].data){continue}var w=r.formatItem(c[v].data,v+1,y,c[v].value,h);if(w===false){continue}var x=a("<li/>").html(r.highlight(w,h)).addClass(v%2==0?"ac_even":"ac_odd").appendTo(p)[0];a.data(x,"ac_data",c[v])}j=p.find("li");if(r.selectFirst){j.slice(0,1).addClass(f.ACTIVE);l=0}if(a.fn.bgiframe){p.bgiframe()}}return{display:function(v,w){k();c=v;h=w;i()},next:function(){e(1)},prev:function(){e(-1)},pageUp:function(){if(l!=0&&l-8<0){e(-l)}else{e(-8)}},pageDown:function(){if(l!=j.size()-1&&l+8>j.size()){e(j.size()-1-l)}else{e(8)}},hide:function(){g&&g.hide();j&&j.removeClass(f.ACTIVE);l=-1},visible:function(){return g&&g.is(":visible")},current:function(){return this.visible()&&(j.filter("."+f.ACTIVE)[0]||r.selectFirst&&j[0])},show:function(){var x=a(s).offset();g.css({width:typeof r.width=="string"||r.width>0?r.width:a(s).width(),top:x.top+s.offsetHeight,left:x.left}).show();if(r.scroll){p.scrollTop(0);p.css({maxHeight:r.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var v=0;j.each(function(){v+=this.offsetHeight});var w=v>r.scrollHeight;p.css("height",w?r.scrollHeight:v);if(!w){j.width(p.width()-parseInt(j.css("padding-left"))-parseInt(j.css("padding-right")))}}}},selected:function(){var v=j&&j.filter("."+f.ACTIVE).removeClass(f.ACTIVE);return v&&v.length&&a.data(v[0],"ac_data")},emptyList:function(){p&&p.empty()},unbind:function(){g&&g.remove()}}};a.fn.selection=function(e,c){if(e!==undefined){return this.each(function(){if(this.createTextRange){var k=this.createTextRange();if(c===undefined||e==c){k.move("character",e);k.select()}else{k.collapse(true);k.moveStart("character",e);k.moveEnd("character",c);k.select()}}else{if(this.setSelectionRange){this.setSelectionRange(e,c)}else{if(this.selectionStart){this.selectionStart=e;this.selectionEnd=c}}}})}var g=this[0];if(g.createTextRange){var f=document.selection.createRange(),d=g.value,i="<->",h=f.text.length;f.text=i;var j=g.value.indexOf(i);g.value=d;this.selection(j,j+h);return{start:j,end:j+h}}else{if(g.selectionStart!==undefined){return{start:g.selectionStart,end:g.selectionEnd}}}}})(jQuery);$(document).ready(function(){if(typeof(queryCompletionSearchForms)=="undefined"||queryCompletionSearchForms.length==0){return}$.each(queryCompletionSearchForms,function(a,b){$(b.textField).autocomplete(queryCompletionUrl,{cacheLength:0,extraParams:{ilang:queryCompletionLanguage},delay:200,selectFirst:false,dataType:"jsonp",highlight:false,scroll:false,parse:function(c){return $.map(c,function(d){return{data:d}})},formatItem:function(c){if(c){var d="<span>"+c.nHits+"</span>";return d+c.suggestionHighlighted}return}}).result(function(c,d){$(b.textField).val(d.suggestion);$(b.button).click()})})});function essClickWithoutOpenWindow(a,b){$.ajax({type:"GET",url:b,dataType:"text",timeout:2000})}function essClick(c,b,a){$.ajax({type:"GET",url:b,dataType:"text",complete:function(){if(a){window.open(c,a)}else{window.location.href=c}},timeout:2000});return false}function essActivateClickTracking(a){$.ajax({type:"GET",url:a,dataType:"text",complete:function(){return},timeout:2000});return false};
