/*
 GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
*/
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 b=["console.debug:"],
a=0;a<arguments.length;a++)b.push(arguments[a]);window.console.log.apply(window.console,b)};if(typeof window.console.warn==="undefined")window.console.warn=function(){for(var b=["console.warn:"],a=0;a<arguments.length;a++)b.push(arguments[a]);window.console.log.apply(window.console,b)};if(typeof window.console.error==="undefined")window.console.error=function(){for(var b=["console.error"],a=0;a<arguments.length;a++)b.push(arguments[a]);window.console.log.apply(window.console,b)};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}String.prototype.trim=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.strip=String.prototype.strip||function(b,a){b=String(b);var c=this;if(b.length){a||0||(b=b.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g,"\\$1"));c=c.replace(eval("/^"+b+"+|"+b+"+$/g"),"")}return String(c)};
String.prototype.stripLeft=String.prototype.stripLeft||function(b,a){b=String(b);var c=this;if(b.length){a||0||(b=b.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g,"\\$1"));c=c.replace(eval("/^"+b+"+/g"),"")}return String(c)};String.prototype.stripRight=String.prototype.stripRight||function(b,a){b=String(b);var c=this;if(b.length){a||0||(b=b.replace(/([\[\]\(\)\^\$\.\?\|\/\\])/g,"\\$1"));c=c.replace(eval("/"+b+"+$/g"),"")}return String(c)};
String.prototype.toInt=String.prototype.toInt||function(){return parseInt(this,10)};String.prototype.wrap=String.prototype.wrap||function(b,a){return b+this+a};String.prototype.wrapSelection=String.prototype.wrapSelection||function(b,a,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)+b+this.substring(c,d)+a+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 b=String(this);b=b.substring(b.indexOf("?")+1);b=b.replace(/\+/g,"%20");if(b.substring(0,1)==="{"&&b.substring(b.length-1)==="}")return eval(decodeURIComponent(b));b=b.split(/\&(amp\;)?/);for(var a={},c=0,d=b.length;c<d;++c){var e=b[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 h=
f.split(".");if(h.length===1)a[f]=e;else{var i="",j="";$.each(h,function(l,k){i+='["'+k.replace(/"/g,'\\"')+'"]';jsonCLOSUREGLOBAL=a;j="if ( typeof jsonCLOSUREGLOBAL"+i+' === "undefined" ) jsonCLOSUREGLOBAL'+i+" = {}";eval(j);a=jsonCLOSUREGLOBAL;delete jsonCLOSUREGLOBAL});jsonCLOSUREGLOBAL=a;valueCLOSUREGLOBAL=e;j="jsonCLOSUREGLOBAL"+i+" = valueCLOSUREGLOBAL";eval(j);a=jsonCLOSUREGLOBAL;delete jsonCLOSUREGLOBAL;delete valueCLOSUREGLOBAL}}}}}return a};
(function(b){b.fn.opacityFix=b.fn.opacityFix||function(){var a=b(this),c=a.css("background-color");if(c&&c!=="rgba(0, 0, 0, 0)")return this;for(var d=a;d.inDOM();){d=d.parent();if((c=d.css("background-color"))&&c!=="rgba(0, 0, 0, 0)"){a.css("background-color",c);break}}return this};b.fn.parentsAndSelf=b.fn.parentsAndSelf||function(a){return b(this).parents(a).andSelf().filter(a)};b.fn.findAndSelf=b.fn.findAndSelf||function(a){return b(this).find(a).andSelf().filter(a)};b.fn.firstInput=b.fn.firstInput||
function(){return b(this).findAndSelf(":input").filter(":first")};b.fn.choose=b.fn.choose||function(a){var c=b(this);if(typeof a==="undefined")a=c.val();else if(c.val()!==a)return this;switch(true){case this.is("option"):c.parents("select:first").choose(a);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(a);break;default:break}return this};b.fn.unchoose=b.fn.unchoose||function(){var a=b(this);switch(true){case a.is("option"):a.parents(":select:first").unchoose();
break;case a.is(":checkbox"):a.attr("checked",false);break;case a.is(":radio"):a.attr("checked",false);break;case a.is("select"):a.val(a.find("option:first").val());break;default:break}return this};b.fn.wouldSubmit=b.fn.wouldSubmit||function(){var a=b(this).findAndSelf(":input"),c=true;if(!a.length||!(a.attr("name")||0)||a.is(":radio,:checkbox")&&!a.is(":selected,:checked"))c=false;return c};b.fn.values=b.fn.values||function(){var a={};b(this).findAndSelf(":input").each(function(){var c=b(this),d=
c.attr("name")||null,e=c.val();if(!c.wouldSubmit())return true;if(d.indexOf("[]")!==-1){if(typeof a[d]==="undefined")a[d]=[];a[d].push(e)}else a[d]=e});return a};b.fn.submitForm=b.fn.submitForm||function(){var a=b(this);a.parentsAndSelf("form:first").trigger("submit");return a};b.fn.inDOM=b.fn.inDOM||function(){var a=b(this).parent().parent();return a.size()&&(a.height()||a.width())};b.fn.valWrap=b.fn.valWrap||function(a,c){var d=b(this);return d.val(d.val().wrap(a,c))};b.fn.valWrapSelection=b.fn.valWrapSelection||
function(a,c,d,e){var f=b(this),g=f.get(0);a=a||"";c=c||"";if(d||e)f.val(f.val().wrapSelection(a,c,d,e));else{d=g.selectionStart;e=g.selectionEnd;if(document.selection){g.focus();d=document.selection.createRange();d.text=a+d.text+c}else{var h=g.scrollTop;f.val(f.val().wrapSelection(a,c,d,e));g.focus();g.selectionStart=d+a.length;g.selectionEnd=e+a.length;g.scrollTop=h}}return f};b.fn.giveFocus=b.fn.giveFocus||function(){b(this).findAndSelf(":input:visible:first").focus();return this};b.fn.highlight=
b.fn.highlight||function(a){return b(this).effect("highlight",{},a||3E3)}})(jQuery);
(function(b){if(b.History)window.console.warn("$.History has already been defined...");else{b.History={options:{debug:false},state:"",$window:null,$iframe:null,handlers:{generic:[],specific:{}},extractHash:function(a){return a.replace(/^[^#]*#/,"").replace(/^#+|#+$/,"")},getState:function(){return b.History.state},setState:function(a){var c=b.History;a=c.extractHash(a);c.state=a;return c.state},getHash:function(){return b.History.extractHash(window.location.hash||location.hash)},setHash:function(a){a=
b.History.extractHash(a);if(typeof window.location.hash!=="undefined"){if(window.location.hash!==a)window.location.hash=a}else if(location.hash!==a)location.hash=a;return a},go:function(a){var c=b.History;a=c.extractHash(a);var d=c.getHash(),e=c.getState();if(a!==d)c.setHash(a);else{a!==e&&c.setState(a);c.trigger()}return true},hashchange:function(){var a=b.History,c=a.getHash();a.go(c);return true},bind:function(a,c){var d=b.History;if(c){if(typeof d.handlers.specific[a]==="undefined")d.handlers.specific[a]=
[];d.handlers.specific[a].push(c)}else{c=a;d.handlers.generic.push(c)}return true},trigger:function(a){var c=b.History;if(typeof a==="undefined")a=c.getState();var d,e,f,g;if(typeof c.handlers.specific[a]!=="undefined"){g=c.handlers.specific[a];d=0;for(e=g.length;d<e;++d){f=g[d];f(a)}}g=c.handlers.generic;d=0;for(e=g.length;d<e;++d){f=g[d];f(a)}return true},construct:function(){var a=b.History;b(document).ready(function(){a.domReady()});return true},configure:function(a){var c=b.History;c.options=
b.extend(c.options,a);return true},domReadied:false,domReady:function(){var a=b.History;if(!a.domRedied){a.domRedied=true;a.$window=b(window);a.$window.bind("hashchange",this.hashchange);setTimeout(a.hashchangeLoader,200);return true}},hashchangeLoader:function(){var a=b.History;if(b.browser.msie&&parseInt(b.browser.version)>=8)a.getHash()&&a.$window.trigger("hashchange");else{var c;if(b.browser.msie){a.$iframe=b('<iframe id="jquery-history-iframe" style="display: none;"></$iframe>').prependTo(document.body)[0];
a.$iframe.contentWindow.document.open();a.$iframe.contentWindow.document.close();var d=false;c=function(){var e=a.getHash(),f=a.getState(),g=a.extractHash(a.$iframe.contentWindow.document.location.hash);if(f!==e){if(!d){a.$iframe.contentWindow.document.open();a.$iframe.contentWindow.document.close();a.$iframe.contentWindow.document.location.hash=e}d=false;a.$window.trigger("hashchange")}else if(f!==g){d=true;a.setHash(g)}}}else c=function(){var e=a.getHash();a.getState()!==e&&a.$window.trigger("hashchange")};
setInterval(c,200)}return true}};b.History.construct()}})(jQuery);

