var vanilla={Version:"2.0",namespace:function(a){if(!a){return window}var d=vanilla.window;var c=a.split(".");for(var b=0;b<c.length;b++){var e=c[b];d[e]=d[e]||{};d=d[e]}return d},extend:function(c,a,b){if(!c||!a){return}for(property in a){if(!b||!c[property]){c[property]=a[property]}}},debug:function(a){if(!document.body){document.write(a+"<br />")}else{var b=$("#vanilla-debug");if(!b.length){b=$(document.createElement("DIV")).css({font:"menu",clear:"both"}).attr("id","vanilla-debug");$(document.body).append(b)}b.append("<br>")}},exists:function(a){if(!a){return false}var d=window;var c=a.split(".");for(var b=0;b<c.length;b++){d=d[c[b]];if(!d){return false}}return true},require:function(a){if(!vanilla.exists(a)){vanilla.console.warn("The package is required : "+a);throw ("The package is required : "+a)}},emptyFunction:function(){}};vanilla.window=this;vanilla.isBoggyIE=(document.all&&!window.opera&&(navigator.vendor!="KDE")?true:false);if(typeof console=="undefined"){vanilla.console={log:function(){},warn:function(){}}}else{vanilla.console=console}$("html").addClass("javascript");vanilla.namespace("vanilla.event");vanilla.event={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,isMouseLeft:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))}};$.fn.extend({log:function(){vanilla.console.log(this);return this},synchronize:function(a,c){if(typeof a!=="string"){c=a;a="fx"}var b=function(){if($(this).queue(a)[0]==b){if(c){c.call(this)}$(this).dequeue(a)}}.bind(this);return this.queue(a,b)}});$.ajaxSetup({cache:false});vanilla.namespace("vanilla.text");vanilla.text={trim:function(a){if(typeof a!="string"&&!(a instanceof String)){return a}var c=0;var b=a.length;while((c<b)&&(a.charAt(c)<=" ")){c++}while((c<b)&&(a.charAt(b-1)<=" ")){b--}return(c>0||b<a.length?a.substring(c,b):a)},DefaultDateFormat:"mm/dd/yyyy",parseDate:function(k,h){if(!k){return null}if(!h){h=this.DefaultDateFormat}if(k.length!=h.length){return null}var b=new String();var d=new String();var j=new String();for(var c=0;c<h.length;c++){switch(h.charAt(c)){case"d":b+=k.charAt(c);break;case"m":d+=k.charAt(c);break;case"y":j+=k.charAt(c);break;default:if(h.charAt(c)!=k.charAt(c)){return null}}}var g=parseInt(b,10);var e=parseInt(d,10)-1;var f=parseInt(j,10);var a=new Date(f,e,g);if(a.getDate()!=g||a.getMonth()!=e||(f.length==2?a.getYear():a.getFullYear())!=f){return null}return a},replaceAll:function(c,b,a){return c.replace(new RegExp(b,"g"),a)}};vanilla.namespace("vanilla.html");vanilla.html={SCRIPT_EXPRESSION:"(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)",extractScripts:function(f){var h=new RegExp(this.SCRIPT_EXPRESSION,"img");var g=new RegExp(this.SCRIPT_EXPRESSION,"im");var c=f.match(h);var a=new Array();for(var d=0;d<c.length;d++){var b=c[d].match(g);if(b){a.push(b[1])}}return a},evalScripts:function(html){var scripts=this.extractScripts(html);for(var i=0;i<scripts.length;i++){var script=scripts[i];eval(script)}}};vanilla.html.DOM={getClassNames:function(a){return($(a).get(0).className||"").split(/\s+/)}};vanilla.html.position={fromStyle:function(b){e=$(b);var a=parseInt(e.css("left")||"0",10);var c=parseInt(e.css("top")||"0",10);return{x:a,y:c,left:a,top:c}},nodeContains:function(a,c){e=$(a);var b=e.offset();b.w=e.innerWidth();b.h=e.innerHeight();return this._boxContains(b,c)},_boxContains:function(a,b){return(b.x>=a.left&&b.y>=a.top&&b.x<(a.left+a.w)&&b.y<(a.top+a.h))}};