widget={};widget.hint=function(){function b(c){if(c.innerText){return c.innerText}else{return c.textContent}}function a(c){var d=curtop=0;if(c.offsetParent){d=c.offsetLeft;curtop=c.offsetTop;while(c=c.offsetParent){d+=c.offsetLeft;curtop+=c.offsetTop}}return[d,curtop]}return{config:{callback:null,field:null,className:"",timeout:500,historyLength:0,container:"",elements:""},id:0,timerId:0,event:0,list:{nodesList:0,pointer:-1,add:function(d,c){this.nodeList=d;this.pointer=-1},elements:function(){var d=this.nodeList;var c=[];for(el in d){if(!isNaN(el)&&d[el]!=undefined){c.push(d[el])}}return c},current:function(){return this.nodeList[(this.pointer<0)?0:this.pointer]},next:function(){if(this.pointer>=this.nodeList.length-1){this.pointer=-1}return this.nodeList[++this.pointer]},prev:function(){if(this.pointer<1){this.pointer=this.nodeList.length}return this.nodeList[--this.pointer]}},history:{list:[],length:0,create:function(e,c){if(!((typeof e=="string")&&(typeof c=="string"))){return}if(this.get(e)!=null){return}if(this.length<1){return}var d={val:e,data:c};this.add(d)},add:function(c){if(this.list.length>=this.length){this.remove()}this.list.push(c)},remove:function(){var c=(this.list.length-this.length);return this.list.splice(0,1)},get:function(d){for(var c=0;c<this.list.length;c++){if(this.list[c].val==d){return this.list[c]}}return null}},initialize:function(c){this.extend(this.config,((typeof c)==="object")?c:{});this.history.length=this.config.historyLength},extend:function(c,e){for(var d in e){c[d]=e[d]}return c},getObject:function(d){var c=null;if((typeof d)==="object"){c=d}else{if(typeof d==="string"){c=document.getElementById(d)}}return c},create:function(){if(this.getObject(this.config.container)==undefined||this.getObject(this.config.container)==null){var d=null;var e=this.getObject(this.config.field);e.setAttribute("autocomplete","off");d=document.createElement("div");d.className=this.config.className;this.id=d.id="hint_"+this.getRandomId(1,100);var c=a(e);d.style.position="absolute";d.style.top=parseInt(c[1]+e.offsetHeight)+"px";d.style.left=c[0];e.parentNode.appendChild(d)}else{this.id=this.config.container;this.getObject(this.config.container).style.display="block"}},getRandomId:function(d,c){return Math.floor(Math.random()*(c-d+1))+d},showResult:function(){var d=this.config.callback;if((typeof d)==="function"){var c=null;if((c=this.history.get(this.getObject(this.config.field).value))!=null){this.handleResult(c.data)}else{d.call(this,this.getObject(this.config.field))}}},handleResult:function(c){var d=this.getObject(this.id);if(c.length){d.innerHTML=c;d.style.display="block";if(this.config.elements!=null){this.list.add(this.getObject(this.id).getElementsByTagName(this.config.elements))}else{this.list.add(this.getObject(this.id).childNodes)}this.history.create(this.getObject(this.config.field).value,c)}else{d.innerHTML="";d.style.display="none"}},eventAction:function(c){switch(c){case 40:this.list.current().className="";this.list.next().className="active";this.getObject(this.config.field).value=b(this.list.current());break;case 38:this.list.current().className="";this.list.prev().className="active";this.getObject(this.config.field).value=b(this.list.current());break;case 13:break;default:clearTimeout(this.timerId);that=this;this.timerId=setTimeout(function(){that.showResult()},this.config.timeout);break}},show:function(e){var d=this;var f=this.getObject(this.config.field);if(f==null){return}var c=function(){setTimeout(function(){if(d.getObject(d.id)!=null){d.getObject(d.id).style.display="none"}},250)};f.onkeyup=function(g){if(window.event){g=window.event}if(d.id==0){d.create()}d.eventAction(g.keyCode)};f.onchange=function(){c()};f.onblur=function(){c()};f.onfocus=function(){f.setAttribute("autocomplete","off")}}}};function replaceSpecialChars(c,b){b=b||"";var a=c.replace(new RegExp("[^a-zA-Z0-9\u0410-\u044F\u0104\u010c\u0118\u0116\u012e\u0160\u0172\u016a\u017d\u0105\u010d\u0119\u0117\u012f\u0161\u0173\u016b\u017e"+b+" ]","g"),"");a=a.replace(/\s\s+/g," ");a=a.replace(/^\s+/,"").replace(/\s+$/,"");return a}function addslashes(a){a=a.replace(/\\/g,"\\\\");a=a.replace(/\'/g,"\\'");a=a.replace(/\"/g,'\\"');a=a.replace(/\0/g,"\\0");return a}function makeUrlAlias(b){var a=replaceSpecialChars(b);a=a.toLowerCase(a);return encodeURIComponent(a)}function shortenText(h,f){var h=h;var d=f||30;var c=0;var g=h.replace(/\s\s+/g," ").split(" ");var b=[];var a=0;for(var e=0;e<g.length;e++){b.push(g[e]);a+=g[e].length;if(a>d){c++;break}}if(c>0){h=b.join(" ").concat("...")}return h}function highlightSearchString(b,a){var f=b.split(" ");var d=[];for(var c=0;c<f.length;c++){var g=0,e=0;d[c]=f[c];while((e=f[c].indexOf(a,g))!=-1){d[c]=f[c].substring(g,e);d[c]+="<b>"+a+"</b>";g=e+a.length;if(g<f[c].length){d[c]+=f[c].substring(g)}}}return d.join(" ")}function highlightSearchString2(b,a){a=a.replace(/[a\u0105]/gi,"[a\u0105]");a=a.replace(/[c\u010d]/gi,"[c\u010d]");a=a.replace(/[e\u0119\u0117]/gi,"[e\u0119\u0117]");a=a.replace(/[i\u012f]/gi,"[i\u012f]");a=a.replace(/[u\u0173\u016b]/gi,"[u\u0173\u016b]");a=a.replace(/[s\u0161]/gi,"[s\u0161]");a=a.replace(/[z\u017e]/gi,"[z\u017e]");return b.replace(new RegExp(a,"gi"),function(c,e,d){return"<b>"+c+"</b>"})}function getXmlHttp(){var d;try{d=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{d=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){try{d=new XMLHttpRequest()}catch(a){d=false}}}return d}function getInnerText(a){if(a.innerText){return a.innerText}else{return a.textContent}}function setValueAndSubmit(a){document.getElementById("q").value=getInnerText(a);document.getElementById("srchfrm").submit();return false}function handleData(c,b){var a=[];if(b.length>0){for(key in b){if((typeof b[key]=="object")||(typeof b[key]=="function")){continue}var d=shortenText(b[key],45);d=highlightSearchString2(d,c);a.push("<a href='#' onclick='setValueAndSubmit(this);'>"+d+"</a>")}a.push("<a href='#' style='display:none;'>"+c+"</a>")}if(a.length>0){return"<div class='new_tp'>"+a.join("")+"</div><div class='new_bt'>&nbsp;</div>"}return""}function handleAjaxResponseHint(field){var response="",data="",res=[],that=this,host="/";if(location.host){host="http://"+location.host+"/"}var f=replaceSpecialChars(field.value);if(f.length>1){try{var xmlHttp=getXmlHttp();xmlHttp.onreadystatechange=function(){if(xmlHttp.status==200&&xmlHttp.readyState==4){data=eval("("+xmlHttp.responseText+")");m=handleData(f,data);that.handleResult(m)}};var params="?"+field.name+"="+encodeURIComponent(f);xmlHttp.open("GET",host+"ajax/suggestions"+params,true);xmlHttp.send(null)}catch(e){alert("Klaida! Pabandykite perkrauti puslapi ir pabandyti is naujo!")}}else{that.handleResult("")}};

/*!
 * jQuery Tools v1.2.5 - The missing UI library for the Web
 * 
 * tooltip/tooltip.js
 * tooltip/tooltip.slide.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function(a){a.tools=a.tools||{version:"v1.2.5"},a.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,c,d){b[a]=[c,d]}};var b={toggle:[function(a){var b=this.getConf(),c=this.getTip(),d=b.opacity;d<1&&c.css({opacity:d}),c.show(),a.call()},function(a){this.getTip().hide(),a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};function c(b,c,d){var e=d.relative?b.position().top:b.offset().top,f=d.relative?b.position().left:b.offset().left,g=d.position[0];e-=c.outerHeight()-d.offset[0],f+=b.outerWidth()+d.offset[1],/iPad/i.test(navigator.userAgent)&&(e-=a(window).scrollTop());var h=c.outerHeight()+b.outerHeight();g=="center"&&(e+=h/2),g=="bottom"&&(e+=h),g=d.position[1];var i=c.outerWidth()+b.outerWidth();g=="center"&&(f-=i/2),g=="left"&&(f-=i);return{top:e,left:f}}function d(d,e){var f=this,g=d.add(f),h,i=0,j=0,k=d.attr("title"),l=d.attr("data-tooltip"),m=b[e.effect],n,o=d.is(":input"),p=o&&d.is(":checkbox, :radio, select, :button, :submit"),q=d.attr("type"),r=e.events[q]||e.events[o?p?"widget":"input":"def"];if(!m)throw"Nonexistent effect \""+e.effect+"\"";r=r.split(/,\s*/);if(r.length!=2)throw"Tooltip: bad events configuration for "+q;d.bind(r[0],function(a){clearTimeout(i),e.predelay?j=setTimeout(function(){f.show(a)},e.predelay):f.show(a)}).bind(r[1],function(a){clearTimeout(j),e.delay?i=setTimeout(function(){f.hide(a)},e.delay):f.hide(a)}),k&&e.cancelDefault&&(d.removeAttr("title"),d.data("title",k)),a.extend(f,{show:function(b){if(!h){l?h=a(l):e.tip?h=a(e.tip).eq(0):k?h=a(e.layout).addClass(e.tipClass).appendTo(document.body).hide().append(k):(h=d.next(),h.length||(h=d.parent().next()));if(!h.length)throw"Cannot find tooltip for "+d}if(f.isShown())return f;h.stop(!0,!0);var o=c(d,h,e);e.tip&&h.html(d.data("title")),b=b||a.Event(),b.type="onBeforeShow",g.trigger(b,[o]);if(b.isDefaultPrevented())return f;o=c(d,h,e),h.css({position:"absolute",top:o.top,left:o.left}),n=!0,m[0].call(f,function(){b.type="onShow",n="full",g.trigger(b)});var p=e.events.tooltip.split(/,\s*/);h.data("__set")||(h.bind(p[0],function(){clearTimeout(i),clearTimeout(j)}),p[1]&&!d.is("input:not(:checkbox, :radio), textarea")&&h.bind(p[1],function(a){a.relatedTarget!=d[0]&&d.trigger(r[1].split(" ")[0])}),h.data("__set",!0));return f},hide:function(c){if(!h||!f.isShown())return f;c=c||a.Event(),c.type="onBeforeHide",g.trigger(c);if(!c.isDefaultPrevented()){n=!1,b[e.effect][1].call(f,function(){c.type="onHide",g.trigger(c)});return f}},isShown:function(a){return a?n=="full":n},getConf:function(){return e},getTip:function(){return h},getTrigger:function(){return d}}),a.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f}})}a.fn.tooltip=function(b){var c=this.data("tooltip");if(c)return c;b=a.extend(!0,{},a.tools.tooltip.conf,b),typeof b.position=="string"&&(b.position=b.position.split(/,?\s/)),this.each(function(){c=new d(a(this),b),a(this).data("tooltip",c)});return b.api?c:this}})(jQuery);
(function(a){var b=a.tools.tooltip;a.extend(b.conf,{direction:"up",bounce:!1,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!a.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.addEffect("slide",function(a){var b=this.getConf(),d=this.getTip(),e=b.slideFade?{opacity:b.opacity}:{},f=c[b.direction]||c.up;e[f[1]]=f[0]+"="+b.slideOffset,b.slideFade&&d.css({opacity:0}),d.show().animate(e,b.slideInSpeed,a)},function(b){var d=this.getConf(),e=d.slideOffset,f=d.slideFade?{opacity:0}:{},g=c[d.direction]||c.up,h=""+g[0];d.bounce&&(h=h=="+"?"-":"+"),f[g[1]]=h+"="+e,this.getTip().animate(f,d.slideOutSpeed,function(){a(this).hide(),b.call()})})})(jQuery);


function XmlHttp(){var c;if(window.XMLHttpRequest){c=new XMLHttpRequest();if(c.readyState==null){c.readyState=1;c.addEventListener("load",function(){c.readyState=4;if(typeof c.onreadystatechange=="function"){c.onreadystatechange()}},false)}return c}else{if(window.ActiveXObject){c=["MSXML2","Microsoft","MSXML","MSXML3"];for(var b=0;c[b];b++){try{return new ActiveXObject(c[b]+".XmlHttp")}catch(a){}}}}return false}var READY_STATE_UNINITIALIZED=0;var READY_STATE_LOADING=1;var READY_STATE_LOADED=2;var READY_STATE_INTERACTIVE=3;var READY_STATE_COMPLETE=4;function sendRequest(a,b,c){if(!c){c="GET"}req=initXMLHTTPRequest();if(req){req.onreadystatechange=onReadyState;req.open(c,a,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.send(b)}}function initXMLHTTPRequest(){var a=null;if(window.XMLHttpRequest){a=new XMLHttpRequest()}else{if(window.ActiveXObject){a=new ActiveXObject("Microsoft.XMLHTTP")}}return a};

$(function(){var a=widget.hint();a.initialize({field:"q",callback:handleAjaxResponseHint,timeout:500,historyLength:15,container:"search_holder",elements:"a"});a.show();$(".tooltip-obj[title]").each(function(){var b=$(this).attr("title");$(this).data("titles",b);$(this).removeAttr("title")});$(".tooltip-obj").tooltip({tip:"#tooltip",position:"top center",onBeforeShow:function(){if(this.getTrigger().next()[0]!=null&&this.getTrigger().next()[0].nodeName.toLowerCase()=="span"&&this.getTrigger().next().hasClass("tooltip-text")){this.getTip().find(".ct").html(this.getTrigger().next().html())}else{if(this.getTrigger().data("titles")&&this.getTrigger().data("titles").length!=0){this.getTip().find(".ct").html(this.getTrigger().data("titles"))}else{this.getTip().hide()}}}});$("input[type='text'], textarea").live("focus",function(){if(this.title==this.value){$(this).addClass("highlight");$(this).val("")}}).live("blur",function(){if(this.value.length==0){$(this).removeClass("highlight");$(this).val(this.title)}});$("#srchfrm").submit(function(c){var b=$("#q");if(b[0].title==b.val()||b.val().length<1){return false}return true})});function getErrorContainer(d,e){var c=$(document.createElement("div")).addClass("new_error-over").attr("id","error_"+e).html('<div class="new_tp"><p>'+d+'</p><a href="#" class="close"></a></div><div class="new_bt">&nbsp;</div></div>');var b=$("input[name='"+e+"']");b.css({borderColor:"red"}).before(c);var a=b.position();c.css({top:a.top-c.outerHeight()});return c}function dBi(a){return document.getElementById(a)}function trim(a){return a.replace(/^[\x20\x0A\x0D]+|[\x20\x0A\x0D]+$/g,"")}function ltrim(a){return a.replace(/^[\x20\x0A\x0D]+/,"")}function rtrim(a){return a.replace(/[\x20\x0A\x0D]+$/,"")}function hasClass(b,a){return b.className.match(new RegExp("(\\s|^)"+a+"(\\s|$)"))}function addClass(b,a){if(!this.hasClass(b,a)){b.className+=" "+a}}function removeClass(c,a){if(hasClass(c,a)){var b=new RegExp("(\\s|^)"+a+"(\\s|$)");c.className=c.className.replace(b," ")}}function toggle_id_vis(a){if(dBi("fltrplus")){flimg=dBi("fltrplus")}else{flimg=new Image()}if(dBi(a)){if(dBi(a).style.display=="none"){if(dBi(a).nodeName=="TR"){dBi(a).style.display=""}else{dBi(a).style.display="block"}removeClass(flimg,"plus");addClass(flimg,"minus")}else{dBi(a).style.display="none";removeClass(flimg,"minus");addClass(flimg,"plus")}}else{return false}}function showID(b,a){dBi(b).style.display="block"}function hideID(a){dBi(a).style.display="none"}function show_info_pop(){if(dBi("gren_hlp_1")){new_thm=dBi("gren_hlp_1");new_thm.onmouseover=new Function("showID('green_hlp_wrap_1')");new_thm.onmouseout=new Function("hideID('green_hlp_wrap_1')")}if(dBi("pg_count_img")){new_thm=dBi("pg_count_img");new_thm.onmouseover=new Function("showID('pg_count')");new_thm.onmouseout=new Function("hideID('pg_count')")}if(dBi("dwnCreditsnfo_img")){new_thm=dBi("dwnCreditsnfo_img");new_thm.onmouseover=new Function("showID('dwnCreditsnfo')");new_thm.onmouseout=new Function("hideID('dwnCreditsnfo')")}if(dBi("dwnCodenfo_img")){new_thm=dBi("dwnCodenfo_img");new_thm.onmouseover=new Function("showID('dwnCodenfo')");new_thm.onmouseout=new Function("hideID('dwnCodenfo')")}if(dBi("allowed_file_types_info")){new_thm=dBi("allowed_file_types_info_img");new_thm.onmouseover=new Function("showID('allowed_file_types_info')");new_thm.onmouseout=new Function("hideID('allowed_file_types_info')")}}function sz(a){while(a.scrollTop>0){a.rows+=1}}function loginLightbox(b,c){this.prefix=b.prefix||"loginLightbox";this.act=b.act||"open";this.redirect=b.redirect||document.location.href;this.isIE=(navigator.appName.indexOf("Microsoft")!=-1)?true:false;this.updatePos=function(){if(this.isIE){this.winWidth=document.body.offsetWidth}else{this.winWidth=window.innerWidth}dBi(this.prefix+"-box").style.left=(this.winWidth-parseInt(dBi(this.prefix+"-box").style.width,10))/2+"px"};if(this.act=="open"){if(dBi(this.prefix+"-content").innerHTML==""){var a=new XmlHttp();a.open("GET","http://"+document.location.host+"/ajax/fetchloginform/?redirect="+this.redirect,false);a.send(null);dBi(this.prefix+"-content").innerHTML=a.responseText;appendJsCss({source:dBi(this.prefix+"-content")})}window.onresize=function(){setTimeout("this.updatePos()",50)};this.updatePos();showID(this.prefix)}else{if(this.act=="close"){hideID(this.prefix)}}}function appendJsCss(c){var a=c.source.getElementsByTagName("script");var g=c.source.getElementsByTagName("style");var e=document.getElementsByTagName("head")[0];for(var d=0;d<a.length;d++){var b=document.createElement("script");b.type="text/javascript";if(a[d].src){b.src=a[d].src}else{b.text=a[d].innerHTML}e.appendChild(b)}for(var d=0;d<g.length;d++){if(g[d].href){var f=document.createElement("link");f.type="text/css";f.rel="stylesheet";f.href=g[d].href;f.media="screen"}else{var f=document.createElement("style");f.type="text/css";f.text=g[d].innerHTML}e.appendChild(f)}};

addEvent(window,"load",convertTrees);function addEvent(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false);return true}else{if(c.attachEvent){return c.attachEvent("on"+b,a)}else{return false}}}function setDefault(a,b){if(typeof(window[a])=="undefined"||window[a]==null){window[a]=b}}function expandTree(a){var b=document.getElementById(a);if(b==null){return false}expandCollapseList(b,nodeOpenClass)}function collapseTree(a){var b=document.getElementById(a);if(b==null){return false}expandCollapseList(b,nodeClosedClass)}function expandToItem(a,e){var c=document.getElementById(a);if(c==null){return false}var b=expandCollapseList(c,nodeOpenClass,e);if(b){var d=document.getElementById(e);if(d.scrollIntoView){d.scrollIntoView(false)}}}function expandCollapseList(e,f,i){if(!e.childNodes||e.childNodes.length==0){return false}for(var a=0;a<e.childNodes.length;a++){var h=e.childNodes[a];if(i!=null&&h.id==i){return true}if(h.nodeName=="LI"){var b=false;for(var c=0;c<h.childNodes.length;c++){var g=h.childNodes[c];if(g.nodeName=="UL"){b=true;var d=expandCollapseList(g,f,i);if(i!=null&&d){h.className=f;return true}}}if(b&&i==null){h.className=f}}}}function convertTrees(){setDefault("treeClass","mktree");setDefault("nodeClosedClass","liClosed");setDefault("nodeOpenClass","liOpen");setDefault("nodeBulletClass","liBullet");setDefault("nodeLinkClass","bullet");setDefault("preProcessTrees",true);if(preProcessTrees){if(!document.createElement){return}var d=document.getElementsByTagName("ul");if(d==null){return}var a=d.length;for(var c=0;c<a;c++){var b=d[c];if(b.nodeName=="UL"&&b.className.indexOf(treeClass)!=-1){processList(b)}}}}function treeNodeOnclick(){this.parentNode.className=(this.parentNode.className==nodeOpenClass)?nodeClosedClass:nodeOpenClass;return false}function retFalse(){return false}function processList(d){if(!d.childNodes||d.childNodes.length==0){return}var f=d.childNodes.length;for(var a=0;a<f;a++){var i=d.childNodes[a];if(i.nodeName=="LI"){var b=false;var e=i.childNodes.length;for(var c=0;c<e;c++){var h=i.childNodes[c];if(h.nodeName=="UL"){b=true;processList(h)}}var j=document.createElement("SPAN");var g="\u00A0";j.className=nodeLinkClass;if(b){if(i.className==null||i.className==""){i.className=nodeClosedClass}if(i.firstChild.nodeName=="#text"){g=g+i.firstChild.nodeValue;i.removeChild(i.firstChild)}j.onclick=treeNodeOnclick}else{i.className=nodeBulletClass;j.onclick=retFalse}j.appendChild(document.createTextNode(g));i.insertBefore(j,i.firstChild)}}};


