// 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:"<",nexthtml:">"},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+='
  • '+$(this).text()+"
  • "}else f+="
  • "+$(this).text()+"
  • "}),""!=f&&e.html("");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=$("
    ",{"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.searchb.search?1:0}));var f=e.parent().parent().parent().find("tbody");f.html("");var g="";$.each(a,function(a,b){g+=""+b.content+""}),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=$("
    ");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]);$("")[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,">"));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=$("
    ",{id:A,"class":d.prefix+"-"+b}),F=0,G=0;$.each(B,function(a,f){F++;var g=$("
    ",{"class":d.prefix+"-"+b+"-step"}).html("").appendTo(E);$.each(D,function(e){if(D[e].data[a]>0){var h=$("
    ",{"class":d.prefix+"-"+b+"-plot "+d.prefix+"-"+b+"-plot"+e}).appendTo(g);$("
    ").text(D[e].label).delay(G).animate({width:100*(D[e].data[a]/C)+"%"},c.speed,c.easing).appendTo(h),$("",{"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&&$("
    ",{id:d.prefix+"-"+b+"-bg","class":d.prefix+"-"+b+"-closer "+d.prefix+"-"+b+"-el"}).fadeTo(c.speed,c.opacity).appendTo("body");var g=$("
    ",{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=$("
    ",{id:d.prefix+"-"+b+"-nav","class":d.prefix+"-"+b+"-el"}).hide().fadeTo(c.speed,1).appendTo("body");$("",{"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=$("",{id:d.prefix+"-"+b+"-nav-next"}).prependTo(h),l=$("",{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=$("
    ",{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('').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.lengthc.height){e.css("position","relative");var M=$("
    ").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=$("",{"class":d.prefix+"-"+b+"-prev"}).html(c.prevhtml).on("click left",function(){plugin.carousel(e,c,"prev")}).insertAfter(a),T=$("",{"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=$("
    ",{id:d.prefix+"-"+e.attr("id")+"-"+b+"-thumbs"}).addClass(d.prefix+"-"+b+"-thumbs").insertAfter(a);if("yes"==c.showcaptions)var Y=$("
    ",{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 _=$("