jQuery.fn.boxList=function(i){var g={};g.listAjaxUrl=null;g.params={};g.get=function(p,q){return null};g.set=function(p,q,r){};g.before=function(r,q,p){};g.after=function(r,q,p){};g.listRebuild=true;g.fadeSpeed=100;g.cookieEnabled=true;g.cookiePrefix="boxList_";g.cookieDays=7;g.cookieDomain="";g.cookiePath="/";var f={};f.getClassData=function(q,r,s){r=" "+r;s=s+" ";var u=" "+jQuery(q).attr("class")+" ";var t=u.indexOf(r);var p=u.indexOf(s,t+r.length);if(t===-1||p===-1){return""}return u.slice(t+r.length,p)};var d=jQuery(this);var n=null;var l={};var b=[];var e=[];var a=[];var h=null;var m=function(p){g=jQuery.extend(g,p);n=d.find(".list > ul");for(var v in g.params){var s=b.length;b[s]=v;e[s]=g.params[v];a[s]=null}for(var s=0;s<b.length;s++){for(var r=0;r<e[s].length;r++){d.find(".listFunctions ."+b[s]+" ."+e[s][r]).each(function(){jQuery(this).addClass("param_"+s+"_"+r);if(jQuery(this).hasClass("active")){a[s]=r}}).click(function(){if(jQuery(this).hasClass("active")){return true}var x=a.slice();var w=f.getClassData(this,"param_","").split("_");x[parseInt(w[0])]=parseInt(w[1]);c(x);return false})}h=n.find("li").eq(0).clone()}var u={};for(var s=0;s<b.length;s++){u[b[s]]=e[s][a[s]]}var t=[];n.children("li").each(function(w){t[w]=g.get(n.children("li").eq(w),u)});var q=o(a);if(q!==null){l[q]=u;l[q].list=t}if(g.cookieEnabled){var q=jQuery.cookie(g.cookiePrefix+"slug");if(q!==null){c(k(q))}}m=function(){}};var o=function(r){var p="i";for(var q=0;q<r.length;q++){if(r[q]===null){return null}p+="_"+r[q]}return p};var k=function(p){var r=p.substring(2,p.length).split("_");for(var q=0;q<r.length;q++){r[q]=parseInt(r[q])}return r};var c=function(q){n.queue(function(){var s={};for(var r=0;r<b.length;r++){s[b[r]]=e[r][a[r]]}g.before(s);n.dequeue()});var p=o(q);if(typeof(l[p])==="undefined"){j(q)}n.fadeOut(g.fadeSpeed);n.queue(function(){var u={};for(var t=0;t<b.length;t++){u[b[t]]=e[t][a[t]]}if(typeof(l[p])!=="undefined"){if(g.listRebuild){n.children("li").remove();for(var t=0;t<l[p].list.length;t++){var r=h.clone();r.appendTo(n).removeClass("i1").addClass("i"+(t+1)+(t+1===l[p].list.length?" ilast":""))}}n.children("li").each(function(v){if(typeof(l[p].list[v])!=="undefined"){jQuery(this).show();g.set(n.children("li").eq(v),l[p].list[v],u)}else{jQuery(this).hide()}})}a=q;for(var t=0;t<b.length;t++){u[b[t]]=e[t][a[t]];for(var s=0;s<e[t].length;s++){d.find(".listFunctions ."+b[t]+" ."+e[t][s]).removeClass("active").each(function(){if(s===a[t]){jQuery(this).addClass("active")}})}}g.after(u);n.dequeue()});n.fadeIn(g.fadeSpeed)};var j=function(p){n.queue(function(){var q=g.listAjaxUrl;var s={};for(var r=0;r<b.length;r++){q=q.replace("{"+b[r]+"}",e[r][p[r]]);s[b[r]]=e[r][p[r]]}jQuery.ajax({type:"GET",url:q,data:s,dataType:"json",success:function(x,y){var w=[];for(var v=0;v<b.length;v++){for(var u=0;u<e[v].length;u++){if(e[v][u]==x[b[v]]){w[v]=u}if(e[v][u]===x[b[v]]){w[v]=u}}}var t=o(w);l[t]=x;if(g.cookieEnabled){jQuery.cookie(g.cookiePrefix+"slug",t,{expires:g.cookieDays,domain:g.cookieDomain,path:g.cookiePath})}n.dequeue()},error:function(t,v,u){n.dequeue()}})})};jQuery(document).ready(function(){m(i)})};