soundmap_theme/carnaval/js/jquery.jkit.1.1.13.min.js
2016-11-29 01:18:17 +01:00

11 lines
52 KiB
JavaScript

// jQuery Plugin: jKit
// A very easy to use, cross platform jQuery UI toolkit that's still small in size, has the features you need and doesn't get in your way.
// Version 1.1.13 - 17. 1. 2013
// http://jquery-jkit.com/
//
// by Fredi Bach
// http://fredibach.ch/jquery-plugins/
(function($,undefined){$.jKit=function(element,options,moreoptions){var defaults={prefix:"jkit",dataAttribute:"data-jkit",activeClass:"active",errorClass:"error",successClass:"success",ignoreFocus:!1,ignoreViewport:!1,keyNavigation:!0,touchNavigation:!0,plugins:{},replacements:{},delimiter:",",macros:{"hide-if-empty":"binding:selector=this;source=text;mode=css.display","smooth-blink":"loop:speed1=2000;duration1=250;speed2=250;duration2=2000"},commands:{template:{action:"set",name:"template",dynamic:"no",addhtml:"+"},lightbox:{speed:500,opacity:.7,clearance:200,closer:"x",next:">",prev:"<",modal:"no",width:"",height:"",titleHeight:20,group:""},scroll:{speed:500,dynamic:"yes",easing:"linear"},hide:{delay:0,speed:500,animation:"fade",easing:"linear"},remove:{delay:0},show:{delay:0,speed:500,animation:"fade",easing:"linear"},showandhide:{delay:0,speed:500,duration:1e4,animation:"fade",easing:"linear"},loop:{speed1:500,speed2:500,duration1:2e3,duration2:2e3,easing1:"linear",easing2:"linear",animation:"fade"},random:{count:1,remove:"yes"},partially:{height:200,text:"more ...",speed:250,easing:"linear"},slideshow:{shuffle:"no",interval:3e3,speed:250,animation:"fade",easing:"linear",on:""},animation:{fps:25,loop:"no",from:"",to:"",speed:"500",easing:"linear",delay:0,on:""},gallery:{active:1,event:"click",showcaptions:"yes",animation:"none",speed:500,easing:"linear"},tabs:{active:1,animation:"none",speed:250,easing:"linear"},accordion:{active:1,animation:"slide",speed:250,easing:"linear"},carousel:{autoplay:"yes",limit:5,animation:"grow",speed:250,easing:"linear",interval:5e3,prevhtml:"&lt;",nexthtml:"&gt;"},parallax:{strength:5,axis:"x",scope:"global"},form:{validateonly:"no"},plugin:{script:""},tooltip:{text:"",color:"#fff",background:"#000",classname:""},background:{distort:"no"},lorem:{paragraphs:0,length:"",random:"no"},binding:{selector:"",source:"val",variable:"",mode:"text",interval:100,math:"",condition:"","if":"","else":"",speed:0,easing:"linear",search:""},limit:{elements:"children",count:5,animation:"none",speed:250,easing:"linear",endstring:"..."},chart:{max:0,delaysteps:100,speed:500,easing:"linear"},encode:{format:"code",fix:"yes"},split:{separator:"",container:"span",before:"",after:""},live:{interval:60},key:{},ajax:{animation:"slide",speed:250,easing:"linear",when:"click"},replace:{modifier:"g",search:"",replacement:""},cycle:{what:"class",where:"li",scope:"children",sequence:"odd,even"},fontsize:{steps:2,min:6,max:72,affected:"p"},swap:{versions:"_off,_on"},ticker:{speed:100,delay:2e3},sort:{what:"text",by:"",start:0,end:0},zoom:{scale:2,speed:150},api:{format:"json",value:"",url:"",interval:-1,template:""},filter:{by:"class",affected:"",animation:"slide",speed:250,easing:"linear",logic:"and"},summary:{what:"",linked:"yes",from:"",scope:"children"}}},plugin=this;plugin.settings={};var $element=$(element),element=element;if("string"==typeof options){var singlecommand=options;moreoptions==undefined&&(moreoptions={}),options=moreoptions}var startX,startY,windowhasfocus=!0,uid=0,lightboxes={},templates={},commandkeys={};(!$.browser.msie||$.browser.msie&&$.browser.version>=9)&&$(window).focus(function(){windowhasfocus=!0}).blur(function(){windowhasfocus=!1}),plugin.applyMacro=function(a,b){var c=plugin.settings;if(c.macros[b]!=undefined){var d=c.macros[b],e=plugin.parseOptions(d);c.replacements[e.type]!=undefined&&"function"==typeof c.replacements[e.type]?c.replacements[e.type].call(plugin,a,e.type,e):plugin.executeCommand(a,e.type,e)}},plugin.init=function(a){a==undefined&&(a=$element),plugin.settings=$.extend({},defaults,options);var b=plugin.settings;singlecommand!=undefined?plugin.executeCommand(a,singlecommand,options):a.find("*[rel^=jKit], *["+b.dataAttribute+"]").each(function(){var c=this,d=$(this).attr("rel"),e=$(this).attr(b.dataAttribute);d=e!=undefined?$.trim(e).substring(1):$.trim(d).substring(5),d=d.substring(0,d.length-1),d=d.replace(/\]\s+\[/g,"]["),relsplit=d.split("]["),$.each(relsplit,function(d,e){e=e.replace(/\\=/g,"|jkit-eq|").replace(/\\:/g,"|jkit-dp|").replace(/\\;/g,"|jkit-sc|").replace(/\\\[/g,"|jkit-sbo|").replace(/\\\]/g,"|jkit-sbc|").replace(/\\\*/g,"|jkit-st|").replace(/\\ /g,"|jkit-sp|"),e=$.trim(e),b.macros[e]!=undefined&&(e=b.macros[e]);var f=plugin.parseOptions(e);if(b.macros[f.type]!=undefined){var g=plugin.parseOptions(b.macros[f.type]);f.type=g.type,f=$.extend({},g,f)}if("macro"==f.type&&relsplit[d-1]!=undefined)plugin.settings.macros[f.name]=relsplit[d-1];else if("repeat"==f.type&&relsplit[d-1]!=undefined){var h=plugin.parseOptions(relsplit[d-1]);a.on(f.onevent,function(){f.delay==undefined&&(f.delay=0),setTimeout(function(){plugin.executeCommand($(c),h.type,h)},f.delay)})}else{var i=[];if(f.target!=undefined){var j=f.target.split(".");switch(j=[j.shift(),j.join(".")],j[1]==undefined&&(j[1]="*"),j[0]){case"children":$(c).children(j[1]).each(function(){i.push(this)});break;case"each":$(c).find(j[1]).each(function(){i.push(this)});break;default:i.push(c)}}else i.push(c);$.each(i,function(c,d){var e=plugin.parseDynamicOptions(f);if(e.commandkey==undefined){var g=$(d).attr("id");e.commandkey=g!=undefined?g:b.prefix+"-uid-"+ ++uid}if(e.commandkey!=undefined&&(commandkeys[e.commandkey]={el:d,options:e,execs:0}),e.onevent!==undefined||e.andonevent!==undefined){var h=[];e.onevent!==undefined&&h.push(e.onevent),e.andonevent!==undefined&&h.push(e.andonevent);var i=h.join(" ");a.on(i,function(){b.replacements[e.type]!=undefined&&"function"==typeof b.replacements[e.type]?b.replacements[e.type].call(plugin,d,e.type,e):plugin.executeCommand(d,e.type,e)})}e.onevent===undefined&&(b.replacements[e.type]!=undefined&&"function"==typeof b.replacements[e.type]?b.replacements[e.type].call(plugin,d,e.type,e):plugin.executeCommand(d,e.type,e))})}})})},plugin.parseOptions=function(a){var b=a.split(":"),c=b[0].split("."),d={type:$.trim(c[0])};if(c[1]!==undefined&&(d.commandkey=c[1]),d.execute==undefined&&(d.execute="always"),b.length>1){var e=b[1].split(";");$.each(e,function(a,b){var c=b.split("=");d[$.trim(c[0])]=$.trim(c[1])})}return d},plugin.parseDynamicOptions=function(a){var b={};for(index in a){var c=a[index];if(c!==undefined&&c.indexOf("{")>-1&&c.indexOf("|")>0&&c.indexOf("}")>1){for(var d="",e=!1,f="",g=!1,h=0;c.length-1>=h;h++)if(e||"{"!=c.charAt(h)?e&&"}"==c.charAt(h)&&(e=!1,g=!0):e=!0,e||g){if(f+=c.charAt(h),g){f=f.slice(1,-1);var i=f.split("|");if("rand"==i[0]){var j=i[1].split("-");d+=plugin.getRandom(Number(j[0]),Number(j[1]))}g=!1,f=""}}else d+=c.charAt(h);b[index]=d}else b[index]=c}return b},plugin.getRandom=function(a,b){if(a>b)return-1;if(a==b)return a;var c;do c=Math.random();while(1==c);return a+parseInt(c*(b-a+1))},plugin.addDefaults=function(a,b){if(plugin.settings.commands[a]!=undefined){var c=plugin.settings.commands[a];$.each(c,function(a,c){b[a]==undefined&&(b[a]=c),a.indexOf("speed")>-1&&(b[a]=plugin.fixSpeed(b[a]))})}return b},plugin.executeCommand=function(a,b,c){var d=plugin.settings,e=$(a);if($element.trigger("jkit-commandinit",{element:e,type:b,options:c}),c.commandkey!==undefined&&(commandkeys[c.commandkey].execs++,"once"==c.execute&&commandkeys[c.commandkey].execs>1||!isNaN(c.execute)&&commandkeys[c.commandkey].execs>c.execute))return e;switch(c=plugin.addDefaults(b,c),$.each(c,function(b,d){"string"==typeof d&&(c[b]=d=d.replace(/\|jkit\-eq\|/g,"=").replace(/\|jkit\-dp\|/g,":").replace(/\|jkit\-sc\|/g,";").replace(/\|jkit\-sbo\|/g,"[").replace(/\|jkit\-sbc\|/g,"]").replace(/\|jkit\-st\|/g,"*").replace(/\|jkit\-sp\|/g," ")),"string"==typeof d&&"*"==d.slice(-1)&&(c[b]=window[d.slice(0,-1)],"function"==typeof c[b]&&(c[b]=c[b].call(a)))}),b){case"filter":plugin.filterElements(e,c),e.find(".jkit-filter").on("change click",function(){plugin.triggerEvent("clicked",e,c),plugin.filterElements(e,c)});break;case"summary":var f="",g="";"children"==c.scope&&(g="> "),$(c.from).find(g+c.what).each(function(){var a=$(this);if("yes"==c.linked){if(a.attr("id")!==undefined)var b=a.attr("id");else{var b=d.prefix+"-uid-"+ ++uid;a.attr("id",b)}f+='<li><a href="#'+b+'">'+$(this).text()+"</a></li>"}else f+="<li>"+$(this).text()+"</li>"}),""!=f&&e.html("<ul>"+f+"</ul>");break;case"api":""!=c.url&&plugin.readAPI(e,c);break;case"zoom":e.parent().css("position","relative"),e.on("mouseover",function(){var a=e.position(),f=e.height(),g=e.width();$zoom=$("<div/>",{"class":d.prefix+"-"+b+"-overlay"}).css({position:"absolute",height:f+"px",width:g+"px",left:a.left+"px",top:a.top+"px",overflow:"hidden","background-image":"url("+e.attr("src")+")","background-repeat":"no-repeat","background-color":"#000",opacity:0}).on("mouseout",function(){$zoom.fadeTo(c.speed,0,function(){$zoom.remove(),plugin.triggerEvent("zoomout",e,c)})}).mousemove(function(a){var b=$(this).offset(),d=(a.pageX-b.left)*(c.scale-1),e=(a.pageY-b.top)*(c.scale-1);$zoom.css("background-position","-"+d+"px -"+e+"px")}).fadeTo(c.speed,1,function(){plugin.triggerEvent("zoomin",e,c)}).insertAfter(e)});break;case"sort":var h=e.text(),i=e.parent().children().index(e);e.on("click",function(){plugin.triggerEvent("clicked",e,c);var a=[];e.parent().parent().parent().find("tbody > tr").each(function(){var b=$(this).find("td:nth-child("+(i+1)+")");switch(c.what){case"html":var d=b.html();break;case"class":var d=b.attr("class");break;default:var d=b.text()}(c.start>0||c.end>0)&&(d=c.end>c.start?d.substring(c.start,c.end):d.substring(c.start)),a.push({content:$(this).html(),search:d})}),e.hasClass(d.prefix+"-"+b+"-down")?(e.parent().find("th").removeClass(d.prefix+"-"+b+"-down").removeClass(d.prefix+"-"+b+"-up"),e.addClass(d.prefix+"-"+b+"-up"),a.sort(function(a,b){if("num"==c.by&&(a.search=Number(a.search),b.search=Number(b.search)),"date"==c.by){var a=new Date(a.search),b=new Date(b.search);return a.getTime()-b.getTime()}return a.search>b.search?-1:a.search<b.search?1:0})):(e.parent().find("th").removeClass(d.prefix+"-"+b+"-down").removeClass(d.prefix+"-"+b+"-up"),e.addClass(d.prefix+"-"+b+"-down"),a.sort(function(a,b){if("num"==c.by&&(a.search=Number(a.search),b.search=Number(b.search)),"date"==c.by){var a=new Date(a.search),b=new Date(b.search);return b.getTime()-a.getTime()}return a.search<b.search?-1:a.search>b.search?1:0}));var f=e.parent().parent().parent().find("tbody");f.html("");var g="";$.each(a,function(a,b){g+="<tr>"+b.content+"</tr>"}),f.html(g),plugin.triggerEvent("complete",e,c)});break;case"ticker":var j=[];if(e.find("li").each(function(){j.push({href:$(this).find("a").attr("href"),target:$(this).find("a").attr("target"),text:$(this).text()})}),j.length>0){var k=$("<div/>");e.replaceWith(k),window.setTimeout(function(){plugin.ticker(k,c,j,0,0)},0)}break;case"swap":var l="src",m=c.versions.split(d.delimiter),n=e.attr(l),o=e.attr(l).replace(m[0],m[1]);$("<img/>")[0].src=o,e.mouseenter(function(){e.attr(l,o),plugin.triggerEvent("active",e,c)}).mouseleave(function(){e.attr(l,n),plugin.triggerEvent("inactive",e,c)});break;case"fontsize":var p="font-size";e.on("click",function(){return $element.find(c.affected).each(function(){var a=parseInt($(this).css(p))+parseInt(c.steps);a>=parseInt(c.min)&&parseInt(c.max)>=a&&$(this).css(p,a)}),plugin.triggerEvent("changed",e,c),!1});break;case"cycle":var q=c.sequence.split(d.delimiter),r=0,s=c.where;"children"==c.scope&&(s="> "+s),e.find(s).each(function(){if(q[r]!=undefined&&""!=q[r])switch(c.what){case"class":$(this).addClass(q[r]);break;case"html":$(this).html(q[r]);break;default:var a=c.what.split(".");"attr"==a[0]?$(this).attr(a[1],q[r]):"css"==a[0]&&$(this).css(a[1],q[r])}r++,r>q.length-1&&(r=0)});break;case"replace":var t=RegExp(c.search,c.modifier);e.html(e.html().replace(t,c.replacement));break;case"ajax":if(c.href!=undefined&&""!=c.href)var u=c.href;else var u=e.attr("href");if("load"==c.when||"viewport"==c.when)if("load"==c.when)e.load(u,function(){plugin.triggerEvent("complete",e,c)});else var v=setInterval(function(){(e.jKit_inViewport()||!e.jKit_inViewport()&&d.ignoreViewport)&&(c.src!=undefined?(e.attr("src",c.src),plugin.triggerEvent("complete",e,c)):e.load(u,function(){plugin.triggerEvent("complete",e,c)}),window.clearInterval(v))},100);else e.on("click",function(){return plugin.loadAndReplace(u,c,e),!1});break;case"key":c.code!=undefined&&(plugin.addKeypressEvents(e,c.code),e.on(c.code,function(){e.attr("onclick")!==undefined?e.click():e.attr("target")!==undefined&&"_blank"==e.attr("target")?window.open(e.attr("href"),"_blank",!1):window.location.href=e.attr("href"),c.macro!=undefined&&plugin.applyMacro(e,c.macro),plugin.triggerEvent("pressed",e,c)}));break;case"live":e.attr("src")!==undefined&&window.setInterval(function(){plugin.updateSrc(e,c),plugin.triggerEvent("reloaded",e,c)},1e3*c.interval);break;case"split":var w=e.text().split(c.separator);e.html(""),$.each(w,function(a,b){$("<"+c.container+"/>").text(b).appendTo(e)}),e.html(c.before+e.html()+c.after);break;case"encode":switch(c.format){case"code":var y=e.html();"yes"==c.fix&&(y=plugin.preFix(y)),e.html(y.replace(/</g,"&lt;").replace(/>/g,"&gt;"));break;case"text":e.html(e.text());break;case"esc":e.html(escape(e.html()));break;case"uri":e.html(encodeURI(e.html()))}break;case"chart":var z=e.find("thead > tr > th.label").text(),A=e.attr("id"),B=[];e.find("thead > tr > th").each(function(){$(this).hasClass("label")||B.push($(this).text())});var C=0,D=[];e.find("tbody tr").each(function(){var a={label:$(this).find("th.label").text(),data:[]};$(this).find("th").each(function(){if(!$(this).hasClass("label")){var b=Number($(this).text());C=Math.max(b,C),a.data.push(b)}}),D.push(a)}),c.max>0&&c.max>C&&(C=c.max);var E=$("<div/>",{id:A,"class":d.prefix+"-"+b}),F=0,G=0;$.each(B,function(a,f){F++;var g=$("<div/>",{"class":d.prefix+"-"+b+"-step"}).html("<label>"+f+"</label>").appendTo(E);$.each(D,function(e){if(D[e].data[a]>0){var h=$("<div/>",{"class":d.prefix+"-"+b+"-plot "+d.prefix+"-"+b+"-plot"+e}).appendTo(g);$("<div/>").text(D[e].label).delay(G).animate({width:100*(D[e].data[a]/C)+"%"},c.speed,c.easing).appendTo(h),$("<span/>",{"class":d.prefix+"-"+b+"-info"}).text(z+" "+D[e].label+": "+D[e].data[a]+" "+c.units).appendTo(h)}}),F==B.length&&setTimeout(function(){plugin.triggerEvent("complete",e,c)},c.speed+G),G+=Number(c.delaysteps)}),e.replaceWith(E);break;case"lightbox":""!=c.group&&(lightboxes[c.group]==undefined&&(lightboxes[c.group]=[]),lightboxes[c.group].push(a)),e.click(function(){plugin.triggerEvent("clicked",e,c),"no"==c.modal&&$("<div/>",{id:d.prefix+"-"+b+"-bg","class":d.prefix+"-"+b+"-closer "+d.prefix+"-"+b+"-el"}).fadeTo(c.speed,c.opacity).appendTo("body");var g=$("<div/>",{id:d.prefix+"-"+b+"-content","class":d.prefix+"-"+b+"-el"}).fadeTo(0,.01).appendTo("body");$.fn.jKit_iOS()&&g.css("top",$(window).scrollTop()+"px"),""!=c.width&&(g.css({width:c.width}),g.css({left:($(window).width()-g.outerWidth())/2+"px"})),""!=c.height&&(g.css({height:c.height}),g.css({top:($(window).height()-g.outerHeight())/2+"px"}));var h=$("<div/>",{id:d.prefix+"-"+b+"-nav","class":d.prefix+"-"+b+"-el"}).hide().fadeTo(c.speed,1).appendTo("body");$("<span/>",{"class":d.prefix+"-"+b+"-closer"}).html(c.closer).prependTo(h);var j=g.offset();if(h.css({top:j.top-c.titleHeight-$(window).scrollTop()+"px",left:j.left+g.outerWidth()-h.width()+"px"}),""!=c.group){var k=$("<span/>",{id:d.prefix+"-"+b+"-nav-next"}).prependTo(h),l=$("<span/>",{id:d.prefix+"-"+b+"-nav-prev"}).prependTo(h);plugin.addKeypressEvents(k,"right"),plugin.addKeypressEvents(l,"left"),lightboxes[c.group][lightboxes[c.group].length-1]!=a&&k.html(c.next).on("click right",function(){$.each(lightboxes[c.group],function(d,e){e==a&&($("."+plugin.settings.prefix+"-"+b+"-el").fadeTo(c.speed,0,function(){$(this).remove()}),lightboxes[c.group][d+1].click())})}),lightboxes[c.group][0]!=a&&l.html(c.prev).on("click left",function(){$.each(lightboxes[c.group],function(d,e){e==a&&($("."+plugin.settings.prefix+"-"+b+"-el").fadeTo(c.speed,0,function(){$(this).remove()}),lightboxes[c.group][d-1].click())})})}$title=$("<div/>",{id:d.prefix+"-"+b+"-title","class":d.prefix+"-"+b+"-el"}).css({top:j.top-c.titleHeight-$(window).scrollTop()+"px",left:j.left+"px",width:g.width()+"px"}).hide().text(e.attr("title")).fadeTo(c.speed,1).appendTo("body");var m=new Image;return $(m).load(function(){var a=($(this).outerWidth()+c.clearance)/$(window).width(),b=($(this).outerHeight()+c.clearance)/$(window).height(),d=Math.max(a,b);if(d>1){var f=$(this).height();$(this).width($(this).width()/d),$(this).height(f/d)}var i=($(window).width()-$(this).outerWidth())/2,j=($(window).height()-$(this).outerHeight())/2;g.width($(this).width()).height($(this).height()).css({left:i+"px",top:j+"px"}).fadeTo(c.speed,1),$(this).hide().fadeTo(c.speed,1),""!=e.attr("title")&&$title.css({top:j-c.titleHeight+"px",left:i+"px",width:$(this).width()+"px"}),h.css({top:j-c.titleHeight+"px",left:i+g.outerWidth()-h.width()+"px"})}).attr("src",e.attr("href")).appendTo(g).error(function(){g.html('<iframe id="'+d.prefix+"-"+b+'-iframe" src="'+e.attr("href")+'" style="border:none;width:100%;height:100%"></iframe>').fadeTo(c.speed,1)}),$("."+d.prefix+"-"+b+"-closer").click(function(){$("."+d.prefix+"-"+b+"-el").fadeTo(c.speed,0,function(){$(this).remove()})}),!1});break;case"scroll":e.click(function(){if(plugin.triggerEvent("clicked",e,c),""==$(this).attr("href"))var a=0;else var a=$(e.attr("href")).offset().top;return"yes"==c.dynamic&&(c.speed=Math.abs($(document).scrollTop()-a)/1e3*c.speed),$("html, body").animate({scrollTop:a+"px"},c.speed,c.easing,function(){plugin.triggerEvent("complete",e,c)}),!1});break;case"hide":e.jKit_effect(!1,c.animation,c.speed,c.easing,c.delay,function(){plugin.triggerEvent("complete",e,c)});break;case"remove":e.delay(c.delay).hide(0,function(){e.remove(),plugin.triggerEvent("complete",e,c)});break;case"show":e.hide().jKit_effect(!0,c.animation,c.speed,c.easing,c.delay,function(){plugin.triggerEvent("complete",e,c)});break;case"showandhide":e.hide().jKit_effect(!0,c.animation,c.speed,c.easing,c.delay,function(){plugin.triggerEvent("shown",e,c),e.jKit_effect(!1,c.animation,c.speed,c.easing,c.duration,function(){plugin.triggerEvent("complete",e,c)})});break;case"loop":plugin.loop(e.hide(),c);break;case"random":for(var H=e.children().size(),I=[];I.length<c.count;){var J=Math.floor(Math.random()*H);-1==$.inArray(J,I)&&I.push(J)}var K=0;e.children().each(function(){-1==$.inArray(K,I)?"yes"==c.remove?$(this).remove():$(this).hide():$(this).show(),K++});break;case"partially":var L=e.height();if(L>c.height){e.css("position","relative");var M=$("<div/>").addClass(d.prefix+"-morediv").appendTo(a).html(c.text).css({width:e.outerWidth()+"px",opacity:.9});plugin.addKeypressEvents(e,"down"),e.css({height:c.height+"px",overflow:"hidden"}).on("mouseenter down",function(){M.fadeTo(c.speed,0),e.animate({height:L+"px"},c.speed,c.easing,function(){plugin.triggerEvent("open",e,c)})}).on("mouseleave up",function(){M.fadeTo(c.speed,.9),e.animate({height:c.height+"px"},c.speed,c.easing,function(){plugin.triggerEvent("closed",e,c)})}),M.on("click",function(){e.animate({height:L+"px"},c.speed,c.easing,function(){plugin.triggerEvent("closed",e,c)})})}break;case"slideshow":var N=e.children();if("yes"==c.shuffle)for(var O,P,Q=N.length,K=0;Q>K;K++)P=Math.floor(Math.random()*Q),O=N[K],N[K]=N[P],N[P]=O;e.css({position:"relative"}),e.html(N[0]),$.data(e,"animating",!1),""!=c.on?("mouseover"==c.on&&e.on("mouseleave",function(){$.data(e,"anim",!1)}),e.on(c.on,function(){"click"==c.on?$.data(e,"anim")?$.data(e,"anim",!1):($.data(e,"anim",!0),window.setTimeout(function(){plugin.slideshow(N,0,e,c)},0)):"mouseover"==c.on&&($.data(e,"anim")||($.data(e,"anim",!0),window.setTimeout(function(){plugin.slideshow(N,0,e,c)},0)))})):($.data(e,"anim",!0),window.setTimeout(function(){plugin.slideshow(N,0,e,c)},c.interval));break;case"carousel":var R=0;e.children().each(function(){R++,R>c.limit&&$(this).hide()});var S=$("<a/>",{"class":d.prefix+"-"+b+"-prev"}).html(c.prevhtml).on("click left",function(){plugin.carousel(e,c,"prev")}).insertAfter(a),T=$("<a/>",{"class":d.prefix+"-"+b+"-next"}).html(c.nexthtml).on("click right",function(){plugin.carousel(e,c,"next")}).insertAfter(a);plugin.addKeypressEvents(S,"left"),plugin.addKeypressEvents(T,"right"),"yes"==c.autoplay&&window.setTimeout(function(){plugin.carousel(e,c)},c.interval);break;case"animation":if(""!=c.to)""!=c.from&&e.css(plugin.cssFromString(c.from)),setTimeout(function(){""!=c.on?e.on(c.on,function(){e.animate(plugin.cssFromString(c.to),c.speed,c.easing,function(){c.macro!=undefined&&plugin.applyMacro(e,c.macro),plugin.triggerEvent("complete",e,c)})}):e.animate(plugin.cssFromString(c.to),c.speed,c.easing,function(){c.macro!=undefined&&plugin.applyMacro($el,c.macro),plugin.triggerEvent("complete",e,c)})},c.delay);else{c.interval=1e3/c.fps;var U=[],r=0,V=0;e.children().each(function(){var a=$(this).attr("rel"),b=$(this).attr(d.dataAttribute);if(b!=undefined)var c=b.indexOf("["),e=b.indexOf("]"),f=b.substring(c+1,e);else var c=a.indexOf("["),e=a.indexOf("]"),f=a.substring(c+1,e);var g=plugin.parseOptions(f);g.el=$(this),g.easing==undefined&&(g.easing="linear"),g.start=r,r+=parseInt(g.steps),g.end=r,V=r,r++,U.push(g)}),c.lastframe=V,e.css("overflow","hidden"),e.html(U[0].el),window.setTimeout(function(){plugin.animation(U,-1,e,c)},0)}break;case"gallery":var W=e.children();e.html(e.children(":nth-child("+c.active+")").clone());var X=$("<div/>",{id:d.prefix+"-"+e.attr("id")+"-"+b+"-thumbs"}).addClass(d.prefix+"-"+b+"-thumbs").insertAfter(a);if("yes"==c.showcaptions)var Y=$("<div/>",{id:d.prefix+"-"+e.attr("id")+"-"+b+"-captions"}).addClass(d.prefix+"-"+b+"-captions").text($(W[c.active-1]).attr("title")).insertAfter(a);$.each(W,function(a,b){c.active-1==a&&$(b).addClass(d.activeClass),$(b).mouseover(function(){"mouseover"==c.event&&(plugin.triggerEvent("hideentry",e,c),e.jKit_effect(!1,c.animation,c.speed,c.easing,0,function(){e.find("img").attr("src",$(b).attr("src")),plugin.triggerEvent("showentry showentry"+(a+1),e,c),e.jKit_effect(!0,c.animation,c.speed,c.easing,0),X.find("img").removeClass(d.activeClass),$(b).addClass(d.activeClass),"yes"==c.showcaptions&&Y.text($(b).attr("title"))}))}).click(function(){"click"==c.event&&(plugin.triggerEvent("hideentry",e,c),e.jKit_effect(!1,c.animation,c.speed,c.easing,0,function(){e.find("img").attr("src",$(b).attr("src")),plugin.triggerEvent("showentry showentry"+(a+1),e,c),e.jKit_effect(!0,c.animation,c.speed,c.easing,0),X.find("img").removeClass(d.activeClass),$(b).addClass(d.activeClass),"yes"==c.showcaptions&&Y.text($(b).attr("title"))}))}).css({cursor:"pointer"}).appendTo(X)});break;case"tabs":var Z=[];e.children("div").each(function(){Z.push({title:$(this).children("h3").html(),content:$(this).children("div").detach()})}),e.html("");var _=$("<ul/>",{}).appendTo(a),ab=$;$.each(Z,function(a,b){var f=$("<li/>",{}).html(b.title).css("cursor","pointer").appendTo(_);c.active-1==a&&f.addClass(d.activeClass),f.on("click",function(){plugin.triggerEvent("showentry showentry"+(a+1),e,c),"fade"==c.animation?ab.fadeTo(c.speed,0,c.easing,function(){$(this).remove(),ab=Z[a].content.appendTo(e).hide().fadeTo(c.speed,1)}):"slide"==c.animation?ab.slideUp(c.speed,c.easing,function(){$(this).remove(),ab=Z[a].content.appendTo(e).hide().slideDown(c.speed)}):"grow"==c.animation?ab.hide(c.speed,c.easing,function(){$(this).remove(),ab=Z[a].content.appendTo(e).hide().show(c.speed)}):(ab.remove(),ab=Z[a].content.appendTo(e)),_.find("li").removeClass(d.activeClass),_.find("li:nth-child("+(a+1)+")").addClass(d.activeClass)})}),Z[c.active-1]!=undefined&&(ab=Z[c.active-1].content.appendTo(e));break;case"accordion":var Z=[];e.children("div").each(function(){Z.push({title:$(this).children("h3").detach(),content:$(this).children("div").detach()})}),e.html("");var _=$("<ul/>",{}).appendTo(a),ab=$,bb=1;0==c.active&&(bb=-1),$.each(Z,function(a,b){var f=$("<li/>",{}).append(b.title).css("cursor","pointer").appendTo(_);c.active-1==a?(f.append(b.content).children("h3").addClass(d.activeClass),bb=a):f.append(b.content.hide()),f.find("> h3").on("click",function(){a!=bb?(plugin.triggerEvent("showentry showentry"+(a+1),e,c),_.find("> li > h3").removeClass(d.activeClass),$(this).addClass(d.activeClass),"slide"==c.animation?(_.find("> li:nth-child("+(bb+1)+") > div").slideUp(c.speed,c.easing),_.find("> li:nth-child("+(a+1)+") > div").slideDown(c.speed,c.easing)):(_.find("> li:nth-child("+(bb+1)+") > div").hide(),_.find("> li:nth-child("+(a+1)+") > div").show()),bb=a):(plugin.triggerEvent("hideentry hideentry"+(a+1),e,c),$(this).removeClass(d.activeClass).next().slideUp(c.speed,c.easing),bb=-1)})});break;case"parallax":var cb=c.strength/10;if("global"==c.scope)var db=$(document);else var db=e;db.mousemove(function(a){if((windowhasfocus||!windowhasfocus&&d.ignoreFocus)&&(e.jKit_inViewport()||!e.jKit_inViewport()&&d.ignoreViewport)){var b=1;e.children().each(function(){var d=e.offset();if("x"==c.axis||"both"==c.axis){var f=-1*(a.pageX-d.left-e.width()/2)*cb*b-$(this).width()/2+e.width()/2;$(this).css({left:f+"px"})}if("y"==c.axis||"both"==c.axis){var g=-1*(a.pageY-d.top-e.height()/2)*cb*b-$(this).height()/2+e.height()/2;$(this).css({top:g+"px"})}b++})}});break;case"menu":e.find("li").hover(function(){$(this).addClass("hover"),$("ul:first",this).css("visibility","visible")},function(){$(this).removeClass("hover"),$("ul:first",this).css("visibility","hidden")}).on("click",function(){$(this).addClass("hover"),$("ul:first",this).css("visibility","visible")});break;case"form":e.append('<input type="hidden" name="'+d.prefix+'-requireds" id="'+d.prefix+'-requireds">'),c.error!=undefined&&(c.formerror=c.error);var eb=[];e.on("submit",function(){var a=[];if($(this).find("span."+d.errorClass).remove(),$(this).find("*[rel^=jKit], *["+d.dataAttribute+"]").each(function(){var b=$(this).attr("rel"),c=$(this).attr(d.dataAttribute);if(c!=undefined)var e=c.indexOf("["),f=c.indexOf("]"),g=c.substring(e+1,f);else var e=b.indexOf("["),f=b.indexOf("]"),g=b.substring(e+1,f);var h=plugin.parseOptions(g);h.type;var j=!1,k=!1;if(h.required==undefined&&(h.required=!1),"true"==h.required&&(""==$(this).val()&&(j=!0,a.push({element:$(this),error:"required"})),k=!0,-1==$.inArray($(this).attr("name"),eb)&&eb.push($(this).attr("name"))),k||""!=$(this).val()||"group"==h.type){if("email"!=h.type||$.fn.jKit_emailCheck($(this).val())||(j=!0,a.push({element:$(this),error:"email"})),"url"!=h.type||$.fn.jKit_urlCheck($(this).val())||(j=!0,a.push({element:$(this),error:"url"})),"date"!=h.type||$.fn.jKit_dateCheck($(this).val())||(j=!0,a.push({element:$(this),error:"date"})),"date"==h.type&&new Date($(this).val()).getTime()<=new Date($(h.older).val()).getTime()&&(j=!0,a.push({element:$(this),error:"older"})),"date"==h.type&&new Date($(this).val()).getTime()>=new Date($(h.younger).val()).getTime()&&(j=!0,a.push({element:$(this),error:"younger"})),"time"!=h.type||$.fn.jKit_timeCheck($(this).val())||(j=!0,a.push({element:$(this),error:"time"})),"phone"!=h.type||$.fn.jKit_phoneCheck($(this).val())||(j=!0,a.push({element:$(this),error:"phone"})),"float"==h.type&&isNaN($(this).val())&&(j=!0,a.push({element:$(this),error:"float"})),"int"==h.type&&parseInt($(this).val())!=$(this).val()&&(j=!0,a.push({element:$(this),error:"int"})),("int"==h.type||"float"==h.type)&&h.min!=undefined&&$(this).val()<h.min&&"group"!=h.type&&(j=!0,a.push({element:$(this),error:"min"})),("int"==h.type||"float"==h.type)&&h.max!=undefined&&$(this).val()>h.max&&"group"!=h.type&&(j=!0,a.push({element:$(this),error:"max"})),("int"==h.type||"float"==h.type)&&h.bigger!=undefined&&$(this).val()>$(h.bigger).val()&&(j=!0,a.push({element:$(this),error:"bigger"})),("int"==h.type||"float"==h.type)&&h.smaller!=undefined&&$(this).val()<$(h.smaller).val()&&(j=!0,a.push({element:$(this),error:"smaller"})),"int"!=h.type&&"float"!=h.type&&h.min!=undefined&&$(this).val().length<h.min&&"group"!=h.type&&(j=!0,a.push({element:$(this),error:"minlength"})),"int"!=h.type&&"float"!=h.type&&h.max!=undefined&&$(this).val().length>h.max&&"group"!=h.type&&(j=!0,a.push({element:$(this),error:"maxlength"})),h.length!=undefined&&$(this).val().length!=h.length&&(j=!0,a.push({element:$(this),error:"length"})),"int"!=h.type&&"float"!=h.type&&h.longer!=undefined&&$(this).val().length>$(h.longer).val().length&&(j=!0,a.push({element:$(this),error:"longer"})),"int"!=h.type&&"float"!=h.type&&h.shorter!=undefined&&$(this).val().length<$(h.shorter).val().length&&(j=!0,a.push({element:$(this),error:"shorter"})),h.strength!=undefined&&$.fn.jKit_passwordStrength($(this).val())<h.strength&&(j=!0,a.push({element:$(this),error:"strength"})),h.same!=undefined&&$(this).val()!=$(h.same).val()&&(j=!0,a.push({element:$(this),error:"same"})),h.different!=undefined&&$(this).val()!=$(h.different).val()&&(j=!0,a.push({element:$(this),error:"different"})),"extension"==h.type){var l=h.options.split(d.delimiter),m=$(this).val().split("."),n=m[m.length-1];-1==$.inArray(n,l)&&(j=!0,a.push({element:$(this),error:"ext"}))}if("group"==h.type)if(h.min!=undefined||h.max!=undefined){var o=0;$(this).children("input[type=checkbox][checked]").each(function(){o++}),(h.min!=undefined&&h.min>o||h.max!=undefined&&o>h.max)&&(j=!0,a.push({element:$(this),error:"group"}))}else $(this).find("input[name='"+h.name+"']:checked").val()==undefined&&(j=!0,a.push({element:$(this),error:"group"}));if("custom"==h.type&&h.checkfunction!=undefined){var p=window[h.checkfunction];"function"==typeof p&&(p($(this).val())||(j=!0,a.push({element:$(this),error:"custom"})))}}j?(h.error!=undefined&&$(this).after('<span class="'+d.errorClass+'">'+h.error+"</span>"),$(this).addClass(d.errorClass)):$(this).removeClass(d.errorClass)}),0==a.length){if("yes"==c.validateonly)return plugin.triggerEvent("complete",e,c),!0;var b=$(this).attr("action");return e.removeClass(d.errorClass),c.success==undefined&&(c.success="Your form has been sent."),e.find("input#"+d.prefix+"-requireds").val(eb.join(d.delimiter)),$.post(b,e.serialize(),function(a){if(e.find("."+d.errorClass).hide(),a.sent!=undefined&&1==a.sent)"#"==c.success.charAt(0)?e.html($(c.success).show()):e.html('<p class="'+d.successClass+'">'+c.success+"</p>"),plugin.triggerEvent("complete",e,c),c.macro!=undefined&&plugin.applyMacro(e,c.macro);else{for(x in a.error){var g=a.error[x];e.find("*[name="+g+"]").addClass(d.errorClass).after('<span class="'+d.errorClass+'">'+c.error+"</span>")}plugin.triggerEvent("error",e,c)}}).error(function(a,b,c){alert(c),e.append('<span class="'+d.errorClass+'">There was an error submitting the form: Error Code '+a.status+"</span>")}),!1}return e.addClass(d.errorClass),c.formerror!=undefined&&e.append('<span class="'+d.errorClass+'">'+c.formerror+"</span>"),plugin.triggerEvent("error",e,c),!1});break;case"plugin":d.plugins[c.script]!=undefined&&(c.functioncall=d.plugins[c.script].fn,d.plugins[c.script].option!=undefined&&(c.option=d.plugins[c.script].option),c.script=d.plugins[c.script].path),$.ajaxSetup({cache:!0}),c.script!=undefined&&$.getScript(c.script,function(){c.option!=undefined?e[c.functioncall](c[c.option]):(delete c.type,delete c.script,e[c.functioncall](c)),plugin.triggerEvent("complete",e,c)}),$.ajaxSetup({cache:!1});break;case"tooltip":0==$("div#"+d.prefix+"-tooltip").length&&$("<div/>",{id:d.prefix+"-"+b}).hide().appendTo("body"),$tip=$("div#"+d.prefix+"-"+b),e.on("mouseenter",function(a){""!=c.classname?$tip.html(c.text).removeClass().css({background:"",color:""}).addClass(c.classname):$tip.html(c.text).removeClass().css({background:c.background,color:c.color}),$tip.css("top",a.pageY+15-$(window).scrollTop()).css("left",a.pageX).stop(!0,!0).fadeIn(200),plugin.triggerEvent("open",e,c)}).on("mouseleave click",function(){var b=200;$tip.is(":animated")&&(b=0),$tip.stop(!0,!0).fadeOut(b),plugin.triggerEvent("closed",e,c)});break;case"background":var fb=$("<div/>",{id:d.prefix+"-"+b}).css({position:"fixed",right:"0px",top:"0px",overflow:"hidden","z-index":"-1",width:$(window).width(),height:$(window).height()}).appendTo("body");fb.append(e);var gb=e.attr("width"),hb=e.attr("height");
plugin.scaleFit(fb,e,gb,hb,c.distort),$(window).resize(function(){plugin.scaleFit(fb,e,gb,hb,c.distort),plugin.triggerEvent("resized",e,c)});break;case"lorem":console.log(c);var ib=["Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.","Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.","Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.","Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.","At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.","Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."],h="";if("yes"==c.random&&(ib=$.fn.jKit_arrayShuffle(ib)),c.paragraphs>0)for(var K=1;c.paragraphs>=K;K++)h+="<p>"+ib[(K-1)%7]+"</p>";else if(c.length!=undefined&&""!=c.length)for(var K=1;h.length<c.length-1;)h+=ib[(K-1)%7]+" ",h=h.substring(0,c.length-1),K++;else h=ib[0];e.html(h);break;case"binding":window.setTimeout(function(){plugin.binding(e,c)},0);break;case"limit":if("children"==c.elements)e.children(":gt("+(c.count-1)+")").each(function(){$(this).jKit_effect(!1,c.animation,c.speed,c.easing)}),setTimeout(function(){plugin.triggerEvent("complete",e,c)},c.speed);else{var jb=e.text().substr(0,c.count);jb!=e.text()&&(jb=jb.substr(0,jb.length-c.endstring.length)+c.endstring,e.text(jb))}break;case"template":if("apply"==c.action){if($el=e,c.children!=undefined&&""!=c.children){$el=e.children(c.children);var R=0;$el.each(function(){R++,plugin.applyTemplate($(this),c,R,$el.length)})}else plugin.applyTemplate(e,c);"yes"==c.dynamic&&$("<a/>",{"class":d.prefix+"-"+b+"-add"}).html(c.addhtml).on("click",function(){$el=$(e.get(0));var a=$el.children(c.children).length+1;$el.find(".if-entry-last").hide(),plugin.applyTemplate($("<"+c.children+"/>").appendTo($el),c,a,a),plugin.triggerEvent("added",e,c)}).insertAfter(e)}else{if(templates[c.name]==undefined&&(templates[c.name]=[]),c.vars==undefined)var lb=[];else var lb=c.vars.split(d.delimiter);templates[c.name]={template:e.detach(),vars:lb}}}return e},plugin.filterElements=function(a,b){var c=[];a.find(".jkit-filter").each(function(){var a=[],b=$(this).val().split(" ");$.each(b,function(b,c){c=$.trim(c),""!=c&&a.push(c)}),c=c.concat(a)}),a.find(b.affected).each(function(){var a=$(this);if(c.length>0){var d=[];$.each(c,function(c,e){"class"==b.by?a.hasClass(e)&&d.push(e):"text"==b.by&&a.text().toLowerCase().indexOf(e.toLowerCase())>-1&&d.push(e)}),d.length==c.length||d.length>0&&"or"==b.logic?a.jKit_effect(!0,b.animation,b.speed,b.easing,0):a.jKit_effect(!1,b.animation,b.speed,b.easing,0)}else a.jKit_effect(!0,b.animation,b.speed,b.easing,0)}),setTimeout(function(){plugin.triggerEvent("complete",a,b)},b.speed)},plugin.readAPI=function($el,options){"json"==options.format&&$.ajax({type:"GET",url:options.url,contentType:"application/json; charset=utf-8",dataType:"jsonp",error:function(){plugin.triggerEvent("error",$el,options)},success:function(data){if(""!=options.template)$el.html(templates[options.template].template.clone().show()),$el.find("[data-jkit-api]").each(function(){var value=$(this).attr("data-jkit-api");try{$(this).text(eval("data."+value.replace(/[^a-zA-Z0-9\.\[\]\_]+/g,"")))}catch(err){}}),$el.find("[data-jkit-api-if]").each(function(){var value=$(this).attr("data-jkit-api-if"),test=undefined;try{eval("test = data."+value.replace(/[^a-zA-Z0-9\.\[\]\_]+/g,""))}catch(err){}test==undefined&&$(this).remove()});else if(""!=options.value)try{$el.text(eval("data."+options.value.replace(/[^a-zA-Z0-9\.\[\]\_]+/g,"")))}catch(err){}else $el.text(data);options.macro!=undefined&&plugin.applyMacro($el,options.macro),plugin.triggerEvent("complete",$el,options),options.interval>-1&&setTimeout(function(){plugin.readAPI($el,options)},1e3*options.interval)}})},plugin.triggerEvent=function(a,b,c){if(c.commandkey!==undefined){var d=a.split(" ");$.each(d,function(a,d){$element.trigger(c.commandkey+"."+d,{element:b,options:c})})}},plugin.cssFromString=function(a){var b=a.split(","),c={};return $.each(b,function(a,b){var d=b.split("(");if(2==d.length){var e=d[0],f=d[1].slice(0,-1);c[e]=f}}),c},plugin.preFix=function(a){var b=a.split("\n"),c=9999;return $.each(b,function(a,b){if(""!=$.trim(b)){for(var d=-1;" "==b.charAt(d+1);)d++;d++,c>d&&(c=d)}}),$.each(b,function(a,d){b[a]=d.substr(c)}),b.join("\n")},plugin.ticker=function(a,b,c,d,e){if((windowhasfocus||!windowhasfocus&&plugin.settings.ignoreFocus)&&(a.jKit_inViewport()||!a.jKit_inViewport()&&plugin.settings.ignoreViewport)){var f=b.speed;e++,e>c[d].text.length?(f=b.delay,d++,d>=c.length&&(d=0),setTimeout(function(){plugin.triggerEvent("showentry showentry"+(d+1),a,b)},f),e=0):c[d].href!=undefined?a.html('<a href="'+c[d].href+'" target="'+c[d].target+'">'+c[d].text.substr(0,e)+"</a>"):a.html(c[d].text.substr(0,e))}window.setTimeout(function(){plugin.ticker(a,b,c,d,e)},f)},plugin.loadAndReplace=function(a,b,c){var d=plugin.settings.prefix+"_ajax_temp_"+$.fn.jKit_getUnixtime();$(b.element).jKit_effect(!1,b.animation,b.speed,b.easing,0,function(){$(b.element).html(""),jQuery("<div/>",{id:d}).appendTo("body"),$("#"+d).load(a+" "+b.element,function(){plugin.triggerEvent("complete",c,b),$(b.element).html($("#"+d+" "+b.element).html()),$(b.element).jKit_effect(!0,b.animation,b.speed,b.easing),b.macro!=undefined&&plugin.applyMacro($(b.element),b.macro),$("#"+d).remove()})})},plugin.updateSrc=function(a){if((windowhasfocus||!windowhasfocus&&plugin.settings.ignoreFocus)&&(a.jKit_inViewport()||!a.jKit_inViewport()&&plugin.settings.ignoreViewport)){var c=a.attr("src").split("?");a.attr("src",c[0]+"?t="+$.fn.jKit_getUnixtime())}},plugin.applyTemplate=function(a,b,c,d){var e={};$.each(templates[b.name].vars,function(b,c){var d=a.find("."+c);plugin.init(d),e[c]=""!=d.val()?d.val():d.html()}),a.html(templates[b.name].template.clone().show()),a.find('[class^="if-entry-"]').hide(),plugin.renameDynamicAttributes(a,c),$.each(templates[b.name].vars,function(b,f){var g=a.find("."+f);g.is("input")||g.is("select")||g.is("textarea")?g.val(e[f]):g.html(e[f]),e[f]==undefined&&a.find(".if-"+f).length>0&&a.find(".if-"+f).remove(),1==c&&a.find(".if-entry-first").show(),c==d&&a.find(".if-entry-last").show(),a.find(".if-entry-nr-"+c).show()})},plugin.renameDynamicAttributes=function(a,b){a.find('[class^="dynamic-"]').each(function(){var a=$(this),c=$(this).attr("class").split(/\s+/);$.each(c,function(c,d){var e=d.substr(8);if(""!=e&&a.attr(e)){var f=a.attr(e),g=f.lastIndexOf("_");g>-1&&(f=f.substr(0,g)),a.attr(e,f+"_"+b)}})})},plugin.binding=function(el,options){if(windowhasfocus||!windowhasfocus&&plugin.settings.ignoreFocus){if(options.value==undefined){if(""!=options.selector){var selsplit=options.selector.split("|"),sourcesplit=options.source.split("."),values=[];if($.each(selsplit,function(a,b){"this"==b?b=el:"parent"==b&&(b=$(el).parent().get(0)),$(b).each(function(){switch(sourcesplit[0]){case"event":$(this).on(sourcesplit[1],function(){options.value=1,plugin.binding(el,options),options.macro!=undefined&&plugin.applyMacro($(el),options.macro)});break;case"html":var a=$(this).html();break;case"text":var a=$(this).text();break;case"attr":var a=$(this).attr(sourcesplit[1]);break;case"css":if("height"==sourcesplit[1])var a=$(this).height();else if("innerHeight"==sourcesplit[1])var a=$(this).innerHeight();else if("outerHeight"==sourcesplit[1])var a=$(this).outerHeight();else if("width"==sourcesplit[1])var a=$(this).width();else if("innerWidth"==sourcesplit[1])var a=$(this).innerWidth();else if("outerWidth"==sourcesplit[1])var a=$(this).outerWidth();else if("scrollTop"==sourcesplit[1])var a=$(this).scrollTop();else if("scrollLeft"==sourcesplit[1])var a=$(this).scrollLeft();else var a=$(this).css(sourcesplit[1]);break;case"scroll":switch(sourcesplit[1]){case"top":var a=$(window).scrollTop();break;case"left":var a=$(window).scrollLeft()}break;case"clearance":var b=el.offset().top-$(window).scrollTop(),c=$(window).scrollTop()+$(window).height()-(el.offset().top+el.height()),d=$(window).width()+$(window).scrollLeft()-(el.offset().left+el.width()),e=el.offset().left-$(window).scrollLeft();switch(sourcesplit[1]){case"bottom":var a=c;break;case"top":var a=b;break;case"right":var a=d;break;case"left":var a=e;break;default:var a=Math.min.apply(Math,[c,b,d,e])}break;case"has":switch(sourcesplit[1]){case"class":var a=$(this).hasClass(options.search);break;case"text":var a=$.fn.jKit_stringOccurrences($(this).text().toLowerCase(),options.search.toLowerCase());break;case"attribute":var a=$(this).attr(options.search)!==undefined;break;case"val":var a=$.fn.jKit_stringOccurrences($(this).val().toLowerCase(),options.search.toLowerCase());break;case"element":var a=$(this).find(options.search).length;break;case"children":var a=$(this).children(options.search).length}break;case"val":default:var a=$(this).val()}values.push(a)})}),sourcesplit[2]!=undefined){var value="";switch(sourcesplit[2]){case"max":value=Math.max.apply(Math,values);break;case"min":value=Math.min.apply(Math,values);break;case"sum":value=values.reduce(function(a,b){return a+b});break;case"avg":value=values.reduce(function(a,b){return a+b})/values.length}}else var value=values[0]}else if(""!=options.variable)var value=window[options.variable]}else value=options.value;if(""!=options.condition){var doit=!1;eval("if ("+options.condition.replace(/[^a-zA-Z 0-9\<\>\=\.\!]+/g,"")+") doit = true;")}else var doit=!0;if(doit||""==options["else"]?doit&&""!=options["if"]&&(doit=!0,value=options["if"]):(doit=!0,value=options["else"]),doit){""!=options.math&&eval("value = "+options.math.replace(/[^a-zA-Z 0-9\+\-\*\/\.]+/g,"")+";");var modesplit=options.mode.split(".");switch(modesplit[0]){case"text":el.text(value);break;case"html":el.html(value);break;case"val":el.val(value);break;case"attr":el.attr(modesplit[1],value);break;case"css":if("display"!=modesplit[1]||""!=$.trim(value)&&0!=$.trim(value)||(value="none"),options.speed>0){var style={};style[modesplit[1]]=value,el.animate(style,options.speed,options.easing)}else el.css(modesplit[1],value);break;default:if(modesplit[0]!=undefined){var fn=window[modesplit[0]];"function"==typeof fn&&fn(value,el)}}}}-1!=options.interval&&window.setTimeout(function(){plugin.binding(el,options)},options.interval)},plugin.fixSpeed=function(a){return"fast"!=a&&"slow"!=a&&(a=parseInt(a)),a},plugin.loop=function(a,b){(windowhasfocus||!windowhasfocus&&plugin.settings.ignoreFocus)&&(a.jKit_inViewport()||!a.jKit_inViewport&&plugin.settings.ignoreViewport)?(plugin.triggerEvent("show",a,b),a.jKit_effect(!0,b.animation,b.speed1,b.easing1,b.duration1,function(){plugin.triggerEvent("hide",a,b),a.jKit_effect(!1,b.animation,b.speed2,b.easing2,b.duration2,plugin.loop(a,b))})):window.setTimeout(function(){plugin.loop(a,b)},100)},plugin.scaleFit=function(a,b,c,d,e){var f=$(window).width(),g=$(window).height();a.css({width:f+"px",height:g+"px"});var h=0,i=0;if("no"==e){var j=c/d,k=f/g;j>k?(f=g*j,i=-1*((f-$(window).width())/2)):(g=f/j,h=-1*((g-$(window).height())/2))}b.css({position:"fixed",top:h+"px",left:i+"px",width:f+"px",height:g+"px"})},plugin.carousel=function(a,b,c){if(c!=undefined&&(b.autoplay=!1),(windowhasfocus||!windowhasfocus&&plugin.settings.ignoreFocus)&&(a.jKit_inViewport()||!a.jKit_inViewport()&&plugin.settings.ignoreViewport)){var d=!1;if(a.children().each(function(){$(this).is(":animated")&&(d=!0)}),!d){var e=Math.min(b.limit,a.children().length);"next"==c||c==undefined?(plugin.triggerEvent("shownext",a,b),a.children(":first-child").jKit_effect(!1,b.animation,b.speed,b.easing,0,function(){a.append(a.children(":nth-child(1)")),a.children(":nth-child("+e+")").jKit_effect(!0,b.animation,b.speed,b.easing,0)})):"prev"==c&&(plugin.triggerEvent("showprev",a,b),a.children(":nth-child("+e+")").jKit_effect(!1,b.animation,b.speed,b.easing,0,function(){a.prepend(a.children(":last-child")),a.children(":first-child").jKit_effect(!0,b.animation,b.speed,b.easing,0)}))}"yes"==b.autoplay&&window.setTimeout(function(){plugin.carousel(a,b)},b.interval)}else window.setTimeout(function(){plugin.carousel(a,b)},b.interval)},plugin.slideshow=function(a,b,c,d){$.data(c,"anim")&&((windowhasfocus||!windowhasfocus&&plugin.settings.ignoreFocus)&&(c.jKit_inViewport()||!c.jKit_inViewport()&&plugin.settings.ignoreViewport)?(a.length-1>b?b++:b=0,plugin.triggerEvent("hideentry hideentry"+(b+1),c,d),c.jKit_effect(!1,d.animation,d.speed,d.easing,0,function(){c.html(a[b]),plugin.triggerEvent("showentry showentry"+(b+1),c,d),c.jKit_effect(!0,d.animation,d.speed,d.easing,0,function(){window.setTimeout(function(){plugin.slideshow(a,b,c,d)},d.interval)})})):window.setTimeout(function(){plugin.slideshow(a,b,c,d)},d.interval))},plugin.animation=function(a,b,c,d){if((windowhasfocus||!windowhasfocus&&plugin.settings.ignoreFocus)&&(c.jKit_inViewport()||!c.jKit_inViewport()&&plugin.settings.ignoreViewport)){plugin.triggerEvent("showframe showframe"+(b+1),c,d),$.each(a,function(e,f){if(f.start==b){c.html(f.el.clone());var g=(f.end-f.start)*d.interval;if("fadeout"==f.action)c.children(":first").show().fadeTo(g,0,f.easing);else if("fadein"==f.action)c.children(":first").hide().fadeTo(g,1,f.easing);else if("fadeinout"==f.action)c.children(":first").hide().fadeTo(g/2,1,f.easing).fadeTo(g/2,0,f.easing);else if("tween"==f.action){var h=a[e+1].el;c.children(":first").animate({"font-size":h.css("font-size"),"letter-spacing":h.css("letter-spacing"),color:h.css("color"),opacity:h.css("opacity"),"background-color":h.css("background-color"),"padding-top":h.css("padding-top"),"padding-bottom":h.css("padding-bottom"),"padding-left":h.css("padding-left"),"padding-right":h.css("padding-right")},g,f.easing)}}}),b++;var e=!1;b>d.lastframe&&(b=0,e=!0),(e&&"yes"==d.loop||!e)&&window.setTimeout(function(){plugin.animation(a,b,c,d)},d.interval),"no"==d.loop&&(d.macro!=undefined&&plugin.applyMacro(c,d.macro),plugin.triggerEvent("complete",c,d))}else window.setTimeout(function(){plugin.animation(a,b,c,d)},d.interval)},plugin.closeLightbox=function(){$("."+plugin.settings.prefix+"-lightbox-el").fadeTo("fast",0,function(){$(this).remove()})},plugin.addKeypressEvents=function(a,b){plugin.settings.keyNavigation&&$(document).keydown(function(c){if(this===c.target||!/textarea|select/i.test(c.target.nodeName)&&"text"!==c.target.type){for(var d={8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},e=48;90>=e;e++)d[e]=String.fromCharCode(e).toLowerCase();if($.inArray(c.which,d)){var f="";c.altKey&&(f+="alt+"),c.ctrlKey&&(f+="ctrl+"),c.metaKey&&(f+="meta+"),c.shiftKey&&(f+="shift+");var g=f+d[c.which];g==b&&(a.trigger(f+d[c.which]),c.preventDefault())}}})},plugin.init()},$.fn.jKit_effect=function(a,b,c,d,e,f){return this.each(function(){f==undefined&&(f=function(){}),e==undefined&&(e=0),"fade"==b?a?$(this).delay(e).fadeTo(c,1,d,f):$(this).delay(e).fadeTo(c,0,d,f):"slide"==b?a?$(this).delay(e).slideDown(c,d,f):$(this).delay(e).slideUp(c,d,f):"none"==b?(a?$(this).delay(e).show():$(this).delay(e).hide(),f()):a?$(this).delay(e).show(c,d,f):$(this).delay(e).hide(c,d,f)})},$.fn.jKit_getUnixtime=function(){var a=new Date,b=a.getTime();return parseInt(b/1e3)},$.fn.jKit_arrayShuffle=function(a){for(var b,c,d=0;a.length>d;d++)c=Math.floor(Math.random()*a.length),b=a[d],a[d]=a[c],a[c]=b;return a},$.fn.jKit_stringOccurrences=function(a,b){for(var c=0,d=0;;){if(d=a.indexOf(b,d),-1==d)break;c++,d+=b.length}return c},$.fn.jKit_emailCheck=function(a){var b=/^[a-z0-9\._-]+@([a-z0-9_-]+\.)+[a-z]{2,6}$/i;return b.test(a)},$.fn.jKit_urlCheck=function(a){var b=/^(?:(ftp|http|https):\/\/)?(?:[\w\-]+\.)+[a-z]{2,6}$/i;return b.test(a)},$.fn.jKit_dateCheck=function(a){var b=/^[0-9]{2}\.[0-9]{2}\.[0-9]{2}$/i;return b.test(a)},$.fn.jKit_timeCheck=function(a){var b=/^[0-9]{1,2}\:[0-9]{2}$/i;return b.test(a)},$.fn.jKit_phoneCheck=function(a){var b=/^(\+|0)[\d ]+(-\d*)?\d$/;return b.test(a)},$.fn.jKit_passwordStrength=function(a){var b=0;return 5>a.length?b+=5:a.length>4&&8>a.length?b+=15:a.length>=8&&(b+=30),a.match(/[a-z]/)&&(b+=5),a.match(/[A-Z]/)&&(b+=10),a.match(/\d+/)&&(b+=10),a.match(/(.*[0-9].*[0-9].*[0-9])/)&&(b+=10),a.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)&&(b+=10),a.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)&&(b+=10),a.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(b+=5),a.match(/([a-zA-Z])/)&&a.match(/([0-9])/)&&(b+=5),a.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)&&(b+=5),b},$.fn.jKit_getAttributes=function(){return this.each(function(){for(var a={},b=$(this)[0].attributes,c=b.length,d=0;c>d;d++)a[b[d].name.toLowerCase()]=b[d].value;return a})},$.fn.jKit_setAttributes=function(a){return this.each(function(){$.each(a,function(a,b){try{$(this).attr(a+"",b+"")}catch(c){}})})},$.fn.jKit_iOS=function(){return navigator.userAgent.match(/(iPod|iPhone|iPad)/i)},$.fn.jKit_belowTheFold=function(){var a=$(window).height()+$(window).scrollTop();return $(this).offset().top>=a},$.fn.jKit_aboveTheTop=function(){var a=$(window).scrollTop();return a>=$(this).offset().top+$(this).height()},$.fn.jKit_rightOfScreen=function(){var a=$(window).width()+$(window).scrollLeft();return $(this).offset().left>=a},$.fn.jKit_leftOfScreen=function(){var a=$(window).scrollLeft();return a>=$(this).offset().left+$(this).width()},$.fn.jKit_inViewport=function(){return!($(this).jKit_belowTheFold()||$(this).jKit_aboveTheTop()||$(this).jKit_rightOfScreen()||$(this).jKit_leftOfScreen())},$.fn.jKit=function(a,b){return this.each(function(){var c=new $.jKit(this,a,b);$(this).data("jKit",c)})}})(jQuery);