/*
 MIT License - {@link http://opensource.org/licenses/mit-license.php}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
*/
Array.prototype.remove=function(a,b){var c=this.slice((b||a)+1||this.length);this.length=a<0?this.length+a:a;return this.push.apply(this,c)};Array.prototype.get=function(a,b){if(a==="first")a=0;else if(a==="last")a=this.length-1;else if(a==="prev")a=this.index-1;else if(a==="next")a=this.index+1;else if(!a&&a!==0)a=this.index;b&&this.setIndex(a);return this.exists(a)?this[a]:undefined};Array.prototype.each=function(a){for(var b=0;b<this.length;++b)if(a(b,this[b],this)===false)break;return this};
Array.prototype.validIndex=function(a){return a>=0&&a<this.length};Array.prototype.setIndex=function(a){this.index=this.validIndex(a)?a:null;return this};Array.prototype.current=function(a){return this.get(a,true)};Array.prototype.isEmpty=function(){return this.length===0};Array.prototype.isSingle=function(){return this.length===1};Array.prototype.isNotEmpty=function(){return this.length!==0};Array.prototype.isNotEmpty=function(){return this.length>1};
Array.prototype.isLast=function(a){a=typeof a==="undefined"?this.index:a;return!this.isEmpty()&&a===this.length-1};Array.prototype.isFirst=function(a){a=typeof a==="undefined"?this.index:a;return!this.isEmpty()&&a===0};Array.prototype.clear=function(){this.length=0};Array.prototype.next=function(a){return this.get(this.index+1,a)};Array.prototype.prev=function(a){return this.get(this.index-1,a)};Array.prototype.reset=function(){this.index=null;return this};
Array.prototype.set=function(a,b){if(a<this.length&&a>=0)this[a]=b;else throw Error("Array.prototype.set: [index] above this.length");return this};Array.prototype.loop=function(){if(!this.index&&this.index!==0)return this.current(0);return this.next()};Array.prototype.add=function(){this.push.apply(this,arguments);return this};
Array.prototype.insert=function(a,b){if(typeof a!=="number")a=this.length;a=a<=this.length?a:this.length;var c=this.slice(a);this.length=a;this.push(b);this.push.apply(this,c);return this};Array.prototype.exists=Array.prototype.exists||function(a){return typeof this[a]!=="undefined"};Array.prototype.has=Array.prototype.has||function(a){for(var b=false,c=0,d=this.length;c<d;++c)if(a==this[c]){b=true;break}return b};
if(typeof window.console!=="object"||typeof window.console.emulated==="undefined"){if(typeof window.console!=="object"||typeof window.console.log!=="function"){window.console={};window.console.log=window.console.debug=window.console.warn=window.console.trace=function(){};window.console.error=function(){alert("An error has occured. Please use another browser to obtain more detailed information.")}}else{if(typeof window.console.debug==="undefined")window.console.debug=function(){for(var a=["console.debug:"],
b=0;b<arguments.length;b++)a.push(arguments[b]);window.console.log.apply(window.console,a)};if(typeof window.console.warn==="undefined")window.console.warn=function(){for(var a=["console.warn:"],b=0;b<arguments.length;b++)a.push(arguments[b]);window.console.log.apply(window.console,a)};if(typeof window.console.error==="undefined")window.console.error=function(){for(var a=["console.error"],b=0;b<arguments.length;b++)a.push(arguments[b]);window.console.log.apply(window.console,a)};if(typeof window.console.trace===
"undefined")window.console.trace=function(){window.console.error.apply(window.console,["console.trace does not exist"])}}window.console.emulated=true}Date.prototype.setDatetimestr=Date.prototype.setDatetimestr||function(a){a=a.split(/[\-\s\:]/g);var b=a[3]||0,c=a[4]||0,d=a[5]||0;this.setUTCFullYear(a[0],a[1]-1,a[2]);this.setUTCHours(b);this.setUTCMinutes(c);this.setUTCSeconds(d);return this};
Date.prototype.setDatestr=Date.prototype.setDatestr||function(a){a=a.split(/[\-\s\:]/g);this.setUTCFullYear(a[0]||1978,(a[1]||0)-1,a[2]||1);return this};Date.prototype.setTimestr=Date.prototype.setTimestr||function(a){a=a.split(/[\-\s\:]/g);var b=a[1]||0,c=a[2]||0;this.setUTCHours(a[0]||0);this.setUTCMinutes(b);this.setUTCSeconds(c);return this};Date.prototype.getDatetimestr=Date.prototype.getDatetimestr||function(){return this.getDatestr()+" "+this.getTimestr()};
Date.prototype.getDatestr=Date.prototype.getDatestr||function(){var a=this,b=a.getUTCFullYear(),c=(this.getUTCMonth()+1).padLeft(0,2);a=this.getUTCDate().padLeft(0,2);return b+"-"+c+"-"+a};Date.prototype.getTimestr=Date.prototype.getTimestr||function(){var a=this.getUTCHours().padLeft(0,2),b=this.getUTCMinutes().padLeft(0,2),c=this.getUTCSeconds().padLeft(0,2);return a+":"+b+":"+c};
Date.prototype.getDatetime=String.prototype.getDatetime||function(){return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).zeroise(2)+"-"+this.getUTCDate().zeroise(2)+"T"+this.getUTCHours().zeroise(2)+":"+this.getUTCMinutes().zeroise(2)+":"+this.getUTCSeconds().zeroise(2)+"+00:00"};Number.prototype.zeroise=String.prototype.zeroise=String.prototype.zeroise||function(a){var b=this.toString();if(this<0)b=b.substr(1,b.length);for(;b.length<a;)b="0"+b;if(this<0)b="-"+b;return b};
Number.prototype.padLeft=String.prototype.padLeft=String.prototype.padLeft||function(a,b){var c=String(this),d=RegExp(".{"+b+"}$"),e="";if(!a&&a!==0)a=" ";do e+=a;while(e.length<b);return d.exec(e+c)[0]};Number.prototype.padRight=String.prototype.padRight=String.prototype.padRight||function(a,b){var c=String(this),d=RegExp("^.{"+b+"}"),e="";if(!a&&a!==0)a=" ";do e+=a;while(e.length<b);return d.exec(c+e)[0]};
Number.prototype.roundTo=String.prototype.roundTo=String.prototype.roundTo||function(){var a=String(parseInt(this,10));return a=parseInt(a.replace(/[1,2]$/,0).replace(/[3,4]$/,5),10)};String.prototype.trim=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.strip=String.prototype.strip||function(a,b){a=String(a);var c=this;if(a.length){b||0||(a=a.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g,"\\$1"));c=c.replace(eval("/^"+a+"+|"+a+"+$/g"),"")}return String(c)};
String.prototype.stripLeft=String.prototype.stripLeft||function(a,b){a=String(a);var c=this;if(a.length){b||0||(a=a.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g,"\\$1"));c=c.replace(eval("/^"+a+"+/g"),"")}return String(c)};String.prototype.stripRight=String.prototype.stripRight||function(a,b){a=String(a);var c=this;if(a.length){b||0||(a=a.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g,"\\$1"));c=c.replace(eval("/"+a+"+$/g"),"")}return String(c)};
String.prototype.toInt=String.prototype.toInt||function(){return parseInt(this,10)};String.prototype.wrap=String.prototype.wrap||function(a,b){return a+this+b};String.prototype.wrapSelection=String.prototype.wrapSelection||function(a,b,c,d){if(typeof c==="undefined"||c===null)c=this.length;if(typeof d==="undefined"||d===null)d=this.length;return this.substring(0,c)+a+this.substring(c,d)+b+this.substring(d)};
String.prototype.toSlug=String.prototype.toSlug||function(){return this.toLowerCase().replace(/[\s_]/g,"-").replace(/[^-a-z0-9]/g,"").replace(/--+/g,"-").replace(/^-+|-+$/g,"")};
String.prototype.queryStringToJSON=String.prototype.queryStringToJSON||function(){var a=String(this);a=a.substring(a.indexOf("?")+1);a=a.replace(/\+/g,"%20");if(a.substring(0,1)==="{"&&a.substring(a.length-1)==="}")return eval(decodeURIComponent(a));a=a.split(/\&(amp\;)?/);for(var b={},c=0,d=a.length;c<d;++c){var e=a[c]||null;if(e!==null){e=e.split("=");if(e!==null){var f=e[0]||null;if(f!==null)if(typeof e[1]!=="undefined"){e=e[1];f=decodeURIComponent(f);e=decodeURIComponent(e);try{e=eval(e)}catch(g){}var j=
f.split(".");if(j.length===1)b[f]=e;else{var k="",m="";$.each(j,function(o,h){k+='["'+h.replace(/"/g,'\\"')+'"]';jsonCLOSUREGLOBAL=b;m="if ( typeof jsonCLOSUREGLOBAL"+k+' === "undefined" ) jsonCLOSUREGLOBAL'+k+" = {}";eval(m);b=jsonCLOSUREGLOBAL;delete jsonCLOSUREGLOBAL});jsonCLOSUREGLOBAL=b;valueCLOSUREGLOBAL=e;m="jsonCLOSUREGLOBAL"+k+" = valueCLOSUREGLOBAL";eval(m);b=jsonCLOSUREGLOBAL;delete jsonCLOSUREGLOBAL;delete valueCLOSUREGLOBAL}}}}}return b};
(function(a){a.appendStylesheet=a.appendStylesheet||function(b,c){if(!(document.body||0)){setTimeout(function(){a.appendStylesheet.apply(a,[b,c])},500);return a}var d="stylesheet-"+b.replace(/[^a-zA-Z0-9]/g,""),e=a("#"+d);if(typeof c==="undefined")c=false;if(e.length===1)if(c)e.remove();else return a;e=document.getElementsByTagName(a.browser.safari?"head":"body")[0];var f=document.createElement("link");f.type="text/css";f.rel="stylesheet";f.media="screen";f.href=b;f.id=d;e.appendChild(f);return a};
a.appendScript=a.appendScript||function(b,c){if(!(document.body||0)){setTimeout(function(){a.appendScript.apply(a,[b,c])},500);return a}var d="script-"+b.replace(/[^a-zA-Z0-9]/g,""),e=a("#"+d);if(typeof c==="undefined")c=false;if(e.length===1)if(c)e.remove();else return a;e=document.getElementsByTagName(a.browser.safari?"head":"body")[0];var f=document.createElement("script");f.type="text/javascript";f.src=b;f.id=d;e.appendChild(f);return a}})(jQuery);
(function(a){a.fn.opacityFix=a.fn.opacityFix||function(){var b=a(this),c=b.css("background-color");if(c&&c!=="rgba(0, 0, 0, 0)")return this;for(var d=b;d.inDOM();){d=d.parent();if((c=d.css("background-color"))&&c!=="rgba(0, 0, 0, 0)"){b.css("background-color",c);break}}return this};a.fn.parentsAndSelf=a.fn.parentsAndSelf||function(b){return a(this).parents(b).andSelf().filter(b)};a.fn.findAndSelf=a.fn.findAndSelf||function(b){return a(this).find(b).andSelf().filter(b)};a.fn.firstInput=a.fn.firstInput||
function(){return a(this).findAndSelf(":input").filter(":first")};a.fn.choose=a.fn.choose||function(b){var c=a(this);if(typeof b==="undefined")b=c.val();else if(c.val()!==b)return this;switch(true){case this.is("option"):c.parents("select:first").choose(b);break;case c.is(":checkbox"):c.attr("checked",true);break;case c.is(":radio"):c.attr("checked",true);break;case c.is("select"):c.val(b);break;default:break}return this};a.fn.unchoose=a.fn.unchoose||function(){var b=a(this);switch(true){case b.is("option"):b.parents(":select:first").unchoose();
break;case b.is(":checkbox"):b.attr("checked",false);break;case b.is(":radio"):b.attr("checked",false);break;case b.is("select"):b.val(b.find("option:first").val());break;default:break}return this};a.fn.wouldSubmit=a.fn.wouldSubmit||function(){var b=a(this).findAndSelf(":input"),c=true;if(!b.length||!(b.attr("name")||0)||b.is(":radio,:checkbox")&&!b.is(":selected,:checked"))c=false;return c};a.fn.values=a.fn.values||function(){var b={};a(this).findAndSelf(":input").each(function(){var c=a(this),d=
c.attr("name")||null,e=c.val();if(!c.wouldSubmit())return true;if(d.indexOf("[]")!==-1){if(typeof b[d]==="undefined")b[d]=[];b[d].push(e)}else b[d]=e});return b};a.fn.submitForm=a.fn.submitForm||function(){var b=a(this);b.parentsAndSelf("form:first").trigger("submit");return b};a.fn.inDOM=a.fn.inDOM||function(){var b=a(this).parent().parent();return b.size()&&(b.height()||b.width())};a.fn.valWrap=a.fn.valWrap||function(b,c){var d=a(this);return d.val(d.val().wrap(b,c))};a.fn.valWrapSelection=a.fn.valWrapSelection||
function(b,c,d,e){var f=a(this),g=f.get(0);b=b||"";c=c||"";if(d||e)f.val(f.val().wrapSelection(b,c,d,e));else{d=g.selectionStart;e=g.selectionEnd;if(document.selection){g.focus();d=document.selection.createRange();d.text=b+d.text+c}else{var j=g.scrollTop;f.val(f.val().wrapSelection(b,c,d,e));g.focus();g.selectionStart=d+b.length;g.selectionEnd=e+b.length;g.scrollTop=j}}return f};a.fn.giveFocus=a.fn.giveFocus||function(){a(this).findAndSelf(":input:visible:first").focus();return this};a.fn.highlight=
a.fn.highlight||function(b){return a(this).effect("highlight",{},b||3E3)};a.fn.htmlAndSelf=a.fn.htmlAndSelf||function(){return a(this).attr("outerHTML")}})(jQuery);
(function(a){a.fn.binder=a.fn.binder||function(b,c,d){var e=a(this);if(d)e.bind(b,c,d);else{d=c;e.bind(b,d)}return e};a.fn.once=a.fn.once||function(b,c,d){var e=a(this);if(d){e.unbind(b,d);e.bind(b,c,d)}else{d=c;e.unbind(b,d);e.bind(b,d)}return e};a.fn.enter=a.fn.enter||function(b,c){return a(this).binder("enter",b,c)};a.event.special.enter=a.event.special.cancel||{setup:function(){a(this).bind("keypress",a.event.special.enter.handler)},teardown:function(){a(this).unbind("keypress",a.event.special.enter.handler)},
handler:function(b){a(this);if(b.keyCode===13){b.type="enter";a.event.handle.apply(this,[b]);return true}}};a.fn.cancel=a.fn.cancel||function(b,c){return a(this).binder("cancel",b,c)};a.event.special.cancel=a.event.special.cancel||{setup:function(){a(this).bind("keyup",a.event.special.cancel.handler)},teardown:function(){a(this).unbind("keyup",a.event.special.cancel.handler)},handler:function(b){a(this);var c=b.keyCode===27;if((typeof b.DOM_VK_ESCAPE==="undefined"?false:b.DOM_VK_ESCAPE)||c){b.type=
"cancel";a.event.handle.apply(this,[b]);return true}}};a.fn.lastclick=a.fn.lastclick||function(b,c){return a(this).binder("lastclick",b,c)};a.event.special.lastclick=a.event.special.lastclick||{setup:function(){a(this).bind("click",a.event.special.lastclick.handler)},teardown:function(){a(this).unbind("click",a.event.special.lastclick.handler)},handler:function(b){var c=function(){var d=a(this),e=d.data("lastclick-timeout")||false;e&&clearTimeout(e);e=false;d.data("lastclick-timeout",e)};(function(d){var e=
this;c.call(e);var f=a(e);f.data("lastclick-clicks",(f.data("lastclick-clicks")||0)+1);var g=setTimeout(function(){var j=f.data("lastclick-clicks");c.apply(e,[d]);f.data("lastclick-clicks",0);d.type="lastclick";a.event.handle.apply(e,[d,j])},500);f.data("lastclick-timeout",g)}).apply(this,[b])}};a.fn.firstclick=a.fn.firstclick||function(b,c){return a(this).binder("firstclick",b,c)};a.event.special.firstclick=a.event.special.firstclick||{setup:function(){a(this).bind("click",a.event.special.firstclick.handler)},
teardown:function(){a(this).unbind("click",a.event.special.firstclick.handler)},handler:function(b){var c=function(){var d=a(this),e=d.data("firstclick-timeout")||false;e&&clearTimeout(e);e=false;d.data("firstclick-timeout",e)};(function(d){var e=this;c.call(e);var f=a(e);f.data("firstclick-clicks",(f.data("firstclick-clicks")||0)+1);if(f.data("firstclick-clicks")===1){d.type="firstclick";a.event.handle.apply(e,[d])}var g=setTimeout(function(){c.apply(e,[d]);f.data("firstclick-clicks",0)},500);f.data("firstclick-timeout",
g)}).apply(this,[b])}};a.fn.singleclick=a.fn.singleclick||function(b,c){return a(this).binder("singleclick",b,c)};a.event.special.singleclick=a.event.special.singleclick||{setup:function(){a(this).bind("click",a.event.special.singleclick.handler)},teardown:function(){a(this).unbind("click",a.event.special.singleclick.handler)},handler:function(b){var c=function(){var d=a(this),e=d.data("singleclick-timeout")||false;e&&clearTimeout(e);e=false;d.data("singleclick-timeout",e)};(function(d){var e=this;
c.call(e);var f=a(e);f.data("singleclick-clicks",(f.data("singleclick-clicks")||0)+1);var g=setTimeout(function(){var j=f.data("singleclick-clicks");c.apply(e,[d]);f.data("singleclick-clicks",0);if(j===1){d.type="singleclick";a.event.handle.apply(e,[d])}},500);f.data("singleclick-timeout",g)}).apply(this,[b])}}})(jQuery);
(function(a){a.prepareObject=a.prepareObject||function(b,c){var d={};a.extend(d,b||{});a.intercept(true,d,c);var e=arguments;e[0]=e[1]="$.prepareObject.skipValue";a.each(e,function(f,g){if(g==="$.prepareObject.skipValue")return true;a.intercept(true,d,g)});return d};a.intercept=a.intercept||function(){var b=arguments,c,d=false,e=false;if(typeof b[0]==="boolean"){d=b[0];b[0]="$.intercept.skipValue";if(typeof b[1]==="boolean"){e=b[1];b[1]="$.intercept.skipValue";if(e)c={};else{c=b[2];b[2]="$.intercept.skipValue"}}else{c=
b[1];b[1]="$.intercept.skipValue"}}else{c=b[0];b[0]="$.intercept.skipValue"}var f={};a.each(c,function(g){f[g]=true});d?a.each(b,function(g,j){if(j==="$.intercept.skipValue")return true;a.each(j,function(k,m){if(typeof f[k]==="undefined")return true;if(typeof m==="object"&&!(m.test||0))a.extend(c[k],m||{});else c[k]=m})}):a.each(b,function(g,j){a.each(j,function(k,m){if(typeof f[k]==="undefined")return true;if(typeof m==="object"&&!(m.test||0))a.intercept(true,c[k],m);else c[k]=m})});return c}})(jQuery);
(function(a){String.prototype.passwordstrength=String.prototype.passwordstrength||function(b,c){var d=this.toString(),e=0;b=b||"";c=c||"";if(d.length<4)return"short";if(c.length&&d.toLowerCase()==c.toLowerCase())return"username";if(b.length&&d!=b)return"mismatch";if(d.match(/[0-9]/))e+=10;if(d.match(/[a-z]/))e+=26;if(d.match(/[A-Z]/))e+=26;if(d.match(/[^a-zA-Z0-9]/))e+=31;d=Math.log(Math.pow(e,d.length))/Math.LN2;if(d<40)return"low";else if(d<56)return"medium";return"high"};if(a.fn.passwordstrength)window.console.warn("$.fn.passwordstrength has already been defined...");
else a.fn.passwordstrength=function(b){var c=a.fn.passwordstrength;c.config=c.config||{content:'<div class="sparkle-passwordstrength-result"></div><div class="sparkle-passwordstrength-description"></div>',contentSelectors:{result:".sparkle-passwordstrength-result",description:".sparkle-passwordstrength-description"},strengthCss:{"short":"invalid",mismatch:"invalid",username:"invalid",low:"low",medium:"medium",high:"high",empty:""},il8n:{description:'Hint: The password should be have a strength of at least medium. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).',
empty:"Strength indicator",username:"Password should not match username",mismatch:"Confirm password does not match","short":"Password is too short",low:"Weak",medium:"Medium",high:"Strongest"}};var d=a.extend({},c.config);a.extend(true,d,b);b=a(this);var e=b.html(d.content).hide(),f=e.find(d.contentSelectors.result);c=e.find(d.contentSelectors.description).html(d.il8n.description);d.il8n.description||c.remove();var g=[d.strengthCss["short"],d.strengthCss.mismatch,d.strengthCss.username,d.strengthCss.low,
d.strengthCss.medium,d.strengthCss.high,d.strengthCss.empty].join(" "),j=a(d.password),k=a(d.confirm||null),m=a(d.username||null);c=function(){var o=j.val(),h=k.val(),i=m.val();h=o?o.passwordstrength(h,i):"empty";o=d.strengthCss[h];h=d.il8n[h];f.removeClass(g).addClass(o).html(h)};j.keyup(function(){var o=a(this);k.val("");o.val()!==""&&!e.data("shown")&&e.animate({height:"show",opacity:"show"},"slow").data("shown",true)});j.add(k).add(m).keyup(c);c();return b}})(jQuery);
(function(a){if(a.BalClass)window.console.warn("$.BalClass has already been defined...");else{a.BalClass=function(b,c){this.construct(b,c)};a.extend(a.BalClass.prototype,{config:{},construct:function(b,c){this.configure(b);a.extend(this,c||{});if(typeof this.built==="function")return this.built();return true},configure:function(b){this.config=this.config||{};this.config=a.extend({},this.config,b||{});return this},clone:function(b){var c=function(d,e){this.construct(d,e)};a.extend(c.prototype,this.prototype,
b||{});c.clone=c.prototype.clone;c.create=c.prototype.create;return c},create:function(b,c){return new this(b,c)},addConfig:function(b,c){if(typeof c==="undefined"){if(typeof b==="object")for(var d in b)this.applyConfig(d,b[d]);return false}else typeof c==="object"&&this.applyConfig(b,c);return this},applyConfig:function(b,c){this.config[b]=this.config[b]||{};a.extend(true,this.config[b],c||{});return this},setConfig:function(b,c){this.config[b]=c||{};return this},getConfig:function(b){if(typeof b!==
"string")return this.config;return this.getConfigWith(b)},getConfigWith:function(b,c){if(typeof b!=="string"){if(typeof c==="undefined")c=b;b="default"}if(typeof c!=="object")c={};var d={};a.extend(true,d,this.config[b]||{},c||{});return d},getConfigWithDefault:function(b,c){return this.getConfigWith("default",this.getConfigWith(b,c))},setDefaults:function(b){return this.applyConfig("default",b)}});a.BalClass.clone=a.BalClass.prototype.clone;a.BalClass.create=a.BalClass.prototype.create}})(jQuery);
(function(a){if(a.Bespin)window.console.warn("$.Bespin has already been defined...");else a.Bespin=a.BalClass.create({"default":{content:null,bespin:{settings:{tabstop:4}},toolbar:{fullscreen:true}},rich:{bespin:{syntax:"html"}},html:{bespin:{syntax:"html"}},plain:{toolbar:false}},{fn:function(b,c){var d=a.Bespin,e=d.getConfigWithDefault(b,c),f=this;a(window).bind("onBespinLoad",function(){d.useBespin(f,e)});var g={onBespinLoad:function(){a(window).trigger("onBespinLoad")}};if(bespin.bootLoaded)setTimeout(function(){g.onBespinLoad()},
500);else window.onBespinLoad=g.onBespinLoad;return this},useBespin:function(b,c){var d=a.Bespin,e=a(b),f,g;if(e.is("textarea")){g=e.attr("id")+"-bespin";f=a('<div id="'+g+'"/>').html(e.val()).css({height:e.css("height"),width:e.css("width")});f.insertAfter(e);e.hide()}else{f=e;g=f.attr("id")}bespin.useBespin(g,c.bespin).then(function(j){d.postBespin(g,j,c)},function(j){throw Error("Bespin Launch Failed: "+j);});return this},postBespin:function(b,c,d){var e=a("#"+b),f=e.siblings("textarea"),g=c.editor;
e.css("overflow","hidden");e.wrap('<div class="bespin-wrap" />');var j=e.parent();f.length&&f.parents("form:first").submit(function(){f.val(g.value)});if(d.content||d.content==="")g.value=d.content;if(d.toolbar){b=a('<div class="bespin-toolbar" />');b.insertBefore(e);if(d.toolbar.fullscreen){d=a('<span class="bespin-toolbar-fullscreen" title="Toggle Fullscreen"></span>');d.appendTo(b);d.click(function(){j.hasClass("bespin-fullscreen")?a("body").add(j).removeClass("bespin-fullscreen"):a("body").add(j).addClass("bespin-fullscreen");
c.dimensionsChanged()})}}return this},built:function(){var b=this;a.fn.Bespin=function(c,d){return b.fn.apply(this,[c,d])};return true}})})(jQuery);
(function(a){if(a.Help)window.console.warn("$.datetimepicker has already been defined...");else a.datetimepicker=a.BalClass.create({"default":{datepickerOptions:{},timepickerOptions:{}},"12hr":{timepickerOptions:{timeConvention:12}},"24hr":{timepickerOptions:{timeConvention:24}}},{fn:function(b,c){var d=a.datetimepicker.getConfigWithDefault(b,c);return a(this).each(function(){var e=a(this);e.hide();if(e.hasClass("sparkle-datetime-has"))return e;e.addClass("sparkle-datetime").addClass("sparkle-datetime-has");
var f=a('<input type="text" class="sparkle-date"/>'),g=a('<span class="sparkle-datetime-sep"> @ </span>'),j=a('<input type="text" class="sparkle-time"/>'),k=e.val(),m=new Date,o="",h="";if(k){m.setDatetimestr(k);o=m.getDatestr();h=m.getTimestr()}j.insertAfter(e);g.insertAfter(e);f.insertAfter(e);f.val(o);j.val(h);f.add(j).change(function(){var i=f.val()+" "+j.val();e.val(i).trigger("change")});f.datepicker(d.datepickerOptions);j.timepicker(d.timepickerOptions);return e})},built:function(){var b=this;
a.fn.datetimepicker=function(c,d){return b.fn.apply(this,[c,d])};return true}})})(jQuery);
(function(a){if(a.EventCalendar)window.console.warn("$.EventCalendar has already been defined...");else a.EventCalendar=a.BalClass.create({"default":{ajaxEntriesVariable:"entries",ajaxEntriesUrl:"",ajaxPostData:{},ajaxCache:true,calendarEntries:[],calendarClass:"hasEventCalendar",dayEventClass:"ui-state-active hasEvent",datepickerOptions:{},disableClick:true,domEvents:{}}},{fn:function(b,c){var d=a(this);if(d.length>1){d.each(function(){a(this).EventCalendar(b,c)});return this}var e=a.EventCalendar.getConfigWithDefault(b,
c),f={entriesById:{},entriesByYearMonth:{},cacheableByYearMonth:{},isCacheable:function(h,i){return this.cacheableByYearMonth[h+"-"+i]?true:false},setCacheable:function(h,i,l){if(typeof l==="undefined")this.cacheableByYearMonth[h+"-"+i]=l;return this},isYearMonthSet:function(h,i){return typeof this.entriesByYearMonth[h+"-"+i]!=="undefined"},isYearMonthEmpty:function(h,i){return!(typeof this.entriesByYearMonth[h+"-"+i]==="array"&&this.entriesByYearMonth[h+"-"+i].length!==0||typeof this.entriesByYearMonth[h+
"-"+i]==="object"&&!a.isEmptyObject(this.entriesByYearMonth[h+"-"+i]))},getEntriesByYearMonth:function(h,i){return this.entriesByYearMonth[h+"-"+i]||[]},getEntryById:function(h){return this.entriesById[h]||undefined},getDaysInMonth:function(h){return 32-(new Date(h.getFullYear(),h.getMonth(),32)).getDate()},getDate:function(h){var i;if(typeof h==="string")i=new Date(h);else if(typeof h==="number"){i=new Date;i.setTime(h)}else if(typeof h==="object"){i=new Date;i.setTime(h.getTime())}else throw Error("Unknown date format.");
if(isNaN(i)||i.toString()==="Invalid Date"){i=new Date;i.setDatetimestr(h)}return i},addEntries:function(h){var i=this;a.each(h,function(l,p){p.id=p.id||l;i.addEntry(p)});return true},addEntry:function(h){h.start=this.getDate(h.start);h.finish=this.getDate(h.finish);var i=this.getDate(h.start);i.setDate(1);i.setHours(0);i.setMinutes(0);i.setSeconds(0);i.setMilliseconds(0);var l=this.getDate(h.finish);l.setDate(2);l.setHours(0);l.setMinutes(0);l.setSeconds(0);for(l.setMilliseconds(0);i<l;){var p=i.getFullYear(),
n=i.getMonth()+1;if(typeof this.entriesByYearMonth[p+"-"+n]==="undefined")this.entriesByYearMonth[p+"-"+n]={};this.entriesByYearMonth[p+"-"+n][h.id]=h;if(n===11){i.setMonth(0);i.setYear(p+1)}else i.setMonth(n+1)}return this.entriesById[h.id]=h}};f.addEntries(e.calendarEntries);var g=function(h,i,l){var p=f.getEntriesByYearMonth(i,l);h=a(h).find("tbody td");var n=h.find("a");if(e.disableClick){h.unbind("click").removeAttr("onclick");n.removeAttr("href").css("cursor","default")}a.each(p,function(H,
r){var s=r.start.getMonth()+1,t=r.finish.getMonth()+1,u=r.start.getDate(),v=r.finish.getDate();u=s==l?n.filter(":contains("+u+"):first"):n.filter(":first");v=t==l?n.filter(":contains("+v+"):first"):n.filter(":last");s=s==l?n.index(u):0;t=t==l?n.index(v):n.length-1;var y=[];y=s==t?u:s==t-1?u.add(v):u.add(n.filter(":lt("+t+")").filter(":gt("+s+")")).add(v);y.addClass(e.dayEventClass).each(function(I,B){var w=a(B);w.text().trim();var q=w.data("dayEntriesIds");if(typeof q==="undefined")q=r.id;else{q=
String(q).split(/,/g);q.push(r.id);q=q.join(",")}w.data("dayEntriesIds",q);a.each(e.domEvents,function(z,C){w.unbind(z).bind(z,function(D){var x=a(this),E=x.text().trim();x=String(x.data("dayEntriesIds")).split(/,/g);var A=[];a.each(x,function(J,F){var G=f.getEntryById(F);A.push(G)});C.apply(this,[D,E,A,p]);return true})})})});return true},j=function(h,i,l){var p=l.dpDiv||l;if(typeof e.ajaxEntriesUrl==="string"&&e.ajaxEntriesUrl.length)if(e.ajaxCache&&f.isCacheable(h,i)&&!f.isYearMonthEmpty(h,i))setTimeout(function(){g(p,
h,i)},50);else{l=a.extend({},{year:h,month:i},e.ajaxPostData);a.ajax({url:e.ajaxEntriesUrl,method:"post",dataType:"json",data:l,success:function(n){n=n[e.ajaxEntriesVariable]||[];f.setCacheable(h,i,true);if(n.length===0)return true;f.addEntries(n);setTimeout(function(){g(p,h,i)},50);return true},error:function(){window.console.warn("$.EventCalendar.calendarChangeMonthYear.ajax.error:",[this,arguments])}})}else f.isYearMonthEmpty(h,i)||setTimeout(function(){g(p,h,i)},50);return true},k=false,m=function(h,
i,l){if(!k){k=true;a(l).addClass(e.calendarClass);j(h,i,l)}},o=a.extend({},e.datepickerOptions,{onChangeMonthYear:function(h,i,l){j(h,i,l);typeof e.datepickerOptions.onChangeMonthYear==="function"&&m(h,i,l)},beforeShow:function(h,i){datepickerShowed=true;typeof e.datepickerOptions.beforeShow==="function"&&e.datepickerOptions.beforeShow.apply(this,[h,i]);setTimeout(function(){m(i.drawYear,i.drawMonth+1,i)},1E3)}});d.datepicker(o);setTimeout(function(){var h=d.datepicker("getDate");m(h.getFullYear(),
h.getMonth()+1,d)},2E3);return d},built:function(){var b=this;a.fn.EventCalendar=function(c,d){return b.fn.apply(this,[c,d])};return true}})})(jQuery);
(function(a){if(a.Help)window.console.warn("$.Help has already been defined...");else a.Help=a.BalClass.create({"default":{wrap:'<span class="sparkle-help-wrap"/>',icon:'<span class="sparkle-help-icon"/>',text:'<span class="sparkle-help-text"/>',parentClass:"",title:""}},{fn:function(b){var c=a.Help;if(typeof b==="string")b={title:b};b=c.getConfigWithDefault("default",b);c=a(this);var d=a(b.wrap),e=a(b.icon),f=a(b.text);c.parent().addClass(b.parentClass);var g=c.contents();c.append(d.append(f).append(e));
g.appendTo(f);c.attr("title",b.title);return c},built:function(){var b=this;a.fn.help=function(c,d){return b.fn.apply(this,[c,d])};return true}})})(jQuery);
(function(a){if(a.timepicker)window.console.warn("$.timepicker has already been defined...");else a.timepicker=a.BalClass.create({"default":{timeConvention:24},"12hr":{timeConvention:12},"24hr":{timeConvention:24}},{fn:function(b,c){a.timepicker.getConfigWithDefault(b,c);return a(this).each(function(){var d=a(this);d.hide();if(d.hasClass("sparkle-time-has"))return d;d.addClass("sparkle-time").addClass("sparkle-time-has");for(var e=a('<select class="sparkle-time-hours" />'),f=12,g=1;g<=f;++g)e.append('<option value="'+
g+'">'+g.padLeft("0",2)+"</option>");var j=a('<select class="sparkle-time-minutes" />');for(f=0;f<=55;f+=5)j.append('<option value="'+f+'">'+f.padLeft("0",2)+"</option>");var k=a('<select class="sparkle-time-meridian" />');k.append("<option>am</option>");k.append("<option>pm</option>");g=d.val();var m=new Date;f="12";var o="0",h="am";if(g){m.setTimestr(g);f=m.getUTCHours();o=m.getUTCMinutes();if(f>12){f-=12;h="pm"}}k.insertAfter(d);j.insertAfter(d);e.insertAfter(d);if(f>12&&h=="pm")f-=12;e.val(f);
j.val(o.roundTo(5));k.val(h);f=function(){var i=parseInt(e.val(),10),l=j.val();if(k.val()=="pm")i+=12;if(i>=24)i=0;i=i.padLeft(0,2)+":"+l.padLeft(0,2)+":00";d.val(i).trigger("change")};e.add(j).add(k).change(f);d.parent("form:first").submit(f);return d})},built:function(){var b=this;a.fn.timepicker=function(c,d){return b.fn.apply(this,[c,d])};return true}})})(jQuery);
(function(a){if(a.Tinymce)window.console.warn("$.Tinymce has already been defined...");else a.Tinymce=a.BalClass.create({"default":{script_url:"/scripts/tiny_mce/tiny_mce.js",theme:"advanced",plugins:"autoresize,safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect,|,code,",
theme_advanced_buttons2:"cut,copy,paste,pastetext,pasteword,|,undo,redo,|,link,unlink,image,|,preview,|,forecolor,backcolor,|,bullist,numlist,|,outdent,indent,blockquote,|,fullscreen",theme_advanced_buttons3:"tablecontrols,|,hr,removeformat,visualaid,|,sub,sup",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_path:false,theme_advanced_resizing:false,width:"100%",template_replace_values:{}},rich:{},simple:{theme_advanced_buttons2:"",
theme_advanced_buttons3:""}},{fn:function(b,c){var d=a.Tinymce.getConfigWithDefault(b,c);return a(this).tinymce(d)},built:function(){var b=this;a.fn.Tinymce=function(c,d){return b.fn.apply(this,[c,d])};return true}})})(jQuery);
(function(a){a(document.body).addClass("js");if(a.Sparkle)window.console.warn("$.Sparkle has already been defined...");else{a.SparkleClass=a.BalClass.clone({addExtension:function(b,c){var d=a.Sparkle;if(b==="object")for(var e in b)d.addExtension(e,b[e]);else{e={config:{},extension:false};if(typeof c==="object"&&typeof c.config!=="undefined"){e.config=c.config;e.extension=c.extension}else e.extension=c;d.addConfig(b,e)}return true},cycleExtensions:function(){var b=a(this),c=a.Sparkle,d=c.getExtensions();
for(var e in d)c.triggerExtension.apply(b,[e]);return b},getExtensions:function(){a(this);return a.Sparkle.getConfig()},getExtension:function(b){a(this);return a.Sparkle.getConfigWithDefault(b)},getExtensionConfig:function(b){a(this);return a.Sparkle.getExtension(b).config||{}},applyExtensionConfig:function(b,c){a(this);a.Sparkle.applyConfig(b,{config:c});return this},triggerExtension:function(b){var c=a(this),d=a.Sparkle;b=d.getExtension(b);if(typeof b.extension!=="undefined")return b.extension.apply(c,
[d,b.config,b]);return false},fn:function(b){var c=a(this),d=a.Sparkle;b?d.triggerExtension.apply(c,[b]):d.cycleExtensions.apply(c,[]);return c},built:function(){var b=this;a.fn.sparkle=function(c){return b.fn.apply(this,[c])};a(function(){a(document.body).sparkle()});return true}});a.Sparkle=a.SparkleClass.create({date:{config:{selector:".sparkle-date",datepickerOptions:{},demo:'<input type="text" class="sparkle-date" />'},extension:function(b,c){var d=a(this).findAndSelf(c.selector);if(!d.length)return true;
if(typeof d.timepicker==="undefined"){window.console.warn("datepicker not loaded. Did you forget to include it?");return false}d.datepicker(c.datepickerOptions);return true}},time:{config:{selector:".sparkle-time",timepickerOptions:{},demo:'<input type="text" class="sparkle-time" />'},extension:function(b,c){var d=a(this).findAndSelf(c.selector);if(!d.length)return true;if(typeof d.timepicker==="undefined"){window.console.warn("timepicker not loaded. Did you forget to include it?");return false}d.timepicker(c.timepickerOptions);
return true}},datetime:{config:{selector:".sparkle-datetime",datepickerOptions:{},timepickerOptions:{},demo:'<input type="text" class="sparkle-datetime" />'},extension:function(b,c){var d=a(this).findAndSelf(c.selector);if(!d.length)return true;if(typeof d.datetimepicker==="undefined"){window.console.warn("datetimepicker not loaded. Did you forget to include it?");return false}d.datetimepicker({datepickerOptions:b.getExtensionConfig("date").datepickerOptions,timepickerOptions:b.getExtensionConfig("time").timepickerOptions});
return true}},"hide-if-empty":{config:{selector:".sparkle-hide-if-empty:empty",demo:'<div class="sparkle-hide-if-empty" style="border:1px solid black"></div>\n<div class="sparkle-hide-if-empty" style="border:1px solid black">Hello World</div>'},extension:function(b,c){var d=a(this).findAndSelf(c.selector);if(!d.length)return true;d.hide();return true}},hide:{config:{selector:".sparkle-hide",demo:'<div class="sparkle-hide">Something to Hide when Sparkle has Loaded</div>'},extension:function(b,c){var d=
a(this).findAndSelf(c.selector);if(!d.length)return true;d.removeClass(c.selector.replace(".","")).hide();return true}},show:{config:{selector:".sparkle-show",demo:'<div class="sparkle-show" style="display:none;">Something to Show when Sparkle has Loaded</div>'},extension:function(b,c){var d=a(this).findAndSelf(c.selector);if(!d.length)return true;d.removeClass(c.selector.replace(".","")).show();return true}},subtle:{config:{selector:".sparkle-subtle",css:{},inSpeed:200,inCss:{opacity:1},outSpeed:400,
outCss:{opacity:0.5},demo:'<div class="sparkle-subtle">This is some subtle text. (mouseover)</div>'},extension:function(b,c){var d=a(this).findAndSelf(c.selector);if(!d.length)return true;var e={};a.extend(e,c.outCss,c.css);d.css(e).opacityFix().hover(function(){a(this).stop(true,false).animate(c.inCss,c.inSpeed)},function(){a(this).stop(true,false).animate(c.outCss,c.outSpeed)});return true}},panelshower:{config:{selectorSwitch:".sparkle-panelshower-switch",selectorPanel:".sparkle-panelshower-panel",
inSpeed:200,outSpeed:200,demo:""},extension:function(b,c){var d=a(this),e=d.findAndSelf(c.selectorSwitch);d=d.findAndSelf(c.selectorPanel);if(!e.length&&!d.length)return true;e.once("click",{clickEvent:function(){var f=a(this),g=f.siblings(c.selectorPanel).filter(":first"),j=f.val();f.is(":checked,:selected")&&!(!j||j===0||j==="0"||j==="false"||j===false||j==="no"||j==="off")?g.fadeIn(c.inSpeed):g.fadeOut(c.outSpeed)}}.clickEvent);d.hide();return true}},autogrow:{config:{selector:"textarea.autogrow,textarea.autosize",
demo:'<textarea class="autogrow">This textarea will autogrow with your input. - Only if jQuery Autogrow has been loaded.</textarea>'},extension:function(b,c){var d=a(this).findAndSelf(c.selector);if(!d.length)return true;if(typeof a.fn.autogrow==="undefined"){window.console.warn("autogrow not loaded. Did you forget to include it?");return false}d.autogrow();return true}},gsfnwidget:{config:{selector:".gsfnwidget",demo:'<a class="gsfnwidget" href="#">This link will show a GetSatisfaction Widget onclick. - Only if GetSatisfaction has been loaded.</a>'},
extension:function(b,c){var d={clickEvent:function(f){if(typeof GSFN_feedback_widget==="undefined"){window.console.warn("GSFN not loaded. Did you forget to include it?");return true}GSFN_feedback_widget.show();f.preventDefault();return false}},e=a(this).findAndSelf(c.selector);if(!e.length)return true;e.once("click",d.clickEvent);return true}},hint:{config:{selector:".form-input-tip,.sparkle-hint,.sparkle-hint-has,:text[placeholder]",hasClass:"sparkle-hint-has",hintedClass:"sparkle-hint-hinted",demoText:"Simulates HTML5's <code>placeholder</code> attribute for non HTML5 browsers. Placeholder can be the <code>title</code> or <code>placeholder</code> attribute. Placeholder will not be sent with the form (unlike most other solutions). The <code>sparkle-hint</code> class is optional if you are using the <code>placeholder</code> attribute.",
demo:'<input type="text" class="sparkle-hint" placeholder="This is some hint text." title="This is a title." /><br/>\n<input type="text" class="sparkle-hint" title="This is some hint text." />'},extension:function(b,c){var d=a(this),e=d.findAndSelf(c.selector).addClass(c.hasClass);if(!e.length)return true;var f={focusEvent:function(){var g=a(this),j=g.attr("placeholder")||g.attr("title"),k=g.val();j===k&&g.val("").removeClass(c.hintedClass);return true},blurEvent:function(){var g=a(this),j=g.attr("placeholder")||
g.attr("title"),k=g.val();if(j===k||!k)g.val("").addClass(c.hintedClass).val(j);return true},submitEvent:function(){e.trigger("focus")}};if(typeof Modernizr!=="undefined"&&Modernizr.input.placeholder)e.each(function(){var g=a(this),j=g.attr("title");j&&!g.attr("placeholder")&&g.attr("placeholder",j)});else{e.each(function(){a(this).once("focus",f.focusEvent).once("blur",f.blurEvent).trigger("blur")});d.find("form").once("submit",f.submitEvent)}return d}},debug:{config:{selector:".sparkle-debug",hasClass:"sparkle-debug-has",
hintedClass:"sparkle-debug-hinted",showVar:"sparkle-debug-show",demo:""},extension:function(b,c){var d=a(this);b=a.Sparkle;var e=d.findAndSelf(c.selector);if(!e.length)return true;e.addClass(c.hasClass).find(".value:has(.var)").hide().siblings(".name,.type").addClass("link").once("singleclick",f.clickEvent).once("dblclick",f.dblclickEvent);var f={clickEvent:function(){var g=a(this),j=g.parent(),k=!j.data(c.showVar);j.data(c.showVar,k);g.siblings(".value").toggle(k)},dblclickEvent:function(){var g=
a(this).parent(),j=g.data(c.showVar);g.data(c.showVar,j);g.find(".value").toggle(j)}};return d}},submit:{config:{selector:".sparkle-submit",demoText:"Adding the <code>sparkle-submit</code> class to an element within a <code>form</code> will submit the form when that element is clicked."},extension:function(b,c){var d=a(this);b=a.Sparkle;var e=d.findAndSelf(c.selector);if(!e.length)return true;e.once("singleclick",{clickEvent:function(){a(this).submitForm();return true}}.clickEvent);return d}},submitswap:{config:{selector:".sparkle-submitswap",
demoText:"Adding the <code>sparkle-submitswap</code> class to a submit button, will swap it's value with it's title when it has been clicked. Making it possible for a submit value which isn't the submit button's text."},extension:function(b,c){var d=a(this);b=a.Sparkle;var e=d.findAndSelf(c.selector);if(!e.length)return true;e.once("singleclick",{clickEvent:function(){var f=a(this);f.val(f.data("sparkle-submitswap-value"));return true}}.clickEvent);e.each(function(){var f=a(this);f.data("sparkle-submitswap-value",
f.val());f.val(f.attr("title"));f.removeAttr("title")});return d}},"highlight-values":{config:{selector:".sparkle-highlight-values",innerSelector:"td,.column",empty:["",false,null,"false","null",0,"-"],emptyClass:"sparkle-highlight-values-empty",notemptyClass:"sparkle-highlight-values-notempty",demoText:'Adding the <code>sparkle-highlight-values</code> class to a table will highlight all <code>td</code> elements with non empty values. By adding <code>sparkle-highlight-values-notempty</code> or <code>sparkle-highlight-values-empty</code> to the corresponding <code>td</code> element - which can by styled by yourself. Benefit over css\'s <code>:empty</code> as 0, false, null and - are counted as empty values (not just "").'},
extension:function(b,c){var d=a(this);b=a.Sparkle;var e=d.findAndSelf(c.selector);if(!e.length)return true;e.findAndSelf(c.innerSelector).each(function(){var f=a(this),g=f.text().trim();c.empty.has(g)?f.addClass(c.emptyClass):f.addClass(c.notemptyClass)});return d}},demo:{config:{selector:".sparkle-demo",hasClass:"sparkle-debug-has",demoText:"Adding the <code>sparkle-demo</code> will display all these demo examples used on this page."},extension:function(b,c){var d=a(this);b=a.Sparkle;d=d.findAndSelf(c.selector);
if(d.hasClass(c.hasClass)||!d.length)return true;d.addClass(c.hasClass);var e=b.getExtensions();for(var f in e){var g=b.getExtension(f);if(g){var j=g.config.demo||"",k=g.config.demoText||"";if(j||k){g=a('<div class="sparkle-demo-section" id="sparkle-demo-'+f+'"><h3>'+f+"<h3></div>");k&&g.append('<div class="sparkle-demo-text">'+k+"</div>");if(j){k=j.replace(/</g,"&lt;").replace(/>/g,"&gt;");g.append('<h4>Example Code:</h4><code class="code language-html sparkle-demo-code">'+k+'</code><h4>Example Result:</h4><div class="sparkle-demo-result">'+
j+"</div>")}d.append(g).sparkle()}}}return true}}})}})(jQuery);

