AJS.toInit(function(A){if(A(".k15t-testimonials")&&A(".k15t-testimonials").length>0){A(".k15t-testimonials").cycle()
}A(".k15t-partner").click(function(B){window.location.href=A(B.target).find("a").attr("href")
});
if(A(".k15t-teaser-stage")&&A(".k15t-teaser-stage").length>1){A(".k15t-teaser-stage").cycle({timeout:5000,prev:".k15t-teaser-navi-left",next:".k15t-teaser-navi-right",pager:".k15t-teaser-pager ul",pause:true,fx:"scrollHorz",pagerAnchorBuilder:function(C,B){return'<li><a href="#">&bull;</a></li>'
},after:function(){A(".k15t-teaser-navi").css("visibility","visible")
},onPrevNextEvent:function(){A(".k15t-teaser-navi").css("visibility","hidden")
}});
A(".k15t-teaser").hover(function(){A(".k15t-teaser-navi").toggleClass("over")
})
}A("#k15tsoftware-tweets").tweet({username:"k15tsoftware",join_text:"",avatar_size:null,count:3,loading_text:"Loading tweets..."});
A(".k15t-navigation > div > div > ul > li > a:contains(SERVICES)").parent().find("> ul").width(320);
A(".k15t-navigation > div > div > ul > li > a:contains(ABOUT US)").parent().find("> ul").width(320);
A(".k15t-navigation > div > div > ul > li > a:contains(BLOG)").parent().find("> ul").width(320);
A(".k15t-navigation > div > div > ul > li > a").parent().mouseover(function(B){A(this).addClass("active").find("ul").show()
}).mouseout(function(B){A(this).removeClass("active").find("ul").hide()
});
A(".k15t-sub-navigation a[href="+window.location.pathname+"]").addClass("active");
A(".k15t-footer > div > div > ul > li:last-child").addClass("last");
A(".k15t-footer li a:contains(Twitter)").parent().addClass("k15t-twitter");
A(".k15t-footer li a:contains(RSS)").parent().addClass("k15t-rss");
A(".blog-post-listing:not(:last-child) .wiki-content br.clear").after("<hr/>");
A(".k15t-product-box-buy .show-pricing-table").click(function(B){var C=A(this).parents(".k15t-product-box-buy");
var D=A(this).addClass("toggled").parents(".k15t-product-box-buy").next(".k15t-pricing-table-panel");
if(D.is(":hidden")){D.show("blind",{direction:"vertical"},630);
C.find(".show-pricing-table").addClass("toggled")
}else{D.hide("blind",{direction:"vertical"},630);
A(".k15t-product-box-buy .show-pricing-table").removeClass("toggled")
}return false
});
A("#k15t-newsletter-subscribe-form input.email").focus(function(){A(this).css({color:"#58585A","font-style":"normal"});
if(A(this).val()==="Email"){A(this).select()
}});
A("#k15t-newsletter-subscribe-form").submit(function(C){C.preventDefault();
var B=A(this);
A.ajax({type:A(this).attr("method"),url:A(this).attr("action"),contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:A(this).serialize(),beforeSend:function(E,D){B.find("input[type=text]").attr("disabled","disabled")
},complete:function(G,H){var F=G.responseText;
if(H==="success"&&G.status==200){B.parent().html("Thank you for subscribing! :-)")
}else{if(H==="error"&&G.status==400){var D=jQuery.parseJSON(F);
if(D&&D.fieldErrors.email){var E=B.find("#newsletter-email");
E.removeAttr("disabled").css({color:"#F00","font-style":"italic"}).val(E.val()||"Email")
}else{B.parent().html("Sorry, something went wrong!")
}}else{B.parent().html("Sorry, something went wrong!")
}}}})
});
A("form.k15t-ajax-form").submit(function(D){D.preventDefault();
var C=A(this);
var B=C.find("input.submit").attr("value");
A.ajax({type:A(this).attr("method"),url:A(this).attr("action"),contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:A(this).serialize(),beforeSend:function(F,E){console.log(C);
C.find(".k15t-form-feedback-error").hide();
C.find(".k15t-form-feedback-success").hide();
C.find(".k15t-form-feedback-waiting").show();
C.find(".error").hide();
if(!C.hasClass("k15t-adminform")){C.find(".k15t-form-panel").hide()
}A("html, body").scrollTop(0)
},complete:function(G,H){var F=G.responseText;
C.find("input.submit").attr("value",B).enable();
C.find(".k15t-form-feedback-waiting").hide();
if(H==="success"&&G.status==200){var E=jQuery.parseJSON(F);
C.find(".k15t-form-feedback-success").html(E.message).fadeIn()
}else{if(H==="error"&&G.status==400){var E=jQuery.parseJSON(F);
A.each(E.fieldErrors,function(J,L){var I=J.replace(".","\\.");
var K=L||A(C).find("#"+I).attr("title");
A(C.find("#"+I+"~ .error")).html(K).show()
});
C.find(".k15t-form-feedback-error").html(E.message).show();
C.find(".k15t-form-panel").show()
}else{C.find(".k15t-form-feedback-error").html("Ooops, there was an unexpected error with our server. Please try later, or, if the problem persists, notify <a href='mailto:admin@k15t.com?subject=Website%20Error%20with%20"+C.attr("action")+"'>admin@k15t.com</a>.").show();
C.find(".k15t-form-panel").show()
}}}})
});
A("#referrerAdditionalInfo").parent().hide();
A("#referrersource").change(function(){var C=A(this).val();
var B=A("#referrerAdditionalInfo").prev();
console.log(B);
if(C==="SEARCH_ENGINE"){B.html("What terms did you search for?");
B.parent().show()
}else{if(C==="WEBSITE"){B.html("Which website?");
B.parent().show()
}else{if(C==="BLOG"){B.html("Which blog or person?");
B.parent().show()
}else{if(C=="OTHER"){B.html("Where did you hear about us?");
B.parent().show()
}else{B.parent().hide()
}}}}})
});
