/*
 * jQLite JavaScript Library v1.1.1 (http://code.google.com/p/jqlite/)
 *
 * Copyright (c) 2010 Brett Fattori (bfattori@gmail.com)
 * Licensed under the MIT license
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Many thanks to the jQuery team's efforts.  Some code is
 * Copyright (c) 2010, John Resig.  See
 * http://jquery.org/license
 *
 * @author Brett Fattori (bfattori@gmail.com)
 * @author $Author: bfattori $
 * @version $Revision: 144 $
 *
 * Created: 03/29/2010
 * Modified: $Date: 2010-06-21 11:06:36 -0400 (Mon, 21 Jun 2010) $
 */
(function(){function C(){return +new Date}var A=function(W,I){if(W===""&&I){return I}var L=W.split(" ");var X=L.shift();var S;if(X.charAt(0)=="#"){var H=n.getElementById(X.substring(1));S=H?[H]:[]}else{var V=X.charAt(0)!=="."?X.split(".")[0]:"*";var K=X.split(".");var N=null;if(V.indexOf("[")!=-1){N=V;V=V.substr(0,V.indexOf("["))}var Y=function(Z){var aa=arguments.callee;if((!aa.needClass||s(Z,aa.classes))&&(!aa.needAttribute||u(Z,aa.attributes))){return Z}};var R=[];for(var O=0;O<I.length;O++){var M=I[O].getElementsByTagName(V);for(var G=0;G<M.length;G++){R.push(M[G])}}if(K){K.shift()}S=[];Y.classes=K;if(N!=null){var U=N.indexOf("[");var P=N.lastIndexOf("]");var Q=N.substring(U+1,P);var J=Q.split("][")}Y.attributes=N!=null?J:null;Y.needClass=(X.indexOf(".")!=-1&&K.length>0);Y.needAttribute=(N!=null);for(var T=0;T<R.length;T++){if(Y(R[T])){S.push(R[T])}}}return A(L.join(" "),S)};var b=function(M,J){J=J||n;if(M.nodeType&&M.nodeType===c){M=n.body;if(M===null){return[n]}}if(M.nodeType&&M.nodeType===g){return[M]}if(M.jquery&&typeof M.jquery==="string"){return M.toArray()}if(J){J=e(J)}if(f.isArray(M)){return M}else{if(typeof M==="string"){var H=[];for(var G=0;G<J.length;G++){var K=[J[G]];if(!f.forceSimpleSelectorEngine&&K[0].querySelectorAll){var L=K[0].querySelectorAll(M);for(var I=0;I<L.length;I++){H.push(L.item(I))}}else{H=H.concat(A(M,K))}}return H}else{return null}}};var s=function(G,J){if(G.className.length==0){return false}var K=G.className.split(" ");var H=J.length;for(var I=0;I<J.length;I++){if(f.inArray(J[I],K)!=-1){H--}}return(H==0)};var u=function(G,K){var J=true;for(var L=0;L<K.length;L++){var H=K[L].split("=");var I=(H[0].indexOf("!")!=-1||H[0].indexOf("*")!=-1)?H[0].charAt(H[0].length-1)+"=":"=";if(I!="="){H[0]=H[0].substring(0,H[0].length-1)}switch(I){case"=":J&=(G.getAttribute(H[0])===H[1]);break;case"!=":J&=(G.getAttribute(H[0])!==H[1]);break;case"*=":J&=(G.getAttribute(H[0]).indexOf(H[1])!=-1);break;default:J=false}}return J};var r=false;setTimeout(function(){var K=n.body;if(!K){setTimeout(arguments.callee,33);return}var G=n.createElement("script"),J="i"+new Date().getTime();G.type="text/javascript";try{G.appendChild(n.createTextNode("window."+J+"=1;"))}catch(H){}K.insertBefore(G,K.firstChild);var I=true;if(window[J]){delete window[J]}else{I=false}K.removeChild(G);r=I},33);var d=function(I){var H=n.createElement("div");H.innerHTML=I;var G=H.getElementsByTagName("script");return{scripts:G,data:I}};var q=function(H,K){K=K||false;H=(!H?"":H.toString().replace(/^\s*|\s*$/g,""));var J="";if(H.length<=0){return""}var L=false;if(!K){J+=H.charAt(0).toUpperCase()}else{J+=H.charAt(0)}for(var G=1;G<H.length;G++){if(L){J+=H.charAt(G).toUpperCase()}else{J+=H.charAt(G).toLowerCase()}var I=H.charCodeAt(G);L=I==32||I==45||I==46;if(I==99||I==67){if(H.charCodeAt(G-1)==77||H.charCodeAt(G-1)==109){L=true}}}return J};var w=function(G){var H=G.replace(/-/g," ");H=q(H,true);return H.replace(/ /g,"")};var t={click:"MouseEvents",dblclick:"MouseEvents",mousedown:"MouseEvents",mouseup:"MouseEvents",mouseover:"MouseEvents",mousemove:"MouseEvents",mouseout:"MouseEvents",contextmenu:"MouseEvents",keypress:"KeyEvents",keydown:"KeyEvents",keyup:"KeyEvents",load:"HTMLEvents",unload:"HTMLEvents",abort:"HTMLEvents",error:"HTMLEvents",resize:"HTMLEvents",scroll:"HTMLEvents",select:"HTMLEvents",change:"HTMLEvents",submit:"HTMLEvents",reset:"HTMLEvents",focus:"HTMLEvents",blur:"HTMLEvents",touchstart:"MouseEvents",touchend:"MouseEvents",touchmove:"MouseEvents"};var h=function(I){if(typeof I==="string"){I=I.toLowerCase()}var G=null;var H=t[I]||"Event";if(n.createEvent){G=n.createEvent(H);G._eventClass=H;if(I){G.initEvent(I,true,true)}}if(n.createEventObject){G=n.createEventObject();if(I){G.type=I;G._eventClass=H}}return G};var k=function(G,H,K){var M=h(H);if(M._eventClass!=="Event"){M.data=K;return G.dispatchEvent(M)}else{var O=G._handlers||{};var L=O[H];if(L){for(var N=0;N<L.length;N++){var I=f.isArray(K)?K:[];I.unshift(M);var J=L[N].apply(G,I);J=(typeof J=="undefined"?true:J);if(!J){break}}}}};var F=function(G,H,J){if(!f.isFunction(J)){return}if(typeof H==="string"){H=H.toLowerCase()}var L=t[H];if(H.indexOf("on")==0){H=H.substring(2)}if(L){var K=function(M){var P=arguments.callee;var O=M.data||[];O.unshift(M);var N=P.fn.apply(G,O);if(typeof N!="undefined"&&N===false){if(M.preventDefault&&M.stopPropagation){M.preventDefault();M.stopPropagation()}else{M.returnValue=false;M.cancelBubble=true}return false}return true};K.fn=J;if(G.addEventListener){G.addEventListener(H,K,false)}else{G.attachEvent("on"+H,K)}}else{if(!G._handlers){G._handlers={}}var I=G._handlers[H]||[];I.push(J);G._handlers[H]=I}};var f=function(H,G){return new o().init(H,G)},n=window.document,a=Object.prototype.hasOwnProperty,l=Object.prototype.toString,m=Array.prototype.push,y=Array.prototype.slice,g=1,c=9,j=[],v=false,D=false,E;f.forceSimpleSelectorEngine=false;f.each=function(M,K){var H,L=0,I=M.length,J=I===undefined||f.isFunction(M);if(J){for(H in M){if(K.call(M[H],H,M[H])===false){break}}}else{for(var G=M[0];L<I&&K.call(G,L,G)!==false;G=M[++L]){}}return M};f.noop=function(){};f.isFunction=function(G){return l.call(G)==="[object Function]"};f.isArray=function(G){return l.call(G)==="[object Array]"};f.isPlainObject=function(H){if(!H||l.call(H)!=="[object Object]"||H.nodeType||H.setInterval){return false}if(H.constructor&&!a.call(H,"constructor")&&!a.call(H.constructor.prototype,"isPrototypeOf")){return false}var G;for(G in H){}return G===undefined||a.call(H,G)};f.merge=function(G,H){var I=G.length,J=0;if(typeof H.length==="number"){for(var K=H.length;J<K;J++){G[I++]=H[J]}}else{while(H[J]!==undefined){G[I++]=H[J++]}}G.length=I;return G};f.param=function(H){var G="";if(H){f.each(H,function(I,J){G+=(G.length!=0?"&":"")+J+"="+encodeURIComponent(I)})}return G};f.evalScripts=function(J){var G=n.getElementsByTagName("head")[0]||n.documentElement;for(var I=0;I<J.length;I++){var H=n.createElement("script");H.type="text/javascript";if(r){H.appendChild(n.createTextNode(J[I].text))}else{H.text=J[I].text}G.insertBefore(H,G.firstChild);G.removeChild(H)}};f.ready=function(){v=true;while(j.length>0){var G=j.shift();G()}};var B="jQuery"+C(),z=0,p={};f.noData={embed:true,object:true,applet:true};f.cache={};f.data=function(G,H,J){if(G.nodeName&&jQuery.noData[G.nodeName.toLowerCase()]){return}G=G==window?p:G;var I=G[B];if(!I){I=G[B]=++z}if(H&&!jQuery.cache[I]){jQuery.cache[I]={}}if(J!==undefined){jQuery.cache[I][H]=J}return H?jQuery.cache[I][H]:I};f.removeData=function(H,I){H=H==window?p:H;var J=H[B];if(I){if(jQuery.cache[J]){delete jQuery.cache[J][I];I="";for(I in jQuery.cache[J]){break}if(!I){jQuery.removeData(H)}}}else{try{delete H[B]}catch(G){if(H.removeAttribute){H.removeAttribute(B)}}delete jQuery.cache[J]}};f.ajax={status:-1,statusText:"",responseText:null,responseXML:null,send:function(L,K,I){if(f.isFunction(K)){I=K;K={}}if(!L){return}var P=true,J=null,G=null;if(typeof K.async!=="undefined"){P=K.async;delete K.async}if(typeof K.username!=="undefined"){J=K.username;delete K.username}if(typeof K.password!=="undefined"){G=K.password;delete K.password}var H=f.param(K);if(H.length!=0){L+=(L.indexOf("?")==-1?"?":"&")+H}var N=new XMLHttpRequest();N.open("POST",L,P,J,G);N.send();if(P){var M=function(R){var Q=arguments.callee;if(R.status==200){f.ajax.complete(R,Q.cb)}else{f.ajax.error(R,Q.cb)}};M.cb=I;var O=function(){var Q=arguments.callee;if(Q.req.readyState!=4){setTimeout(Q,250)}else{Q.xcb(Q.req)}};O.req=N;O.xcb=M;setTimeout(O,250)}else{}},complete:function(H,G){f.ajax.status=H.status;f.ajax.responseText=H.responseText;f.ajax.responseXML=H.responseXML;if(f.isFunction(G)){G(H.responseText,H.status)}},error:function(H,G){f.ajax.status=H.status;f.ajax.statusText=H.statusText;if(f.isFunction(G)){G(H.status,H.statusText)}}};f.makeArray=function(G,H){var I=H||[];if(G!=null){if(G.length==null||typeof G==="string"||jQuery.isFunction(G)||(typeof G!=="function"&&G.setInterval)){m.call(I,G)}else{f.merge(I,G)}}return I};f.inArray=function(G,H){for(var I=0;I<H.length;I++){if(H[I]===G){return I}}return -1};f.trim=function(G){if(G!=null){return G.toString().replace(/^\s*|\s*$/g,"")}else{return""}};var o=function(){};o.prototype={selector:"",context:null,length:0,jquery:"jqlite-1.1.1",init:function(H,I){if(!H){return this}if(H.nodeType){this.context=this[0]=H;this.length=1}else{if(typeof H==="function"){this.ready(H)}else{var G=[];if(H.jquery&&typeof H.jquery==="string"){G=H.toArray()}else{if(f.isArray(H)){G=H}else{if(typeof H==="string"&&f.trim(H).indexOf("<")==0&&f.trim(H).indexOf(">")!=-1){var J=i(H);var L=n.createElement(J);L.innerHTML=H;G=[L.removeChild(L.firstChild)];L=null}else{var K;if(H.indexOf(",")!=-1){K=H.split(",");for(var M=0;M<K.length;M++){K[M]=f.trim(K[M])}}else{K=[H]}var N=[];for(var O=0;O<K.length;O++){N=N.concat(b(K[O],I))}G=N}}}m.apply(this,G)}}return this},each:function(G){return f.each(this,G)},size:function(){return this.length},toArray:function(){return y.call(this,0)},ready:function(G){if(v){G()}else{j.push(G);return this}},data:function(H,I){if(typeof H==="undefined"&&this.length){return jQuery.data(this[0])}else{if(typeof H==="object"){return this.each(function(){jQuery.data(this,H)})}}var G=H.split(".");G[1]=G[1]?"."+G[1]:"";if(I===undefined){if(data===undefined&&this.length){data=jQuery.data(this[0],H)}return data===undefined&&G[1]?this.data(G[0]):data}else{return this.each(function(){jQuery.data(this,H,I)})}},removeData:function(G){return this.each(function(){jQuery.removeData(this,G)})},addClass:function(G){return this.each(function(){if(this.className.length!=0){var H=this.className.split(" ");if(f.inArray(G,H)==-1){H.push(G);this.className=H.join(" ")}}else{this.className=G}})},removeClass:function(G){return this.each(function(){if(this.className.length!=0){var H=this.className.split(" ");var I=f.inArray(G,H);if(I!=-1){H.splice(I,1);this.className=H.join(" ")}}})},hasClass:function(G){if(this[0].className.length==0){return false}return f.inArray(G,this[0].className.split(" "))!=-1},isElementName:function(G){return(this[0].nodeName.toLowerCase()===G.toLowerCase())},toggleClass:function(G){return this.each(function(){if(this.className.length==0){this.className=G}else{var H=this.className.split(" ");var I=f.inArray(G,H);if(I!=-1){H.splice(I,1)}else{H.push(G)}this.className=H.join(" ")}})},hide:function(G){return this.each(function(){if(this.style&&this.style.display!=null){if(this.style.display.toString()!="none"){this._oldDisplay=this.style.display.toString()||(this.nodeName!="span"?"block":"inline");this.style.display="none"}}if(f.isFunction(G)){G(this)}})},show:function(G){return this.each(function(){this.style.display=((this._oldDisplay&&this._oldDisplay!=""?this._oldDisplay:null)||(this.nodeName!="span"?"block":"inline"));if(f.isFunction(G)){G(this)}})},css:function(G,H){if(typeof G==="string"&&H==null){return this[0].style[w(G)]}else{G=typeof G==="string"?x(G,H):G;return this.each(function(){var I=this;if(typeof I.style!="undefined"){f.each(G,function(K,L){L=(typeof L==="number"?L+"px":L);var J=w(K);if(!I.style[J]){J=K}I.style[J]=L})}})}},load:function(H,G,I){if(f.isFunction(G)){I=G;G={}}return this.each(function(){var J=function(N,L){var K=arguments.callee;if(N){var M=d(N);K.elem.innerHTML=M.data;f.evalScripts(M.scripts)}if(f.isFunction(K.cback)){K.cback(N,L)}};J.cback=I;J.elem=this;f.ajax.send(H,G,J)})},html:function(G){if(!G){return this[0].innerHTML}else{return this.each(function(){var H=d(G);this.innerHTML=H.data;f.evalScripts(H.scripts)})}},attr:function(H,G){if(typeof H==="string"&&G==null){if(this[0]){return this[0].getAttribute(H)}else{return""}}else{return this.each(function(){H=typeof H==="string"?x(H,G):H;for(var I in H){var J=H[I];this.setAttribute(I,J)}})}},eq:function(G){var H=this.toArray();var I=G<0?H[H.length+G]:H[G];this.context=this[0]=I;this.length=1;return this},first:function(){var G=this.toArray();this.context=this[0]=G[0];this.length=1;return this},last:function(){var G=this.toArray();this.context=this[0]=G[G.length-1];this.length=1;return this},index:function(K){var M=-1;if(this.length!=0){var L=this[0];if(!K){var I=this.parent();var G=I[0].firstChild;var J=[];while(G!=null){if(G.nodeType===g){J.push(G)}G=G.nextSibling}f.each(G,function(N){if(this===L){M=N;return false}})}else{var H=f(K)[0];this.each(function(N){if(this===H){M=N;return false}})}}return M},next:function(H){var G=[];if(!H){this.each(function(){var J=this.nextSibling;while(J!=null&&J.nodeType!==g){J=J.nextSibling}if(J!=null){G.push(J)}})}else{var I=f(H);this.each(function(){var J=this.nextSibling;while(J!=null&&J.nodeType!==g){J=J.nextSibling}if(J!=null){var K=false;I.each(function(){if(this==J){K=true;return false}});if(K){G.push(J)}}})}return f(G)},prev:function(H){var G=[];if(!H){this.each(function(){var J=this.previousSibling;while(J!=null&&J.nodeType!==g){J=J.previousSibling}if(J!=null){G.push(J)}})}else{var I=f(H);this.each(function(){var J=this.previousSibling;while(J!=null&&J.nodeType!==g){J=J.previousSibling}if(J!=null){var K=false;I.each(function(){if(this==J){K=true;return false}});if(K){G.push(J)}}})}return f(G)},parent:function(H){var G=[];if(!H){this.each(function(){G.push(this.parentNode)})}else{var I=f(H);this.each(function(){var J=this.parentNode;var K=false;I.each(function(){if(this==J){K=true;return false}});if(K){G.push(J)}})}return f(G)},parents:function(H){var G=[];if(!H){this.each(function(){var J=this;while(J!=n.body){J=J.parentNode;G.push(J)}})}else{var I=f(H);this.each(function(){var J=this;while(J!=n.body){I.each(function(){if(this==J){G.push(J)}});J=J.parentNode}})}return f(G)},children:function(H){var G=[];if(!H){this.each(function(){var J=this.firstChild;while(J!=null){if(J.nodeType==g){G.push(J)}J=J.nextSibling}})}else{var I=f(H);this.each(function(){var J=this.firstChild;while(J!=null){if(J.nodeType==g){I.each(function(){if(this===J){G.push(J)}})}J=J.nextSibling}})}return f(G)},append:function(G){G=e(G);return this.each(function(){for(var H=0;H<G.length;H++){this.appendChild(G[H])}})},remove:function(G){return this.each(function(){if(G){$(G,this).remove()}else{var H=this.parentNode;H.removeChild(this)}})},empty:function(){return this.each(function(){this.innerHTML=""})},val:function(G){if(G==null){var H=null;if(this&&this.length!=0&&typeof this[0].value!="undefined"){H=this[0].value}return H}else{return this.each(function(){if(typeof this.value!="undefined"){this.value=G}})}},bind:function(G,H){return this.each(function(){F(this,G,H)})},trigger:function(G,H){return this.each(function(){return k(this,G,H)})},submit:function(G){return this.each(function(){if(f.isFunction(G)){F(this,"onsubmit",G)}else{if(this.submit){this.submit()}}})}};if(n.addEventListener){E=function(){n.removeEventListener("DOMContentLoaded",E,false);f.ready()}}else{if(n.attachEvent){E=function(){if(n.readyState==="complete"){n.detachEvent("onreadystatechange",E);f.ready()}}}}if(!D){D=true;if(n.readyState==="complete"){return f.ready()}if(n.addEventListener){n.addEventListener("DOMContentLoaded",E,false);window.addEventListener("load",f.ready,false)}else{if(n.attachEvent){n.attachEvent("onreadystatechange",E);window.attachEvent("onload",f.ready)}}}var x=function(I,H){var G={};G[I]=H;return G};var e=function(G){if(G.nodeType&&(G.nodeType===g||G.nodeType===c)){G=[G]}else{if(typeof G==="string"){G=f(G).toArray()}else{if(G.jquery&&typeof G.jquery==="string"){G=G.toArray()}}}return G};var i=function(H){var G=f.trim(H).toLowerCase();return G.indexOf("<option")==0?"SELECT":G.indexOf("<li")==0?"UL":G.indexOf("<tr")==0?"TBODY":G.indexOf("<td")==0?"TR":"DIV"};if(typeof window.jQuery=="undefined"){window.jQuery=f;window.jQuery.fn=o.prototype;window.$=window.jQuery;window.now=C}jQuery.extend=jQuery.fn.extend=function(){var O=arguments[0]||{},M=1,J=arguments.length,H=false,K,I,G,N;if(typeof O==="boolean"){H=O;O=arguments[1]||{};M=2}if(typeof O!=="object"&&!jQuery.isFunction(O)){O={}}if(J===M){O=this;--M}for(;M<J;M++){if((K=arguments[M])!=null){for(I in K){G=O[I];N=K[I];if(O===N){continue}if(H&&N&&(jQuery.isPlainObject(N)||jQuery.isArray(N))){var L=G&&(jQuery.isPlainObject(G)||jQuery.isArray(G))?G:jQuery.isArray(N)?[]:{};O[I]=jQuery.extend(H,L,N)}else{if(N!==undefined){O[I]=N}}}}}return O};jQuery.each("click,dblclick,mouseover,mouseout,mousedown,mouseup,keydown,keypress,keyup,focus,blur,change,select,error,load,unload,scroll,resize,touchstart,touchend,touchmove".split(","),function(G,H){jQuery.fn[H]=function(I){return(I?this.bind(H,I):this.trigger(H))}})})();var iPadLabels=function(){function b(){var f=document.getElementsByTagName("label"),d,c;for(var e=0;f[e];e++){if(f[e].getAttribute("for")){f[e].onclick=a}}}function a(){el=document.getElementById(this.getAttribute("for"));if(["radio","checkbox"].indexOf(el.getAttribute("type"))!=-1){el.setAttribute("selected",!el.getAttribute("selected"))}else{el.focus()}}return{fix:b}}();
