var pageElement=Array();var paginatorId='';var currentPage=1;var allItems=0;var lastPage=1;var startPage=1;var itemsPerPage=5;var firstPageSymbol='Перша';var previousPageSymbol='Попередня';var nextPageSymbol='Наступна';var lastPageSymbol='Остання';var separator='  ';var paginatorPosition='both';var paginatorStyle=3;var enablePageOfOption=false;var enableGoToPage=false;var textGoToPage='Jump to';var enableSelectNoItems=false;var textSelectNoItems='Items Per Page';var paginatorValues=Array(5,10,15,20,25,30);var anchorLink='#comments';var showIfSinglePage=false;jQuery.fn.extend({pagination:function(){paginatorId=this;switch(paginatorPosition)
{case'top':{paginatorId.before('<div class="paginator"></div>');break;}
case'bottom':{paginatorId.after('<div class="paginator"></div>');break;}
case'both':{paginatorId.before('<div class="paginator"></div>');paginatorId.after('<div class="paginator"></div>');break;}
default:{paginatorId.after('<div class="paginator"></div>');}}
initPaginator();},depagination:function(){$('.paginator').remove();paginatorId.children().show();}});function initPaginator()
{if(itemsPerPage<1)
itemsPerPage=5;allItems=paginatorId.children().length;if(allItems%itemsPerPage==0)
lastPage=parseInt(allItems/itemsPerPage);else
lastPage=parseInt(allItems/itemsPerPage)+1;if((startPage<1)||(startPage>lastPage))
startPage=1;if(!showIfSinglePage)
{if(lastPage>1)
appendContent(startPage,1);}
else
appendContent(startPage,1);}
function appendContent(page,effect)
{effect=1;if(page<0)
{if(page==-1)
page=currentPage-1;else
page=currentPage+1;}
currentPage=page;till=(currentPage-1)*itemsPerPage;if(!effect)
{paginatorId.fadeOut("medium",function(){createPaginator();paginatorId.children().hide();paginatorId.children().slice(till,itemsPerPage+till).show();paginatorId.fadeIn("medium");});}
else
{createPaginator();paginatorId.children().hide();paginatorId.children().slice(till,itemsPerPage+till).show();}}
function createPaginator()
{$(".paginator").html("");var style1='';var style2='';var style3='';var style4='';var pageOfOption=' Page '+currentPage+' of '+lastPage+' Page(s) ';var goToPage=' '+textGoToPage+' <select onchange="appendContent(this.value);" >';var selectNoItems=' '+textSelectNoItems+' <select onchange="itemsPerPage=Number(this.value);initPaginator();" >';for(var i=0;i<paginatorValues.length;i++)
{if(itemsPerPage==paginatorValues[i])
selectNoItems+='<option value="'+paginatorValues[i]+'" selected="selected">'+paginatorValues[i]+'</option>';else
selectNoItems+='<option value="'+paginatorValues[i]+'">'+paginatorValues[i]+'</option>';}
selectNoItems+='</select>';if(currentPage==1)
{style='<a href="'+anchorLink+'" class="inactive" title="First Page">'+firstPageSymbol+'</a>'+separator;style1=style2=style;style='<a href="'+anchorLink+'" class="inactive" title="Previous Page">'+previousPageSymbol+'</a>'+separator;style1+=style;style2+=style;style3+=style;style4+=style;}
else
{style='<a href="'+anchorLink+'" class="active" onclick="appendContent(1);" title="First Page">'+firstPageSymbol+'</a>'+separator;style1=style2=style;style='<a href="'+anchorLink+'" class="active" onclick="appendContent(-1);" title="Previous Page">'+previousPageSymbol+'</a>'+separator;style1+=style;style2+=style;style3+=style;style4+=style;}
for(var i=1;i<=lastPage;i++)
{if(i==currentPage)
{style1+='<a href="'+anchorLink+'" class="inactive" title="Page '+i+'">'+i+'</a>'+separator;style2+='<a href="'+anchorLink+'" class="inactive" title="Page '+i+'">'+i+'/'+lastPage+'</a>'+separator;style3+='<a href="'+anchorLink+'" class="inactive" title="Page '+i+'">'+i+'</a>'+separator;goToPage+='<option value="'+i+'" selected="selected">'+i+'</option>';}
else
{style='<a href="'+anchorLink+'" class="active" onclick="appendContent('+i+');" title="Page '+i+'">'+i+'</a>'+separator;style1+=style;style3+=style;goToPage+='<option value="'+i+'">'+i+'</option>';}}
goToPage+='</select>';if(currentPage==lastPage)
{style='<a href="'+anchorLink+'" class="inactive" title="Next Page">'+nextPageSymbol+'</a>';style1+=style;style2+=style;style3+=style;style4+=style;style=separator+'<a href="'+anchorLink+'" class="inactive" title="Last Page">'+lastPageSymbol+'</a>';style1+=style;style2+=style;}
else
{style='<a href="'+anchorLink+'" class="active" onclick="appendContent(-2);" title="Next Page">'+nextPageSymbol+'</a>';style1+=style;style2+=style;style3+=style;style4+=style;style=separator+'<a href="'+anchorLink+'" class="active" onclick="appendContent('+lastPage+');" title="Last Page">'+lastPageSymbol+'</a>';style1+=style;style2+=style;}
switch(paginatorStyle)
{case 1:style=style1;break;case 2:style=style2;break;case 3:style=style3;break;case 4:style=style4;break;default:style=style1;}
if(enablePageOfOption)
style+='<span class="inactive" title="Page Information">'+pageOfOption+'</span>';if(enableGoToPage)
style+='<span class="inactive" title="Select Page">'+goToPage+'</span>';if(enableSelectNoItems)
style+='<span class="inactive" title="Select no. of items per page">'+selectNoItems+'</span>';$(".paginator").html(style);};(function($){$.widget("thomaskahn.smoothDivScroll",{options:{scrollingHotSpotLeft:"div.scrollingHotSpotLeft",scrollingHotSpotRight:"div.scrollingHotSpotRight",scrollableArea:"div.scrollableArea",scrollWrapper:"div.scrollWrapper",hiddenOnStart:false,ajaxContentURL:"",countOnlyClass:"",scrollStep:15,scrollInterval:10,mouseDownSpeedBooster:3,autoScroll:"",autoScrollDirection:"right",autoScrollStep:5,autoScrollInterval:10,visibleHotSpots:"",hotSpotsVisibleTime:5,startAtElementId:""},_create:function(){var self=this,o=this.options,el=this.element;el.data("scrollWrapper",el.find(o.scrollWrapper));el.data("scrollingHotSpotRight",el.find(o.scrollingHotSpotRight));el.data("scrollingHotSpotLeft",el.find(o.scrollingHotSpotLeft));el.data("scrollableArea",el.find(o.scrollableArea));el.data("speedBooster",1);el.data("motherElementOffset",el.offset().left);el.data("scrollXPos",0);el.data("hotSpotWidth",el.find(o.scrollingHotSpotLeft).width());el.data("scrollableAreaWidth",0);el.data("startingPosition",0);el.data("rightScrollInterval",null);el.data("leftScrollInterval",null);el.data("autoScrollInterval",null);el.data("hideHotSpotBackgroundsInterval",null);el.data("previousScrollLeft",0);el.data("pingPongDirection","right");el.data("getNextElementWidth",true);el.data("swapAt",null);el.data("startAtElementHasNotPassed",true);el.data("swappedElement",null);el.data("originalElements",el.data("scrollableArea").children(o.countOnlyClass));el.data("visible",true);el.data("initialAjaxContentLoaded",false);el.data("enabled",true);el.data("scrollWrapper").scrollLeft(el.data("startingPosition"));if(o.autoScroll!=="always"){switch(o.visibleHotSpots){case"always":self.showHotSpotBackgrounds();break;case"onstart":self.showHotSpotBackgrounds();el.data("hideHotSpotBackgroundsInterval",setTimeout(function(){self.hideHotSpotBackgrounds("slow")},(o.hotSpotsVisibleTime*1000)));break;default:break}}el.data("scrollingHotSpotRight").bind("mousemove",function(e){var x=e.pageX-(this.offsetLeft+el.data("motherElementOffset"));el.data("scrollXPos",Math.round((x/el.data("hotSpotWidth"))*o.scrollStep));if(el.data("scrollXPos")===Infinity){el.data("scrollXPos",0)}});el.data("scrollingHotSpotRight").bind("mouseover",function(){if((o.autoScroll==="onstart"&&el.data("autoScrollInterval")!==null)){clearInterval(el.data("autoScrollInterval"));el.data("autoScrollInterval",null);self._trigger("autoScrollIntervalStopped")}el.data("rightScrollInterval",setInterval(function(){if(el.data("scrollXPos")>0&&el.data("enabled")){el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+(el.data("scrollXPos")*el.data("speedBooster")));self._showHideHotSpots()}},o.scrollInterval));self._trigger("mouseOverRightHotSpot")});el.data("scrollingHotSpotRight").bind("mouseout",function(){clearInterval(el.data("rightScrollInterval"));el.data("scrollXPos",0)});el.data("scrollingHotSpotRight").bind("mousedown",function(){el.data("speedBooster",o.mouseDownSpeedBooster)});$("body").bind("mouseup",function(){el.data("speedBooster",1)});el.data("scrollingHotSpotLeft").bind("mousemove",function(e){var x=el.data("scrollingHotSpotLeft").innerWidth()-(e.pageX-el.data("motherElementOffset"));el.data("scrollXPos",Math.round((x/el.data("hotSpotWidth"))*o.scrollStep));if(el.data("scrollXPos")===Infinity){el.data("scrollXPos",0)}});el.data("scrollingHotSpotLeft").bind("mouseover",function(){if((o.autoScroll==="onstart"&&el.data("autoScrollInterval")!==null)){clearInterval(el.data("autoScrollInterval"));el.data("autoScrollInterval",null);self._trigger("autoScrollIntervalStopped")}el.data("leftScrollInterval",setInterval(function(){if(el.data("scrollXPos")>0&&el.data("enabled")){el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-(el.data("scrollXPos")*el.data("speedBooster")));self._showHideHotSpots()}},o.scrollInterval));self._trigger("mouseOverLeftHotSpot")});el.data("scrollingHotSpotLeft").bind("mouseout",function(){clearInterval(el.data("leftScrollInterval"));el.data("scrollXPos",0)});el.data("scrollingHotSpotLeft").bind("mousedown",function(){el.data("speedBooster",o.mouseDownSpeedBooster)});$(window).bind("resize",function(){if(!(o.hiddenOnStart)){self._showHideHotSpots()}self._trigger("windowResized")});if(o.ajaxContentURL.length>0){self.replaceContent(o.ajaxContentURL)}else{self.recalculateScrollableArea()}if(o.hiddenOnStart){self.hide()}if((o.autoScroll.length>0)&&!(o.hiddenOnStart)&&(o.ajaxContentURL.length<=0)){self.startAutoScroll()}},showHotSpotBackgrounds:function(fadeSpeed){var self=this,el=this.element;if(fadeSpeed!==undefined){el.data("scrollingHotSpotLeft").css("opacity","0.0");el.data("scrollingHotSpotRight").css("opacity","0.0");el.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible");el.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible");el.data("scrollingHotSpotLeft").fadeTo(fadeSpeed,0.35);el.data("scrollingHotSpotRight").fadeTo(fadeSpeed,0.35)}else{el.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible");el.data("scrollingHotSpotLeft").removeAttr("style");el.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible");el.data("scrollingHotSpotRight").removeAttr("style")}self._showHideHotSpots()},hideHotSpotBackgrounds:function(fadeSpeed){var el=this.element;if(fadeSpeed!==undefined){el.data("scrollingHotSpotLeft").fadeTo(fadeSpeed,0.0,function(){el.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible")});el.data("scrollingHotSpotRight").fadeTo(fadeSpeed,0.0,function(){el.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible")})}else{el.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible");el.data("scrollingHotSpotLeft").removeAttr("style");el.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible");el.data("scrollingHotSpotRight").removeAttr("style")}},_showHideHotSpots:function(){var self=this,el=this.element,o=this.options;if(o.autoScroll!=="always"){if(el.data("scrollableAreaWidth")<=(el.data("scrollWrapper").innerWidth())){el.data("scrollingHotSpotLeft").hide();el.data("scrollingHotSpotRight").hide()}else if(el.data("scrollWrapper").scrollLeft()===0){el.data("scrollingHotSpotLeft").hide();el.data("scrollingHotSpotRight").show();self._trigger("scrollLeftLimitReached");clearInterval(el.data("leftScrollInterval"));el.data("leftScrollInterval",null)}else if(el.data("scrollableAreaWidth")<=(el.data("scrollWrapper").innerWidth()+el.data("scrollWrapper").scrollLeft())){el.data("scrollingHotSpotLeft").show();el.data("scrollingHotSpotRight").hide();self._trigger("scrollRightLimitReached");clearInterval(el.data("rightScrollInterval"));el.data("rightScrollInterval",null)}else{el.data("scrollingHotSpotLeft").show();el.data("scrollingHotSpotRight").show()}}else{el.data("scrollingHotSpotLeft").hide();el.data("scrollingHotSpotRight").hide()}},moveToElement:function(moveTo,elementNumber){var self=this,el=this.element,o=this.options,tempScrollableAreaWidth=0,foundStartAtElement=false;switch(moveTo){case"first":el.data("scrollXPos",0);self._trigger("movedToFirstElement");break;case"start":el.data("scrollableArea").children(o.countOnlyClass).each(function(){if((o.startAtElementId.length>0)&&(($(this).attr("id"))===o.startAtElementId)){el.data("startingPosition",tempScrollableAreaWidth);foundStartAtElement=true}tempScrollableAreaWidth=tempScrollableAreaWidth+$(this).outerWidth(true)});el.data("scrollXPos",el.data("startingPosition"));self._trigger("movedToStartElement");break;case"last":el.data("scrollXPos",el.data("scrollableAreaWidth"));self._trigger("movedToLastElement");break;case"number":if(!(isNaN(elementNumber))){el.data("scrollableArea").children(o.countOnlyClass).each(function(index){if(index===(elementNumber-1)){el.data("scrollXPos",tempScrollableAreaWidth)}tempScrollableAreaWidth=tempScrollableAreaWidth+$(this).outerWidth(true)})}self._trigger("movedToElementNumber",null,{"elementNumber":elementNumber});break;default:break}el.data("scrollWrapper").scrollLeft(el.data("scrollXPos"));self._showHideHotSpots()},addContent:function(ajaxContentURL,addWhere){var self=this,el=this.element;$.get(ajaxContentURL,function(data){if(addWhere==="first"){el.data("scrollableArea").children(":first").before(data)}else{el.data("scrollableArea").children(":last").after(data)}self.recalculateScrollableArea();self._showHideHotSpots()})},replaceContent:function(ajaxContentURL){var self=this,el=this.element;el.data("scrollableArea").load(ajaxContentURL,function(){self.recalculateScrollableArea();self.moveToElement("first");self._showHideHotSpots();el.data("startingPosition",0)})},recalculateScrollableArea:function(){var tempScrollableAreaWidth=0,foundStartAtElement=false,o=this.options,el=this.element,self=this;el.data("scrollableArea").children(o.countOnlyClass).each(function(){if((o.startAtElementId.length>0)&&(($(this).attr("id"))===o.startAtElementId)){el.data("startingPosition",tempScrollableAreaWidth);foundStartAtElement=true}tempScrollableAreaWidth=tempScrollableAreaWidth+$(this).outerWidth(true)});if(!(foundStartAtElement)){el.data("startAtElementId","")}el.data("scrollableAreaWidth",tempScrollableAreaWidth);el.data("scrollableArea").width(el.data("scrollableAreaWidth"));if(!(el.data("initialAjaxContentLoaded"))){if((o.autoScroll.length>0)&&!(o.hiddenOnStart)&&(o.ajaxContentURL.length>0)){self.startAutoScroll();el.data("initialAjaxContentLoaded",true)}}},stopAutoScroll:function(){var self=this,el=this.element;clearInterval(el.data("autoScrollInterval"));el.data("autoScrollInterval",null);self._showHideHotSpots();self._trigger("autoScrollStopped")},startAutoScroll:function(){var self=this,el=this.element,o=this.options;self._showHideHotSpots();clearInterval(el.data("autoScrollInterval"));el.data("autoScrollInterval",null);self._trigger("autoScrollStarted");el.data("autoScrollInterval",setInterval(function(){if(!(el.data("visible"))||(el.data("scrollableAreaWidth")<=(el.data("scrollWrapper").innerWidth()))){clearInterval(el.data("autoScrollInterval"));el.data("autoScrollInterval",null)}else{el.data("previousScrollLeft",el.data("scrollWrapper").scrollLeft());switch(o.autoScrollDirection){case"right":el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+o.autoScrollStep);if(el.data("previousScrollLeft")===el.data("scrollWrapper").scrollLeft()){self._trigger("autoScrollRightLimitReached");clearInterval(el.data("autoScrollInterval"));el.data("autoScrollInterval",null);self._trigger("autoScrollIntervalStopped")}break;case"left":el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-o.autoScrollStep);if(el.data("previousScrollLeft")===el.data("scrollWrapper").scrollLeft()){self._trigger("autoScrollLeftLimitReached");clearInterval(el.data("autoScrollInterval"));el.data("autoScrollInterval",null);self._trigger("autoScrollIntervalStopped")}break;case"backandforth":if(el.data("pingPongDirection")==="right"){el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+(o.autoScrollStep))}else{el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-(o.autoScrollStep))}if(el.data("previousScrollLeft")===el.data("scrollWrapper").scrollLeft()){if(el.data("pingPongDirection")==="right"){el.data("pingPongDirection","left");self._trigger("autoScrollRightLimitReached")}else{el.data("pingPongDirection","right");self._trigger("autoScrollLeftLimitReached")}}break;case"endlessloopright":if(el.data("getNextElementWidth")){if((o.startAtElementId.length>0)&&(el.data("startAtElementHasNotPassed"))){el.data("swapAt",$("#"+o.startAtElementId).outerWidth(true));el.data("startAtElementHasNotPassed",false)}else{el.data("swapAt",el.data("scrollableArea").children(":first").outerWidth(true))}el.data("getNextElementWidth",false)}el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+o.autoScrollStep);if(el.data("swapAt")<=el.data("scrollWrapper").scrollLeft()){el.data("swappedElement",el.data("scrollableArea").children(":first").detach());el.data("scrollableArea").append(el.data("swappedElement"));el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-el.data("swappedElement").outerWidth(true));el.data("getNextElementWidth",true)}break;case"endlessloopleft":if(el.data("getNextElementWidth")){if((o.startAtElementId.length>0)&&(el.data("startAtElementHasNotPassed"))){el.data("swapAt",$("#"+o.startAtElementId).outerWidth(true));el.data("startAtElementHasNotPassed",false)}else{el.data("swapAt",el.data("scrollableArea").children(":first").outerWidth(true))}el.data("getNextElementWidth",false)}el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-o.autoScrollStep);if(el.data("scrollWrapper").scrollLeft()===0){el.data("swappedElement",el.data("scrollableArea").children(":last").detach());el.data("scrollableArea").prepend(el.data("swappedElement"));el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+el.data("swappedElement").outerWidth(true));el.data("getNextElementWidth",true)}break;default:break}}},o.autoScrollInterval))},restoreOriginalElements:function(){var self=this,el=this.element;el.data("scrollableArea").html(el.data("originalElements"));self.recalculateScrollableArea();self.moveToElement("first")},show:function(){var el=this.element;el.data("visible",true);el.show()},hide:function(){var el=this.element;el.data("visible",false);el.hide()},enable:function(){var el=this.element;el.data("enabled",true)},disable:function(){var el=this.element;clearInterval(el.data("autoScrollInterval"));clearInterval(el.data("rightScrollInterval"));clearInterval(el.data("leftScrollInterval"));clearInterval(el.data("hideHotSpotBackgroundsInterval"));el.data("enabled",false)},destroy:function(){var el=this.element;clearInterval(el.data("autoScrollInterval"));clearInterval(el.data("rightScrollInterval"));clearInterval(el.data("leftScrollInterval"));clearInterval(el.data("hideHotSpotBackgroundsInterval"));el.data("scrollingHotSpotRight").unbind("mouseover");el.data("scrollingHotSpotRight").unbind("mouseout");el.data("scrollingHotSpotRight").unbind("mousedown");el.data("scrollingHotSpotLeft").unbind("mouseover");el.data("scrollingHotSpotLeft").unbind("mouseout");el.data("scrollingHotSpotLeft").unbind("mousedown");el.data("scrollableArea").html(el.data("originalElements"));el.data("scrollableArea").removeAttr("style");el.data("scrollingHotSpotRight").removeAttr("style");el.data("scrollingHotSpotLeft").removeAttr("style");el.data("scrollWrapper").scrollLeft(0);el.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible");el.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible");el.data("scrollingHotSpotRight").hide();el.data("scrollingHotSpotLeft").hide();$.Widget.prototype.destroy.apply(this,arguments)}})})(jQuery);;var timeout=700;var closetimer=0;var ddmenuitem=0;function jsddm_open()
{jsddm_canceltimer();jsddm_close();ddmenuitem=$(this).find('ul').css('visibility','visible');}
function jsddm_close()
{if(ddmenuitem)ddmenuitem.css('visibility','hidden');}
function jsddm_timer()
{closetimer=window.setTimeout(jsddm_close,timeout);}
function jsddm_canceltimer()
{if(closetimer)
{window.clearTimeout(closetimer);closetimer=null;}}
$(document).ready(function()
{$('#jsddm > li').bind('mouseover',jsddm_open)
$('#jsddm > li').bind('mouseout',jsddm_timer)});document.onclick=jsddm_close;;(function($){$.Autocompleter=function($elem,options){this.cacheData_={};this.cacheLength_=0;this.selectClass_='jquery-autocomplete-selected-item';this.keyTimeout_=null;this.lastKeyPressed_=null;this.lastProcessedValue_=null;this.lastSelectedValue_=null;this.active_=false;this.finishOnBlur_=true;if(!$elem||!($elem instanceof jQuery)||$elem.length!==1||$elem.get(0).tagName.toUpperCase()!=='INPUT'){alert('Invalid parameter for jquery.Autocompleter, jQuery object with one element with INPUT tag expected');return;}
if(typeof options==='string'){this.options={url:options};}else{this.options=options;}
this.options.maxCacheLength=parseInt(this.options.maxCacheLength);if(isNaN(this.options.maxCacheLength)||this.options.maxCacheLength<1){this.options.maxCacheLength=1;}
this.options.minChars=parseInt(this.options.minChars);if(isNaN(this.options.minChars)||this.options.minChars<1){this.options.minChars=1;}
this.dom={};this.dom.$elem=$elem;if(this.options.inputClass){this.dom.$elem.addClass(this.options.inputClass);}
this.dom.$results=$('<div></div>').hide();if(this.options.resultsClass){this.dom.$results.addClass(this.options.resultsClass);}
this.dom.$results.css({position:'absolute'});$('body').append(this.dom.$results);var self=this;$elem.keydown(function(e){self.lastKeyPressed_=e.keyCode;switch(self.lastKeyPressed_){case 38:e.preventDefault();if(self.active_){self.focusPrev();}else{self.activate();}
return false;break;case 40:e.preventDefault();if(self.active_){self.focusNext();}else{self.activate();}
return false;break;case 9:case 13:if(self.active_){e.preventDefault();self.selectCurrent();return false;}
break;case 27:if(self.active_){e.preventDefault();self.finish();return false;}
break;default:self.activate();}});$elem.blur(function(){if(self.finishOnBlur_){setTimeout(function(){self.finish();},200);}});};$.Autocompleter.prototype.position=function(){var offset=this.dom.$elem.offset();this.dom.$results.css({top:offset.top+this.dom.$elem.outerHeight(),left:offset.left});};$.Autocompleter.prototype.cacheRead=function(filter){var filterLength,searchLength,search,maxPos,pos;if(this.options.useCache){filter=String(filter);filterLength=filter.length;if(this.options.matchSubset){searchLength=1;}else{searchLength=filterLength;}
while(searchLength<=filterLength){if(this.options.matchInside){maxPos=filterLength-searchLength;}else{maxPos=0;}
pos=0;while(pos<=maxPos){search=filter.substr(0,searchLength);if(this.cacheData_[search]!==undefined){return this.cacheData_[search];}
pos++;}
searchLength++;}}
return false;};$.Autocompleter.prototype.cacheWrite=function(filter,data){if(this.options.useCache){if(this.cacheLength_>=this.options.maxCacheLength){this.cacheFlush();}
filter=String(filter);if(this.cacheData_[filter]!==undefined){this.cacheLength_++;}
return this.cacheData_[filter]=data;}
return false;};$.Autocompleter.prototype.cacheFlush=function(){this.cacheData_={};this.cacheLength_=0;};$.Autocompleter.prototype.callHook=function(hook,data){var f=this.options[hook];if(f&&$.isFunction(f)){return f(data,this);}
return false;};$.Autocompleter.prototype.activate=function(){var self=this;var activateNow=function(){self.activateNow();};var delay=parseInt(this.options.delay);if(isNaN(delay)||delay<=0){delay=250;}
if(this.keyTimeout_){clearTimeout(this.keyTimeout_);}
this.keyTimeout_=setTimeout(activateNow,delay);};$.Autocompleter.prototype.activateNow=function(){var value=this.dom.$elem.val();if(value!==this.lastProcessedValue_&&value!==this.lastSelectedValue_){if(value.length>=this.options.minChars){this.active_=true;this.lastProcessedValue_=value;this.fetchData(value);}}};$.Autocompleter.prototype.fetchData=function(value){if(this.options.data){this.filterAndShowResults(this.options.data,value);}else{var self=this;this.fetchRemoteData(value,function(remoteData){self.filterAndShowResults(remoteData,value);});}};$.Autocompleter.prototype.fetchRemoteData=function(filter,callback){var data=this.cacheRead(filter);if(data){callback(data);}else{var self=this;this.dom.$elem.addClass(this.options.loadingClass);var ajaxCallback=function(data){var parsed=false;if(data!==false){parsed=self.parseRemoteData(data);self.cacheWrite(filter,parsed);}
self.dom.$elem.removeClass(self.options.loadingClass);callback(parsed);};$.ajax({url:this.makeUrl(filter),success:ajaxCallback,error:function(){ajaxCallback(false);}});}};$.Autocompleter.prototype.setExtraParam=function(name,value){var index=$.trim(String(name));if(index){if(!this.options.extraParams){this.options.extraParams={};}
if(this.options.extraParams[index]!==value){this.options.extraParams[index]=value;this.cacheFlush();}}};$.Autocompleter.prototype.makeUrl=function(param){var self=this;var paramName=this.options.paramName||'q';var url=this.options.url;var params=$.extend({},this.options.extraParams);if(this.options.paramName===false){url+=encodeURIComponent(param);}else{params[paramName]=param;}
var urlAppend=[];$.each(params,function(index,value){urlAppend.push(self.makeUrlParam(index,value));});if(urlAppend.length){url+=url.indexOf('?')==-1?'?':'&';url+=urlAppend.join('&');}
return url;};$.Autocompleter.prototype.makeUrlParam=function(name,value){return String(name)+'='+encodeURIComponent(value);}
$.Autocompleter.prototype.parseRemoteData=function(remoteData){var results=[];var text=String(remoteData).replace('\r\n','\n');var i,j,data,line,lines=text.split('\n');var value;for(i=0;i<lines.length;i++){line=lines[i].split('|');data=[];for(j=0;j<line.length;j++){data.push(unescape(line[j]));}
value=data.shift();results.push({value:unescape(value),data:data});}
return results;};$.Autocompleter.prototype.filterAndShowResults=function(results,filter){this.showResults(this.filterResults(results,filter),filter);};$.Autocompleter.prototype.filterResults=function(results,filter){var filtered=[];var value,data,i,result,type;var regex,pattern,attributes='';for(i=0;i<results.length;i++){result=results[i];type=typeof result;if(type==='string'){value=result;data={};}else if($.isArray(result)){value=result.shift();data=result;}else if(type==='object'){value=result.value;data=result.data;}
value=String(value);if(value){if(typeof data!=='object'){data={};}
pattern=String(filter);if(!this.options.matchInside){pattern='^'+pattern;}
if(!this.options.matchCase){attributes='i';}
regex=new RegExp(pattern,attributes);if(regex.test(value)){filtered.push({value:value,data:data});}}}
if(this.options.sortResults){return this.sortResults(filtered);}
return filtered;};$.Autocompleter.prototype.sortResults=function(results){var self=this;if($.isFunction(this.options.sortFunction)){results.sort(this.options.sortFunction);}else{results.sort(function(a,b){return self.sortValueAlpha(a,b);});}
return results;};$.Autocompleter.prototype.sortValueAlpha=function(a,b){a=String(a.value);b=String(b.value);if(!this.options.matchCase){a=a.toLowerCase();b=b.toLowerCase();}
if(a>b){return 1;}
if(a<b){return-1;}
return 0;};$.Autocompleter.prototype.showResults=function(results,filter){var self=this;var $ul=$('<ul></ul>');var i,result,$li,extraWidth,first=false,$first=false;var numResults=results.length;for(i=0;i<numResults;i++){result=results[i];$li=$('<li>'+this.showResult(result.value,result.data)+'</li>');$li.data('value',result.value);$li.data('data',result.data);$li.click(function(){var $this=$(this);self.selectItem($this);}).mousedown(function(){self.finishOnBlur_=false;}).mouseup(function(){self.finishOnBlur_=true;});$ul.append($li);if(first===false){first=String(result.value);$first=$li;$li.addClass(this.options.firstItemClass);}
if(i==numResults-1){$li.addClass(this.options.lastItemClass);}}
this.position();this.dom.$results.html($ul).show();extraWidth=this.dom.$results.outerWidth()-this.dom.$results.width();this.dom.$results.width(this.dom.$elem.outerWidth()-extraWidth);$('li',this.dom.$results).hover(function(){self.focusItem(this);},function(){});if(this.autoFill(first,filter)){this.focusItem($first);}};$.Autocompleter.prototype.showResult=function(value,data){if($.isFunction(this.options.showResult)){return this.options.showResult(value,data);}else{return value;}};$.Autocompleter.prototype.autoFill=function(value,filter){var lcValue,lcFilter,valueLength,filterLength;if(this.options.autoFill&&this.lastKeyPressed_!=8){lcValue=String(value).toLowerCase();lcFilter=String(filter).toLowerCase();valueLength=value.length;filterLength=filter.length;if(lcValue.substr(0,filterLength)===lcFilter){this.dom.$elem.val(value);this.selectRange(filterLength,valueLength);return true;}}
return false;};$.Autocompleter.prototype.focusNext=function(){this.focusMove(+1);};$.Autocompleter.prototype.focusPrev=function(){this.focusMove(-1);};$.Autocompleter.prototype.focusMove=function(modifier){var i,$items=$('li',this.dom.$results);modifier=parseInt(modifier);for(var i=0;i<$items.length;i++){if($($items[i]).hasClass(this.selectClass_)){this.focusItem(i+modifier);return;}}
this.focusItem(0);};$.Autocompleter.prototype.focusItem=function(item){var $item,$items=$('li',this.dom.$results);if($items.length){$items.removeClass(this.selectClass_).removeClass(this.options.selectClass);if(typeof item==='number'){item=parseInt(item);if(item<0){item=0;}else if(item>=$items.length){item=$items.length-1;}
$item=$($items[item]);}else{$item=$(item);}
if($item){$item.addClass(this.selectClass_).addClass(this.options.selectClass);}}};$.Autocompleter.prototype.selectCurrent=function(){var $item=$('li.'+this.selectClass_,this.dom.$results);if($item.length==1){this.selectItem($item);}else{this.finish();}};$.Autocompleter.prototype.selectItem=function($li){var value=$li.data('value');var data=$li.data('data');var displayValue=this.displayValue(value,data);this.lastProcessedValue_=displayValue;this.lastSelectedValue_=displayValue;this.dom.$elem.val(displayValue).focus();this.setCaret(displayValue.length);this.callHook('onItemSelect',{value:value,data:data});this.finish();};$.Autocompleter.prototype.displayValue=function(value,data){if($.isFunction(this.options.displayValue)){return this.options.displayValue(value,data);}else{return value;}};$.Autocompleter.prototype.finish=function(){if(this.keyTimeout_){clearTimeout(this.keyTimeout_);}
if(this.dom.$elem.val()!==this.lastSelectedValue_){if(this.options.mustMatch){this.dom.$elem.val('');}
this.callHook('onNoMatch');}
this.dom.$results.hide();this.lastKeyPressed_=null;this.lastProcessedValue_=null;if(this.active_){this.callHook('onFinish');}
this.active_=false;};$.Autocompleter.prototype.selectRange=function(start,end){var input=this.dom.$elem.get(0);if(input.setSelectionRange){input.focus();input.setSelectionRange(start,end);}else if(this.createTextRange){var range=this.createTextRange();range.collapse(true);range.moveEnd('character',end);range.moveStart('character',start);range.select();}};$.Autocompleter.prototype.setCaret=function(pos){this.selectRange(pos,pos);};$.fn.autocomplete=function(options){if(typeof options==='string'){options={url:options};}
var o=$.extend({},$.fn.autocomplete.defaults,options);return this.each(function(){var $this=$(this);var ac=new $.Autocompleter($this,o);$this.data('autocompleter',ac);});};$.fn.autocomplete.defaults={paramName:'q',minChars:1,loadingClass:'acLoading',resultsClass:'acResults',inputClass:'acInput',selectClass:'acSelect',mustMatch:false,matchCase:false,matchInside:true,matchSubset:true,useCache:true,maxCacheLength:10,autoFill:false,sortResults:true,sortFunction:false,onItemSelect:false,onNoMatch:false};})(jQuery);;$(document).ready(function(){$("div#makeMeScrollable").smoothDivScroll({autoScroll:"onstart",autoScrollDirection:"backandforth",autoScrollStep:1,autoScrollInterval:15,startAtElementId:"startAtMe",visibleHotSpots:"always"});$("#comment_list").pagination();$("#search_top").click(function(){if($("#search_top").val()=="Пошук у Львові"){$("#search_top").val("");}});$(".logo").click(function(){window.location.href="/";});addGoogleTracking();apsdoc=document;wd='0';r='';c=0;apsimg='<img src=http://apserver.org.ua/counter/?id=411&t=65';apsdoc.cookie="a=1";if(apsdoc.cookie)c='1';s=screen;w=s.width;$('#counters_bottom').after(apsimg+"&c="+c+"&wd="+wd+"&r="+escape(apsdoc.referrer.slice(7))+" width=88 height=31 hspace=0 vspace=0 border=0 alt='APServer' class='left top'>");var loader=document.getElementById("adsense_loader");if(loader){document.getElementById("adsense").appendChild(loader);}
$(".company_item > img.right").fadeTo(0,'0.33');$(".company_item").mouseover(function(){$("img.right",this).fadeTo(0,'1');$("img.right",this).css('position','absolute');$("img.right",this).css('right','0px');$("img.right",this).css('z-index','1000');$(this).css('overflow','visible');});$(".company_item").mouseout(function(){$("img.right",this).fadeTo(0,'0.33');$("img.right",this).css('position','');$("img.right",this).css('right','');$("img.right",this).css('z-index','');$(this).css('overflow','hidden');});$('#search_top').autocomplete('/index.php?mod=autosuggest',{minChars:3});});var _googleInterval;function addGoogleTracking()
{var sc=document.createElement('script');sc.type='text/javascript';sc.src='http://www.google-analytics.com/ga.js';document.getElementsByTagName("head").item(0).appendChild(sc);_googleInterval=setInterval(activateGoogle,250);}
function activateGoogle()
{if(typeof _gat!='undefined')
{clearInterval(_googleInterval);var pageTracker=_gat._getTracker("UA-276910-10");pageTracker._initData();pageTracker._trackPageview();}}
