/*
 * sQuery 1.0.0
 *
 * Copyright (c) 2009 SolutionSet LLC
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 */
(function(name, settings){var j=window[name],c=function(){var b=0;var a={};this.space=function(){var f=this.args(arguments),k=typeof f[0]=="object"?f.shift():a,g=f.shift(),i,e;switch($.type(g)){case"string":case"number":g=g.split(".");case"array":break;default:return k}if(f.length==1){this.each(g,function(l,m){if(!k[m]){k[m]={};if(m=="[]"){i[e]=[];i[e].push({});m=0;k=i[e]}}i=k;e=m;k=k[m]});i[e]=f[0];return this}var d,h=g.length;this.each(g,function(l,m){if((l+1)==h){d=k[m];return false}if(!k[m]){d=null;return false}k=k[m]});return d};this.unspace=function(){var d=this.args(arguments),g=typeof d[0]=="object"?d.shift():a,e=d.shift();switch($.type(e)){case"string":case"number":e=e.split(".");case"array":break;default:return this}var f=e.length;this.each(e,function(h,i){if((h+1)==f){delete g[i];return false}g=g[i]});return this};this.isspace=function(){var d=this.args(arguments),g=typeof d[0]=="object"?d.shift():a,e=d.shift();switch($.type(e)){case"string":case"number":e=e.split(".");case"array":break;default:return false}var f=e.length,h=true;this.each(e,function(i,k){if(!g[k]){h=false;return false}g=g[k]});return h};this.args=function(d){return Array.prototype.slice.call(d)};this.type=function(h,d){d=typeof d=="string"?[d]:d;d=d instanceof Array?d:[];var g=(function(k){var l,i=typeof k;if(i=="function"){l=k.toString();if((/^\/.*\/$/).test(l)){return"regexp"}if((/^\[object.*\]$/i).test(l)){i="object"}}if(i!="object"){return i}switch(k){case null:return"null";case window:return"window";case window.event:return"event";case document:return"document"}if(k.CLASSNAME){return k.CLASSNAME}if(window.event&&(event.type==k.type)){return"event"}if(k.nodeType!=null){switch(k.nodeType){case 1:return"element";case 3:return"textnode"}}if(k.constructor!=null){switch(k.constructor){case Array:i="array";break;case Date:return"date";case RegExp:return"regexp";case Object:i="object";break;case ReferenceError:return"error";default:l=k.constructor.toString().match(/\s*function (.*)\(/);if(l!=null){return l[1]}}}if(k.toString!=null){l=k.toString().match(/^\[object (.*)\]$/i);if(l!=null){switch(l[1].toLowerCase()){case"window":return"window";case"event":return"event";case"math":return"math";case"error":return"error";case"nodelist":case"htmlcollection":case"elementarray":return"domcollection"}}}if(k.callee!=null){return"arguments"}return i})(h);if(d.length>0){for(var e=0,f=d.length;e<f;e++){if(d[e]==g){return true}}return false}return g};this.uid=function(){return b++};this.BROWSER=(function(d){var e=/MSIE\x20[0-9]*/g.exec(navigator.userAgent);if(e){e=e[0].replace("MS","").split(" ");return d?e:e[0]}e=/Firefox\/[0-9]*/g.exec(navigator.userAgent);if(e){e=e[0].split("/");return d?e:e[0]}e=/Chrome\/[0-9]*/g.exec(navigator.userAgent);if(e){e=e[0].split("/");return d?e:e[0]}e=/[0-9]*\.[0-9]*\x20Safari/g.exec(navigator.userAgent);if(e){e=e[0].split(" ").reverse();e[1]=/^[A-Z0-9]*/g.exec(e[1])[0];return d?e:e[0]}e=/^Opera\/[0-9]*/g.exec(navigator.userAgent);if(e){e=e[0].split("/");return d?e:e[0]}return d?[navigator.userAgent,false]:navigator.userAgent})(true)},$=new c();c.prototype=(function(){var a=c.prototype;a.define=function(){var d,b=$.args(arguments),f=this.type(b[0],"object")?b.shift():j;while(this.type(b[0],"string")){d=b.shift();if(typeof f[d]=="undefined"){f[d]={}}if(typeof b[0]=="string"){f=f[d]}}var e=this.type(b[1],"function")?b[1].prototype:b[1]||{};var g=function(){};f[d]=function(){var i=$.args(arguments);if(typeof g.prototype.__load=="function"){return g.prototype.__load(g,i)}var h=new g();if(typeof h.__construct=="function"){h.__construct.apply(h,i)}return h};g.prototype=f[d].prototype;this.extend(g.prototype,e,{__parent:e},b[0]||{});return this};return a})();c.prototype=(function(){var a=c.prototype;a.clone=function(d){var b={};if(d instanceof Array){b=[];this.each(d,this.bind(function(e,f){b.push(f)},this))}else{if(typeof d=="object"){this.each(d,this.bind(function(e,f){b[e]=f},this))}else{b=d}}return b};a.destroy=function(f){switch(this.type(f)){case"object":for(var d in f){switch(this.type(f[d])){case"array":case"object":value=this.destroy(f[d]);break}delete f[d]}break;case"array":for(var b=0,e=f.length;b<e;b++){switch(this.type(f)){case"array":case"object":value=this.destroy(f[b]);break}delete f[b]}break}return null};a.has=function(d,b){switch(this.type(d)){case"object":case"array":return !(this.each(d,function(f,e){if(e==b){return false}}));case"number":d=d.toString();case"string":return d.search(b)!=-1;default:return d==b}};a.merge=function(){var d=this.args(arguments),b=d.shift();switch(typeof b){case"object":this.each(d,this.bind(function(f,e){this.each(e,function(g,h){if(b instanceof Array){b.push(h)}else{b[g]=h}})},this));break;case"string":b=b.concat.apply(b,d);break}return b};a.reach=function(f,g,d){switch(this.type(f)){case"string":f=this.split("").reverse().join("");break;case"array":f=f.reverse();break;default:var e=[],b={};this.each(f,function(h,i){e.unshift(h)});this.each(e,function(h,i){b[i]=f[i]});f=b;break}return this.each(f,g,d)};a.replace=function(d,b,e){switch(this.type(d)){case"array":case"object":this.each(d,function(g,f){if(f==b){d[g]=e}});break;case"string":d=d.replace(new RegExp(b,"g"),e);break;case"number":d=parseInt(d.toString().replace(new RegExp(b,"g"),e));break}return d};a.size=function(e){switch(typeof e){case"object":var b,d=0;for(b in e){d++}return d;case"number":e=e.toString();case"array":case"string":return e.length}return 0};a.toJson=function(e,b){var d=[];switch(this.type(e)){case"object":this.each(e,this.bind(function(g,f){var h=[g,f];this.each(h,this.bind(function(l,i){switch(this.type(i)){case"string":h[l]='"'+i+'"';break;case"object":h[l]=this.toJson(i,b);break;case"array":h[l]=this.toJson(i,b);break;case"function":h[l]=i.toString();if(!b.func){return null}break;case"undefined":h[l]="undefined";if(!b.undef){return null}break}},this));d.push(h[0]+":"+h[1])},this));return"{"+d.join(",")+"}";case"array":this.each(e,this.bind(function(g,f){switch(this.type(f)){case"string":f='"'+f+'"';break;case"object":f=this.toJson(f,b);break;case"array":f=this.toJson(f,b);break;case"function":f=f.toString();if(!b.func){return null}break;case"undefined":f="undefined";if(!b.undef){return null}break}d.push(f)},this));return"["+d.join(",")+"]";case"string":return'"'+e+'"';case"number":case"bool":return e;default:return null}};a.toParam=function(e,b){var d=[];this.each(e,this.bind(function(f,g){var h=b?b+"["+escape(f)+"]":escape(f),f=b?h:f;switch(this.type(g)){case"string":case"number":d.push(f+"="+escape(g));break;case"array":d.push(this.toParam(g,h));break;case"object":d.push(this.toParam(g,h));break}},this));return d.join("&")};return a})();c.prototype=(function(){var a=c.prototype;a.bind=function(){var d=this.args(arguments);var b=d.shift(),e=d.shift();if(typeof b!="function"){return null}return function(){for(var f=0,g=arguments.length,h=[];f<g;f++){h.push(arguments[f])}return b.apply(e,h.concat(d))}};return a})();c.prototype=(function(){var p=c.prototype;p.camelize=function(string){string=string.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()});return string.replace(string.charAt(0),string.charAt(0).toLowerCase())};p.dasherize=function(string){return string.replace(/[A-Z]/g,function(all,letter){if(letter==0){return all.toLowerCase()}return"-"+all.toLowerCase()})};p.entities=function(string){return string.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;")};p.escape=function(string){return escape(string)};p.search=function(string,substri){return string.match(new RegExp(substri,"g"))};p.isJson=function(string){return/^[\],:{}\s]*$/.test(string.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))};p.strip=function(string){return string.replace(/<\/?[^>]+>/gi,"")};p.template=function(string,obj){this.each(obj,this.bind(function(k,v){string=this.replace(string,"#"+k,v)},this));return string};p.toElement=function(string,i){string=this.createElement("div",{},string).children();return typeof i=="number"?string.get(i):string};p.truncate=function(string,length,truncation){if(string.length>length){return string.slice(0,length)+truncation}return string};p.unentities=function(string){return string.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')};p.unescape=function(string){return unescape(string)};p.unserialize=function(string,object){if(this.isJson(string)){eval("string = "+this._native);return string}object=object==false?false:true;var unserial={};this.each(string.split("&"),this.bind(function(k,v){var t=v.split("=");if(object){if(t[0].indexOf("[")!=-1){var args=this.replace(this.replace(t[0],"]","").split("["),"","[]");args.unshift(unserial);args.push(t[1]);this.set.apply(this,args);return true}}unserial[t[0]]=t[1];return true},this));return unserial};p.validAlphaNum=function(str){/^([a-zA-Z0-9_-]+)$/.test(str)};p.validUrl=function(str){return/^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/.test(str)};p.validEmail=function(str){return/^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/.test(str)};return p})();c.prototype=(function(){var a=c.prototype;a.square=function(b){return b*b};a.hypotenuse=function(f,d,b){var e=Math.sqrt(this.square(f)+this.square(d));if(b){e=Math.round(e)}return e};a.trigSSS=function(g,e,d,b){var f=180/Math.PI*Math.acos((this.square(e)+this.square(d)-this.square(g))/(2*e*d));if(b){f=Math.round(f)}return f};a.trigSAS=function(g,d,e,b){var f=Math.sqrt(this.square(g)+this.square(e)-2*g*e*Math.cos(d));if(b){f=Math.round(f)}return f};a.trigSSA=function(f,g,d,b){var e=180/Math.PI*Math.asin((Math.sin(d)*f)/g);if(b){e=Math.round(e)}return e};return a})();c.prototype=(function(){var a=c.prototype;a.createElement=function(d,b,f,e){return this.Element(document.createElement(d),b,f,e)};a.documentSize=function(){var d=this.windowSize();var e=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;var b=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return{width:Math.max(b,d.width),height:Math.max(e,d.height)}};a.select=function(b,e,d){if(typeof e=="number"){d=e;e=document.body}e=e||document.body;return this.Element(e).select(b,d)};a.windowCenter=function(){var b=this.windowSize();return{left:Math.round(b.width/2),top:Math.round(b.height/2)}};a.windowOffset=function(){if(typeof(window.pageYOffset)=="number"){return{left:window.pageXOffset,top:window.pageYOffset}}return{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}};a.windowSize=function(){if(typeof window.innerWidth!="undefined"){return{width:window.innerWidth,height:window.innerHeight}}if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!==0){return{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}}return{width:document.getElementsByTagName("body")[0].clientWidth,height:document.getElementsByTagName("body")[0].clientHeight}};return a})();c.prototype=(function(){var a=c.prototype;a.keyPressed=function(b){if(b.keyCode){if(b.keyCode==13){return"enter"}return String.fromCharCode(b.keyCode)}if(b.which){if(b.which==13){return"enter"}return String.fromCharCode(b.which)}return null};a.mousePosition=function(b){if(b.pageX||b.pageY){return{left:b.pageX,top:b.pageY}}return b.clientX||b.clientY?{left:b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,top:b.clientY+document.body.scrollTop+document.documentElement.scrollTop}:{left:0,top:0}};a.rightClicked=function(b){if(b.which){return b.which==3}return b.button?b.button==2:false};a.stop=function(b){switch(true){case typeof b.preventDefault=="function":b.preventDefault();break;case typeof b.stopPropagation=="function":b.stopPropagation();break;default:b.returnValue=false;b.cancelBubble=true;break}};a.target=function(d){var b=d.target?d.target:d.srcElement;return b.nodeType==3?b.parentNode:b};return a})();c.prototype=(function(){var b=c.prototype;var a={};b.include=function(d,f){f=f||function(){};if(a[d]){f(a[d]);return}else{var e=this.uid();if(d.indexOf(".css")!=-1){a[d]=this.createElement("link",{id:"css_link"+e,type:"text/css",rel:"stylesheet",href:d});f(a[d])}else{a[d]=this.createElement("script",{id:"js_script"+e,type:"text/javascript",src:d});a[d].on("readystatechange",this.bind(function(g){if(a[d].el.readyState=="complete"||a[d].el.readyState=="loaded"){f(a[d])}},this));a[d].on("load",this.bind(this.bind(function(g){f(a[d])},this)))}this.Element(document).select("head",0).append(a[d])}return this};b.proxy=function(f,e){e=e||{};e.data=e.data||"";e.form=e.form||false;e.method=e.method||"get";e.success=e.success||function(m){};e.failiure=e.failiure||function(m){};e.timeout=e.timeout||0;var l=this.uid();var k=this.toElement('<iframe id="frame_proxy'+l+'" name="frame_proxy'+l+'" src="//:" style="display:none;"></iframe>',0);var h=true,d,g;if(e.form==false){h=false;e.form=this.createElement("form",{method:e.method,action:f});data=this.unserialize(e.data);for(g in data){d=this.createElement("input",{type:"hidden",name:g,value:data[g]});e.form.append(d)}}else{e.form=$.Element(e.form)}e.form.attr("target","frame_proxy"+l);if(e.timeout){var i=setTimeout(function(){setTimeout(function(){k.remove()},1);e.failiure(new Error("Server took to long to respond."))},e.timeout)}k.on("load",function(m){clearTimeout(i);try{e.success(k.attr("contentWindow").document.body.innerHTML)}catch(m){e.failiure(new Error("Remote calls not supported."))}if(!h){e.form.remove()}setTimeout(function(){k.remove()},1)});if(k.parent().el){k.remove()}this.Element(document.body).append(k);if(!h){this.Element(document.body).append(e.form)}e.form.el.submit()};return b})();j.extend($);$=j;$.Element=function(d,a,e,b){if($.type(d,"string")){d=document.getElementById(d)}d=$(d);if(a){d.attr(a)}if(e){d.html(e)}if(b){d.appendTo(b)}return d};$.define("Base",new function(){this.CLASSNAME="Base";this.bind=this.on=function(b,e,d){var a=$.uid();if(!$.isspace(this,["__events",b])){$.space(this,["__events",b],{})}$.space(this,["__events",b,a],e);if(!$.isspace(this,["__triggers",b])){$.space(this,["__triggers",b],$.bind(function(){var g=$.args(arguments),k,f=true;var h=$.space(this,["__events",b]);for(k in h){if($.type(h[k])=="function"&&h[k].apply(this,g)===false){f=false}}return f},this))}var e=$.bind(this.unbind,this,b,a);return{id:a,type:b,unbind:e,off:e}};this.trigger=function(b){var a=$.args(arguments);b=a.shift();if($.isspace(this,["__triggers",b])){if($.space(this,["__triggers",b]).apply(this,a)===false){return false}}return this};this.unbind=this.off=function(a){var b=$.args(arguments),e={},d=$.type(a);switch(true){case b.length==2&&$.type(b[0])=="string":var f={};var e=$.space(this,["__events",a]);$.each(e,function(g,h){if($.type(b[1])=="function"&&value!=b[1]){f[g]=h}else{if(g!=b[1]){f[g]=h}}});$.space(this,["__events",a],f);break;case d=="string":$.space(this,["__events",a],e);break;case d=="number":$.each($.space(this,"__events"),function(g,h){h={};$.each(h,function(i,k){if(i!=a){h[i]=k}});$.space(this,["__events",g],h)});break}return this}});$.fn.extend(new function(){this.CLASSNAME="Element";this.space=function(){var d=$.args(arguments);if(d.length==1){d.unshift($.cache[this.uid()]||{});return $.space.apply($,d)}this.each(function(){temp=$.clone(d);temp.unshift($.cache[$.data(this)]||{});$.space.apply($,temp)});return this};this.unspace=function(){var d=$.args(arguments);this.each(function(){temp=$.clone(d);temp.unshift($.cache[$.data(this)]||{});$.unspace.apply($,temp)});return this};this.isspace=function(){var d=$.args(arguments);d.unshift($.cache[this.uid()]||{});return $.isspace.apply($,d)};this.opacity=function(d){if(!$.type(d,"number")){if($.BROWSER[0]=="IE"){return parseInt(this.css("filter").replace("alpha(opacity=","").replace(")",""))/10}return parseInt(this.css("opacity"))*10}this.css("opacity",d/10);this.css("filter","alpha(opacity="+d*10+")");return this};this.trueCoordinates=function(){var d=this.truePosition(),e=this.trueSize();return[{left:d.left,top:d.top},{top:d.top+e.height,left:d.left+e.width}]};this.truePosition=$.fn.offset;this.trueSize=function(){var h=this.css("display"),i,g;if(h!="none"&&h!==null){g=this.css("offsetHeight");i=this.css("offsetWidth");if(i&&g){return{width:i,height:g}}return{width:this.attr("clientWidth"),height:this.attr("clientHeight")}}var f=this.css("visibility");var e=this.css("position");var d=this.css("display");this.css("visibility","visible");this.css("position","absolute");this.css("display","block");g=this.attr("clientHeight");i=this.attr("clientWidth");this.css("visibility",f);this.css("position",e);this.css("display",d);return{width:i,height:g}};this.previous=$.fn.prev;this.select=function(f,e){var d=$.fn.find.call(this,f);if($.type(e,"number")){d=d.eq(e)}return d};var a=$.fn.parents,b=$.fn.children;this.parents=function(d,f){var e=a.call(this,d);if($.type(f,"number")){e=e.eq(f)}return e};this.children=function(d,e){var f=b.call(this,d);if($.type(e,"number")){f=f.eq(e)}return f};this.on=$.fn.bind;this.off=$.fn.unbind;this.tween=function(g,h){var e=$.args(arguments);if(!$.type(e[0],"object")){return this}g=e.shift();h=typeof e[0]=="number"?e.shift():30;callback=typeof e[0]=="function"?e.shift():false;$.each(g,$.bind(function(i,k){this.css(i,k[0])},this));var f=1,d=setInterval($.bind(function(k,l,n,o,i){if($.BROWSER[0]!="Firefox"){var m=$.args(arguments);l=m[0];n=m[1];o=m[2];i=m[3]}$.each(l,$.bind(function(r,s){var q,p=(parseFloat(s[1])-parseFloat(s[0]))/n;switch(true){case s[0].indexOf("px")!=-1:q="px";break;case s[0].indexOf("em")!=-1:q="em";break;default:q="";break}if(r=="opacity"){this.opacity(parseFloat(s[0])+(p*f))}else{this.css(r,(parseFloat(s[0])+(p*f))+q)}},this));if(f>=n){clearInterval(d);if(typeof o=="function"){o(this,l,n)}if(i&&i.length>0){this.tween.apply(this,i)}}f++},this,g,h,callback,e),1);return this};this.uid=function(){try{return $.data(this[0])}catch(d){}}});})('jQuery',{});
