1String.prototype.formatBytes=function(b){if(b==undefined){b=2}var c=["B","KB","MB","GB","TB"],a=Math.max(this,0),d=Math.floor((a?Math.log(a):0)/Math.log(1024));d=Math.min(d,c.length-1);a/=Math.pow(1024,d);return Math.round(a,b)+" "+c[d]};String.prototype.translate=function(){if(typeof locale!="undefined"&&typeof locale[this]!="undefined"){return locale[this]}else{return this}};String.prototype.removeAccents=function(){return this.toLowerCase().replace(/[áà ãâä]/gi,"a").replace(/[Äç]/gi,"c").replace(/[Ä]/gi,"d").replace(/[éèê]/gi,"e").replace(/[Ãìïî]/gi,"i").replace(/[ľĺ]/gi,"l").replace(/[ñ]/gi,"n").replace(/[óòöôõ]/gi,"o").replace(/[Å]/gi,"r").replace(/[Å¡]/gi,"s").replace(/[Å¥]/gi,"t").replace(/[úùüûů]/gi,"u").replace(/[ž]/gi,"z").replace(/[^a-zA-Z0-9]/g," ")};var isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return(isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows())}};function __(a){return a.translate()}$.maxZIndex=function(b){if(b==undefined){b="body > div"}var a=Math.max.apply(null,$.map($(b),function(c,d){if($(c).css("position")=="absolute"){return parseInt($(c).css("z-index"))||1}}));return(a<1000)?a+1000:a};$.fn.tagsAutocomplete=function(a){return this.each(function(){var b=this;b.instance=$(b);b.settings=$.extend({tags:"ul.tags",tag:"li",input:"input.custom_tags",template:'<li class="check"><label><input type="checkbox" name="custom_tag[]" value="{id}" /><span>{name}</span></label></li>',onSelect:function(){return true}},a||{});b.request=null;b.tags=b.instance.find(b.settings.tags);b.input=b.instance.find(b.settings.input);b.search=function(){if(b.request!==null){b.request.abort()}var c=b.input.val();b.request=$.ajax({url:"/autocomplete/tags/",data:{query:c},dataType:"json",success:function(e){var d=b.popup.find("ul.items");d.find("li.item").remove();var f=true;if(e.items.length){while(e.items.length){var h=e.items.shift();if(h.type=="tag"){if(!b.tags.find(b.settings.tag+'[data-tag="'+h.id+'"]').length){if(h.name==c){f=false}var g=d.find("> li.template").clone();g.data("id",h.id);g.data("name",h.name);g.html(g.html().replace(/{id}/g,h.id));g.html(g.html().replace(/{name}/g,h.name));d.append(g.removeClass().addClass("item"))}}}}if(f){d.prepend('<li class="item" data-id="'+c+'" data-name="'+c+'">'+c+'<span class="btn btn-xs">'+__("PridaÅ¥")+"</span></li>")}b.popup.css({position:"absolute",zIndex:$.maxZIndex()+1,top:b.input.offset().top+(b.input.outerHeight()+15)+"px",left:b.input.offset().left+"px",width:b.input.outerWidth()+"px"}).show()}})};b.getInstance=function(){return b.instance};b.init=function(){if(b.input.length){b.popup=$('<div id="tagsAutocompletePopup"></div>').html('<ul class="items"><li class="template hidden">{name}<span class="btn btn-xs">'+__("VybraÅ¥")+"</span></li></ul>").hide().appendTo($("body"));b.input.on("keyup",function(){if(b.input.val()){b.search()}}).on("focus",function(){if(b.input.val()){b.search()}}).attr("autocomplete","off");b.popup.on("click",function(g){g.stopPropagation();var c=null;if($(g.target).hasClass("item")){c=$(g.target)}else{if($(g.target).hasClass("btn")){c=$(g.target).closest("li")}}if(c!==null){var h=new Date();var f=$(b.settings.template);f.html(f.html().replace(/{id}/g,c.data("id")));f.html(f.html().replace(/{name}/g,c.data("name")));f.html(f.html().replace(/{time}/g,h.getTime()));b.tags.append(f);f.attr("data-tag",c.data("id"));f.attr("data-category","custom");f.find("input").trigger("click");c.remove();b.popup.css({top:b.input.offset().top+(b.input.outerHeight()+15)+"px"});if(!b.popup.find("ul.items > li.item").length){b.popup.hide();b.input.val("")}if(typeof b.settings.onSelect=="function"){b.settings.onSelect.call(b,f)}}});$(window).on("click",function(c){if(!c.isPropagationStopped()){b.popup.hide();b.input.val("")}}).on("resize",function(c){if(!c.isPropagationStopped()){b.popup.hide();b.input.val("")}})}};if(!b.instance.data("initialized")){b.instance.data("initialized",1);b.init()}})};$.fn.ui_tooltip=function(a){a=$.extend({},{my:"right+5 bottom-10",at:"right top",collision:"flip flip"},a||{});return this.each(function(){var c=$(this);var b=$(".tooltip",c);if(b.length){b.tooltip({content:function(){return $(this).data("title")!=undefined?$(this).data("title"):$(this).prop("title")},position:a});b.on("tap",function(){b.tooltip("close");$(this).tooltip("open").tooltip("option",{position:a})})}var d=$(".delay-tooltip",c);if(d.length){d.tooltip({content:function(){return $(this).data("title")!=undefined?$(this).data("title"):$(this).prop("title")},position:a,show:{delay:500}});d.on("tap",function(){d.tooltip("close");$(this).tooltip("open").tooltip("option",{position:a})})}})};$.fn.ui_selectbox=function(a){a=$.extend({},{selector:".select",onshow:function(){}},a||{});return this.each(function(){var c=$(this);var b=$(a.selector,c);if(b.length){b.selectbox({onshow:a.onshow})}})};jQuery.initUI=function(c){if(c==undefined){c=jQuery("body")}var d=jQuery(".tooltip:visible",c);if(d.length){d.tooltip({content:function(){return $(this).prop("title").replace(/\|/g,"<br />")},position:{my:"center bottom",at:"center top"}}).click(function(){$(this).tooltip("close")})}var f=jQuery("select.selectbox:visible",c);if(f.length){f.selectbox()}var e=jQuery(":checkbox:visible",c);if(e.length){e.checkboxes()}var a=jQuery("ul.tree:visible",c);if(a.length){a.treeMenu()}var b=jQuery("div.tabber:visible",c);if(b.length){b.tabber()}};jQuery.fn.initUI=function(){return this.each(function(){jQuery.initUI($(this))})};jQuery.fn.inputHint=function(){this.each(function(){var a=jQuery(this);if(a.is("input[type=text]")){jQuery.inputHintShow(a);a.focus(function(){jQuery.inputHintHide(this)}).blur(function(){jQuery.inputHintShow(this)}).closest("form").submit(function(){jQuery.inputHintHide(a);return true})}});return this};jQuery.inputHintShow=function(a){a=jQuery(a);if(a.val()==a.attr("title")||a.val()==""){a.addClass("hint").val(a.attr("title"))}};jQuery.inputHintHide=function(a){a=jQuery(a);a.removeClass("hint");if(a.val()==a.attr("title")){a.val("")}};jQuery.fn.zebraTable=function(){this.each(function(){var a=jQuery(this);if(a.is("table")){jQuery("tbody tr:even",a).removeClass("even").addClass("odd");jQuery("tbody tr:odd",a).removeClass("odd").addClass("even")}});return this};jQuery.fn.highlightTable=function(){this.each(function(){var a=jQuery(this);if(a.is("table")){jQuery("tbody tr",a).unbind("mouseover.highlight").bind("mouseover.highlight",function(){jQuery(">td, >th",this).addClass("highlight")});jQuery("tbody tr",a).unbind("mouseout.highlight").bind("mouseout.highlight",function(){jQuery(">td, >th",this).removeClass("highlight")})}});return this};jQuery.fn.treeMenu=function(){return this.each(function(){var a=$(this);if(a.data("initialized")==1){return true}a.data("initialized",1);
1a.on("click","img.plusminus",function(){var e=$(this);if(e.hasClass("minus")){e.attr("src",e.attr("src").replace("minus","plus"));e.addClass("plus").removeClass("minus");$("> ul",e.closest("li")).hide()}else{e.attr("src",e.attr("src").replace("plus","minus"));e.addClass("minus").removeClass("plus");$("> ul",e.closest("li")).show()}});var c=$("li.active",a);if(c.length){c.parents("li").each(function(g,h){var e=$(h);$("> ul",e).show();var f=$("img.plusminus",e);f.attr("src",f.attr("src").replace("plus","minus"));f.addClass("minus").removeClass("plus")});var d=$("> ul",c);if(d.length){d.show();var b=$("img.plusminus",c);b.attr("src",b.attr("src").replace("plus","minus"));b.addClass("minus").removeClass("plus")}}})};jQuery.fn.centerObject=function(a){return this.each(function(){var b=jQuery(this);b.css({position:a?"fixed":"absolute",left:"50%",top:"50%",zIndex:jQuery.maxZIndex()+1}).css({marginLeft:"-"+(b.outerWidth()/2)+"px",marginTop:"-"+(b.outerHeight()/2)+"px"});if(!a){b.css({marginTop:parseInt(b.css("marginTop"),10)+jQuery(window).scrollTop(),marginLeft:parseInt(b.css("marginLeft"),10)+jQuery(window).scrollLeft()})}})};var tabIdCounter=0;jQuery.fn.tabber=function(a){a=jQuery.extend({active:0,collapsible:false,activate:function(b,c){},beforeActivate:function(b,c){}},a);return this.each(function(){var b=jQuery(this);if(b.data("initialized")==1){return true}b.data("initialized",1);var c=jQuery("<ul></ul>");var d=a.active;b.find("> .tabbertab").each(function(e,g){if(jQuery(g).is(".tabbertabdefault")){d=e}var f=jQuery(g).attr("id");if(!f){f="tabPanel_"+(++tabIdCounter);jQuery(g).attr("id",f)}c.append('<li><a href="#'+f+'"><span>'+jQuery(g).attr("title")+"</span></a></li>");jQuery(g).removeAttr("title")});b.prepend(c).tabs({active:d,collapsible:a.collapsible,activate:function(e,f){a.activate(e,f)},beforeActivate:function(e,f){a.beforeActivate(e,f)}})})};jQuery.fn.fastUpdate=function(a){a=jQuery.extend({url:null,loader:null,callback:function(b,c){return}},a);return this.each(function(){var b=jQuery(this);b.on("click",":checkbox, :radio",function(c){b.update();c.stopPropagation()}).on("change","input:text, input:hidden, select",function(c){b.update();c.stopPropagation()});b.update=function(){var c=[];c.id=b.data("id");jQuery("input, textarea, select",b).each(function(){var d=jQuery(this);if(d.is(":checkbox")||d.is(":radio")){if(d.prop("checked")){c[d.attr("name")]=d.val()}}else{c[d.attr("name")]=d.val()}});if(a.loader){if(b.is("tr")||b.is("td")||b.is("th")){b.closest("table").loading()}else{b.loading()}}jQuery.post(a.url,jQuery.extend({},c),function(d){if(d.status=="ERROR"){if(d.message.constructor===Array){for(var e in d.message){addReport(d.message[e],"ERROR")}}else{addReport(d.message,"ERROR")}}else{a.callback(d,b)}if(a.loader){if(b.is("tr")||b.is("td")||b.is("th")){b.closest("table").loading("hide")}else{b.loading("hide")}}},"json")}})};jQuery.fn.removable=function(a){a=jQuery.extend({selector:".icon-remove",target:"tr",callback:function(b){return}},a);return this.each(function(){var b=jQuery(this);b.on("click",a.selector,function(c){jQuery(c.target).closest(a.target).remove();a.callback(c)})})};jQuery.fn.clonable=function(a){a=jQuery.extend({selector:".prototype",target:".prototype",callback:function(b){return}},a);return this.each(function(){var b=jQuery(this);var c=0;b.on("click",a.selector,function(e){var f=jQuery(e.target);if(!f.hasClass(a.target)){f=b.find(a.target)}var d=jQuery(f).clone();jQuery("input, select, textarea",f).each(function(){var g=jQuery(this);g.attr("name",g.attr("name").replace(/@id/g,"n"+c))});f.find(".hidden").removeClass("hidden");f.removeClass("prototype").removeClass("hidden");d.insertAfter(f);c++;$.initUI(f)});b.on("focus",a.target,function(){jQuery(this).trigger("click")})})};jQuery.fn.tableSortable=function(){return this.each(function(){var a=jQuery(this);jQuery("td, th",a).each(function(){var b=jQuery(this);b.width(b.width())});jQuery("tbody",a).sortable({items:"tr:not(:last)",placeholder:"placeholder",cursor:"move"})})};jQuery.fn.blockSortable=function(a){a=jQuery.extend({update:function(b,c){return},itemEditSelector:".edit",itemEditCallback:function(){return}
1,itemDeleteSelector:".delete",itemDeleteCallback:function(){return}},a);return this.each(function(){var b=jQuery(this);b.sortable({items:"> div.item",placeholder:"placeholder",cursor:"move",update:function(c,d){a.update(c,d)}});b.disableSelection();b.on("click",a.itemEditSelector,function(){a.itemEditCallback($(this))});b.on("click",a.itemDeleteSelector,function(){a.itemDeleteCallback($(this))})})};jQuery.fn.photoSortable=function(a){return this.each(function(){jQuery(this).blockSortable({update:function(b,c){jQuery.post(a.updateUrl,jQuery(b.target).sortable("serialize"),function(d){if(d.status=="ERROR"){showReport(d.message,"ERROR")}},"json")},itemEditSelector:".photoEdit",itemEditCallback:function(b){jQuery.get(a.editUrl,{photoId:b.data("id")},function(c){var d=new ModalDialog(c);d.setTitle(__("Editácia popisu fotografie"));d.addButton(__("UložiÅ¥"),function(){jQuery.post(a.editUrl,jQuery("form",jQuery("#"+d.id)).serialize(),function(e){if(e.status=="ERROR"){showReport(e.message,"ERROR")}else{d.close()}},"json")});d.addButton(__("ZavrieÅ¥"));d.open();jQuery("div.tabber",jQuery("#"+d.id)).tabber()})},itemDeleteSelector:".photoDelete",itemDeleteCallback:function(b){var c=jQuery.confirmDialog(__("SkutoÄne chcete odstrániÅ¥ fotografiu?"),function(){c.close();jQuery.post(a.deleteUrl,{photoId:b.data("id")},function(d){if(d.status=="ERROR"){showReport(d.message,"ERROR")}else{b.closest("div.item").remove()}},"json")})}})})};jQuery.confirmDialog=function(c,d,b){b=jQuery.extend({},{title:__("Potvrdenie akcie"),okLabel:__("Confirm"),cancelLabel:__("Cancel"),cancelCallback:null},b||{});var e;var a=new ModalDialog(c);if(typeof(d)=="function"){e=function(){d();a.remove()}}else{e=function(){var f=jQuery(d);if(f.is("a")){location.href=f.attr("href")}}}a.setTitle(b.title);a.addButton(b.okLabel,e,"btn-blue");a.addButton(b.cancelLabel,function(){a.remove();if(typeof(b.cancelCallback)=="function"){b.cancelCallback()}},"btn-back");a.open();return a};function ModalDialog(c,b){var a=this;a.id="id"+(new Date()).getTime();a.dialog=null;a.content=c;a.buttons=[];a.options=jQuery.extend({width:450,height:"auto",resizable:false,modal:true,title:"Modal Dialog"},b);a.addButton=function(d,f,e){a.buttons[a.buttons.length]={text:d,click:function(){a.close();if(f){f.call()}},"class":e};return a};a.setTitle=function(d){a.options.title=d;return a};a.setContent=function(d){a.content=d;return a};a.setOptions=function(d){a.options=jQuery.extend(a.options,d);return a};a.initDialog=function(){a.dialog=jQuery("#"+a.id);if(!a.dialog.length){a.dialog=jQuery('<div id="'+a.id+'"></div>');a.dialog.dialog({resizable:a.options.resizable,width:a.options.width,height:a.options.height,modal:a.options.modal,title:a.options.title,buttons:a.buttons,autoOpen:false})}a.dialog.html(a.content);return a};a.getDialog=function(){return a.dialog};a.open=function(){a.initDialog();a.dialog.dialog("open");a.dialog.dialog("option","position","center")};a.close=function(){a.dialog.dialog("close")};a.remove=function(){a.dialog.remove()}}jQuery.fn.popupDialog=function(a){return this.each(function(){var d=jQuery(this);var c=jQuery.extend({width:500,height:200,loadUrl:"",loaded:function(e){},success:function(e){},beforesubmit:function(e){}},a);if(d.data("width")){c.width=d.data("width")}var b=jQuery("<div></div>").appendTo(jQuery("body"));d.click(function(f){f.preventDefault();b.dialog({modal:true,autoOpen:false,width:c.width,minHeight:c.height,title:d.attr("title"),close:function(){b.remove()}});if(d.is("a")){c.loadUrl=d.attr("href")}b.load(c.loadUrl,function(){var e=jQuery("form",b);e.submit(function(i){i.preventDefault();c.beforesubmit(e);for(var h in CKEDITOR.instances){CKEDITOR.instances[h].updateElement()}var g=jQuery("button",e).attr("disabled","disabled");e.loading();jQuery.post(e.attr("action"),e.serialize(),function(j){if(j.status=="OK"){addReport(j.message,"OK");b.dialog("close");c.success(j)}else{if(j.message.constructor===Array){for(var k in j.message){addReport(j.message[k],"ERROR")}}else{addReport(j.message,"ERROR")}g.removeAttr("disabled");e.loading("hide")}},"JSON")});c.loaded(b);b.dialog("open");jQuery.initUI(b);b.dialog("option","position","center")})})})};jQuery.fn.loading=function(b){var a=jQuery.extend({className:"loading loading-24",bgColor:"#FFF"},b);return this.each(function(){var c=this;if(b=="hide"){if(c.loading!==undefined){c.hideLoading()}}else{c.position=jQuery(c).css("position");c.loading=jQuery("<div></div>").addClass(a.className).css({opacity:0.5,position:"absolute","background-color":a.bgColor,top:0,left:0,zIndex:jQuery.maxZIndex()+1});c.showLoading=function(){if(c.position!="relative"&&c.position!="absolute"&&c.position!="fixed"){jQuery(c).css("position","relative")}c.loading.css({width:jQuery(c).outerWidth(),height:jQuery(c).outerHeight()});c.loading.remove().appendTo(jQuery(c))};c.hideLoading=function(){if(c.position!="relative"&&c.position!="absolute"&&c.position!="fixed"){jQuery(c).css("position","")}c.loading.remove()};c.showLoading()}})};jQuery.fn.disable=function(){this.each(function(){if(jQuery(this).is("form")){jQuery(this).find("input,select,textarea,button").each(function(){this.disabled=true})}});return this};jQuery.fn.enable=function(){this.each(function(){if(jQuery(this).is("form")){jQuery(this).find("input,select,textarea,button").each(function(){this.disabled=false})}});return this};jQuery.fn.ajaxFormSubmit=function(a){a=jQuery.extend({container:"#ajaxForm",reloadUrl:"",showLoading:true,reloadData:function(b){return{id:b.id}},onSuccess:function(b){}
1,onError:function(b){addReport(__("Chyba zo strany servera"),"ERROR")}},a);return this.each(function(){var b=this;var c=jQuery(this);b.container=jQuery(a.container);b.init=function(){c.ajaxForm({beforeSerialize:function(f,e){for(var d in CKEDITOR.instances){CKEDITOR.instances[d].updateElement();CKEDITOR.remove(CKEDITOR.instances[d])}},beforeSubmit:function(d,e,g){if(a.showLoading){b.container.loading()}},success:function(d){d=jQuery.parseJSON(d);if(d.status=="ERROR"){addReport(d.message,"ERROR");if(a.showLoading){b.container.loading("hide")}}else{jQuery.ajax({type:"GET",url:a.reloadUrl,data:a.reloadData(d),success:function(e){b.container.html(e);a.onSuccess(b)},error:function(){a.onError(b)},complete:function(){if(a.showLoading){b.container.loading("hide")}}})}}})};b.init()})};jQuery.fn.ajaxFormPost=function(a){a=jQuery.extend({onSuccess:function(b){},onError:function(b){addReport(__("Chyba zo strany servera"),"ERROR")}},a);return this.each(function(){var b=jQuery(this);b.submit(function(c){c.preventDefault();b.loading();b.find("button").attr("disabled","disabled");jQuery.ajax({type:"POST",url:b.attr("action"),data:b.serialize(),dataType:"JSON",success:function(d){if(d.status=="OK"){addReport(d.message,"OK");a.onSuccess(b)}else{if(d.message.constructor===Array){for(var e in d.message){addReport(d.message[e],"ERROR")}}else{addReport(d.message,"ERROR")}}},error:function(){a.onError(b)},complete:function(){b.loading("hide");b.find("button").removeAttr("disabled")}})})})};jQuery.fn.preventUnsaveData=function(a){var a=$.extend({message:__("Vykonali ste zmeny, ktoré ste nedali uložiÅ¥."),targets:'input:not([data-ignore="1"]), textarea:not([data-ignore="1"]), select:not([data-ignore="1"])',nochange:function(){showReport(__("Nevykonali ste žiadne zmeny, ktoré je potrebné uložiÅ¥"),"INFO")},afterinit:function(){}},a);return this.each(function(){var c=this;var e=$(this);c.enabled=true;c.form=(e.is("form"))?e:e.find("form");if(c.form.length==0){return}c.isChanged=function(){if($(".changed",c.form).length>0){return true}if(c.inputs.length!=$(a.targets,c.form).length){return true}if(typeof CKEDITOR!=="undefined"){for(var f in CKEDITOR.instances){if(CKEDITOR.instances[f].checkDirty()){return true}}}return false};c.init=function(){c.inputs=$(a.targets,c.form);c.inputs.each(function(){var f=$(this);if(f.is(":checkbox")||f.is(":radio")){f.data("before",f.is(":checked")?1:0).removeClass("changed")}else{f.data("before",f.val()).removeClass("changed")}});c.form.on("change",a.targets,function(){c.setAsChanged($(this))});a.afterinit()};c.setAsChanged=function(g){if(g.data("ignore")==1){return}var f=g.val();if(g.is(":checkbox")||g.is(":radio")){f=g.is(":checked")?1:0}if(g.data("before")==f){g.removeClass("changed")}else{g.addClass("changed")}};c.init();var b=null;var d=new ModalDialog(a.message);d.setTitle(__("Oznámenie"));d.addButton(__("OstaÅ¥ na stránke"),function(){var f=b.closest(".ui-selectbox-options");if(f.length){f.trigger("deselect")}},"back");d.addButton(__("OpustiÅ¥ stránku"),function(){if(b.is("a")){location.href=b.attr("href")}else{if(b.closest("a").length){location.href=b.closest("a").attr("href")}else{if(b.closest("form").length){b.closest("form").submit()}}}},"btn-blue");d.initDialog();$("body").on("click","a, a > img, button",function(f){b=$(this);if(b.is("img")){b=b.parent()}if(!b.data("ignore")&&!b.closest(c.form).length&&!b.closest(".ui-dialog").length){if(c.enabled&&c.isChanged()){f.preventDefault();d.open()}}});c.form.on("nochange",function(f){a.nochange()});c.form.on("preventSubmit",function(f){if(c.isChanged()){c.form.trigger("unbindPreventUnsave");c.form.submit()}else{c.form.trigger("nochange")}});c.form.on("unbindPreventUnsave",function(f){$(window).off("beforeunload");c.form.off("submit")});c.form.on("disablePreventUnsave",function(){c.enabled=false});c.form.on("enablePreventUnsave",function(){c.enabled=true});c.form.on("submit",function(f){if(c.enabled&&!f.isPropagationStopped()){c.form.trigger("preventSubmit");f.preventDefault()}})})};jQuery.fn.checkFileSize=function(a){var a=jQuery.extend({maxFileSize:10*1024*1024,message:__("PrekroÄili ste maximálnu povolenú veľkosÅ¥ súborov pre upload.")+" "+__(" Povolená veľkosÅ¥ je")+":"},a);return this.each(function(){var b=this;var c=jQuery(this);b.files=[];b.index=0;b.form=(c.is("form"))?c:c.find("form");if(b.form.length==0){return}b.form.on("change","input:file",function(f){var d=jQuery(this);if(d.data("index")==undefined){d.data("index",b.index);b.index++}if(f.originalEvent.target.files!==undefined){b.files[d.data("index")]=f.originalEvent.target.files;b.form.trigger("check.file.size",f)}});b.totalSize=0;b.form.on("check.file.size",function(k,h){b.totalSize=0;for(var g=0;g<b.files.length;g++){for(var d=0;d<b.files[g].length;d++){var f=b.files[g][d];b.totalSize+=parseInt(f.size)}}if(b.totalSize>a.maxFileSize){showReport(a.message+" "+a.maxFileSize.formatBytes(),"ERROR");h.preventDefault();h.stopPropagation();$(h.target).val("")}});b.form.on("submit",function(d){if(!d.isPropagationStopped()){b.form.trigger("check.file.size",d)}})})};jQuery.fn.googleMapClusterer=function(a,b){return this.each(function(){var c=this;var d=$(c);a.ajax=jQuery.extend({},{url:"",data:"",dataType:"json",success:function(f){for(var e=0;e<f.length;e++){c.markers.push(new google.maps.Marker({metadata:{id:f[e].id},position:new google.maps.LatLng(f[e].lat,f[e].lng),map:null}))}c.redraw()}}
1,a.ajax||{});a=jQuery.extend({},{width:"auto",height:400,zoom:4,maxZoom:15,minZoom:2,panControl:false,center:new google.maps.LatLng(48.745206,19.012401),mapTypeId:google.maps.MapTypeId.ROADMAP,markerClickCallback:function(e){},useClusterer:true},a||{});d.show();d.height(a.height);if(a.width!=="auto"){d.width(a.width)}c.markers=b||[];c.infoWindow=new google.maps.InfoWindow({content:null});c.mapId=d.attr("id")+"Container";c.mapContainer=$("<div></div>");c.mapContainer.attr("id",c.mapId);c.mapContainer.height(d.height());c.mapContainer.appendTo(d);c.initialize=function(){c.disableScrollZoom=function(){d.on("click",c.enableScrollZoom);d.off("mouseleave",c.disableScrollZoom);d.find("> div").css("pointer-events","none")};c.enableScrollZoom=function(){d.off("click",c.enableScrollZoom);d.on("mouseleave",c.disableScrollZoom);d.find("> div").css("pointer-events","auto")};c.disableScrollZoom();c.map=new google.maps.Map(document.getElementById(c.mapId),{zoom:a.zoom,maxZoom:a.maxZoom,minZoom:a.minZoom,panControl:a.panControl,center:a.center,mapTypeId:a.mapTypeId});google.maps.event.addListener(c.map,"dragend",function(){c.redraw()});google.maps.event.addListener(c.map,"zoom_changed",function(){c.redraw()});google.maps.event.addListenerOnce(c.map,"bounds_changed",function(){c.redraw()});if(a.ajax.url){$.ajax(a.ajax)}else{c.redraw()}
1if(a.useClusterer){c.clusterer=new MarkerClusterer(c.map,c.markers)}else{for(var f=0,e;e=c.markers[f];f++){e.setMap(c.map)}}};c.redraw=function(){var h=[];var g=c.map.getBounds();for(var f=0;f<c.markers.length;f++){google.maps.event.clearListeners(c.markers[f],"click");if(g.contains(c.markers[f].getPosition())){h.push(c.markers[f]);google.maps.event.addListener(c.markers[f],"click",function(i){a.markerClickCallback.call(c,this,i)})}}if(a.useClusterer){c.clusterer.clearMarkers();c.clusterer=new MarkerClusterer(c.map,h)}else{for(var f=0,e;e=c.markers[f];f++){e.setMap(c.map)}}};google.maps.event.addDomListener(window,"load",c.initialize)})};jQuery.fn.googleMap=function(a){var b=jQuery.extend({width:"auto",height:300,route:false,routeSelector:"#googleMapRoute",routeTrigger:".googleMapRouteTrigger",zoom:14},a);return this.each(function(){var c=this;var d=jQuery(this);c.iws=[];c.bounds=new google.maps.LatLngBounds();c.map;c.directionsDisplay;c.directionsService;d.on("fit",function(){google.maps.event.trigger(c.map,"resize");c.map.fitBounds(c.bounds);c.map.setZoom(b.zoom)});c.mapId=d.attr("id")+"Container";c.mapContainer=jQuery("<div></div>");c.mapContainer.attr("id",c.mapId);c.mapContainer.height(b.height);c.mapContainer.appendTo(d);c.init=function(){c.disableScrollZoom=function(){d.on("click",c.enableScrollZoom);d.off("mouseleave",c.disableScrollZoom);d.find("> div").css("pointer-events","none")};c.enableScrollZoom=function(){d.off("click",c.enableScrollZoom);d.on("mouseleave",c.disableScrollZoom);d.find("> div").css("pointer-events","auto")};c.disableScrollZoom();d.find("address").each(function(){var f=jQuery(this);c.iws.push({html:f.html(),lat:f.data("lat"),lng:f.data("lng")});f.remove()});if(c.iws.length){d.show();d.height(b.height);if(b.width!=="auto"){d.width(b.width)}c.map=new google.maps.Map(document.getElementById(c.mapId),{zoom:b.zoom,center:new google.maps.LatLng(c.iws[0].lat,c.iws[0].lng),mapTypeId:google.maps.MapTypeId.ROADMAP});jQuery.each(c.iws,function(e,g){var h=new google.maps.InfoWindow({content:g.html,maxWidth:200});var f=new google.maps.Marker({position:new google.maps.LatLng(g.lat,g.lng),map:c.map});if(g.html){google.maps.event.addListener(f,"click",function(){h.open(c.map,f)})}c.bounds.extend(new google.maps.LatLng(g.lat,g.lng))});c.map.fitBounds(c.bounds);google.maps.event.addListenerOnce(c.map,"bounds_changed",function(e){if(this.getZoom()>=b.zoom){this.setZoom(b.zoom)}});if(b.route){c.directionsService=new google.maps.DirectionsService();c.directionsDisplay=new google.maps.DirectionsRenderer();c.directionsDisplay.setMap(c.map);c.route=jQuery(b.routeSelector);if(c.route.length){c.route.find(b.routeTrigger).on("click",function(f){f.preventDefault();c.calcRoute()})}}}};c.calcRoute=function(){var g=jQuery(b.routeSelector);var i=jQuery('input[name="start"]',g).val();if(!i){showReport(jQuery("span.label",g).attr("title"),"INFO")}else{var f=jQuery(":checkbox",g).is(":checked")?1:0;if(f==1){window.open("http://maps.google.com/maps?saddr="+i+"&daddr="+c.iws[0].lat+","+c.iws[0].lon)}else{var e=new google.maps.LatLng(c.iws[0].lat,c.iws[0].lon);var h={origin:i,destination:e,travelMode:google.maps.DirectionsTravelMode.DRIVING};c.directionsService.route(h,function(k,j){if(j==google.maps.DirectionsStatus.OK){c.directionsDisplay.setDirections(k);c.map.setMapTypeId(google.maps.MapTypeId.ROADMAP)}})}}};c.init()})};jQuery.fn.gpsFromGoogleMap=function(b){var a=this;var c=jQuery(a);this.options=jQuery.extend({mapId:"gmapCanvas",mapHeight:400,mapZoom:14,mapType:google.maps.MapTypeId.ROADMAP,latitudeSelector:".gps_latitude",longitudeSelector:".gps_longitude",addressSelector:".gps_address",defaultGps:{latitude:48.67234283929355,longitude:19.456787109375},centerMapOnClick:true,disableScrollZoom:false},b);this.geocoder=null;this.map=null;this.marker=null;this.gpsLatitude=null;this.gpsLongitude=null;this.gpsAddress=null;return this.each(function(){jQuery("#"+a.options.mapId).height(a.options.mapHeight);a.gpsLatitude=jQuery(a.options.latitudeSelector,a);a.gpsLongitude=jQuery(a.options.longitudeSelector,a);a.gpsAddress=jQuery(a.options.addressSelector);a.gpsLatitude.on("change",function(){if(a.options.centerMapOnClick){a.center.call()}});a.gpsLongitude.on("change",function(){if(a.options.centerMapOnClick){a.center.call()}});a.latLng=function(){var e=parseFloat(a.gpsLatitude.val());var d=parseFloat(a.gpsLongitude.val());if(e&&d){return new google.maps.LatLng(e,d)}else{return new google.maps.LatLng(a.options.defaultGps.latitude,a.options.defaultGps.longitude)}};a.init=function(){if(a.options.disableScrollZoom){a.disableScrollZoom=function(){c.on("click",a.enableScrollZoom);c.off("mouseleave",a.disableScrollZoom);c.find("> div").css("pointer-events","none")};a.enableScrollZoom=function(){c.off("click",a.enableScrollZoom);c.on("mouseleave",a.disableScrollZoom);c.find("> div").css("pointer-events","auto")};a.disableScrollZoom()}a.geocoder=new google.maps.Geocoder();a.map=new google.maps.Map(document.getElementById(a.options.mapId),{zoom:a.options.mapZoom,center:a.latLng.call(),mapTypeId:a.options.mapType,mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.TOP_LEFT}});a.marker=new google.maps.Marker({position:a.latLng.call(),draggable:true,animation:google.maps.Animation.DROP,map:a.map});google.maps.event.addListener(a.map,"click",function(e){var d=jQuery.confirmDialog(__("Naozaj chcete zmeniÅ¥ GPS súradnice na zvolenú pozÃciu?"),function(){d.close();a.gpsLatitude.val(e.latLng.lat()).trigger("change");a.gpsLongitude.val(e.latLng.lng()).trigger("change");a.marker.setPosition(a.latLng.call())},{okLabel:__("Confirm"),cancelLabel:__("Cancel")})});google.maps.event.addListenerOnce(a.map,"bounds_changed",function(d){a.map.setZoom(a.getZoom())});google.maps.event.addListener(a.marker,"dragend",function(e){var d=jQuery.confirmDialog(__("Naozaj chcetez zmeniÅ¥ GPS súradnice na zvolenú pozÃciu?"),function(){d.close();a.gpsLatitude.val(e.latLng.lat()).trigger("change");a.gpsLongitude.val(e.latLng.lng()).trigger("change");a.marker.setPosition(a.latLng.call())},{okLabel:__("Confirm"),cancelLabel:__("Cancel"),cancelCallback:function(){a.marker.setPosition(a.latLng.call());a.center()}})});a.center.call();a.fit.call();if(!a.gpsLatitude.val()||!a.gpsLongitude.val()){a.geocodeAddress(true)}window.setTimeout(function(){a.resize();a.center()},100)};
1a.center=function(){a.resize();a.marker.setPosition(a.latLng.call());a.map.setCenter(a.marker.getPosition());return a};a.getZoom=function(){var e=parseFloat(a.gpsLatitude.val());var d=parseFloat(a.gpsLongitude.val());if(e&&d){return a.options.mapZoom}return 7};a.fit=function(e){var d=new google.maps.LatLngBounds();d.extend(a.marker.getPosition());a.map.fitBounds(d);return a};a.resize=function(){google.maps.event.trigger(a.map,"resize");return a};a.geocodeAddress=function(f){var e=false;if(f==undefined){e=true}var d=[];a.gpsAddress.each(function(){d.push($(this).val())});d=d.join(" ");if(d){a.geocoder.geocode({address:d},function(h,g){if(g==google.maps.GeocoderStatus.OK){a.gpsLatitude.val(h[0].geometry.location.lat()).trigger("change");a.gpsLongitude.val(h[0].geometry.location.lng()).trigger("change");a.center.call()}else{if(e){showReport(__("Adresu nebolo možné transformovať na polohu na mape"),"ERROR")}}})}return a};a.on("geocode",function(){a.geocodeAddress()});a.on("resize",function(f,d){jQuery("#"+a.options.mapId).height(d||a.options.mapHeight);a.resize()});a.init()})};jQuery.fn.selectbox=function(settings){settings=jQuery.extend({},{optionsSelector:"ul",instanceClass:"selectbox",optionsClass:"selectbox-options",selectedClass:"selected",triggeredClass:"triggered",hoverClass:"hover",multiple:false,onselect:function(event){return false},oncreate:function(){},onshow:function(event){},beforeselect:function(event){return true}},settings||{});return this.each(function(){var self=this;self._instance=jQuery(this);if(self._instance.data("initialized")==1){return true}self._instance.data("initialized",1);self._options=null;self._value=self._instance.find("input, select").val();self.inlineOnSelect=null;self.getInstance=function(){return self._instance};self.getOptions=function(){return self._options};self.getValue=function(){return self._value};if(self._instance.parent().is("div."+settings.instanceClass)){if(self._instance.is("select")){var select=self._instance;self._instance=self._instance.parent();self._options=jQuery('<ul class="ui-selectbox-options '+settings.optionsClass+'"></ul>');jQuery("option",select).each(function(){var li=jQuery("<li>"+jQuery(this).text()+"</li>");li.data("value",jQuery(this).attr("value"));if(jQuery(this).attr("title")){li.data("title",jQuery(this).attr("title"))}if($(this).is(":selected")){li.addClass("selected")}li.appendTo(self._options)});if(select.attr("onchange")!=undefined){self.inlineOnSelect=function(event){eval(select.attr("onchange"))}}select.hide()}}else{if(self._instance.is("select")){var select=self._instance;var inlineClass=select.attr("class");self._instance=jQuery('<div class="ui-selectbox '+inlineClass+'"><span>'+jQuery("option:selected",select).text()+"</span></div>");select.after(self._instance);self._options=jQuery('<ul class="ui-selectbox-options '+settings.optionsClass+'"></ul>');jQuery("option",select).each(function(){var li=jQuery("<li>"+jQuery(this).text()+"</li>").attr("class",jQuery(this).attr("class"));li.data("value",jQuery(this).attr("value"));if(jQuery(this).attr("title")){li.data("title",jQuery(this).attr("title"))}if($(this).is(":selected")){li.addClass("selected")}li.appendTo(self._options)});if(select.attr("onchange")!=undefined){self.inlineOnSelect=function(event){eval(select.attr("onchange"))}}select.hide().appendTo(self._instance)}else{self._options=self._instance.next(settings.optionsSelector)}}self._defaultValue=self._instance.data("default");if(!self._defaultValue){self._defaultValue=self._instance.find("span").html()}self._options.appendTo("body");self._instance.on("click",function(event){self._options.toggle().css({top:-1000,left:-1000});if(self._options.is(":hidden")){self._instance.removeClass(settings.triggeredClass)}else{self._instance.addClass(settings.triggeredClass)}if(self._options.data("initialized")!=1){self._options.data("initialized",1)}self._options.width("auto");self._options.height("auto");var minWidth=self._instance.innerWidth();var optWidth=self._options.innerWidth();var maxHeight=parseInt(self._options.css("max-height"));var optHeight=0;self._options.find("li").each(function(){optHeight+=jQuery(this).outerHeight()});if(maxHeight>optHeight){self._options.height(optHeight)}else{optWidth+=25}self._options.width((minWidth>optWidth)?minWidth:optWidth);var top=parseInt(self._instance.offset().top)+self._instance.outerHeight()+1;if(top+self._options.outerHeight()>jQuery(window).scrollTop()+jQuery(window).height()){top=top-(self._instance.outerHeight()+4)-self._options.outerHeight()}var ww=(jQuery(document).width()>jQuery(window).width())?jQuery(document).width():jQuery(window).width();var left=parseInt(self._instance.offset().left);if(left+self._options.outerWidth()>ww){left=left-self._options.outerWidth()+self._instance.outerWidth()}self._options.css({top:top,left:left,zIndex:jQuery.maxZIndex()+1});if(self._options.is(":visible")){var selected=self._options.find("li.selected");if(!selected.length){selected=self._options.find("li:eq(0)")}self._options.scrollTo(selected);settings.onshow.call(self,self._instance,self._options)}});self._options.on("click","li",function(event,triggered,preventDefault){var li=jQuery(this);if(li.data("ignore")==1){return true}if(!preventDefault){if(!settings.beforeselect.call(self,li)){return true}}if(settings.multiple){if(li.hasClass("selected")){li.removeClass("selected");self._instance.find("input.v"+li.data("value")).remove()}else{li.addClass("selected");var input=jQuery("> input:eq(0)",self._instance);var clone=input.clone();clone.addClass("v"+li.data("value")).val(li.data("value"));input.after(clone)}var value="";if(self._options.find("li.selected").length){self._options.find("li.selected").each(function(){if(value){value+=", "}value+=$(this).text()})}if(!value){value=self._defaultValue}jQuery("> span",self._instance).html(value)}else{jQuery("li",self._options).removeClass("selected");li.addClass("selected");var input=jQuery("> input, > select",self._instance);input.val(li.data("value"));if(li.find("a").length){jQuery("> span",self._instance).html(li.find("a").html())}else{jQuery("> span",self._instance).html(li.html())}self._value=li.data("value");self._instance.data("value",self._value);self._instance.data("title",li.data("title"));self._instance.removeClass(settings.triggeredClass);self._options.hide();if(!preventDefault){input.trigger("change",triggered)}if($.fn.ui_tooltip){self._instance.ui_tooltip()}}if(!preventDefault){settings.onselect.call(self,event);if(jQuery.isFunction(self.inlineOnSelect)){self.inlineOnSelect.call(self,event)}}});self._instance.on("change.value",function(event,value){jQuery('li[data-value="'+value+'"]',self._options).trigger("click",true,false)});self._instance.on("set.value",function(event,value){jQuery('li[data-value="'+value+'"]',self._options).trigger("click",true,true)});self._instance.on("destroy",function(event){self._options.remove()});self._instance.on("deselect",function(event){self._instance.find("> input, > select").val("");if(settings.multiple){self._instance.find("> input:gt(0)").remove()}self._instance.find("> span").html(self._defaultValue);self._options.find("li.selected").removeClass("selected")});self._options.on("deselect",function(event){self._instance.trigger("deselect")});jQuery("li",self._options).hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")});jQuery(window).on("click",function(e){if(!jQuery(e.target).closest(self._instance).length&&!jQuery(e.target).closest(self._options).length){self._options.hide();self._instance.removeClass(settings.triggeredClass)}}).on("resize",function(){self._options.hide();self._instance.removeClass(settings.triggeredClass)}).on("scroll",function(){self._options.hide();self._instance.removeClass(settings.triggeredClass)});var findMe="";var findMeTimeout=null;
1jQuery("body").on("keypress, keydown",function(e){if(self._options.is(":visible")){var code=(e.keyCode?e.keyCode:e.which);if(code==40||code==38||code==13){e.preventDefault();window.clearTimeout(findMeTimeout);findMe="";var selected=self._options.find("li."+settings.selectedClass);if(!selected.length){selected=self._options.find("li:eq(0)")}switch(code){case 40:var next=selected.next("li");if(next.length){self._options.find("li").removeClass(settings.selectedClass).removeClass(settings.hoverClass);if(!settings.multiple){next.addClass(settings.selectedClass)}self._options.scrollTo(next)}break;case 38:var prev=selected.prev("li");if(prev.length){self._options.find("li").removeClass(settings.selectedClass).removeClass(settings.hoverClass);if(!settings.multiple){prev.addClass(settings.selectedClass)}self._options.scrollTo(prev)}break;case 13:selected.trigger("click");break}}else{if(!e.ctrlKey&&!e.altKey&&!e.shiftKey){e.preventDefault();findMe+=e.key?e.key:String.fromCharCode((96<=code&&code<=105)?code-48:code);window.clearTimeout(findMeTimeout);findMeTimeout=window.setTimeout(function(){findMe=""},500);var resultList=jQuery("li",self._options).filter(function(){return jQuery(this).text().removeAccents().toLowerCase().indexOf(findMe.toLowerCase())===0});if(resultList.length){var li=resultList.first();self._options.scrollTo(li);jQuery("li",self._options).removeClass(settings.selectedClass);if(!settings.multiple){li.addClass(settings.selectedClass)}}}}}});settings.oncreate.call(self)})};jQuery.fn.checkboxes=function(){return this.each(function(){var a=this;var b=jQuery(this);if(b.data("initialized")==1){return true}if(b.parent().is("span.input")){a.span=b.parent();a.icon=a.span.find("i");if(!a.icon.length){a.icon=jQuery('<i class="icon-ok" />')}}else{b.css({position:"absolute",visibility:"hidden",top:0,left:0}).data("initialized",1);a.span=jQuery('<span class="input input-box"></span>').css({position:"relative"});a.icon=jQuery('<i class="icon-ok" />');if(b.is(":checked")){a.span.append(a.icon)}a.span.insertAfter(b);a.span.append(b)}b.on("uncheck",function(){b.removeAttr("checked");a.icon.remove()});a.span.on("click",function(){b.trigger("click")});b.on("change",function(){if(b.is(":checked")){a.span.append(a.icon)}else{a.icon.remove()}})})};jQuery.fn.carousel=function(a){a=$.extend({animationDuration:750,moveBy:1,updateHeight:false,auto:false,itemSelector:"img",vertical:false,navbar:false,timeout:6000,autoStartDelay:0,stopAutoMoveOnSelect:false,stopAutoMoveOnHover:false,defaultWidth:0,visible:1},a);return this.each(function(){var k=this;var l=$(this);l.timeout=null;var i=0;var h=l.find(a.itemSelector);var b=$("<div></div>").addClass("carousel-container").css({position:"relative",overflow:"hidden",margin:"0 auto"});var g=$("<div></div>").addClass("carousel-content").css({position:"absolute",top:"0px",left:"0px"});if(a.navbar){var c=(h.length>1)?jQuery("<ul></ul>").addClass("carousel-navbar"):""}else{var d=jQuery('<a href="javascript:void(0);"></a>').addClass("arrow arrow-prev").html("<span>prev</span>");var e=jQuery('<a href="javascript:void(0);"></a>').addClass("arrow arrow-next").html("<span>next</span>")}k.startAutoMove=function(n,m){if(m===undefined){m=0}if(a.auto&&h.length>1){var p=a.timeout;if(a.visible==1){if(a.vertical){var o=h.eq(Math.abs(parseInt(g.css("top")))/i);if(parseInt(o.data("timeout"))>0){p=parseInt(o.data("timeout"))*1000}}else{var o=h.eq(Math.abs(parseInt(g.css("left")))/i);if(parseInt(o.data("timeout"))>0){p=parseInt(o.data("timeout"))*1000}}}l.timeout=window.setTimeout(function(){n.trigger("click.carousel",true)},p+m)}};k.recalculate=function(){b.width(h.eq(0).width()*a.visible);if(b.width()<h.eq(0).width()){h.width(b.width())}else{if(b.width()<a.defaultWidth){h.width(b.width())}else{if(a.defaultWidth){h.width(a.defaultWidth)}}}g.width(h.eq(0).outerWidth()*h.length).css({left:parseInt(g.css("left"))/i*(h.eq(0).outerWidth()*a.moveBy)});i=h.eq(0).outerWidth()*a.moveBy;b.height(l.height())};if(h.length){h.appendTo(g).show();g.appendTo(b);if(a.navbar){l.html("").append(b).append(c)}else{l.html("").append(d).append(b).append(e)}i=(a.vertical)?h.eq(0).outerHeight()*a.moveBy:h.eq(0).outerWidth()*a.moveBy;if(a.navbar){if(h.length>1){h.each(function(m){c.append("<li><span>"+(m+1)+"</span></li>")});l.active=c.find("li:eq(0)").addClass("carousel-navbar-active");var f=0;c.data("disabled",0).on("click.carousel","li",function(q,n){var m=$(this);l.active=m;if(!n&&a.auto){clearTimeout(l.timeout);l.timeout=null}if(f!=m.index()&&!c.data("disabled")){c.data("disabled",1);if(a.vertical){var p=-(m.index()*i);g.animate({top:p+"px"},{duration:a.animationDuration,complete:function(){c.find("li").removeClass("carousel-navbar-active");c.data("disabled",0);m.addClass("carousel-navbar-active");f=m.index();if(n||!a.stopAutoMoveOnSelect){k.startAutoMove((l.active.next("li").length)?l.active.next("li"):c.find("li:eq(0)"))}}})}else{var o=-(m.index()*i);if(m.index()==0&&f+1==h.length){o=-f*i;g.append(h.eq(0)).css({left:-(h.length-2)*i})}else{if(f==0&&m.index()+1==h.length){o=0;g.prepend(h.eq(h.length-1)).css({left:-i})}}g.animate({left:o+"px"},{duration:a.animationDuration,complete:function(){c.find("li").removeClass("carousel-navbar-active");c.data("disabled",0);if(m.index()==0&&f+1==h.length){g.prepend(h.eq(0)).css({left:0})}else{if(f==0&&m.index()+1==h.length){g.append(h.eq(h.length-1)).css({left:-(h.length-1)*i})}}m.addClass("carousel-navbar-active");f=m.index();if(n||!a.stopAutoMoveOnSelect){k.startAutoMove((l.active.next("li").length)?l.active.next("li"):c.find("li:eq(0)"))}}})}}});var j=(l.active.next("li").length)?l.active.next("li"):c.find("li:eq(0)");k.startAutoMove(j,a.autoStartDelay)}}else{e.on("click.carousel",function(q,m){if(!e.data("disabled")){e.data("disabled",1);if(!m&&a.auto){clearTimeout(l.timeout);l.timeout=null}if(a.vertical){var o=parseInt(g.css("top"));var p=Math.max(o-i,-g.height()+b.height());if(Math.abs(o)+i==h.length*i){g.append(h.eq(0)).css({top:-(h.length-2)*i})}g.animate({top:p+"px"},{duration:a.animationDuration,complete:function(){e.data("disabled",0);if(Math.abs(o)+i==h.length*i){g.prepend(h.eq(0)).css({top:0})}if(m||!a.stopAutoMoveOnSelect){k.startAutoMove(e)}}})}else{var r=parseInt(g.css("left"));
1var n=Math.max(r-i,-g.width()+b.width());if(Math.abs(r)+i==h.length*i){g.append(h.eq(0)).css({left:-(h.length-2)*i})}g.animate({left:n+"px"},{duration:a.animationDuration,complete:function(){e.data("disabled",0);if(Math.abs(r)+i==h.length*i){g.prepend(h.eq(0)).css({left:0})}if(m||!a.stopAutoMoveOnSelect){k.startAutoMove(e)}}})}}return false});d.on("click.carousel",function(q,m){if(!d.data("disabled")){d.data("disabled",1);if(!m&&a.auto){clearTimeout(l.timeout);l.timeout=null}if(a.vertical){var o=parseInt(g.css("top"));var p=Math.min(o+i,0);if(o==0){g.prepend(h.eq(h.length-1)).css({top:-i})}g.animate({top:p+"px"},{duration:a.animationDuration,complete:function(){d.data("disabled",0);if(o==0){g.append(h.eq(h.length-1)).css({top:-(h.length-1)*i})}if(m||!a.stopAutoMoveOnSelect){k.startAutoMove(d)}}})}else{var r=parseInt(g.css("left"));var n=Math.min(r+i,0);if(r==0){g.prepend(h.eq(h.length-1)).css({left:-i})}g.animate({left:n+"px"},{duration:a.animationDuration,complete:function(){d.data("disabled",0);if(r==0){g.append(h.eq(h.length-1)).css({left:-(h.length-1)*i})}if(m||!a.stopAutoMoveOnSelect){k.startAutoMove(d)}}})}}return false});if(h.length==a.visible){e.hide();d.hide()}k.startAutoMove(e,a.autoStartDelay)}}if(a.stopAutoMoveOnHover&&a.auto){l.on("mouseover",function(){clearTimeout(l.timeout);l.timeout=null});l.on("mouseout",function(){if(a.navbar){var m=(l.active.next("li").length)?l.active.next("li"):c.find("li:eq(0)");k.startAutoMove(m,a.autoStartDelay)}else{k.startAutoMove(e,a.autoStartDelay)}})}l.on("carousel.swipe.left",function(m){if(a.navbar){if(l.active.next("li").length){l.active.next("li").trigger("click.carousel")}else{c.find("li:eq(0)").trigger("click.carousel")}}else{e.trigger("click.carousel")}}).on("carousel.swipe.right",function(m){if(a.navbar){if(l.active.prev("li").length){l.active.prev("li").trigger("click.carousel")}else{c.find("li:last-child").trigger("click.carousel")}}else{d.trigger("click.carousel")}});if(!a.vertical&&a.defaultWidth){$(window).on("resize",function(){clearTimeout(l.timeout);k.recalculate();if(a.navbar){var m=(l.active.next("li").length)?l.active.next("li"):c.find("li:eq(0)");k.startAutoMove(m,a.autoStartDelay)}else{k.startAutoMove(e,a.autoStartDelay)}})}$(window).load(function(){k.recalculate()})})};jQuery.fn.sameHeight=function(a){a=jQuery.extend({seletor:".col",minWidth:0},a);return this.each(function(){var c=jQuery(this);var d=c.find(a.selector);var b=this;b.calculate=function(){if($(window).width()>=a.minWidth){b.height=d.eq(0).height();d.each(function(){var e=jQuery(this);if(e.height()>b.height){b.height=e.height()}}).height(b.height)}else{d.height("auto")}};b.calculate();$(window).on("resize",function(){b.calculate()})})};jQuery.fn.extend({insertAtCursor:function(a){return this.each(function(d){if(document.selection){this.focus();sel=document.selection.createRange();sel.text=a;this.focus()}else{if(this.selectionStart||this.selectionStart=="0"){var c=this.selectionStart;var b=this.selectionEnd;var e=this.scrollTop;this.value=this.value.substring(0,c)+a+this.value.substring(b,this.value.length);this.focus();this.selectionStart=c+a.length;this.selectionEnd=c+a.length;this.scrollTop=e}else{this.value+=a;this.focus()}}})}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.