"+item.name+"
"+settings.hintText+"
");show_dropdown();}}function highlight_term(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term+")(?![^<>]*>)(?![^&;]+;)","gi"),"$1");}function populate_dropdown(query,results){if(results&&results.length){dropdown.empty();var dropdown_ul=$(""+settings.noResultsText+"
");show_dropdown();}}}function select_dropdown_item(item){if(item){if(selected_dropdown_item){deselect_dropdown_item($(selected_dropdown_item));}item.addClass(settings.classes.selectedDropdownItem);selected_dropdown_item=item.get(0);}}function deselect_dropdown_item(item){item.removeClass(settings.classes.selectedDropdownItem);selected_dropdown_item=null;}function do_search(){var query=input_box.val().toLowerCase();if(query&&query.length){if(selected_token){deselect_token($(selected_token),POSITION.AFTER);}if(query.length>=settings.minChars){show_dropdown_searching();clearTimeout(timeout);timeout=setTimeout(function(){run_search(query);},settings.searchDelay);}else{hide_dropdown();}}}function run_search(query){var cached_results=cache.get(query);if(cached_results){populate_dropdown(query,cached_results);}else{if(settings.url){var ajax_params={};ajax_params.data={};if(settings.url.indexOf("?")>-1){var parts=settings.url.split("?");ajax_params.url=parts[0];var param_array=parts[1].split("&");$.each(param_array,function(index,value){var kv=value.split("=");ajax_params.data[kv[0]]=kv[1];});}else{ajax_params.url=settings.url;}ajax_params.data[settings.queryParam]=query;ajax_params.type=settings.method;ajax_params.dataType=settings.contentType;if(settings.crossDomain){ajax_params.dataType="jsonp";}ajax_params.success=function(results){if($.isFunction(settings.onResult)){results=settings.onResult.call(hidden_input,results);}cache.add(query,settings.jsonContainer?results[settings.jsonContainer]:results);if(input_box.val().toLowerCase()===query){populate_dropdown(query,settings.jsonContainer?results[settings.jsonContainer]:results);}};$.ajax(ajax_params);}else{if(settings.local_data){var results=$.grep(settings.local_data,function(row){return row.name.toLowerCase().indexOf(query.toLowerCase())>-1;});if($.isFunction(settings.onResult)){results=settings.onResult.call(hidden_input,results);}cache.add(query,results);populate_dropdown(query,results);}}}}};$.TokenList.Cache=function(options){var settings=$.extend({max_size:500},options);var data={};var size=0;var flush=function(){data={};size=0;};this.add=function(query,results){if(size>settings.max_size){flush();}if(!data[query]){size+=1;}data[query]=results;};this.get=function(query){return data[query];};};}(jQuery)); ;(function(a){a.fn.vTicker=function(b){var c={speed:700,pause:4000,showItems:3,animation:"",mousePause:true,isPaused:false,direction:"up",height:0};var b=a.extend(c,b);moveUp=function(g,d,e){if(e.isPaused){return}var f=g.children("ul");var h=f.children("li:first").clone(true);if(e.height>0){d=f.children("li:first").height()}f.animate({top:"-="+d+"px"},e.speed,function(){a(this).children("li:first").remove();a(this).css("top","0px")});if(e.animation=="fade"){f.children("li:first").fadeOut(e.speed);if(e.height==0){f.children("li:eq("+e.showItems+")").hide().fadeIn(e.speed)}}h.appendTo(f)};moveDown=function(g,d,e){if(e.isPaused){return}var f=g.children("ul");var h=f.children("li:last").clone(true);if(e.height>0){d=f.children("li:first").height()}f.css("top","-"+d+"px").prepend(h);f.animate({top:0},e.speed,function(){a(this).children("li:last").remove()});if(e.animation=="fade"){if(e.height==0){f.children("li:eq("+e.showItems+")").fadeOut(e.speed)}f.children("li:first").hide().fadeIn(e.speed)}};return this.each(function(){var f=a(this);var e=0;f.css({overflow:"hidden",position:"relative"}).children("ul").css({position:"absolute",margin:0,padding:0}).children("li").css({margin:0,padding:0});if(b.height==0){f.children("ul").children("li").each(function(){if(a(this).height()>e){e=a(this).height()}});f.children("ul").children("li").each(function(){a(this).height(e)});f.height(e*b.showItems)}else{f.height(b.height)}var d=setInterval(function(){if(b.direction=="up"){moveUp(f,e,b)}else{moveDown(f,e,b)}},b.pause);if(b.mousePause){f.bind("mouseenter",function(){b.isPaused=true}).bind("mouseleave",function(){b.isPaused=false})}})}})(jQuery); ;/* * jQuery Autocompleter */ function remove_accent(str) { var map={ 'Ύ':'Υ', 'Ά':'Α', 'Ί':'Ι', 'Ή':'Η', 'Ό':'Ο', 'Έ':'Ε', 'Ώ':'Ω', 'ύ':'υ', 'ά':'α', 'ί':'ι', 'ή':'η', 'ό':'ο', 'έ':'ε', 'ώ':'ω' }; var res=''; for (var i=0;i
').addClass("active")}),$("form").submit(function(){var thisForm=$(this);$(".lock",thisForm).attr("disabled","disabled")})},autocompleter:function(inputHtmlElement,collection,options){var defaultOptions={delay:this.CONFIG.AUTOCOMPLETER.DELAY,width:this.CONFIG.AUTOCOMPLETER.WIDTH,scroll:this.CONFIG.AUTOCOMPLETER.SCROLL,matchContains:this.CONFIG.AUTOCOMPLETER.MATCHCONTAINS,searchCodes:this.CONFIG.AUTOCOMPLETER.SEARCHCODES};this.mixOptions(defaultOptions,options),inputHtmlElement.autocomplete(collection,defaultOptions)},initCalendar:function(){$.datepicker.regional[this.CONFIG.LOCALE.LANG]={closeText:this.CONFIG.LOCALE.CLOSE_TEXT,prevText:this.CONFIG.LOCALE.PREV_TEXT,nextText:this.CONFIG.LOCALE.NEXT_TEXT,currentText:this.CONFIG.LOCALE.CURRENT_TEXT,monthNames:this.CONFIG.LOCALE.MONTHS,monthNamesShort:this.CONFIG.LOCALE.SHORT_MONTHS,dayNames:this.CONFIG.LOCALE.DAYS,dayNamesShort:this.CONFIG.LOCALE.SHORT_DAYS,dayNamesMin:this.CONFIG.LOCALE.MIN_DAYS,dateFormat:this.CONFIG.LOCALE.DATE_FORMAT,firstDay:this.CONFIG.LOCALE.FIRST_DAY_OF_WEEK,isRTL:!1};var defaults=$.extend({buttonImage:this.CONFIG.CALENDAR.BUTTON_IMAGE,buttonImageOnly:this.CONFIG.CALENDAR.BUTTON_IMAGE_ONLY,duration:this.CONFIG.CALENDAR.DURATION,maxDate:this.CONFIG.CALENDAR.MAX_DATE,minDate:this.CONFIG.CALENDAR.MIN_DATE,numberOfMonths:this.CONFIG.CALENDAR.NUMBER_OF_MONTHS,showOn:this.CONFIG.CALENDAR.SHOW_ON},$.datepicker.regional[this.CONFIG.LOCALE.LANG]);$.datepicker.setDefaults(defaults)},calendar:function(input,options){var defaultOptions={};defaultOptions.showButtonPanel=this.CONFIG.CALENDAR.SHOW_BUTTONS,this.mixOptions(defaultOptions,options),input.datepicker(defaultOptions)},changeMonthPositionAccordingToOutboundDate:function(obDateInput,ibDateInput){var outboundDate=obDateInput.datepicker("getDate"),inboundDate=ibDateInput.datepicker("getDate");inboundDate.getMonth()-outboundDate.getMonth()==1?monthPositionOfInbound=1:monthPositionOfInbound=0,ibDateInput.datepicker("option","showCurrentAtPos",monthPositionOfInbound)},maskCalendar:function(obDateInput,ibDateInput,options){var defaultOptions={showButtonPanel:this.CONFIG.CALENDAR.SHOW_BUTTONS,onSelect:function(){var outboundDate=obDateInput.datepicker("getDate"),inboundDate=ibDateInput.datepicker("getDate");outboundDate>inboundDate&&(outboundDate.setDate(outboundDate.getDate()+2),ibDateInput.datepicker("setDate",outboundDate)),TP24.changeMonthPositionAccordingToOutboundDate(obDateInput,ibDateInput)}};this.mixOptions(defaultOptions,options),obDateInput.datepicker(defaultOptions),defaultOptions={showButtonPanel:this.CONFIG.CALENDAR.SHOW_BUTTONS,beforeShowDay:function(date){return""+date==""+obDateInput.datepicker("getDate")?[!0,"ob-date"]:[!0,""]},onSelect:function(){var outboundDate=obDateInput.datepicker("getDate"),inboundDate=ibDateInput.datepicker("getDate");outboundDate>inboundDate&&(inboundDate.setDate(inboundDate.getDate()-2),obDateInput.datepicker("setDate",inboundDate)),TP24.changeMonthPositionAccordingToOutboundDate(obDateInput,ibDateInput)}},this.mixOptions(defaultOptions,options),ibDateInput.datepicker(defaultOptions),this.changeMonthPositionAccordingToOutboundDate(obDateInput,ibDateInput)},linkCalendar:function(obDateInput,ibDateInput){obDateInput.datepicker("option",{onSelect:function(){var outboundDate=obDateInput.datepicker("getDate"),inboundDate=ibDateInput.datepicker("getDate");outboundDate>inboundDate&&(outboundDate.setDate(outboundDate.getDate()+2),ibDateInput.datepicker("setDate",outboundDate))}}),ibDateInput.datepicker("option",{beforeShowDay:function(date){return""+date==""+
obDateInput.datepicker("getDate")?[!0,"ob-date"]:[!0,""]},onSelect:function(){var outboundDate=obDateInput.datepicker("getDate"),inboundDate=ibDateInput.datepicker("getDate");outboundDate>inboundDate&&(inboundDate.setDate(inboundDate.getDate()-2),obDateInput.datepicker("setDate",inboundDate))}})},tabs:function(){var tabs=$(this.CONFIG.TABS.SELECTOR).tabs(this.CONFIG.TABS.PANELS_SELECTOR);tabs.data("tabs")&&tabs.data("tabs").onBeforeClick(function(){$(".validation-error").hide()})},refreshModalDimensions:function(){var getDimension=function(limit,outer){return!outer||outer>limit?d.px(limit):"auto"},win=$(window),winHeight=win.height(),winWidth=win.width(),content=this.overlayWrapper.css({height:d.px(winHeight),width:d.px(winWidth)}).children().eq(0),limitH=winHeight-100,outerHeight=content.outerHeight(!0),limitW=winWidth-400,outerWidth=content.outerWidth(!0),height=getDimension(limitH,outerHeight),width=getDimension(limitW,outerWidth);this.overlayWrapper.css({height:height,width:width})},setModalDimensions:function(){this.overlayContent.css({"margin-left":d.mpx(0),"margin-top":d.mpx(0)}).show(),this.refreshModalDimensions(),this.overlayContent.css({display:"none","margin-left":d.mpx(this.overlayContent.outerWidth(!0)/2),"margin-top":d.mpx(this.overlayContent.outerHeight(!0)/2)}),setTimeout(TP24.proxy(function(){this.overlayContent.fadeIn("fast")},this),0)},emodal:function(){$(this.CONFIG.MODAL.EMODAL_SELECTOR).live("click",TP24.proxy(function(event){var runner=$(event.target).closest("[data-href], a"),target=runner.attr("href")||runner.data("href");this.overlay.show();if(!/(\.gif|\.png|\.jpg|\.jpeg)/.exec(target))target=target.replace("#"," #"),this.overlayWrapper.load(target,TP24.proxy(function(){if(arguments[1]==="error"){this.overlayHide();return}setTimeout(this.proxy(this.setModalDimensions,this),0)},this));else{var image=$('');image.load(TP24.proxy(function(){this.setModalDimensions()},this)),this.overlayWrapper.html(image)}return!1},this))},ifmodal:function(){$(this.CONFIG.MODAL.IFMODAL_SELECTOR).live("click",TP24.proxy(function(event){var runner=$(event.target).closest("[data-href], a"),target=runner.attr("href")||runner.data("href");this.isKept=!1,this.overlay.show(),target=target.replace("#"," #");var iframe=$('');return this.overlayWrapper.html(iframe),iframe.ready(this.proxy(function(){setTimeout(this.proxy(this.setModalDimensions,this),600)},this)),!1},this))},modal:function(){$(this.CONFIG.MODAL.SELECTOR).live("click",TP24.proxy(function(event){var runner=$(event.target).closest("[data-href], a");if(!!runner.length){var target=runner.attr("href")||runner.data("href");this.overlay.show(),this.overlayWrapper.html($(target)),this.setModalDimensions()}return!1},this))},xmodal:function(target){var element=$(target);!element.length||(this.overlay.show(),this.overlayWrapper.html(element.show()),this.setModalDimensions())},accordion:function(){var config={};config.tabs=this.CONFIG.ACCORDION.TABS_SELECTOR,config.effect=this.CONFIG.ACCORDION.EFFECT,config.initialIndex=this.CONFIG.ACCORDION.INDEX,$(this.CONFIG.ACCORDION.SELECTOR).tabs(this.CONFIG.ACCORDION.PANELS_SELECTOR,config)},radioAccordion:function(){$(this.CONFIG.RADIO_ACCORDION.SELECTOR).each(function(){var container=$(this),optionTag=container.data("option-tag");optionTag||(optionTag=TP24.CONFIG.RADIO_ACCORDION.DEFAULT_OPTION_TAG);var options=container.children(optionTag);options.not(container.find("[type=radio]").filter(":checked").parents(optionTag).addClass("active")).next().hide(),options.add(options.find("[type=radio]")).click(function(){var selected=$(this).closest(optionTag).addClass("active"),toBeHidden=options.not(selected).removeClass("active");toBeHidden.next().stop(!0,!0).hide(),selected.next().slideDown(300,"easeInCirc")})})},radioTabs:function(){$(this.CONFIG.RADIO_TABS.SELECTOR).each(function(){var container=$(this),optionTag=container.data("option-tag"),effect=container.data("effect");optionTag||(optionTag=TP24.CONFIG.RADIO_TABS.DEFAULT_OPTION_TAG),effect||(effect=TP24.CONFIG.RADIO_TABS.DEFAULT_EFFECT);var options=container.children(optionTag),notChecked=options.not(container.find("[type=radio]").filter(":checked").parents(optionTag).addClass("active"));notChecked.each(function(){$($(this).data(TP24.CONFIG.RADIO_TABS.DEFAULT_CONTENT_ATTR)).hide()}),options.add(options.find("[type=radio]")).click(function(){var selected=$(this).closest(optionTag).addClass("active");$(selected.data(TP24.CONFIG.RADIO_TABS.DEFAULT_CONTENT_ATTR)).show();var toBeHidden=options.not(selected).removeClass("active");toBeHidden.each(function(){$($(this).data(TP24.CONFIG.RADIO_TABS.DEFAULT_CONTENT_ATTR)).hide()})})})},tooltip:function(){this.isTooltipLoaded||($(this.CONFIG.TOOLTIP.SELECTOR).tooltip({effect:this.CONFIG.TOOLTIP.EFFECT}).dynamic(),this.isTooltipLoaded=!0)},toggle:function(){$(this.CONFIG.TOGGLE.HEADER_SELECTOR).each(function(){var _this=$(this),content=_this.nextAll(TP24.CONFIG.TOGGLE.CONTENT_SELECTOR).first();content.is(":visible")&&_this.addClass(TP24.CONFIG.TOGGLE.ACTIVE),_this.click(function(){return _this.toggleClass(TP24.CONFIG.TOGGLE.ACTIVE),content.slideToggle("fast"),!1})})},toggleIt:function(){$(this.CONFIG.TOGGLEIT.SELECTOR).live("click",function(){var _this=$(this),selector=_this.attr(TP24.CONFIG.TOGGLEIT.ATTR);return $(selector).slideToggle("fast").toggleClass("active"),_this.toggleClass("active"),!1})},checkboxToggle:function(){$(this.CONFIG.CHECKBOX_TOGGLE.TRIGGER_SELECTOR).each(function(){var _this=$(this),content=_this.parents().find(TP24.CONFIG.CHECKBOX_TOGGLE.CONTENT_SELECTOR).first();_this.change(function(){_this.toggleClass(TP24.CONFIG.CHECKBOX_TOGGLE.ACTIVE),content.slideToggle("fast")})})},hideable:function(){$(this.CONFIG.HIDEABLE.SELECTOR).live("click",function(){var _this=$(this),state=_this.attr(TP24.CONFIG.HIDEABLE.STATE_ATTR),selectors=_this.attr(TP24.CONFIG.HIDEABLE.ATTR);$(selectors).not(TP24.CONFIG.HIDEABLE.AVOID).slideToggle("fast"),_this.attr(TP24.CONFIG.HIDEABLE.DISABLED_TEXT_ATTR)||_this.attr(TP24.CONFIG.HIDEABLE.DISABLED_TEXT_ATTR,_this.html()),!state||state!==TP24.CONFIG.HIDEABLE.ENABLED_STATE?(_this.attr(TP24.CONFIG.HIDEABLE.STATE_ATTR,TP24.CONFIG.HIDEABLE.ENABLED_STATE),_this.html(_this.attr(TP24.CONFIG.HIDEABLE.ENABLED_TEXT_ATTR)),_this.toggleClass("active")):(_this.attr(TP24.CONFIG.HIDEABLE.STATE_ATTR,TP24.CONFIG.HIDEABLE.DISABLED_STATE),_this.html(_this.attr(TP24.CONFIG.HIDEABLE.DISABLED_TEXT_ATTR)),_this.toggleClass("active"));var id=_this.attr("id")||(new Date).getTime();return TP24.fire(TP24.CONFIG.HIDEABLE.EVENT+id,_this.attr(TP24.CONFIG.HIDEABLE.STATE_ATTR)),!1})},confirmable:function(){$(this.CONFIG.CONFIRMABLE.SELECTOR).live("click",TP24.proxy(function(event){return confirm($(event.target).data(this.CONFIG.CONFIRMABLE.DATA))},this))},slider:function(){var config={};config.effect=this.CONFIG.SLIDER.EFFECT,config.fadeInSpeed=1e3,config.fadeOutSpeed=this.CONFIG.SLIDER.SPEED,config.rotate=this.CONFIG.SLIDER.ROTATE,config.initialIndex=1;var sliders=$(this.CONFIG.SLIDER.SELECTOR);sliders.tabs(this.CONFIG.SLIDER.PANELS_SELECTOR,config).slideshow({autoplay:!0,autopause:!1})},range:function(){$.each($(this.CONFIG.RANGE.SELECTOR),function(){var _this=$(this),config={};config.range=!0,config.min=_this.attr("data-min"),config.max=_this.attr("data-max"),config.values=[parseInt(config.min,10),parseInt(config.max,10)];var slide=function(){TP24.fire(Template.evaluate({id:this.attr("id")},TP24.CONFIG.RANGE.EVENT))};config.slide=this.proxy(slide,_this),_this.slider(config)})},formValidation:function(){$.tools.validator.localize("tp24",TP24.CONFIG.LOCALE.FORM_VALIDATION)},overlayShow:function(){this.overlay.show(),this.overlayContent.show()},overlayHide:function(){this.overlay.hide(),this.overlayContent.hide(),this.isKept&&this.body.append(this.overlayWrapper.children().hide()),this.isKept=!0},numberFormat:function(a,b,c,d){a=Math.round(a*Math.pow(10,b))/Math.pow(10,b),e=a+"",f=e.split("."),f[0]||(f[0]="0"),f[1]||(f[1]="");if(f[1].length3){h=f[0],f[0]="";for(j=3;j