Skip to content
Browse files

upgrading to jquery 1.5, jquery mobile alpha 3, latest rails ujs from…

… github
  • Loading branch information...
1 parent 6c488e5 commit 029c06a0963e334cf7d9345042c32796bb923228 @croaky croaky committed Feb 19, 2011
View
2 app/views/shared/_javascript.html.erb
@@ -1,4 +1,4 @@
-<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
+<script src="//code.jquery.com/jquery-1.5.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="/javascripts/jquery.js"%3E%3C/script%3E'))</script>
<%= javascript_include_tag 'jquery-ui', 'prefilled_input', 'rails', 'application' %>
View
4 app/views/shared/_javascript.mobile.erb
@@ -1,8 +1,8 @@
<% if Rails.env.test? %>
<%= javascript_include_tag "jquery", "jquery-mobile" %>
<% else %>
- <script src="//code.jquery.com/jquery-1.4.4.min.js"></script>
- <script src="//code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>
+ <script src="//code.jquery.com/jquery-1.5.min.js"></script>
+ <script src="//code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
<% end %>
<%= render :partial => 'shared/google_analytics' %>
View
206 public/javascripts/jquery-mobile.js
@@ -1,99 +1,121 @@
/*!
- * jQuery Mobile v1.0a2
+ * jQuery Mobile v1.0a3
* http://jquerymobile.com/
*
* Copyright 2010, jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
-(function(a,e){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var f=0,h;(h=b[f])!=null;f++)a(h).triggerHandler("remove");c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,f){return this.each(function(){if(!f)if(!b||a.filter(b,[this]).length)a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")});return d.call(a(this),b,f)})}}a.widget=function(b,f,h){var l=b.split(".")[0],j;b=b.split(".")[1];j=l+"-"+b;if(!h){h=f;f=a.Widget}a.expr[":"][j]=function(n){return!!a.data(n,
-b)};a[l]=a[l]||{};a[l][b]=function(n,g){arguments.length&&this._createWidget(n,g)};f=new f;f.options=a.extend(true,{},f.options);a[l][b].prototype=a.extend(true,f,{namespace:l,widgetName:b,widgetEventPrefix:a[l][b].prototype.widgetEventPrefix||b,widgetBaseClass:j},h);a.widget.bridge(b,a[l][b])};a.widget.bridge=function(b,f){a.fn[b]=function(h){var l=typeof h==="string",j=Array.prototype.slice.call(arguments,1),n=this;h=!l&&j.length?a.extend.apply(null,[true,h].concat(j)):h;if(l&&h.charAt(0)==="_")return n;
-l?this.each(function(){var g=a.data(this,b);if(!g)throw"cannot call methods on "+b+" prior to initialization; attempted to call method '"+h+"'";if(!a.isFunction(g[h]))throw"no such method '"+h+"' for "+b+" widget instance";var i=g[h].apply(g,j);if(i!==g&&i!==e){n=i;return false}}):this.each(function(){var g=a.data(this,b);g?g.option(h||{})._init():a.data(this,b,new f(h,this))});return n}};a.Widget=function(b,f){arguments.length&&this._createWidget(b,f)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",
-options:{disabled:false},_createWidget:function(b,f){a.data(f,this.widgetName,this);this.element=a(f);this.options=a.extend(true,{},this.options,this._getCreateOptions(),b);var h=this;this.element.bind("remove."+this.widgetName,function(){h.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){var b={};if(a.metadata)b=a.metadata.get(element)[this.widgetName];return b},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);
-this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(b,f){var h=b;if(arguments.length===0)return a.extend({},this.options);if(typeof b==="string"){if(f===e)return this.options[b];h={};h[b]=f}this._setOptions(h);return this},_setOptions:function(b){var f=this;a.each(b,function(h,l){f._setOption(h,l)});return this},_setOption:function(b,f){this.options[b]=f;if(b===
-"disabled")this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,f,h){var l=this.options[b];f=a.Event(f);f.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();h=h||{};if(f.originalEvent){b=a.event.props.length;for(var j;b;){j=a.event.props[--b];f[j]=f.originalEvent[j]}}this.element.trigger(f,
-h);return!(a.isFunction(l)&&l.call(this.element[0],f,h)===false||f.isDefaultPrevented())}}})(jQuery);(function(a,e){a.widget("mobile.widget",{_getCreateOptions:function(){var c=this.element,d={};a.each(this.options,function(b){var f=c.data(b.replace(/[A-Z]/g,function(h){return"-"+h.toLowerCase()}));if(f!==e)d[b]=f});return d}})})(jQuery);
-(function(a,e){function c(j){var n=j.charAt(0).toUpperCase()+j.substr(1);j=(j+" "+f.join(n+" ")+n).split(" ");for(var g in j)if(b[g]!==e)return true}a.media=function(){var j={},n=a("html"),g=a("<div id='jquery-mediatest'>"),i=a("<body>").append(g);return function(m){if(!(m in j)){var o=a("<style type='text/css'>@media "+m+"{#jquery-mediatest{position:absolute;}}</style>");n.prepend(i).prepend(o);j[m]=g.css("position")==="absolute";i.add(o).remove()}return j[m]}}();var d=a("<body>").prependTo("html"),
-b=d[0].style,f=["webkit","moz","o"],h=window.palmGetResource||window.PalmServiceBridge,l=window.blackberry;a.extend(a.support,{orientation:"orientation"in window,touch:"ontouchend"in document,cssTransitions:"WebKitTransitionEvent"in window,pushState:!!history.pushState,mediaquery:a.media("only all"),cssPseudoElement:!!c("content"),boxShadow:!!c("boxShadow")&&!l,scrollTop:("pageXOffset"in window||"scrollTop"in document.documentElement||"scrollTop"in d[0])&&!h,dynamicBaseTag:function(){var j=location.protocol+
-"//"+location.host+location.pathname+"ui-dir/",n=a("<base>",{href:j}).appendTo("head"),g=a("<a href='testurl'></a>").prependTo(d)[0].href;n.remove();return g.indexOf(j)===0}()});d.remove();a.support.boxShadow||a("html").addClass("ui-mobile-nosupport-boxshadow")})(jQuery);
-(function(a,e){a.each("touchstart touchmove touchend orientationchange tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(h,l){a.fn[l]=function(j){return j?this.bind(l,j):this.trigger(l)};a.attrFn[l]=true});var c=a.support.touch,d=c?"touchstart":"mousedown",b=c?"touchend":"mouseup",f=c?"touchmove":"mousemove";a.event.special.scrollstart={enabled:true,setup:function(){function h(g,i){j=i;var m=g.type;g.type=j?"scrollstart":"scrollstop";a.event.handle.call(l,g);g.type=
-m}var l=this,j,n;a(l).bind("touchmove scroll",function(g){if(a.event.special.scrollstart.enabled){j||h(g,true);clearTimeout(n);n=setTimeout(function(){h(g,false)},50)}})}};a.event.special.tap={setup:function(){var h=this,l=a(h);l.bind(d,function(j){function n(){if(Math.abs(m[0]-j.pageX)>10||Math.abs(m[1]-j.pageY)>10)g=true}if(!(j.which&&j.which!==1)){var g=false,i=true,m=[j.pageX,j.pageY],o,t;t=setTimeout(function(){if(i&&!g){o=j.type;j.type="taphold";a.event.handle.call(h,j);j.type=o}},750);l.one(f,
-n).one(b,function(w){l.unbind(f,n);clearTimeout(t);i=false;if(!g){o=w.type;w.type="tap";a.event.handle.call(h,w);w.type=o}})}})}};a.event.special.swipe={setup:function(){var h=a(this);h.bind(d,function(l){function j(m){if(g){var o=m.originalEvent.touches?m.originalEvent.touches[0]:m;i={time:(new Date).getTime(),coords:[o.pageX,o.pageY]};Math.abs(g.coords[0]-i.coords[0])>10&&m.preventDefault()}}var n=l.originalEvent.touches?l.originalEvent.touches[0]:l,g={time:(new Date).getTime(),coords:[n.pageX,
-n.pageY],origin:a(l.target)},i;h.bind(f,j).one(b,function(){h.unbind(f,j);if(g&&i)if(i.time-g.time<1E3&&Math.abs(g.coords[0]-i.coords[0])>30&&Math.abs(g.coords[1]-i.coords[1])<75)g.origin.trigger("swipe").trigger(g.coords[0]>i.coords[0]?"swipeleft":"swiperight");g=i=e})})}};(function(h){function l(){var i=n();if(i!==g){g=i;j.trigger("orientationchange")}}var j=h(window),n,g;h.event.special.orientationchange={setup:function(){if(h.support.orientation)return false;g=n();j.bind("resize",l)},teardown:function(){if(h.support.orientation)return false;
-j.unbind("resize",l)},add:function(i){var m=i.handler;i.handler=function(o){o.orientation=n();return m.apply(this,arguments)}}};n=function(){var i=document.documentElement;return i&&i.clientWidth/i.clientHeight<1.1?"portrait":"landscape"}})(jQuery);a.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(h,l){a.event.special[h]={setup:function(){a(this).bind(l,a.noop)}}})})(jQuery);
-(function(a,e,c){function d(g){g=g||location.href;return"#"+g.replace(/^[^#]*#?(.*)$/,"$1")}var b="hashchange",f=document,h,l=a.event.special,j=f.documentMode,n="on"+b in e&&(j===c||j>7);a.fn[b]=function(g){return g?this.bind(b,g):this.trigger(b)};a.fn[b].delay=50;l[b]=a.extend(l[b],{setup:function(){if(n)return false;a(h.start)},teardown:function(){if(n)return false;a(h.stop)}});h=function(){function g(){var x=d(),v=u(o);if(x!==o){w(o=x,v);a(e).trigger(b)}else if(v!==o)location.href=location.href.replace(/#.*/,
-"")+v;m=setTimeout(g,a.fn[b].delay)}var i={},m,o=d(),t=function(x){return x},w=t,u=t;i.start=function(){m||g()};i.stop=function(){m&&clearTimeout(m);m=c};a.browser.msie&&!n&&function(){var x,v;i.start=function(){if(!x){v=(v=a.fn[b].src)&&v+d();x=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){v||w(d());g()}).attr("src",v||"javascript:0").insertAfter("body")[0].contentWindow;f.onpropertychange=function(){try{if(event.propertyName==="title")x.document.title=f.title}catch(s){}}}};
-i.stop=t;u=function(){return d(x.location.href)};w=function(s,z){var q=x.document,G=a.fn[b].domain;if(s!==z){q.title=f.title;q.open();G&&q.write('<script>document.domain="'+G+'"<\/script>');q.close();x.location.hash=s}}}();return i}()})(jQuery,this);
-(function(a){a.widget("mobile.page",a.mobile.widget,{options:{backBtnText:"Back",addBackBtn:true,degradeInputs:{color:false,date:false,datetime:false,"datetime-local":false,email:false,month:false,number:false,range:true,search:true,tel:false,time:false,url:false,week:false}},_create:function(){var e=this.element,c=this.options;if(this._trigger("beforeCreate")!==false){e.find("[data-role='page'], [data-role='content']").andSelf().each(function(){a(this).addClass("ui-"+a(this).data("role"))});e.find("[data-role='nojs']").addClass("ui-nojs");
-this._enchanceControls();e.find("[data-role]").andSelf().each(function(){var d=a(this),b=d.data("role"),f=d.data("theme");if(b==="header"||b==="footer"){d.addClass("ui-bar-"+(f||d.parent("[data-role=page]").data("theme")||"a"));d.attr("role",b==="header"?"banner":"contentinfo");f=d.children("a");var h=f.hasClass("ui-btn-left"),l=f.hasClass("ui-btn-right");if(!h)h=f.eq(0).not(".ui-btn-right").addClass("ui-btn-left").length;if(!l)l=f.eq(1).addClass("ui-btn-right").length;if(c.addBackBtn&&b==="header"&&
-(a.mobile.urlStack.length>1||a(".ui-page").length>1)&&!h&&!d.data("noBackBtn"))a("<a href='#' class='ui-btn-left' data-icon='arrow-l'>"+c.backBtnText+"</a>").click(function(){history.back();return false}).prependTo(d);d.children("h1, h2, h3, h4, h5, h6").addClass("ui-title").attr({tabindex:"0",role:"heading","aria-level":"1"})}else if(b==="content"){f&&d.addClass("ui-body-"+f);d.attr("role","main")}else if(b==="page")d.addClass("ui-body-"+(f||"c"));switch(b){case "header":case "footer":case "page":case "content":d.addClass("ui-"+
-b);break;case "collapsible":case "fieldcontain":case "navbar":case "listview":case "dialog":d[b]()}});e.find("[data-role='button'], .ui-bar a, .ui-header a, .ui-footer a").not(".ui-btn").buttonMarkup();e.find("[data-role='controlgroup']").controlgroup();e.find("a:not(.ui-btn):not(.ui-link-inherit)").addClass("ui-link");e.fixHeaderFooter()}},_enchanceControls:function(){var e=this.options;this.element.find("input").each(function(){var c=this.getAttribute("type");e.degradeInputs[c]&&a(this).replaceWith(a("<div>").html(a(this).clone()).html().replace(/type="([a-zA-Z]+)"/,
-"data-type='$1'"))});this.element.find("[type='radio'], [type='checkbox']").checkboxradio();this.element.find("button, [type='button'], [type='submit'], [type='reset'], [type='image']").not(".ui-nojs").button();this.element.find("input, textarea").not("[type='radio'], [type='checkbox'], button, [type='button'], [type='submit'], [type='reset'], [type='image']").textinput();this.element.find("input, select").filter("[data-role='slider'], [data-type='range']").slider();this.element.find("select:not([data-role='slider'])").selectmenu()}})})(jQuery);
-(function(a){a.fn.fixHeaderFooter=function(){if(!a.support.scrollTop)return a(this);return a(this).each(function(){a(this).data("fullscreen")&&a(this).addClass("ui-page-fullscreen");a(this).find('.ui-header[data-position="fixed"]').addClass("ui-header-fixed ui-fixed-inline fade");a(this).find('.ui-footer[data-position="fixed"]').addClass("ui-footer-fixed ui-fixed-inline fade")})};a.fixedToolbars=function(){function e(g){var i=0;if(g){var m=g.offsetParent,o=document.body;for(i=g.offsetTop;g&&g!=o;){i+=
-g.scrollTop||0;if(g==m){i+=m.offsetTop;m=g.offsetParent}g=g.parentNode}}return i}function c(g){var i=a(window).scrollTop(),m=e(g[0]),o=g.css("top")=="auto"?0:parseFloat(g.css("top")),t=window.innerHeight,w=g.outerHeight(),u=g.parents(".ui-page:not(.ui-page-fullscreen)").length;if(g.is(".ui-header-fixed")){o=i-m+o;if(o<m)o=0;return g.css("top",u?o:i)}else{o=i+t-w-(m-o);return g.css("top",u?o:i+t-w)}}if(a.support.scrollTop){var d="inline",b,f=a.support.touch,h=f?"touchstart":"mousedown",l=f?"touchend":
-"mouseup",j=null,n=false;a(function(){a(document).bind(h,function(g){if(!a(g.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length){j=d;a.fixedToolbars.hide(true)}}).bind("scrollstart",function(g){if(!a(g.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length){n=true;if(j==null)j=d;a.fixedToolbars.hide(true)}}).bind(l,function(g){if(!a(g.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length)if(!n){a.fixedToolbars.toggle(j);
-j=null}}).bind("scrollstop",function(g){if(!a(g.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length){n=false;a.fixedToolbars.toggle(j=="overlay"?"inline":"overlay");j=null}});a(".ui-page").live("pagebeforeshow",function(g){var i=a(g.target).find('[data-role="footer"]');b=a('.ui-footer[data-id="'+i.data("id")+'"]:not(.ui-footer-duplicate)').not(i);if(b.length){b.parents(".ui-page:eq(0)").find('.ui-footer[data-id="'+b.data("id")+'"]').length==1&&b.before(b.clone().addClass("ui-footer-duplicate"));
-a(g.target).find('[data-role="footer"]').addClass("ui-footer-duplicate");b.appendTo(a.pageContainer).css("top",0);c(b)}});a(".ui-page").live("pageshow",function(g){b&&b.length&&b.appendTo(g.target).css("top",0);a.fixedToolbars.show(true,this)})});return{show:function(g,i){d="overlay";return(i?a(i):a.mobile.activePage?a.mobile.activePage:a(".ui-page-active")).children(".ui-header-fixed:first, .ui-footer-fixed:not(.ui-footer-duplicate):last").each(function(){var m=a(this),o=a(window).scrollTop(),t=
-e(m[0]),w=window.innerHeight,u=m.outerHeight();o=m.is(".ui-header-fixed")&&o<=t+u||m.is(".ui-footer-fixed")&&t<=o+w;m.addClass("ui-fixed-overlay").removeClass("ui-fixed-inline");!o&&!g&&m.addClass("in").animationComplete(function(){m.removeClass("in")});c(m)})},hide:function(g){d="inline";return(a.mobile.activePage?a.mobile.activePage:a(".ui-page-active")).children(".ui-header-fixed:first, .ui-footer-fixed:not(.ui-footer-duplicate):last").each(function(){var i=a(this),m=i.css("top");m=m=="auto"?0:
-parseFloat(m);i.addClass("ui-fixed-inline").removeClass("ui-fixed-overlay");if(m<0||i.is(".ui-header-fixed")&&m!=0)if(g)i.css("top",0);else i.css("top")!=="auto"&&parseFloat(i.css("top"))!==0&&i.addClass("out reverse").animationComplete(function(){i.removeClass("out reverse");i.css("top",0)})})},hideAfterDelay:function(){setTimeout(function(){a.fixedToolbars.hide()},3E3)},toggle:function(g){if(g)d=g;return d=="overlay"?a.fixedToolbars.hide():a.fixedToolbars.show()}}}}()})(jQuery);
-(function(a,e){a.widget("mobile.checkboxradio",a.mobile.widget,{options:{theme:null},_create:function(){var c=this.element,d=a("label[for='"+c.attr("id")+"']"),b=c.attr("type"),f="ui-icon-"+b+"-off";if(!(b!="checkbox"&&b!="radio")){d.buttonMarkup({theme:this.options.theme,icon:this.element.parents("[data-type='horizontal']").length?e:f,shadow:false});c.add(d).wrapAll("<div class='ui-"+b+"'></div>");d.bind({mouseover:function(){if(a(this).parent().is(".ui-disabled"))return false},mousedown:function(){if(a(this).parent().is(".ui-disabled"))return false;
-d.data("state",c.attr("checked"))},click:function(){setTimeout(function(){c.attr("checked")===d.data("state")&&c.trigger("click")},1)}});c.bind({click:function(){a("input[name='"+c.attr("name")+"'][type='"+b+"']").checkboxradio("refresh")},focus:function(){d.addClass("ui-focus")},blur:function(){d.removeClass("ui-focus")}});this.refresh()}},refresh:function(){var c=this.element,d=a("label[for='"+c.attr("id")+"']"),b=c.attr("type"),f=d.find(".ui-icon"),h="ui-icon-"+b+"-on";b="ui-icon-"+b+"-off";if(c[0].checked){d.addClass("ui-btn-active");
-f.addClass(h);f.removeClass(b)}else{d.removeClass("ui-btn-active");f.removeClass(h);f.addClass(b)}c.is(":disabled")?this.disable():this.enable()},disable:function(){this.element.attr("disabled",true).parent().addClass("ui-disabled")},enable:function(){this.element.attr("disabled",false).parent().removeClass("ui-disabled")}})})(jQuery);
-(function(a){a.widget("mobile.textinput",a.mobile.widget,{options:{theme:null},_create:function(){var e=this.element,c=this.options,d=c.theme;if(!d){d=this.element.closest("[class*='ui-bar-'],[class*='ui-body-']");d=d.length?/ui-(bar|body)-([a-z])/.exec(d.attr("class"))[2]:"c"}d=" ui-body-"+d;a("label[for="+e.attr("id")+"]").addClass("ui-input-text");e.addClass("ui-input-text ui-body-"+c.theme);var b=e;if(e.is('[type="search"],[data-type="search"]')){b=e.wrap('<div class="ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-search'+
-d+'"></div>').parent();var f=a('<a href="#" class="ui-input-clear" title="clear text">clear text</a>').click(function(){e.val("").focus();e.trigger("change");f.addClass("ui-input-clear-hidden");return false}).appendTo(b).buttonMarkup({icon:"delete",iconpos:"notext",corners:true,shadow:true});c=function(){e.val()==""?f.addClass("ui-input-clear-hidden"):f.removeClass("ui-input-clear-hidden")};c();e.keyup(c)}else e.addClass("ui-corner-all ui-shadow-inset"+d);e.focus(function(){b.addClass("ui-focus")}).blur(function(){b.removeClass("ui-focus")});
-if(e.is("textarea")){var h=function(){var j=e[0].scrollHeight;e[0].clientHeight<j&&e.css({height:j+15})},l;e.keyup(function(){clearTimeout(l);l=setTimeout(h,100)})}},disable:function(){(this.element.attr("disabled",true).is('[type="search"],[data-type="search"]')?this.element.parent():this.element).addClass("ui-disabled")},enable:function(){(this.element.attr("disabled",false).is('[type="search"],[data-type="search"]')?this.element.parent():this.element).removeClass("ui-disabled")}})})(jQuery);
-(function(a){a.widget("mobile.selectmenu",a.mobile.widget,{options:{theme:null,disabled:false,icon:"arrow-d",iconpos:"right",inline:null,corners:true,shadow:true,iconshadow:true,menuPageTheme:"b",overlayTheme:"a"},_create:function(){var e=this,c=this.options,d=this.element.attr("tabindex","-1").wrap("<div class='ui-select'>"),b=d.attr("id"),f=a("label[for="+b+"]").addClass("ui-select"),h=b+"-button",l=b+"-menu",j=d.closest(".ui-page"),n=a("<a>",{href:"#",role:"button",id:h,"aria-haspopup":"true",
-"aria-owns":l}).text(a(d[0].options.item(d[0].selectedIndex)).text()).insertBefore(d).buttonMarkup({theme:c.theme,icon:c.icon,iconpos:c.iconpos,inline:c.inline,corners:c.corners,shadow:c.shadow,iconshadow:c.iconshadow}),g=/ui-btn-up-([a-z])/.exec(n.attr("class"))[1],i=a("<div data-role='dialog' data-theme='"+c.menuPageTheme+"'><div data-role='header'><div class='ui-title'>"+f.text()+"</div></div><div data-role='content'></div></div>").appendTo(a.pageContainer).page(),m=i.find(".ui-content"),o=a("<div>",
-{"class":"ui-listbox-screen ui-overlay ui-screen-hidden fade"}).appendTo(j);c=a("<div>",{"class":"ui-listbox ui-listbox-hidden ui-overlay-shadow ui-corner-all pop ui-body-"+c.overlayTheme}).insertAfter(o);var t=a("<ul>",{"class":"ui-listbox-list",id:l,role:"listbox","aria-labelledby":h,"data-theme":g}).appendTo(c);a.extend(e,{select:d,selectID:b,label:f,buttonId:h,menuId:l,thisPage:j,button:n,menuPage:i,menuPageContent:m,screen:o,listbox:c,list:t,menuType:void 0});e.refresh();this.options.disabled&&
-this.disable();d.change(function(){e.refresh()}).focus(function(){a(this).blur();n.focus()});n.click(function(){e.open();return false});t.delegate("li","click",function(){var w=t.find("li").index(this),u=d[0].selectedIndex;d[0].selectedIndex=w;w!==u&&d.trigger("change");e.refresh();e.close();return false});o.click(function(){e.close();return false})},_buildList:function(){var e=this;e.list.empty().filter(".ui-listview").listview("destroy");e.select.find("option").each(function(){var c=a("<a>",{role:"option",
-href:"#"}).text(a(this).text());a("<li>",{"data-icon":"checkbox-on"}).append(c).appendTo(e.list)});e.list.listview()},refresh:function(e){var c=this.element,d=c[0].selectedIndex;if(e||c[0].options.length>this.list.find("li").length)this._buildList();this.button.find(".ui-btn-text").text(a(c[0].options.item(d)).text());this.list.find("li").removeClass(a.mobile.activeBtnClass).attr("aria-selected",false).eq(d).addClass(a.mobile.activeBtnClass).find("a").attr("aria-selected",true)},open:function(){function e(){c.list.find(".ui-btn-active").focus()}
-if(!this.options.disabled){var c=this,d=c.list.outerHeight(),b=a(window).scrollTop(),f=c.button.offset().top,h=window.innerHeight;if(d>h-80||!a.support.scrollTop){b==0&&f>h&&c.thisPage.one("pagehide",function(){a(this).data("lastScroll",f)});c.menuPage.one("pageshow",e);c.menuType="page";c.menuPageContent.append(c.list);a.mobile.changePage(c.menuPage,"pop",false,false)}else{c.menuType="overlay";c.screen.height(a(document).height()).removeClass("ui-screen-hidden");c.listbox.append(c.list).removeClass("ui-listbox-hidden").css({top:b+
-h/2,"margin-top":-d/2,left:window.innerWidth/2,"margin-left":-1*c.listbox.outerWidth()/2}).addClass("in");e()}}},close:function(){function e(){setTimeout(function(){c.button.focus()},40);c.listbox.removeAttr("style").append(c.list)}if(!this.options.disabled){var c=this;if(c.menuType=="page"){a.mobile.changePage([c.menuPage,c.thisPage],"pop",true,false);c.menuPage.one("pagehide",function(){e()})}else{c.screen.addClass("ui-screen-hidden");c.listbox.addClass("ui-listbox-hidden").removeAttr("style").removeClass("in");
-e()}}},disable:function(){this.element.attr("disabled",true);this.button.addClass("ui-disabled").attr("aria-disabled",true);return this._setOption("disabled",true)},enable:function(){this.element.attr("disabled",false);this.button.removeClass("ui-disabled").attr("aria-disabled",false);return this._setOption("disabled",false)}})})(jQuery);
-(function(a){a.fn.buttonMarkup=function(c){return this.each(function(){var d=a(this),b=a.extend({},a.fn.buttonMarkup.defaults,d.data(),c),f,h="ui-btn-inner",l;e&&e();if(!b.theme){f=d.closest("[class*='ui-bar-'],[class*='ui-body-']");b.theme=f.length?/ui-(bar|body)-([a-z])/.exec(f.attr("class"))[2]:"c"}f="ui-btn ui-btn-up-"+b.theme;if(b.inline)f+=" ui-btn-inline";if(b.icon){b.icon="ui-icon-"+b.icon;b.iconpos=b.iconpos||"left";l="ui-icon "+b.icon;if(b.shadow)l+=" ui-icon-shadow"}if(b.iconpos){f+=" ui-btn-icon-"+
-b.iconpos;b.iconpos=="notext"&&!d.attr("title")&&d.attr("title",d.text())}if(b.corners){f+=" ui-btn-corner-all";h+=" ui-btn-corner-all"}if(b.shadow)f+=" ui-shadow";d.attr("data-theme",b.theme).addClass(f);b=("<D class='"+h+"'><D class='ui-btn-text'></D>"+(b.icon?"<span class='"+l+"'></span>":"")+"</D>").replace(/D/g,b.wrapperEls);d.wrapInner(b)})};a.fn.buttonMarkup.defaults={corners:true,shadow:true,iconshadow:true,wrapperEls:"span"};var e=function(){a(".ui-btn").live({mousedown:function(){var c=
-a(this).attr("data-theme");a(this).removeClass("ui-btn-up-"+c).addClass("ui-btn-down-"+c)},mouseup:function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-down-"+c).addClass("ui-btn-up-"+c)},"mouseover focus":function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-up-"+c).addClass("ui-btn-hover-"+c)},"mouseout blur":function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-hover-"+c).addClass("ui-btn-up-"+c)}});e=null}})(jQuery);
-(function(a){a.widget("mobile.button",a.mobile.widget,{options:{theme:null,icon:null,iconpos:null,inline:null,corners:true,shadow:true,iconshadow:true},_create:function(){var e=this.element,c=this.options,d=e.attr("type");e.addClass("ui-btn-hidden").attr("tabindex","-1");a("<a>",{href:"#",role:"button","aria-label":e.attr("type")}).text(e.text()||e.val()).insertBefore(e).click(function(){d=="submit"?a(this).closest("form").submit():e.click();return false}).buttonMarkup({theme:c.theme,icon:c.icon,
-iconpos:c.iconpos,inline:c.inline,corners:c.corners,shadow:c.shadow,iconshadow:c.iconshadow})}})})(jQuery);
-(function(a){a.widget("mobile.slider",a.mobile.widget,{options:{theme:null,trackTheme:null},_create:function(){function e(s,z){if(z)t=(parseFloat(z)-m)/(o-m)*100;else{var q=s.originalEvent.touches?s.originalEvent.touches[0]:s;if(!v||q.pageX<u.offset().left-8||q.pageX>u.offset().left+u.width()+8)return;t=Math.round((q.pageX-u.offset().left)/u.width()*100)}if(t<0)t=0;if(t>100)t=100;q=Math.round(t/100*(o-m))+m;if(q<m)q=m;if(q>o)q=o;w=Math.round(q/(o-m)*100);x.css("left",t+"%");x.attr({"aria-valuenow":j==
-"input"?q:b.find("option").eq(q).attr("value"),"aria-valuetext":j=="input"?q:b.find("option").eq(q).text(),title:q});c(q);q=q;if(j=="input")b.val(q);else b[0].selectedIndex=q;b.trigger("change")}function c(s){if(j!="input")s==0?u.addClass("ui-slider-switch-a").removeClass("ui-slider-switch-b"):u.addClass("ui-slider-switch-b").removeClass("ui-slider-switch-a")}function d(){j=="select"&&x.addClass("ui-slider-handle-snapping").css("left",w+"%").animationComplete(function(){x.removeClass("ui-slider-handle-snapping")})}
-var b=this.element,f=b.parents("[class*=ui-bar-],[class*=ui-body-]").eq(0);f=f.length?f.attr("class").match(/ui-(bar|body)-([a-z])/)[2]:"c";var h=this.options.theme?this.options.theme:f,l=this.options.trackTheme?this.options.trackTheme:f,j=b[0].nodeName.toLowerCase();f=j=="select"?"ui-slider-switch":"";var n=b.attr("id"),g=n+"-label";n=a("[for="+n+"]").attr("id",g);var i=j=="input"?parseFloat(b.val()):b[0].selectedIndex,m=j=="input"?parseFloat(b.attr("min")):0,o=j=="input"?parseFloat(b.attr("max")):
-b.find("option").length-1,t=(parseFloat(i)-m)/(o-m)*100,w=t,u=a('<div class="ui-slider '+f+" ui-btn-down-"+l+' ui-btn-corner-all" role="application"></div>'),x=a('<a href="#" class="ui-slider-handle"></a>').appendTo(u).buttonMarkup({corners:true,theme:h,shadow:true}).attr({role:"slider","aria-valuemin":m,"aria-valuemax":o,"aria-valuenow":i,"aria-valuetext":i,title:i,"aria-labelledby":g}),v=false;if(j=="select"){u.wrapInner('<div class="ui-slider-inneroffset"></div>');b.find("option");b.find("option").each(function(s){var z=
-s==0?"b":"a",q=s==0?"right":"left";s=s==0?" ui-btn-down-"+l:" ui-btn-active";a('<div class="ui-slider-labelbg ui-slider-labelbg-'+z+s+" ui-btn-corner-"+q+'"></div>').prependTo(u);a('<span class="ui-slider-label ui-slider-label-'+z+s+" ui-btn-corner-"+q+'" role="img">'+a(this).text()+"</span>").prependTo(x)})}c(i);n.addClass("ui-slider");b.addClass(j=="input"?"ui-slider-input":"ui-slider-switch").keyup(function(s){e(s,a(this).val())});a(document).bind(a.support.touch?"touchmove":"mousemove",function(s){if(v){e(s);
-return false}});u.bind(a.support.touch?"touchstart":"mousedown",function(s){v=true;if(j=="select")i=b[0].selectedIndex;e(s);return false});u.add(document).bind(a.support.touch?"touchend":"mouseup",function(s){if(v){v=false;if(j=="select"){if(i==b[0].selectedIndex){i=i==0?1:0;e(s,i)}d()}return false}});u.insertAfter(b);x.css("left",t+"%").bind("click",function(){return false})}})})(jQuery);
-(function(a){a.widget("mobile.collapsible",a.mobile.widget,{options:{expandCueText:" click to expand contents",collapseCueText:" click to collapse contents",collapsed:false,heading:">:header,>legend",theme:null,iconTheme:"d"},_create:function(){var e=this.element,c=this.options,d=e.addClass("ui-collapsible-contain"),b=e.find(c.heading).eq(0),f=d.wrapInner('<div class="ui-collapsible-content"></div>').find(".ui-collapsible-content");e=e.closest('[data-role="collapsible-set"]').addClass("ui-collapsible-set");
-if(b.is("legend")){b=a('<div role="heading">'+b.html()+"</div>").insertBefore(b);b.next().remove()}b.insertBefore(f);b.addClass("ui-collapsible-heading").append('<span class="ui-collapsible-heading-status"></span>').wrapInner('<a href="#" class="ui-collapsible-heading-toggle"></a>').find("a:eq(0)").buttonMarkup({shadow:!!!e.length,corners:false,iconPos:"left",icon:"plus",theme:c.theme}).find(".ui-icon").removeAttr("class").buttonMarkup({shadow:true,corners:true,iconPos:"notext",icon:"plus",theme:c.iconTheme});
-if(e.length)d.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").addClass("ui-corner-bottom");else b.find("a:eq(0)").addClass("ui-corner-all").find(".ui-btn-inner").addClass("ui-corner-all");d.bind("collapse",function(h){if(!h.isDefaultPrevented()){h.preventDefault();b.addClass("ui-collapsible-heading-collapsed").find(".ui-collapsible-heading-status").text(c.expandCueText);b.find(".ui-icon").removeClass("ui-icon-minus").addClass("ui-icon-plus");f.addClass("ui-collapsible-content-collapsed").attr("aria-hidden",
-true);d.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").addClass("ui-corner-bottom")}}).bind("expand",function(h){if(!h.isDefaultPrevented()){h.preventDefault();b.removeClass("ui-collapsible-heading-collapsed").find(".ui-collapsible-heading-status").text(c.collapseCueText);b.find(".ui-icon").removeClass("ui-icon-plus").addClass("ui-icon-minus");f.removeClass("ui-collapsible-content-collapsed").attr("aria-hidden",false);d.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").removeClass("ui-corner-bottom")}}).trigger(c.collapsed?
-"collapse":"expand");if(e.length&&!e.data("collapsiblebound")){e.data("collapsiblebound",true).bind("expand",function(h){a(this).find(".ui-collapsible-contain").not(a(h.target).closest(".ui-collapsible-contain")).not("> .ui-collapsible-contain .ui-collapsible-contain").trigger("collapse")});e=e.find("[data-role=collapsible]");e.first().find("a:eq(0)").addClass("ui-corner-top").find(".ui-btn-inner").addClass("ui-corner-top");e.last().data("collapsible-last",true)}b.click(function(){b.is(".ui-collapsible-heading-collapsed")?
-d.trigger("expand"):d.trigger("collapse");return false})}})})(jQuery);
-(function(a){a.fn.controlgroup=function(e){return a(this).each(function(){function c(h){h.removeClass("ui-btn-corner-all ui-shadow").eq(0).addClass(f[0]).end().filter(":last").addClass(f[1]).addClass("ui-controlgroup-last")}var d=a.extend({direction:a(this).data("type")||"vertical",shadow:false},e),b=a(this).find(">legend"),f=d.direction=="horizontal"?["ui-corner-left","ui-corner-right"]:["ui-corner-top","ui-corner-bottom"];a(this).find("input:eq(0)").attr("type");if(b.length){a(this).wrapInner('<div class="ui-controlgroup-controls"></div>');
-a('<div role="heading" class="ui-controlgroup-label">'+b.html()+"</div>").insertBefore(a(this).children(0));b.remove()}a(this).addClass("ui-corner-all ui-controlgroup ui-controlgroup-"+d.direction);c(a(this).find(".ui-btn"));c(a(this).find(".ui-btn-inner"));d.shadow&&a(this).addClass("ui-shadow")})}})(jQuery);(function(a){a.fn.fieldcontain=function(e){a.extend({theme:"c"},e);return a(this).addClass("ui-field-contain ui-body ui-br")}})(jQuery);
-(function(a){a.widget("mobile.listview",a.mobile.widget,{options:{theme:"c",countTheme:"c",headerTheme:"b",dividerTheme:"b",splitIcon:"arrow-r",splitTheme:"b",inset:false},_create:function(){var e=this.element,c=this.options;e.addClass("ui-listview").attr("role","listbox");c.inset&&e.addClass("ui-listview-inset ui-corner-all ui-shadow");e.delegate(".ui-li","focusin",function(){a(this).attr("tabindex","0")});this._itemApply(e,e);this.refresh(true);e.keydown(function(d){var b=a(d.target),f=b.closest("li");
-switch(d.keyCode){case 38:d=f.prev();if(d.length){b.blur().attr("tabindex","-1");d.find("a").first().focus()}return false;case 40:d=f.next();if(d.length){b.blur().attr("tabindex","-1");d.find("a").first().focus()}return false;case 39:d=f.find("a.ui-li-link-alt");if(d.length){b.blur();d.first().focus()}return false;case 37:d=f.find("a.ui-link-inherit");if(d.length){b.blur();d.first().focus()}return false;case 13:case 32:b.trigger("click");return false}});e.delegate("li","click",function(d){if(!a(d.target).closest("a").length){a(this).find("a").first().trigger("click");
-return false}})},_itemApply:function(e,c){c.find(".ui-li-count").addClass("ui-btn-up-"+(e.data("counttheme")||this.options.countTheme)+" ui-btn-corner-all");c.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading");c.find("p, dl").addClass("ui-li-desc");c.find("img").addClass("ui-li-thumb").each(function(){a(this).closest("li").addClass(a(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")});var d=c.find(".ui-li-aside");d.length&&d.each(function(b,f){a(f).prependTo(a(f).parent())});a.support.cssPseudoElement||
-a.nodeName(c[0],"ol")},refresh:function(e){this._createSubPages();var c=this.options,d=this.element,b=this,f=d.data("dividertheme")||c.dividerTheme,h=d.children("li"),l=a.support.cssPseudoElement||!a.nodeName(d[0],"ol")?0:1;l&&d.find(".ui-li-dec").remove();h.attr({role:"option",tabindex:"-1"});h.first().attr("tabindex","0");h.each(function(j){var n=a(this),g="ui-li";if(!(!e&&n.hasClass("ui-li"))){var i=n.find("a");if(i.length){n.buttonMarkup({wrapperEls:"div",shadow:false,corners:false,iconpos:"right",
-icon:i.length>1?false:n.data("icon")||"arrow-r",theme:c.theme});i.first().addClass("ui-link-inherit");if(i.length>1){g+=" ui-li-has-alt";i=i.last();var m=d.data("splittheme")||i.data("theme")||c.splitTheme;i.attr("title",i.text()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:false,corners:false,theme:c.theme,icon:false,iconpos:false}).find(".ui-btn-inner").append(a("<span>").buttonMarkup({shadow:true,corners:true,theme:m,iconpos:"notext",icon:d.data("spliticon")||i.data("icon")||c.splitIcon}))}}else if(n.data("role")===
-"list-divider"){g+=" ui-li-divider ui-btn ui-bar-"+f;n.attr("role","heading");if(l)l=1}else g+=" ui-li-static ui-btn-up-"+c.theme;if(j===0){if(c.inset){g+=" ui-corner-top";n.add(n.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").addClass("ui-corner-tl")}}else if(j===h.length-1)if(c.inset){g+=" ui-corner-bottom";n.add(n.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").addClass("ui-corner-bl")}l&&g.indexOf("ui-li-divider")<
-0&&n.find(".ui-link-inherit").first().addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+l++ +". </span>");n.addClass(g);e||b._itemApply(d,n)}})},_createSubPages:function(){var e=this.element,c=e.closest(".ui-page"),d=c.attr("id"),b=this.options,f=c.find("[data-role='footer']").data("id");a(e.find("ul, ol").toArray().reverse()).each(function(h){var l=a(this),j=l.parent(),n=j.contents()[0].nodeValue.split("\n")[0];h=d+"&"+a.mobile.subPageUrlKey+"="+a.mobile.idStringEscape(n+" "+h);var g=
-l.data("theme")||b.theme,i=l.data("counttheme")||e.data("counttheme")||b.countTheme;l.wrap("<div data-role='page'><div data-role='content'></div></div>").parent().before("<div data-role='header' data-theme='"+b.headerTheme+"'><div class='ui-title'>"+n+"</div></div>").after(f?a("<div>",{"data-role":"footer","data-id":f,"class":"ui-footer-duplicate"}):"").parent().attr({id:h,"data-theme":g,"data-count-theme":i}).appendTo(a.pageContainer).page();j.html("<a href='#"+h+"'>"+n+"</a>")}).listview()}})})(jQuery);
-(function(a){a.mobile.listview.prototype.options.filter=false;a("[data-role='listview']").live("listviewcreate",function(){var e=a(this);if(e.data("listview").options.filter){var c=a("<form>",{"class":"ui-listview-filter ui-bar-c",role:"search"});a("<input>",{placeholder:"Filter results...","data-type":"search"}).bind("keyup change",function(){var d=this.value.toLowerCase();e.children().show();d&&e.children().filter(function(){return a(this).text().toLowerCase().indexOf(d)===-1}).hide()}).appendTo(c).textinput();
-c.insertBefore(e)}})})(jQuery);
-(function(a,e){a.widget("mobile.dialog",a.mobile.widget,{options:{},_create:function(){var c=this,d=c.element,b=a.mobile.activePage,f=a('<a href="#" data-icon="delete" data-iconpos="notext">Close</a>');d.delegate("a, submit","click submit",function(h){if(h.type=="click"&&(a(h.target).closest("[data-back]")||a(h.target).closest(f))){c.close();return false}a.mobile.activePage=this.element});this.element.bind("pageshow",function(){return false}).attr("role","dialog").addClass("ui-page ui-dialog ui-body-a").find("[data-role=header]").addClass("ui-corner-top ui-overlay-shadow").prepend(f).end().find('.ui-content:not([class*="ui-body-"])').addClass("ui-body-c").end().find(".ui-content,[data-role=footer]").last().addClass("ui-corner-bottom ui-overlay-shadow");a(window).bind("hashchange",
-function(){if(d.is(".ui-page-active")){c.close();d.bind("pagehide",function(){a.mobile.updateHash(b.attr("id"),true)})}})},close:function(){a.mobile.changePage([this.element,a.mobile.activePage],e,true,true)}})})(jQuery);
-(function(a,e){a.widget("mobile.navbar",a.mobile.widget,{options:{iconpos:"top",grid:null},_create:function(){var c=this.element,d=c.find("a"),b=d.filter("[data-icon]").length?this.options.iconpos:e;c.addClass("ui-navbar").attr("role","navigation").find("ul").grid({grid:this.options.grid});b||c.addClass("ui-navbar-noicons");d.buttonMarkup({corners:false,shadow:false,iconpos:b});c.delegate("a","click",function(){d.removeClass("ui-btn-active")})}})})(jQuery);
-(function(a){a.fn.grid=function(e){return a(this).each(function(){var c=a.extend({grid:null},e),d=a(this).children(),b={a:2,b:3,c:4,d:5};c=c.grid;if(!c)if(d.length<=5)for(var f in b){if(b[f]==d.length)c=f}else c="a";b=b[c];a(this).addClass("ui-grid-"+c);d.filter(":nth-child("+b+"n+1)").addClass("ui-block-a");d.filter(":nth-child("+b+"n+2)").addClass("ui-block-b");b>2&&d.filter(":nth-child(3n+3)").addClass("ui-block-c");b>3&&d.filter(":nth-child(4n+4)").addClass("ui-block-d");b>4&&d.filter(":nth-child(5n+5)").addClass("ui-block-e")})}})(jQuery);
-(function(a,e,c){function d(k){a.event.special.scrollstart.enabled=false;setTimeout(function(){e.scrollTo(0,k||0)},20);setTimeout(function(){a.event.special.scrollstart.enabled=true},150)}function b(k){k=k.replace(/#/,"").split("/");k.pop();return k.join("/")+(k.length?"/":"")}function f(k){if(k)o.removeClass("ui-loading");else{a.mobile.loadingMessage&&w.appendTo(s).css({top:a(e).scrollTop()+75});o.addClass("ui-loading")}}function h(k){var p=k.find(".ui-title:eq(0)");p.length?p.focus():k.find(G).eq(0).focus()}
-function l(k){if(H){k.attr("data-role",H);H=c}}function j(k){var p=["data-role","data-theme","data-fullscreen"],r=k.wrap("<div>").parent();a.each(p,function(y){if(k.attr(p[y])){r.attr(p[y],k.attr(p[y]));k.removeAttr(p[y])}});return r}function n(k){if(z&&(!z.closest(".ui-page-active").length||k))z.removeClass(a.mobile.activeBtnClass);z=null}function g(k,p,r,y){function A(){function E(){f(true);if(C.data("page")._trigger("hide",null,{nextPage:k})!==false&&k.data("page")._trigger("show",null,{prevPage:C})!==
-false)a.mobile.activePage=k;h(k);y&&D&&a.mobile.updateHash(D,true);n();K!=null&&K.remove();d(k.data("lastScroll"))}a(e.document.activeElement).blur();var I=m.scrollTop();C.data("lastScroll",I);C.data("page")._trigger("beforehide",{nextPage:k});k.data("page")._trigger("beforeshow",{prevPage:C});if(p&&p!=="none"){s.addClass("ui-mobile-viewport-transitioning");C.addClass(p+" out "+(r?"reverse":""));k.addClass(a.mobile.activePageClass+" "+p+" in "+(r?"reverse":""));k.animationComplete(function(){C.add(k).removeClass(" out in reverse "+
-a.mobile.transitions.join(" "));C.removeClass(a.mobile.activePageClass);E();s.removeClass("ui-mobile-viewport-transitioning")})}else{C.removeClass(a.mobile.activePageClass);k.addClass(a.mobile.activePageClass);E()}}function J(E){return E.match("&"+a.mobile.subPageUrlKey)?E.split("&"+a.mobile.subPageUrlKey)[0]:E}var F=a.type(k)==="array",C=F?k[0]:a.mobile.activePage;k=F?k[1]:k;var D=fileUrl=a.type(k)==="string"?k.replace(/^#/,""):null;F=c;var L="get",O=false,K=null;r=r!==c?r:q.length>1&&q[q.length-
-2].url===D;p=p!==c?p:a.mobile.defaultTransition;if(a.type(k)==="object"&&k.url){D=k.url;F=k.data;L=k.type;O=true;if(F&&L=="get"){D+="?"+F;F=c}}P();if(r)p=q.pop().transition;else q.push({url:D,transition:p});if(D){k=a("[id='"+D+"']");fileUrl=J(D)}else{var Q=k.attr("id"),R=J(Q);if(Q!=R)fileUrl=R}if(k.length&&!O){fileUrl&&S(fileUrl);l(k);k.page();A()}else{if(k.length)K=k;f();a.ajax({url:fileUrl,type:L,data:F,success:function(E){S(fileUrl);var I=a("<div></div>");I.get(0).innerHTML=E;k=I.find('[data-role="page"]');
-if(!a.support.dynamicBaseTag){var U=b(fileUrl||location.hash);k.find("[src],link[href]").each(function(){var T=a(this).is("[href]")?"href":"src",M=a(this).attr(T);M.replace(location.protocol+"//"+location.host+location.pathname,"");/^(\w+:|#|\/)/.test(M)||a(this).attr(T,U+M)})}if(k.attr("id"))k=j(k);k.attr("id",fileUrl).appendTo(s);l(k);k.page();A()},error:function(){f(true);n(true);a("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>Error Loading Page</h1></div>").css({display:"block",
-opacity:0.96,top:a(e).scrollTop()+100}).appendTo(s).delay(800).fadeOut(400,function(){a(this).remove()})}})}}function i(){var k=m.width(),p=[],r=[],y;o.removeClass("min-width-"+B.join("px min-width-")+"px max-width-"+B.join("px max-width-")+"px");a.each(B,function(A){k>=B[A]&&p.push("min-width-"+B[A]+"px");k<=B[A]&&r.push("max-width-"+B[A]+"px")});if(p.length)y=p.join(" ");if(r.length)y+=" "+r.join(" ");o.addClass(y)}a.extend(a.mobile,{subPageUrlKey:"ui-page",nonHistorySelectors:"dialog",activePageClass:"ui-page-active",
-activeBtnClass:"ui-btn-active",ajaxLinksEnabled:true,ajaxFormsEnabled:true,transitions:["slide","slideup","slidedown","pop","flip","fade"],defaultTransition:"slide",loadingMessage:"loading",metaViewportContent:"width=device-width, minimum-scale=1, maximum-scale=1",gradeA:function(){return a.support.mediaquery}});a(e.document).trigger("mobileinit");if(a.mobile.gradeA()){var m=a(e),o=a("html"),t=a("head"),w=a.mobile.loadingMessage?a('<div class="ui-loader ui-body-a ui-corner-all"><span class="ui-icon ui-icon-loading spin"></span><h1>'+
-a.mobile.loadingMessage+"</h1></div>"):c;a.mobile.metaViewportContent&&a("<meta>",{name:"viewport",content:a.mobile.metaViewportContent}).prependTo(t);var u=b(location.protocol+"//"+location.host+location.pathname),x=a.support.dynamicBaseTag?a("<base>",{href:u}).prependTo(t):c,v,s,z=null,q=[{url:location.hash.replace(/^#/,""),transition:c}],G="[tabindex],a,button:visible,select:visible,input",H=null,N=true,B=[320,480,768,1024];o.addClass("ui-mobile ui-mobile-rendering");a.mobile.urlStack=q;a.mobile.idStringEscape=
-function(k){return k.replace(/[^a-zA-Z0-9]/g,"-")};var S=!a.support.dynamicBaseTag?a.noop:function(k){x.attr("href",u+b(k||location.hash))},P=!a.support.dynamicBaseTag?a.noop:function(){x.attr("href",u)};P();a("form").live("submit",function(k){if(a.mobile.ajaxFormsEnabled){var p=a(this).attr("method"),r=a(this).attr("action").replace(location.protocol+"//"+location.host,"");if(!/^(:?\w+:)/.test(r)){if(r.indexOf("/")&&r.indexOf("#")!==0)r=b(location.hash)+r;g({url:r,type:p,data:a(this).serialize()},
-c,c,true);k.preventDefault()}}});a("a").live("click",function(k){var p=a(this),r=p.attr("href").replace(location.protocol+"//"+location.host,""),y=p.is("[target]"),A=y||/^(:?\w+:)/.test(r)||p.is("[rel=external]");y=p.is("[target]");if(r==="#")return false;z=p.closest(".ui-btn").addClass(a.mobile.activeBtnClass);if(A||!a.mobile.ajaxLinksEnabled){n(true);if(y)e.open(r);else location.href=r}else{y=p.data("transition");A=p.data("back");var J=!p.is("[data-rel="+a.mobile.nonHistorySelectors+"]");H=p.attr("data-rel");
-if(r.indexOf("/")&&r.indexOf("#")!==0)r=b(location.hash)+r;r.replace(/^#/,"");g(r,y,A,J)}k.preventDefault()});a.mobile.updateHash=function(k,p){if(p)N=false;location.hash=k};a(function(){a("body");f();m.bind("hashchange",function(k,p){if(N){if(!a(".ui-page-active").is("[data-role="+a.mobile.nonHistorySelectors+"]")){var r=location.hash,y=p?false:c;if(r)g(r,y);else if(a.mobile.activePage.length&&v[0]!==a.mobile.activePage[0]&&!p)g(v,y,true);else{v.trigger("pagebeforeshow",{prevPage:a("")});v.addClass(a.mobile.activePageClass);
-f(true);v.trigger("pageshow",{prevPage:a("")})!==false&&h(v)}}}else N=true})});m.bind("orientationchange.htmlclass",function(k){o.removeClass("portrait landscape").addClass(k.orientation)});m.bind("orientationchange resize",i);i();a.mobile.addResolutionBreakpoints=function(k){if(a.type(k)==="array")B=B.concat(k);else B.push(k);i()};a.fn.animationComplete=function(k){if(a.support.cssTransitions)return a(this).one("webkitAnimationEnd",k);else k()};a.extend(a.mobile,{pageLoading:f,changePage:g,silentScroll:d});
-a(function(){var k=a("[data-role='page']");v=a.mobile.activePage=k.first();s=v.parent().addClass("ui-mobile-viewport");a.extend({pageContainer:s});k.page();m.trigger("hashchange",[true]);m.trigger("orientationchange.htmlclass");o.removeClass("ui-mobile-rendering")});m.load(d)}})(jQuery,this);
+(function(a,d){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var g=0,e;(e=b[g])!=null;g++)a(e).triggerHandler("remove");c(b)}}else{var f=a.fn.remove;a.fn.remove=function(b,g){return this.each(function(){if(!g)if(!b||a.filter(b,[this]).length)a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")});return f.call(a(this),b,g)})}}a.widget=function(b,g,e){var i=b.split(".")[0],h;b=b.split(".")[1];h=i+"-"+b;if(!e){e=g;g=a.Widget}a.expr[":"][h]=function(k){return!!a.data(k,
+b)};a[i]=a[i]||{};a[i][b]=function(k,j){arguments.length&&this._createWidget(k,j)};g=new g;g.options=a.extend(true,{},g.options);a[i][b].prototype=a.extend(true,g,{namespace:i,widgetName:b,widgetEventPrefix:a[i][b].prototype.widgetEventPrefix||b,widgetBaseClass:h},e);a.widget.bridge(b,a[i][b])};a.widget.bridge=function(b,g){a.fn[b]=function(e){var i=typeof e==="string",h=Array.prototype.slice.call(arguments,1),k=this;e=!i&&h.length?a.extend.apply(null,[true,e].concat(h)):e;if(i&&e.charAt(0)==="_")return k;
+i?this.each(function(){var j=a.data(this,b);if(!j)throw"cannot call methods on "+b+" prior to initialization; attempted to call method '"+e+"'";if(!a.isFunction(j[e]))throw"no such method '"+e+"' for "+b+" widget instance";var o=j[e].apply(j,h);if(o!==j&&o!==d){k=o;return false}}):this.each(function(){var j=a.data(this,b);j?j.option(e||{})._init():a.data(this,b,new g(e,this))});return k}};a.Widget=function(b,g){arguments.length&&this._createWidget(b,g)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",
+options:{disabled:false},_createWidget:function(b,g){a.data(g,this.widgetName,this);this.element=a(g);this.options=a.extend(true,{},this.options,this._getCreateOptions(),b);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){var b={};if(a.metadata)b=a.metadata.get(element)[this.widgetName];return b},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);
+this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(b,g){var e=b;if(arguments.length===0)return a.extend({},this.options);if(typeof b==="string"){if(g===d)return this.options[b];e={};e[b]=g}this._setOptions(e);return this},_setOptions:function(b){var g=this;a.each(b,function(e,i){g._setOption(e,i)});return this},_setOption:function(b,g){this.options[b]=g;if(b===
+"disabled")this.widget()[g?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",g);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,g,e){var i=this.options[b];g=a.Event(g);g.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();e=e||{};if(g.originalEvent){b=a.event.props.length;for(var h;b;){h=a.event.props[--b];g[h]=g.originalEvent[h]}}this.element.trigger(g,
+e);return!(a.isFunction(i)&&i.call(this.element[0],g,e)===false||g.isDefaultPrevented())}}})(jQuery);(function(a,d){a.widget("mobile.widget",{_getCreateOptions:function(){var c=this.element,f={};a.each(this.options,function(b){var g=c.data(b.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}));if(g!==d)f[b]=g});return f}})})(jQuery);
+(function(a){function d(){var g=c.width(),e=[],i=[],h;f.removeClass("min-width-"+b.join("px min-width-")+"px max-width-"+b.join("px max-width-")+"px");a.each(b,function(k,j){g>=j&&e.push("min-width-"+j+"px");g<=j&&i.push("max-width-"+j+"px")});if(e.length)h=e.join(" ");if(i.length)h+=" "+i.join(" ");f.addClass(h)}var c=a(window),f=a("html"),b=[320,480,768,1024];a.mobile.media=function(){var g={},e=a("<div id='jquery-mediatest'>"),i=a("<body>").append(e);return function(h){if(!(h in g)){var k=document.createElement("style"),
+j="@media "+h+" { #jquery-mediatest { position:absolute; } }";k.type="text/css";if(k.styleSheet)k.styleSheet.cssText=j;else k.appendChild(document.createTextNode(j));f.prepend(i).prepend(k);g[h]=e.css("position")==="absolute";i.add(k).remove()}return g[h]}}();a.mobile.addResolutionBreakpoints=function(g){if(a.type(g)==="array")b=b.concat(g);else b.push(g);b.sort(function(e,i){return e-i});d()};a(document).bind("mobileinit.htmlclass",function(){c.bind("orientationchange.htmlclass resize.htmlclass",
+function(g){g.orientation&&f.removeClass("portrait landscape").addClass(g.orientation);d()})});a(function(){c.trigger("orientationchange.htmlclass")})})(jQuery);
+(function(a,d){function c(h){var k=h.charAt(0).toUpperCase()+h.substr(1);h=(h+" "+g.join(k+" ")+k).split(" ");for(var j in h)if(b[j]!==d)return true}var f=a("<body>").prependTo("html"),b=f[0].style,g=["webkit","moz","o"],e=window.palmGetResource||window.PalmServiceBridge,i=window.blackberry;a.extend(a.support,{orientation:"orientation"in window,touch:"ontouchend"in document,cssTransitions:"WebKitTransitionEvent"in window,pushState:!!history.pushState,mediaquery:a.mobile.media("only all"),cssPseudoElement:!!c("content"),
+boxShadow:!!c("boxShadow")&&!i,scrollTop:("pageXOffset"in window||"scrollTop"in document.documentElement||"scrollTop"in f[0])&&!e,dynamicBaseTag:function(){var h=location.protocol+"//"+location.host+location.pathname+"ui-dir/",k=a("head base"),j=null,o="";if(k.length)o=k.attr("href");else k=j=a("<base>",{href:h}).appendTo("head");var p=a("<a href='testurl'></a>").prependTo(f)[0].href;k[0].href=o?o:location.pathname;j&&j.remove();return p.indexOf(h)===0}()});f.remove();a.support.boxShadow||a("html").addClass("ui-mobile-nosupport-boxshadow")})(jQuery);
+(function(a,d){a.each("touchstart touchmove touchend orientationchange tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(e,i){a.fn[i]=function(h){return h?this.bind(i,h):this.trigger(i)};a.attrFn[i]=true});var c=a.support.touch,f=c?"touchstart":"mousedown",b=c?"touchend":"mouseup",g=c?"touchmove":"mousemove";a.event.special.scrollstart={enabled:true,setup:function(){function e(j,o){h=o;var p=j.type;j.type=h?"scrollstart":"scrollstop";a.event.handle.call(i,j);j.type=
+p}var i=this,h,k;a(i).bind("touchmove scroll",function(j){if(a.event.special.scrollstart.enabled){h||e(j,true);clearTimeout(k);k=setTimeout(function(){e(j,false)},50)}})}};a.event.special.tap={setup:function(){var e=this,i=a(e);i.bind("mousedown touchstart",function(h){function k(n){if(n.type=="scroll")j=true;else{n=n.type=="touchmove"?n.originalEvent.touches[0]:n;if(Math.abs(v[0]-n.pageX)>10||Math.abs(v[1]-n.pageY)>10)j=true}}if(h.which&&h.which!==1||i.data("prevEvent")&&i.data("prevEvent")!==h.type)return false;
+i.data("prevEvent",h.type);setTimeout(function(){i.removeData("prevEvent")},800);var j=false,o=true,p=h.target,t=h.originalEvent,v=h.type=="touchstart"?[t.touches[0].pageX,t.touches[0].pageY]:[h.pageX,h.pageY],m,r;r=setTimeout(function(){if(o&&!j){m=h.type;h.type="taphold";a.event.handle.call(e,h);h.type=m}},750);a(window).one("scroll",k);i.bind("mousemove touchmove",k).one("mouseup touchend",function(n){i.unbind("mousemove touchmove",k);a(window).unbind("scroll",k);clearTimeout(r);o=false;if(!j&&
+p==n.target){m=n.type;n.type="tap";a.event.handle.call(e,n);n.type=m}})})}};a.event.special.swipe={setup:function(){var e=a(this);e.bind(f,function(i){function h(p){if(j){var t=p.originalEvent.touches?p.originalEvent.touches[0]:p;o={time:(new Date).getTime(),coords:[t.pageX,t.pageY]};Math.abs(j.coords[0]-o.coords[0])>10&&p.preventDefault()}}var k=i.originalEvent.touches?i.originalEvent.touches[0]:i,j={time:(new Date).getTime(),coords:[k.pageX,k.pageY],origin:a(i.target)},o;e.bind(g,h).one(b,function(){e.unbind(g,
+h);if(j&&o)if(o.time-j.time<1E3&&Math.abs(j.coords[0]-o.coords[0])>30&&Math.abs(j.coords[1]-o.coords[1])<75)j.origin.trigger("swipe").trigger(j.coords[0]>o.coords[0]?"swipeleft":"swiperight");j=o=d})})}};(function(e){function i(){var o=k();if(o!==j){j=o;h.trigger("orientationchange")}}var h=e(window),k,j;e.event.special.orientationchange={setup:function(){if(e.support.orientation)return false;j=k();h.bind("resize",i)},teardown:function(){if(e.support.orientation)return false;h.unbind("resize",i)},
+add:function(o){var p=o.handler;o.handler=function(t){t.orientation=k();return p.apply(this,arguments)}}};k=function(){var o=document.documentElement;return o&&o.clientWidth/o.clientHeight<1.1?"portrait":"landscape"}})(jQuery);a.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(e,i){a.event.special[e]={setup:function(){a(this).bind(i,a.noop)}}})})(jQuery);
+(function(a,d,c){function f(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}var b="hashchange",g=document,e,i=a.event.special,h=g.documentMode,k="on"+b in d&&(h===c||h>7);a.fn[b]=function(j){return j?this.bind(b,j):this.trigger(b)};a.fn[b].delay=50;i[b]=a.extend(i[b],{setup:function(){if(k)return false;a(e.start)},teardown:function(){if(k)return false;a(e.stop)}});e=function(){function j(){var n=f(),u=r(t);if(n!==t){m(t=n,u);a(d).trigger(b)}else if(u!==t)location.href=location.href.replace(/#.*/,
+"")+u;p=setTimeout(j,a.fn[b].delay)}var o={},p,t=f(),v=function(n){return n},m=v,r=v;o.start=function(){p||j()};o.stop=function(){p&&clearTimeout(p);p=c};a.browser.msie&&!k&&function(){var n,u;o.start=function(){if(!n){u=(u=a.fn[b].src)&&u+f();n=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){u||m(f());j()}).attr("src",u||"javascript:0").insertAfter("body")[0].contentWindow;g.onpropertychange=function(){try{if(event.propertyName==="title")n.document.title=g.title}catch(l){}}}};
+o.stop=v;r=function(){return f(n.location.href)};m=function(l,s){var q=n.document,w=a.fn[b].domain;if(l!==s){q.title=g.title;q.open();w&&q.write('<script>document.domain="'+w+'"<\/script>');q.close();n.location.hash=l}}}();return o}()})(jQuery,this);
+(function(a){a.widget("mobile.page",a.mobile.widget,{options:{backBtnText:"Back",addBackBtn:true,degradeInputs:{color:false,date:false,datetime:false,"datetime-local":false,email:false,month:false,number:false,range:"number",search:true,tel:false,time:false,url:false,week:false},keepNative:null},_create:function(){var d=this.element,c=this.options;this.keepNative="[data-role='none'], [data-role='nojs']"+(c.keepNative?", "+c.keepNative:"");if(this._trigger("beforeCreate")!==false){d.find("[data-role='page'], [data-role='content']").andSelf().each(function(){a(this).addClass("ui-"+
+a(this).data("role"))});d.find("[data-role='nojs']").addClass("ui-nojs");d.find("[data-role]").andSelf().each(function(){var f=a(this),b=f.data("role"),g=f.data("theme");if(b==="header"||b==="footer"){f.addClass("ui-bar-"+(g||f.parent("[data-role=page]").data("theme")||"a"));f.attr("role",b==="header"?"banner":"contentinfo");g=f.children("a");var e=g.hasClass("ui-btn-left"),i=g.hasClass("ui-btn-right");if(!e)e=g.eq(0).not(".ui-btn-right").addClass("ui-btn-left").length;i||g.eq(1).addClass("ui-btn-right");
+c.addBackBtn&&b==="header"&&a(".ui-page").length>1&&d.data("url")!==a.mobile.path.stripHash(location.hash)&&!e&&f.data("backbtn")!==false&&a("<a href='#' class='ui-btn-left' data-rel='back' data-icon='arrow-l'>"+c.backBtnText+"</a>").prependTo(f);f.children("h1, h2, h3, h4, h5, h6").addClass("ui-title").attr({tabindex:"0",role:"heading","aria-level":"1"})}else if(b==="content"){g&&f.addClass("ui-body-"+g);f.attr("role","main")}else if(b==="page")f.addClass("ui-body-"+(g||"c"));switch(b){case "header":case "footer":case "page":case "content":f.addClass("ui-"+
+b);break;case "collapsible":case "fieldcontain":case "navbar":case "listview":case "dialog":f[b]()}});this._enhanceControls();d.find("[data-role='button'], .ui-bar > a, .ui-header > a, .ui-footer > a").not(".ui-btn").not(this.keepNative).buttonMarkup();d.find("[data-role='controlgroup']").controlgroup();d.find("a:not(.ui-btn):not(.ui-link-inherit)").not(this.keepNative).addClass("ui-link");d.fixHeaderFooter()}},_enhanceControls:function(){var d=this.options;this.element.find("input").not(this.keepNative).each(function(){var b=
+this.getAttribute("type"),g=d.degradeInputs[b]||"text";d.degradeInputs[b]&&a(this).replaceWith(a("<div>").html(a(this).clone()).html().replace(/type="([a-zA-Z]+)"/,"type="+g+" data-type='$1'"))});var c=this.element.find("input, textarea, select, button"),f=c.not(this.keepNative);c=c.filter("input[type=text]");c.length&&typeof c[0].autocorrect!=="undefined"&&c.each(function(){this.setAttribute("autocorrect","off");this.setAttribute("autocomplete","off")});f.filter("[type='radio'], [type='checkbox']").checkboxradio();
+f.filter("button, [type='button'], [type='submit'], [type='reset'], [type='image']").button();f.filter("input, textarea").not("[type='radio'], [type='checkbox'], [type='button'], [type='submit'], [type='reset'], [type='image'], [type='hidden']").textinput();f.filter("input, select").filter("[data-role='slider'], [data-type='range']").slider();f.filter("select:not([data-role='slider'])").selectmenu()}})})(jQuery);
+(function(a,d,c){a.extend(a.mobile,{subPageUrlKey:"ui-page",nonHistorySelectors:"dialog",activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",ajaxEnabled:true,hashListeningEnabled:true,ajaxLinksEnabled:true,ajaxFormsEnabled:true,defaultTransition:"slide",loadingMessage:"loading",metaViewportContent:"width=device-width, minimum-scale=1, maximum-scale=1",gradeA:function(){return a.support.mediaquery},autoInitialize:true,keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,
+COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a(d.document).trigger("mobileinit");if(a.mobile.gradeA()){var f=a(d),b=a("html"),g=a("head"),e=a.mobile.loadingMessage?a("<div class='ui-loader ui-body-a ui-corner-all'><span class='ui-icon ui-icon-loading spin'></span><h1>"+
+a.mobile.loadingMessage+"</h1></div>"):c;b.addClass("ui-mobile ui-mobile-rendering");a.mobile.metaViewportContent&&a("<meta>",{name:"viewport",content:a.mobile.metaViewportContent}).prependTo(g);a.extend(a.mobile,{pageLoading:function(i){if(i)b.removeClass("ui-loading");else{if(a.mobile.loadingMessage){i=a("."+a.mobile.activeBtnClass).first();e.appendTo(a.mobile.pageContainer).css({top:a.support.scrollTop&&a(d).scrollTop()+a(d).height()/2||i.length&&i.offset().top||100})}b.addClass("ui-loading")}},
+silentScroll:function(i){i=i||0;a.event.special.scrollstart.enabled=false;setTimeout(function(){d.scrollTo(0,i);a(document).trigger("silentscroll",{x:0,y:i})},20);setTimeout(function(){a.event.special.scrollstart.enabled=true},150)},initializePage:function(){var i=a("[data-role='page']");i.add("[data-role='dialog']").each(function(){a(this).attr("data-url",a(this).attr("id"))});a.mobile.firstPage=i.first();a.mobile.pageContainer=i.first().parent().addClass("ui-mobile-viewport");a.mobile.pageLoading();
+!a.mobile.hashListeningEnabled||!a.mobile.path.stripHash(location.hash)?a.mobile.changePage(a.mobile.firstPage,false,true,false,true):f.trigger("hashchange",[true])}});a.mobile.autoInitialize&&a(a.mobile.initializePage);f.load(a.mobile.silentScroll)}})(jQuery,this);
+(function(a,d){function c(l){if(i&&(!i.closest(".ui-page-active").length||l))i.removeClass(a.mobile.activeBtnClass);i=null}var f=a(window),b=a("html"),g=a("head"),e={get:function(l){if(l==d)l=location.hash;return e.stripHash(l).replace(/[^\/]*\.[^\/*]+$/,"")},getFilePath:function(l){var s="&"+a.mobile.subPageUrlKey;return l&&l.split(s)[0].split(t)[0]},set:function(l){location.hash=l},origin:"",setOrigin:function(){e.origin=e.get(location.protocol+"//"+location.host+location.pathname)},makeAbsolute:function(l){return e.get()+
+l},clean:function(l){return l.replace(location.protocol+"//"+location.host,"")},stripHash:function(l){return l.replace(/^#/,"")},isExternal:function(l){return e.hasProtocol(e.clean(l))},hasProtocol:function(l){return/^(:?\w+:)/.test(l)},isRelative:function(l){return/^[^\/|#]/.test(l)&&!e.hasProtocol(l)},isEmbeddedPage:function(l){return/^#/.test(l)}},i=null,h={stack:[],activeIndex:0,getActive:function(){return h.stack[h.activeIndex]},getPrev:function(){return h.stack[h.activeIndex-1]},getNext:function(){return h.stack[h.activeIndex+
+1]},addNew:function(l,s){h.getNext()&&h.clearForward();h.stack.push({url:l,transition:s});h.activeIndex=h.stack.length-1},clearForward:function(){h.stack=h.stack.slice(0,h.activeIndex+1)},ignoreNextHashChange:true},k="[tabindex],a,button:visible,select:visible,input",j=null,o=[],p=false,t="&ui-state=dialog",v=g.children("base"),m=location.protocol+"//"+location.host,r=e.get(m+location.pathname),n=r;if(v.length){var u=v.attr("href");if(u)n=u.search(/^[^:/]+:\/\/[^/]+\/?/)==-1?u.charAt(0)=="/"?m+u:
+r+u:u;n+=n.charAt(n.length-1)=="/"?" ":"/"}base=a.support.dynamicBaseTag?{element:v.length?v:a("<base>",{href:n}).prependTo(g),set:function(l){base.element.attr("href",n+e.get(l))},reset:function(){base.element.attr("href",n)}}:d;e.setOrigin();a.fn.animationComplete=function(l){if(a.support.cssTransitions)return a(this).one("webkitAnimationEnd",l);else setTimeout(l,0)};a.mobile.updateHash=e.set;a.mobile.path=e;a.mobile.base=base;a.mobile.urlstack=h.stack;a.mobile.urlHistory=h;a.mobile.changePage=
+function(l,s,q,w,z){function F(){function A(){if(w!==false&&x){h.ignoreNextHashChange=false;e.set(x)}!I&&!K&&h.addNew(x,s);c();a.mobile.silentScroll(l.data("lastScroll"));var G=l,P=G.find(".ui-title:eq(0)");P.length?P.focus():G.find(k).eq(0).focus();y&&y.data("page")._trigger("hide",null,{nextPage:l});l.data("page")._trigger("show",null,{prevPage:y||a("")});a.mobile.activePage=l;L!=null&&L.remove();b.removeClass("ui-mobile-rendering");p=false;o.length>0&&a.mobile.changePage.apply(a.mobile,o.pop())}
+function B(G){a.mobile.pageContainer.addClass(G);D.push(G)}a.mobile.silentScroll();var M=f.scrollTop(),J=["flip"],D=[];if(x.indexOf("&"+a.mobile.subPageUrlKey)>-1)l=a("[data-url='"+x+"']");if(y){y.data("lastScroll",M);y.data("page")._trigger("beforehide",{nextPage:l})}l.data("page")._trigger("beforeshow",{prevPage:y||a("")});if(s&&s!=="none"){a.mobile.pageLoading(true);a.inArray(s,J)>=0&&B("ui-mobile-viewport-perspective");B("ui-mobile-viewport-transitioning");if(y)y.addClass(s+" out "+(q?"reverse":
+""));l.addClass(a.mobile.activePageClass+" "+s+" in "+(q?"reverse":""));l.animationComplete(function(){y.add(l).removeClass("out in reverse "+s);y&&y.removeClass(a.mobile.activePageClass);A();a.mobile.pageContainer.removeClass(D.join(" "));D=[]})}else{a.mobile.pageLoading(true);y&&y.removeClass(a.mobile.activePageClass);l.addClass(a.mobile.activePageClass);A()}}function Q(){if(j||l.data("role")=="dialog"){x=h.getActive().url+t;if(j){l.attr("data-role",j);j=null}}l.page()}var E=a.type(l)==="array",
+H=a.type(l)==="object",y=E?l[0]:a.mobile.activePage;l=E?l[1]:l;var x=fileUrl=a.type(l)==="string"?e.stripHash(l):"",C=d,N="get",R=false,L=null,O=h.getActive(),I=false,K=false;if(!(O&&h.stack.length>1&&O.url===x&&!E&&!H))if(p)o.unshift(arguments);else{p=true;if(z){a.each(h.stack,function(A){if(this.url==x){urlIndex=A;I=A<h.activeIndex;K=!I;h.activeIndex=A}});if(I){q=true;s=s||O.transition}else if(K)s=s||h.getActive().transition}if(H&&l.url){x=l.url;C=l.data;N=l.type;R=true;if(C&&N=="get"){if(a.type(C)==
+"object")C=a.param(C);x+="?"+C;C=d}}base&&base.reset();a(window.document.activeElement).add("input:focus, textarea:focus, select:focus").blur();if(x){l=a("[data-url='"+x+"']");fileUrl=e.getFilePath(x)}else{E=l.attr("data-url");H=e.getFilePath(E);if(E!=H)fileUrl=H}if(s===d)s=a.mobile.defaultTransition;if(l.length&&!R){fileUrl&&base&&base.set(fileUrl);Q();F()}else{if(l.length)L=l;a.mobile.pageLoading();a.ajax({url:fileUrl,type:N,data:C,success:function(A){var B=/ data-url="(.*)"/.test(A)&&RegExp.$1;
+if(B){base&&base.set(B);x=fileUrl=e.getFilePath(B)}else base&&base.set(fileUrl);B=a("<div></div>");B.get(0).innerHTML=A;l=B.find('[data-role="page"], [data-role="dialog"]').first();if(!a.support.dynamicBaseTag){var M=e.get(fileUrl);l.find("[src],link[href]").each(function(){var J=a(this).is("[href]")?"href":"src",D=a(this).attr(J);D.replace(location.protocol+"//"+location.host+location.pathname,"");/^(\w+:|#|\/)/.test(D)||a(this).attr(J,M+D)})}l.attr("data-url",fileUrl).appendTo(a.mobile.pageContainer);
+Q();setTimeout(function(){F()},0)},error:function(){a.mobile.pageLoading(true);c(true);base&&base.set(e.get());a("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>Error Loading Page</h1></div>").css({display:"block",opacity:0.96,top:a(window).scrollTop()+100}).appendTo(a.mobile.pageContainer).delay(800).fadeOut(400,function(){a(this).remove()})}})}}};a("form[data-ajax!='false']").live("submit",function(l){if(a.mobile.ajaxEnabled&&a.mobile.ajaxFormsEnabled){var s=a(this).attr("method"),
+q=e.clean(a(this).attr("action"));if(!e.isExternal(q)){if(e.isRelative(q))q=e.makeAbsolute(q);a.mobile.changePage({url:q,type:s,data:a(this).serialize()},d,d,true);l.preventDefault()}}});a("a").live("click",function(l){var s=a(this),q=s.attr("href")||"#";q=e.clean(q);var w=s.is("[rel='external']"),z=e.isEmbeddedPage(q);w=e.isExternal(q)||w&&!z;z=s.is("[target]");var F=s.is("[data-ajax='false']");if(s.is("[data-rel='back']")){window.history.back();return false}if(q==="#")return false;i=s.closest(".ui-btn").addClass(a.mobile.activeBtnClass);
+if(w||F||z||!a.mobile.ajaxEnabled||!a.mobile.ajaxLinksEnabled){c(true);if(z)window.open(q);else if(F)return;else location.href=q}else{w=s.data("transition");z=(z=s.data("direction"))&&z=="reverse"||s.data("back");j=s.attr("data-rel");if(e.isRelative(q))q=e.makeAbsolute(q);q=e.stripHash(q);a.mobile.changePage(q,w,z)}l.preventDefault()});f.bind("hashchange",function(){var l=e.stripHash(location.hash),s=a.mobile.urlHistory.stack.length===0?false:d;if(!a.mobile.hashListeningEnabled||!h.ignoreNextHashChange||
+h.stack.length>1&&l.indexOf(t)>-1&&!a.mobile.activePage.is(".ui-dialog")){if(!h.ignoreNextHashChange)h.ignoreNextHashChange=true}else l?a.mobile.changePage(l,s,d,false,true):a.mobile.changePage(a.mobile.firstPage,s,true,false,true)})})(jQuery);
+(function(a,d){a.fn.fixHeaderFooter=function(){if(!a.support.scrollTop)return this;return this.each(function(){var c=a(this);c.data("fullscreen")&&c.addClass("ui-page-fullscreen");c.find('.ui-header[data-position="fixed"]').addClass("ui-header-fixed ui-fixed-inline fade");c.find('.ui-footer[data-position="fixed"]').addClass("ui-footer-fixed ui-fixed-inline fade")})};a.fixedToolbars=function(){function c(){if(!e&&g=="overlay"){i||a.fixedToolbars.hide(true);a.fixedToolbars.startShowTimer()}}function f(m){var r=
+0;if(m){var n=m.offsetParent,u=document.body;for(r=m.offsetTop;m&&m!=u;){r+=m.scrollTop||0;if(m==n){r+=n.offsetTop;n=m.offsetParent}m=m.parentNode}}return r}function b(m){var r=a(window).scrollTop(),n=f(m[0]),u=m.css("top")=="auto"?0:parseFloat(m.css("top")),l=window.innerHeight,s=m.outerHeight(),q=m.parents(".ui-page:not(.ui-page-fullscreen)").length;if(m.is(".ui-header-fixed")){u=r-n+u;if(u<n)u=0;return m.css("top",q?u:r)}else{u=r+l-s-(n-u);return m.css("top",q?u:r+l-s)}}if(a.support.scrollTop){var g=
+"inline",e=false,i,h,k=a.support.touch,j=k?"touchstart":"mousedown",o=k?"touchend":"mouseup",p=null,t=false,v=true;a(function(){a(document).bind(j,function(m){if(v)a(m.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length||(p=g)}).bind(o,function(m){if(v)if(!a(m.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length)if(!t){a.fixedToolbars.toggle(p);p=null}}).bind("scrollstart",function(m){if(!a(m.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length){t=
+true;if(p==null)p=g;if(e=(m=p=="overlay")||!!i){a.fixedToolbars.clearShowTimer();m&&a.fixedToolbars.hide(true)}}}).bind("scrollstop",function(m){if(!a(m.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length){t=false;if(e){e=false;a.fixedToolbars.startShowTimer()}p=null}}).bind("silentscroll",c);a(window).bind("resize",c)});a(".ui-page").live("pagebeforeshow",function(m){m=a(m.target).find('[data-role="footer"]:not(.ui-sticky-footer)');var r=m.data("id");
+h=null;if(r){h=a('.ui-footer[data-id="'+r+'"].ui-sticky-footer');if(h.length==0){h=m;m=h.clone();h.addClass("ui-sticky-footer").before(m)}m.addClass("ui-footer-duplicate");h.appendTo(a.pageContainer).css("top",0);b(h)}});a(".ui-page").live("pageshow",function(m){h&&h.length&&h.appendTo(m.target).css("top",0);a.fixedToolbars.show(true,this)});return{show:function(m,r){a.fixedToolbars.clearShowTimer();g="overlay";return(r?a(r):a.mobile.activePage?a.mobile.activePage:a(".ui-page-active")).children(".ui-header-fixed:first, .ui-footer-fixed:not(.ui-footer-duplicate):last").each(function(){var n=
+a(this),u=a(window).scrollTop(),l=f(n[0]),s=window.innerHeight,q=n.outerHeight();u=n.is(".ui-header-fixed")&&u<=l+q||n.is(".ui-footer-fixed")&&l<=u+s;n.addClass("ui-fixed-overlay").removeClass("ui-fixed-inline");!u&&!m&&n.animationComplete(function(){n.removeClass("in")}).addClass("in");b(n)})},hide:function(m){g="inline";return(a.mobile.activePage?a.mobile.activePage:a(".ui-page-active")).children(".ui-header-fixed:first, .ui-footer-fixed:not(.ui-footer-duplicate):last").each(function(){var r=a(this),
+n=r.css("top");n=n=="auto"?0:parseFloat(n);r.addClass("ui-fixed-inline").removeClass("ui-fixed-overlay");if(n<0||r.is(".ui-header-fixed")&&n!=0)if(m)r.css("top",0);else r.css("top")!=="auto"&&parseFloat(r.css("top"))!==0&&r.animationComplete(function(){r.removeClass("out reverse");r.css("top",0)}).addClass("out reverse")})},startShowTimer:function(){a.fixedToolbars.clearShowTimer();var m=a.makeArray(arguments);i=setTimeout(function(){i=d;a.fixedToolbars.show.apply(null,m)},100)},clearShowTimer:function(){i&&
+clearTimeout(i);i=d},toggle:function(m){if(m)g=m;return g=="overlay"?a.fixedToolbars.hide():a.fixedToolbars.show()},setTouchToggleEnabled:function(m){v=m}}}}()})(jQuery);
+(function(a,d){a.widget("mobile.checkboxradio",a.mobile.widget,{options:{theme:null},_create:function(){var c=this,f=this.element,b=f.closest("form,fieldset,[data-role='page']").find("label[for='"+f.attr("id")+"']"),g=f.attr("type"),e="ui-icon-"+g+"-off";if(!(g!="checkbox"&&g!="radio")){if(!this.options.theme)this.options.theme=this.element.data("theme");b.buttonMarkup({theme:this.options.theme,icon:this.element.parents("[data-type='horizontal']").length?d:e,shadow:false});f.add(b).wrapAll("<div class='ui-"+
+g+"'></div>");b.bind({mouseover:function(){if(a(this).parent().is(".ui-disabled"))return false},touchmove:function(i){i=i.originalEvent.touches[0];if(b.data("movestart")){if(Math.abs(b.data("movestart")[0]-i.pageX)>10||Math.abs(abel.data("movestart")[1]-i.pageY)>10)b.data("moved",true)}else b.data("movestart",[parseFloat(i.pageX),parseFloat(i.pageY)])},"touchend mouseup":function(i){b.removeData("movestart");if(b.data("etype")&&b.data("etype")!==i.type||b.data("moved")){b.removeData("etype").removeData("moved");
+b.data("moved")&&b.removeData("moved");return false}b.data("etype",i.type);c._cacheVals();f.attr("checked",g==="radio"&&true||!f.is(":checked"));c._updateAll();i.preventDefault()},click:false});f.bind({mousedown:function(){this._cacheVals()},click:function(){c._updateAll()},focus:function(){b.addClass("ui-focus")},blur:function(){b.removeClass("ui-focus")}});this.refresh()}},_cacheVals:function(){this._getInputSet().each(function(){a(this).data("cacheVal",a(this).is(":checked"))})},_getInputSet:function(){return this.element.closest("form,fieldset,[data-role='page']").find("input[name='"+
+this.element.attr("name")+"'][type='"+this.element.attr("type")+"']")},_updateAll:function(){this._getInputSet().each(function(){var c=a(this).data("cacheVal");if(c&&c!==a(this).is(":checked")||a(this).is("[type='checkbox']"))a(this).trigger("change")}).checkboxradio("refresh")},refresh:function(){var c=this.element,f=c.closest("form,fieldset,[data-role='page']").find("label[for='"+c.attr("id")+"']"),b=c.attr("type"),g=f.find(".ui-icon"),e="ui-icon-"+b+"-on";b="ui-icon-"+b+"-off";if(c[0].checked){f.addClass("ui-btn-active");
+g.addClass(e);g.removeClass(b)}else{f.removeClass("ui-btn-active");g.removeClass(e);g.addClass(b)}c.is(":disabled")?this.disable():this.enable()},disable:function(){this.element.attr("disabled",true).parent().addClass("ui-disabled")},enable:function(){this.element.attr("disabled",false).parent().removeClass("ui-disabled")}})})(jQuery);
+(function(a){a.widget("mobile.textinput",a.mobile.widget,{options:{theme:null},_create:function(){var d=this.element,c=this.options,f=c.theme;if(!f){f=this.element.closest("[class*='ui-bar-'],[class*='ui-body-']");f=f.length?/ui-(bar|body)-([a-z])/.exec(f.attr("class"))[2]:"c"}f=" ui-body-"+f;a("label[for="+d.attr("id")+"]").addClass("ui-input-text");d.addClass("ui-input-text ui-body-"+c.theme);var b=d;if(d.is('[type="search"],[data-type="search"]')){b=d.wrap('<div class="ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield'+
+f+'"></div>').parent();var g=a('<a href="#" class="ui-input-clear" title="clear text">clear text</a>').tap(function(h){d.val("").focus();d.trigger("change");g.addClass("ui-input-clear-hidden");h.preventDefault()}).appendTo(b).buttonMarkup({icon:"delete",iconpos:"notext",corners:true,shadow:true});c=function(){d.val()==""?g.addClass("ui-input-clear-hidden"):g.removeClass("ui-input-clear-hidden")};c();d.keyup(c)}else d.addClass("ui-corner-all ui-shadow-inset"+f);d.focus(function(){b.addClass("ui-focus")}).blur(function(){b.removeClass("ui-focus")});
+if(d.is("textarea")){var e=function(){var h=d[0].scrollHeight;d[0].clientHeight<h&&d.css({height:h+15})},i;d.keyup(function(){clearTimeout(i);i=setTimeout(e,100)})}},disable:function(){(this.element.attr("disabled",true).is('[type="search"],[data-type="search"]')?this.element.parent():this.element).addClass("ui-disabled")},enable:function(){(this.element.attr("disabled",false).is('[type="search"],[data-type="search"]')?this.element.parent():this.element).removeClass("ui-disabled")}})})(jQuery);
+(function(a){a.widget("mobile.selectmenu",a.mobile.widget,{options:{theme:null,disabled:false,icon:"arrow-d",iconpos:"right",inline:null,corners:true,shadow:true,iconshadow:true,menuPageTheme:"b",overlayTheme:"a",hidePlaceholderMenuItems:true,closeText:"Close",nativeMenu:false},_create:function(){var d=this,c=this.options,f=this.element.wrap("<div class='ui-select'>"),b=f.attr("id"),g=a("label[for="+b+"]").addClass("ui-select"),e=(d.options.nativeMenu?a("<div/>"):a("<a>",{href:"#",role:"button",id:k,
+"aria-haspopup":"true","aria-owns":j})).text(a(f[0].options.item(f[0].selectedIndex)).text()).insertBefore(f).buttonMarkup({theme:c.theme,icon:c.icon,iconpos:c.iconpos,inline:c.inline,corners:c.corners,shadow:c.shadow,iconshadow:c.iconshadow}),i=d.isMultiple=f[0].multiple;c.nativeMenu&&window.opera&&window.opera.version&&f.addClass("ui-select-nativeonly");if(!c.nativeMenu){var h=f.find("option"),k=b+"-button",j=b+"-menu",o=f.closest(".ui-page"),p=/ui-btn-up-([a-z])/.exec(e.attr("class"))[1],t=a("<div data-role='dialog' data-theme='"+
+c.menuPageTheme+"'><div data-role='header'><div class='ui-title'>"+g.text()+"</div></div><div data-role='content'></div></div>").appendTo(a.mobile.pageContainer).page(),v=t.find(".ui-content"),m=t.find(".ui-header a"),r=a("<div>",{"class":"ui-selectmenu-screen ui-screen-hidden"}).appendTo(o),n=a("<div>",{"class":"ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all pop ui-body-"+c.overlayTheme}).insertAfter(r),u=a("<ul>",{"class":"ui-selectmenu-list",id:j,role:"listbox","aria-labelledby":k,
+"data-theme":p}).appendTo(n);p=a("<div>",{"class":"ui-header ui-bar-"+p}).prependTo(n);var l=a("<h1>",{"class":"ui-title"}).appendTo(p),s=a("<a>",{"data-iconpos":"notext","data-icon":"delete",text:c.closeText,href:"#","class":"ui-btn-left"}).appendTo(p).buttonMarkup()}if(i)d.buttonCount=a("<span>").addClass("ui-li-count ui-btn-up-c ui-btn-corner-all").hide().appendTo(e);c.disabled&&this.disable();f.change(function(){d.refresh()});a.extend(d,{select:f,optionElems:h,selectID:b,label:g,buttonId:k,menuId:j,
+thisPage:o,button:e,menuPage:t,menuPageContent:v,screen:r,listbox:n,list:u,menuType:void 0,header:p,headerClose:s,headerTitle:l,placeholder:""});if(c.nativeMenu){f.appendTo(e).bind("touchstart mousedown",function(){e.addClass(a.mobile.activeBtnClass)}).bind("focus mouseover",function(){e.trigger("mouseover")}).bind("touchmove",function(){e.removeClass(a.mobile.activeBtnClass)}).bind("change blur mouseout",function(){e.trigger("mouseout").removeClass(a.mobile.activeBtnClass)});e.attr("tabindex","-1")}else{d.refresh();
+f.attr("tabindex","-1").focus(function(){a(this).blur();e.focus()});e.bind("touchstart",function(q){a(this).data("startTouches",a.extend({},q.originalEvent.touches[0]))}).bind(a.support.touch?"touchend":"mouseup",function(q){a(this).data("moved")?a(this).removeData("moved"):d.open();q.preventDefault()}).bind("touchmove",function(q){q=q.originalEvent.touches[0];var w=a(this).data("startTouches"),z=Math.abs(q.pageY-w.pageY);if(Math.abs(q.pageX-w.pageX)>10||z>10)a(this).data("moved",true)});u.delegate("li:not(.ui-disabled, .ui-li-divider)",
+"click",function(q){if(a(q.target).is("a")){var w=u.find("li:not(.ui-li-divider)").index(this);w=d.optionElems.eq(w)[0];w.selected=i?!w.selected:true;i&&a(this).find(".ui-icon").toggleClass("ui-icon-checkbox-on",w.selected).toggleClass("ui-icon-checkbox-off",!w.selected);f.trigger("change");i||d.close();q.preventDefault()}});r.add(s).add(m).bind("click",function(q){d.close();q.preventDefault();a.contains(m[0],q.target)&&q.stopImmediatePropagation()})}},_buildList:function(){var d=this,c=this.options,
+f=this.placeholder,b=[],g=[],e=d.isMultiple?"checkbox-off":"false";d.list.empty().filter(".ui-listview").listview("destroy");d.select.find("option").each(function(){var i=a(this),h=i.parent(),k=i.text(),j="<a href='#'>"+k+"</a>",o=[],p=[];if(h.is("optgroup")){h=h.attr("label");if(a.inArray(h,b)===-1){g.push("<li data-role='list-divider'>"+h+"</li>");b.push(h)}}if(!this.getAttribute("value")||k.length==0||i.data("placeholder")){c.hidePlaceholderMenuItems&&o.push("ui-selectmenu-placeholder");f=d.placeholder=
+k}if(this.disabled){o.push("ui-disabled");p.push("aria-disabled='true'")}g.push("<li data-icon='"+e+"' class='"+o.join(" ")+"' "+p.join(" ")+">"+j+"</li>")});d.list.html(g.join(" "));this.isMultiple||this.headerClose.hide();!this.isMultiple&&!f.length?this.header.hide():this.headerTitle.text(this.placeholder);d.list.listview()},refresh:function(d){var c=this,f=this.element,b=this.isMultiple,g=this.optionElems=f.find("option"),e=g.filter(":selected"),i=e.map(function(){return g.index(this)}).get();
+if(!c.options.nativeMenu&&(d||f[0].options.length>c.list.find("li").length))c._buildList();c.button.find(".ui-btn-text").text(function(){if(!b)return e.text();return e.length?e.map(function(){return a(this).text()}).get().join(", "):c.placeholder});if(b)c.buttonCount[e.length>1?"show":"hide"]().text(e.length);c.options.nativeMenu||c.list.find("li:not(.ui-li-divider)").removeClass(a.mobile.activeBtnClass).attr("aria-selected",false).each(function(h){if(a.inArray(h,i)>-1){h=a(this).addClass(a.mobile.activeBtnClass);
+h.find("a").attr("aria-selected",true);b&&h.find(".ui-icon").removeClass("ui-icon-checkbox-off").addClass("ui-icon-checkbox-on")}})},open:function(){function d(){c.list.find(".ui-btn-active").focus()}if(!(this.options.disabled||this.options.nativeMenu)){var c=this,f=c.list.outerHeight(),b=c.list.outerWidth(),g=a(window).scrollTop(),e=c.button.offset().top,i=window.innerHeight,h=c.list.parents(".ui-dialog").length;c.button.addClass(a.mobile.activeBtnClass);if(h||f>i-80||!a.support.scrollTop){g==0&&
+e>i&&c.thisPage.one("pagehide",function(){a(this).data("lastScroll",e)});c.menuPage.one("pageshow",function(){a(window).one("silentscroll",function(){d()})});c.menuType="page";c.menuPageContent.append(c.list);a.mobile.changePage(c.menuPage,"pop",false,true)}else{c.menuType="overlay";c.screen.height(a(document).height()).removeClass("ui-screen-hidden");h=e-g;var k=g+i-e,j=f/2;f=h>f/2&&k>f/2?e+c.button.outerHeight()/2-j:h>k?g+i-f-30:g+30;b=c.button.offset().left+c.button.outerWidth()/2-b/2;c.listbox.append(c.list).removeClass("ui-selectmenu-hidden").css({top:f,
+left:b}).addClass("in");d()}setTimeout(function(){c.isOpen=true},400)}},close:function(){function d(){setTimeout(function(){c.button.focus();c.button.removeClass(a.mobile.activeBtnClass)},40);c.listbox.removeAttr("style").append(c.list)}if(!(this.options.disabled||!this.isOpen||this.options.nativeMenu)){var c=this;if(c.menuType=="page"){a.mobile.changePage([c.menuPage,c.thisPage],"pop",true,false);c.menuPage.one("pagehide",d)}else{c.screen.addClass("ui-screen-hidden");c.listbox.addClass("ui-selectmenu-hidden").removeAttr("style").removeClass("in");
+d()}this.isOpen=false}},disable:function(){this.element.attr("disabled",true);this.button.addClass("ui-disabled").attr("aria-disabled",true);return this._setOption("disabled",true)},enable:function(){this.element.attr("disabled",false);this.button.removeClass("ui-disabled").attr("aria-disabled",false);return this._setOption("disabled",false)}})})(jQuery);
+(function(a){a.fn.buttonMarkup=function(c){return this.each(function(){var f=a(this),b=a.extend({},a.fn.buttonMarkup.defaults,f.data(),c),g,e="ui-btn-inner",i;d&&d();if(!b.theme){g=f.closest("[class*='ui-bar-'],[class*='ui-body-']");b.theme=g.length?/ui-(bar|body)-([a-z])/.exec(g.attr("class"))[2]:"c"}g="ui-btn ui-btn-up-"+b.theme;if(b.inline)g+=" ui-btn-inline";if(b.icon){b.icon="ui-icon-"+b.icon;b.iconpos=b.iconpos||"left";i="ui-icon "+b.icon;if(b.shadow)i+=" ui-icon-shadow"}if(b.iconpos){g+=" ui-btn-icon-"+
+b.iconpos;b.iconpos=="notext"&&!f.attr("title")&&f.attr("title",f.text())}if(b.corners){g+=" ui-btn-corner-all";e+=" ui-btn-corner-all"}if(b.shadow)g+=" ui-shadow";f.attr("data-theme",b.theme).addClass(g);b=("<D class='"+e+"'><D class='ui-btn-text'></D>"+(b.icon?"<span class='"+i+"'></span>":"")+"</D>").replace(/D/g,b.wrapperEls);f.wrapInner(b)})};a.fn.buttonMarkup.defaults={corners:true,shadow:true,iconshadow:true,wrapperEls:"span"};var d=function(){a(".ui-btn:not(.ui-disabled)").live({"touchstart mousedown":function(){var c=
+a(this).attr("data-theme");a(this).removeClass("ui-btn-up-"+c).addClass("ui-btn-down-"+c)},"touchmove touchend mouseup":function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-down-"+c).addClass("ui-btn-up-"+c)},"mouseover focus":function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-up-"+c).addClass("ui-btn-hover-"+c)},"mouseout blur":function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-hover-"+c).addClass("ui-btn-up-"+c)}});d=null}})(jQuery);
+(function(a){a.widget("mobile.button",a.mobile.widget,{options:{theme:null,icon:null,iconpos:null,inline:null,corners:true,shadow:true,iconshadow:true},_create:function(){var d=this.element,c=this.options;this.button=a("<div></div>").text(d.text()||d.val()).buttonMarkup({theme:c.theme,icon:c.icon,iconpos:c.iconpos,inline:c.inline,corners:c.corners,shadow:c.shadow,iconshadow:c.iconshadow}).insertBefore(d).append(d.addClass("ui-btn-hidden"));d.attr("type")!=="reset"&&d.click(function(){var f=a("<input>",
+{type:"hidden",name:d.attr("name"),value:d.attr("value")}).insertBefore(d);a(document).submit(function(){f.remove()})})},enable:function(){this.element.attr("disabled",false);this.button.removeClass("ui-disabled").attr("aria-disabled",false);return this._setOption("disabled",false)},disable:function(){this.element.attr("disabled",true);this.button.addClass("ui-disabled").attr("aria-disabled",true);return this._setOption("disabled",true)}})})(jQuery);
+(function(a){a.widget("mobile.slider",a.mobile.widget,{options:{theme:null,trackTheme:null,disabled:false},_create:function(){var d=this,c=this.element,f=c.parents("[class*=ui-bar-],[class*=ui-body-]").eq(0);f=f.length?f.attr("class").match(/ui-(bar|body)-([a-z])/)[2]:"c";var b=this.options.theme?this.options.theme:f,g=this.options.trackTheme?this.options.trackTheme:f,e=c[0].nodeName.toLowerCase();f=e=="select"?"ui-slider-switch":"";var i=c.attr("id"),h=i+"-label";i=a("[for="+i+"]").attr("id",h);
+var k=function(){return e=="input"?parseFloat(c.val()):c[0].selectedIndex},j=e=="input"?parseFloat(c.attr("min")):0,o=e=="input"?parseFloat(c.attr("max")):c.find("option").length-1,p=window.parseFloat(c.attr("step")||1),t=a('<div class="ui-slider '+f+" ui-btn-down-"+g+' ui-btn-corner-all" role="application"></div>'),v=a('<a href="#" class="ui-slider-handle"></a>').appendTo(t).buttonMarkup({corners:true,theme:b,shadow:true}).attr({role:"slider","aria-valuemin":j,"aria-valuemax":o,"aria-valuenow":k(),
+"aria-valuetext":k(),title:k(),"aria-labelledby":h});a.extend(this,{slider:t,handle:v,dragging:false,beforeStart:null});if(e=="select"){t.wrapInner('<div class="ui-slider-inneroffset"></div>');c.find("option");c.find("option").each(function(m){var r=m==0?"b":"a",n=m==0?"right":"left";m=m==0?" ui-btn-down-"+g:" ui-btn-active";a('<div class="ui-slider-labelbg ui-slider-labelbg-'+r+m+" ui-btn-corner-"+n+'"></div>').prependTo(t);a('<span class="ui-slider-label ui-slider-label-'+r+m+" ui-btn-corner-"+
+n+'" role="img">'+a(this).text()+"</span>").prependTo(v)})}i.addClass("ui-slider");c.addClass(e=="input"?"ui-slider-input":"ui-slider-switch").change(function(){d.refresh(k(),true)}).keyup(function(){d.refresh(k(),true,true)}).blur(function(){d.refresh(k(),true)});a(document).bind("touchmove mousemove",function(m){if(d.dragging){d.refresh(m);return false}});t.bind("touchstart mousedown",function(m){d.dragging=true;if(e==="select")d.beforeStart=c[0].selectedIndex;d.refresh(m);return false});t.add(document).bind("touchend mouseup",
+function(){if(d.dragging){d.dragging=false;if(e==="select"){if(d.beforeStart===c[0].selectedIndex)d.refresh(d.beforeStart===0?1:0);var m=k();m=Math.round(m/(o-j)*100);v.addClass("ui-slider-handle-snapping").css("left",m+"%").animationComplete(function(){v.removeClass("ui-slider-handle-snapping")})}return false}});t.insertAfter(c);this.handle.bind("touchstart mousedown",function(){a(this).focus()});this.handle.bind("keydown",function(m){var r=k();if(!d.options.disabled){switch(m.keyCode){case a.mobile.keyCode.HOME:case a.mobile.keyCode.END:case a.mobile.keyCode.PAGE_UP:case a.mobile.keyCode.PAGE_DOWN:case a.mobile.keyCode.UP:case a.mobile.keyCode.RIGHT:case a.mobile.keyCode.DOWN:case a.mobile.keyCode.LEFT:m.preventDefault();
+if(!d._keySliding){d._keySliding=true;a(this).addClass("ui-state-active")}}switch(m.keyCode){case a.mobile.keyCode.HOME:d.refresh(j);break;case a.mobile.keyCode.END:d.refresh(o);break;case a.mobile.keyCode.PAGE_UP:case a.mobile.keyCode.UP:case a.mobile.keyCode.RIGHT:d.refresh(r+p);break;case a.mobile.keyCode.PAGE_DOWN:case a.mobile.keyCode.DOWN:case a.mobile.keyCode.LEFT:d.refresh(r-p)}}}).keyup(function(){if(d._keySliding){d._keySliding=false;a(this).removeClass("ui-state-active")}});this.refresh()},
+refresh:function(d,c,f){if(!this.options.disabled){var b=this.element,g=b[0].nodeName.toLowerCase(),e=g==="input"?parseFloat(b.attr("min")):0,i=g==="input"?parseFloat(b.attr("max")):b.find("option").length-1;if(typeof d==="object"){d=d.originalEvent.touches?d.originalEvent.touches[0]:d;if(!this.dragging||d.pageX<this.slider.offset().left-8||d.pageX>this.slider.offset().left+this.slider.width()+8)return;d=Math.round((d.pageX-this.slider.offset().left)/this.slider.width()*100)}else{if(d==null)d=g===
+"input"?parseFloat(b.val()):b[0].selectedIndex;d=(parseFloat(d)-e)/(i-e)*100}if(!isNaN(d)){if(d<0)d=0;if(d>100)d=100;var h=Math.round(d/100*(i-e))+e;if(h<e)h=e;if(h>i)h=i;this.handle.css("left",d+"%");this.handle.attr({"aria-valuenow":g==="input"?h:b.find("option").eq(h).attr("value"),"aria-valuetext":g==="input"?h:b.find("option").eq(h).text(),title:h});if(g==="select")h===0?this.slider.addClass("ui-slider-switch-a").removeClass("ui-slider-switch-b"):this.slider.addClass("ui-slider-switch-b").removeClass("ui-slider-switch-a");
+if(!f){if(g==="input")b.val(h);else b[0].selectedIndex=h;c||b.trigger("change")}}}},enable:function(){this.element.attr("disabled",false);this.slider.removeClass("ui-disabled").attr("aria-disabled",false);return this._setOption("disabled",false)},disable:function(){this.element.attr("disabled",true);this.slider.addClass("ui-disabled").attr("aria-disabled",true);return this._setOption("disabled",true)}})})(jQuery);
+(function(a){a.widget("mobile.collapsible",a.mobile.widget,{options:{expandCueText:" click to expand contents",collapseCueText:" click to collapse contents",collapsed:false,heading:">:header,>legend",theme:null,iconTheme:"d"},_create:function(){var d=this.element,c=this.options,f=d.addClass("ui-collapsible-contain"),b=d.find(c.heading).eq(0),g=f.wrapInner('<div class="ui-collapsible-content"></div>').find(".ui-collapsible-content");d=d.closest('[data-role="collapsible-set"]').addClass("ui-collapsible-set");
+if(b.is("legend")){b=a('<div role="heading">'+b.html()+"</div>").insertBefore(b);b.next().remove()}b.insertBefore(g);b.addClass("ui-collapsible-heading").append('<span class="ui-collapsible-heading-status"></span>').wrapInner('<a href="#" class="ui-collapsible-heading-toggle"></a>').find("a:eq(0)").buttonMarkup({shadow:!!!d.length,corners:false,iconPos:"left",icon:"plus",theme:c.theme}).find(".ui-icon").removeAttr("class").buttonMarkup({shadow:true,corners:true,iconPos:"notext",icon:"plus",theme:c.iconTheme});
+if(d.length)f.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").addClass("ui-corner-bottom");else b.find("a:eq(0)").addClass("ui-corner-all").find(".ui-btn-inner").addClass("ui-corner-all");f.bind("collapse",function(e){if(!e.isDefaultPrevented()){e.preventDefault();b.addClass("ui-collapsible-heading-collapsed").find(".ui-collapsible-heading-status").text(c.expandCueText);b.find(".ui-icon").removeClass("ui-icon-minus").addClass("ui-icon-plus");g.addClass("ui-collapsible-content-collapsed").attr("aria-hidden",
+true);f.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").addClass("ui-corner-bottom")}}).bind("expand",function(e){if(!e.isDefaultPrevented()){e.preventDefault();b.removeClass("ui-collapsible-heading-collapsed").find(".ui-collapsible-heading-status").text(c.collapseCueText);b.find(".ui-icon").removeClass("ui-icon-plus").addClass("ui-icon-minus");g.removeClass("ui-collapsible-content-collapsed").attr("aria-hidden",false);f.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").removeClass("ui-corner-bottom")}}).trigger(c.collapsed?
+"collapse":"expand");if(d.length&&!d.data("collapsiblebound")){d.data("collapsiblebound",true).bind("expand",function(e){a(this).find(".ui-collapsible-contain").not(a(e.target).closest(".ui-collapsible-contain")).not("> .ui-collapsible-contain .ui-collapsible-contain").trigger("collapse")});d=d.find("[data-role=collapsible]");d.first().find("a:eq(0)").addClass("ui-corner-top").find(".ui-btn-inner").addClass("ui-corner-top");d.last().data("collapsible-last",true)}b.bind(a.support.touch?"touchstart":
+"click",function(){b.is(".ui-collapsible-heading-collapsed")?f.trigger("expand"):f.trigger("collapse");return false})}})})(jQuery);
+(function(a){a.fn.controlgroup=function(d){return this.each(function(){function c(e){e.removeClass("ui-btn-corner-all ui-shadow").eq(0).addClass(g[0]).end().filter(":last").addClass(g[1]).addClass("ui-controlgroup-last")}var f=a.extend({direction:a(this).data("type")||"vertical",shadow:false},d),b=a(this).find(">legend"),g=f.direction=="horizontal"?["ui-corner-left","ui-corner-right"]:["ui-corner-top","ui-corner-bottom"];a(this).find("input:eq(0)").attr("type");if(b.length){a(this).wrapInner('<div class="ui-controlgroup-controls"></div>');
+a('<div role="heading" class="ui-controlgroup-label">'+b.html()+"</div>").insertBefore(a(this).children(0));b.remove()}a(this).addClass("ui-corner-all ui-controlgroup ui-controlgroup-"+f.direction);c(a(this).find(".ui-btn"));c(a(this).find(".ui-btn-inner"));f.shadow&&a(this).addClass("ui-shadow")})}})(jQuery);(function(a){a.fn.fieldcontain=function(){return this.addClass("ui-field-contain ui-body ui-br")}})(jQuery);
+(function(a){a.widget("mobile.listview",a.mobile.widget,{options:{theme:"c",countTheme:"c",headerTheme:"b",dividerTheme:"b",splitIcon:"arrow-r",splitTheme:"b",inset:false},_create:function(){var d=this.element,c=this.options;d.addClass("ui-listview").attr("role","listbox");c.inset&&d.addClass("ui-listview-inset ui-corner-all ui-shadow");d.delegate(".ui-li","focusin",function(){a(this).attr("tabindex","0")});this._itemApply(d,d);this.refresh(true);d.keydown(function(f){var b=a(f.target),g=b.closest("li");
+switch(f.keyCode){case 38:f=g.prev();if(f.length){b.blur().attr("tabindex","-1");f.find("a").first().focus()}return false;case 40:f=g.next();if(f.length){b.blur().attr("tabindex","-1");f.find("a").first().focus()}return false;case 39:f=g.find("a.ui-li-link-alt");if(f.length){b.blur();f.first().focus()}return false;case 37:f=g.find("a.ui-link-inherit");if(f.length){b.blur();f.first().focus()}return false;case 13:case 32:b.trigger("click");return false}});d.delegate("li","click",function(f){if(!a(f.target).closest("a").length){a(this).find("a").first().trigger("click");
+return false}})},_itemApply:function(d,c){c.find(".ui-li-count").addClass("ui-btn-up-"+(d.data("counttheme")||this.options.countTheme)+" ui-btn-corner-all");c.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading");c.find("p, dl").addClass("ui-li-desc");c.find("li").find("img:eq(0)").addClass("ui-li-thumb").each(function(){a(this).closest("li").addClass(a(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")});var f=c.find(".ui-li-aside");f.length&&f.each(function(b,g){a(g).prependTo(a(g).parent())});
+a.support.cssPseudoElement||a.nodeName(c[0],"ol")},_removeCorners:function(d){d.add(d.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")).removeClass("ui-corner-top ui-corner-bottom ui-corner-br ui-corner-bl ui-corner-tr ui-corner-tl")},refresh:function(d){this._createSubPages();var c=this.options,f=this.element,b=this,g=f.data("dividertheme")||c.dividerTheme,e=f.children("li"),i=a.support.cssPseudoElement||!a.nodeName(f[0],"ol")?0:1;i&&f.find(".ui-li-dec").remove();e.attr({role:"option",tabindex:"-1"});
+e.first().attr("tabindex","0");e.each(function(h){var k=a(this),j="ui-li";if(!(!d&&k.hasClass("ui-li"))){var o=k.data("theme")||c.theme,p=k.find("a");if(p.length){var t=k.data("icon");k.buttonMarkup({wrapperEls:"div",shadow:false,corners:false,iconpos:"right",icon:p.length>1||t===false?false:t||"arrow-r",theme:o});p.first().addClass("ui-link-inherit");if(p.length>1){j+=" ui-li-has-alt";p=p.last();t=f.data("splittheme")||p.data("theme")||c.splitTheme;p.appendTo(k).attr("title",p.text()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:false,
+corners:false,theme:o,icon:false,iconpos:false}).find(".ui-btn-inner").append(a("<span>").buttonMarkup({shadow:true,corners:true,theme:t,iconpos:"notext",icon:f.data("spliticon")||p.data("icon")||c.splitIcon}))}}else if(k.data("role")==="list-divider"){j+=" ui-li-divider ui-btn ui-bar-"+g;k.attr("role","heading");if(i)i=1}else j+=" ui-li-static ui-btn-up-"+o;if(c.inset){if(h===0){j+=" ui-corner-top";k.add(k.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").addClass("ui-corner-tl");
+k.next().next().length&&b._removeCorners(k.next())}if(h===e.length-1){j+=" ui-corner-bottom";k.add(k.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").addClass("ui-corner-bl");k.prev().prev().length&&b._removeCorners(k.prev())}}i&&j.indexOf("ui-li-divider")<0&&k.find(".ui-link-inherit").first().addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+i++ +". </span>");k.addClass(j);d||b._itemApply(f,k)}})},_idStringEscape:function(d){return d.replace(/[^a-zA-Z0-9]/g,
+"-")},_createSubPages:function(){var d=this.element,c=d.closest(".ui-page"),f=c.data("url"),b=this.options,g=this,e=c.find("[data-role='footer']").data("id");a(d.find("ul, ol").toArray().reverse()).each(function(i){var h=a(this),k=h.parent(),j=a.trim(k.contents()[0].nodeValue)||k.find("a:first").text();i=f+"&"+a.mobile.subPageUrlKey+"="+g._idStringEscape(j+" "+i);var o=h.data("theme")||b.theme,p=h.data("counttheme")||d.data("counttheme")||b.countTheme;h.wrap("<div data-role='page'><div data-role='content'></div></div>").parent().before("<div data-role='header' data-theme='"+
+b.headerTheme+"'><div class='ui-title'>"+j+"</div></div>").after(e?a("<div>",{"data-role":"footer","data-id":e,"class":"ui-footer-duplicate"}):"").parent().attr({"data-url":i,"data-theme":o,"data-count-theme":p}).appendTo(a.mobile.pageContainer).page();h=k.find("a:first");h.length||(h=a("<a></a>").html(j).prependTo(k.empty()));h.attr("href","#"+i)}).listview()}})})(jQuery);
+(function(a){a.mobile.listview.prototype.options.filter=false;a("[data-role='listview']").live("listviewcreate",function(){var d=a(this);if(d.data("listview").options.filter){var c=a("<form>",{"class":"ui-listview-filter ui-bar-c",role:"search"});a("<input>",{placeholder:"Filter results...","data-type":"search"}).bind("keyup change",function(){var f=this.value.toLowerCase();d.children().show();f&&d.children().filter(function(){return a(this).text().toLowerCase().indexOf(f)===-1}).hide()}).appendTo(c).textinput();
+c.insertBefore(d)}})})(jQuery);
+(function(a){a.widget("mobile.dialog",a.mobile.widget,{options:{},_create:function(){this.element.attr("role","dialog").addClass("ui-page ui-dialog ui-body-a").find("[data-role=header]").addClass("ui-corner-top ui-overlay-shadow").prepend('<a href="#" data-icon="delete" data-rel="back" data-iconpos="notext">Close</a>').end().find('.ui-content:not([class*="ui-body-"])').addClass("ui-body-c").end().find(".ui-content,[data-role=footer]").last().addClass("ui-corner-bottom ui-overlay-shadow");this.element.bind("click submit",
+function(d){d=d.type=="click"?a(d.target).closest("a"):a(d.target).closest("form");d.length&&!d.data("transition")&&d.attr("data-transition",a.mobile.urlHistory.getActive().transition).attr("data-direction","reverse")})},close:function(){window.history.back()}})})(jQuery);
+(function(a,d){a.widget("mobile.navbar",a.mobile.widget,{options:{iconpos:"top",grid:null},_create:function(){var c=this.element,f=c.find("a"),b=f.filter("[data-icon]").length?this.options.iconpos:d;c.addClass("ui-navbar").attr("role","navigation").find("ul").grid({grid:this.options.grid});b||c.addClass("ui-navbar-noicons");f.buttonMarkup({corners:false,shadow:false,iconpos:b});c.delegate("a","click",function(){f.removeClass("ui-btn-active");a(this).addClass("ui-btn-active")})}})})(jQuery);
+(function(a){a.fn.grid=function(d){return this.each(function(){var c=a.extend({grid:null},d),f=a(this).children(),b={a:2,b:3,c:4,d:5};c=c.grid;if(!c)if(f.length<=5)for(var g in b){if(b[g]==f.length)c=g}else c="a";b=b[c];a(this).addClass("ui-grid-"+c);f.filter(":nth-child("+b+"n+1)").addClass("ui-block-a");f.filter(":nth-child("+b+"n+2)").addClass("ui-block-b");b>2&&f.filter(":nth-child(3n+3)").addClass("ui-block-c");b>3&&f.filter(":nth-child(4n+4)").addClass("ui-block-d");b>4&&f.filter(":nth-child(5n+5)").addClass("ui-block-e")})}})(jQuery);
View
161 public/javascripts/jquery.js
5 additions, 156 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
325 public/javascripts/rails.js
@@ -1,156 +1,169 @@
-/*
- * jquery-ujs
- *
- * http://github.com/rails/jquery-ujs/blob/master/src/rails.js
- *
- * This rails.js file supports jQuery 1.4.3 and 1.4.4 .
- *
- */
-
-jQuery(function ($) {
- var csrf_token = $('meta[name=csrf-token]').attr('content'),
- csrf_param = $('meta[name=csrf-param]').attr('content');
-
- $.fn.extend({
- /**
- * Triggers a custom event on an element and returns the event result
- * this is used to get around not being able to ensure callbacks are placed
- * at the end of the chain.
- *
- * TODO: deprecate with jQuery 1.4.2 release, in favor of subscribing to our
- * own events and placing ourselves at the end of the chain.
- */
- triggerAndReturn: function (name, data) {
- var event = new $.Event(name);
- this.trigger(event, data);
-
- return event.result !== false;
- },
-
- /**
- * Handles execution of remote calls. Provides following callbacks:
- *
- * - ajax:before - is execute before the whole thing begings
- * - ajax:loading - is executed before firing ajax call
- * - ajax:success - is executed when status is success
- * - ajax:complete - is execute when status is complete
- * - ajax:failure - is execute in case of error
- * - ajax:after - is execute every single time at the end of ajax call
- */
- callRemote: function () {
- var el = this,
- method = el.attr('method') || el.attr('data-method') || 'GET',
- url = el.attr('action') || el.attr('href'),
- dataType = el.attr('data-type') || ($.ajaxSettings && $.ajaxSettings.dataType);
-
- if (url === undefined) {
- throw "No URL specified for remote call (action or href must be present).";
- } else {
- if (el.triggerAndReturn('ajax:before')) {
- var data = el.is('form') ? el.serializeArray() : [];
- $.ajax({
- url: url,
- data: data,
- dataType: dataType,
- type: method.toUpperCase(),
- beforeSend: function (xhr) {
- el.trigger('ajax:loading', xhr);
- },
- success: function (data, status, xhr) {
- el.trigger('ajax:success', [data, status, xhr]);
- },
- complete: function (xhr) {
- el.trigger('ajax:complete', xhr);
- },
- error: function (xhr, status, error) {
- el.trigger('ajax:failure', [xhr, status, error]);
- }
- });
- }
-
- el.trigger('ajax:after');
- }
- }
- });
-
- /**
- * confirmation handler
- */
-
- $('body').delegate('a[data-confirm], button[data-confirm], input[data-confirm]', 'click.rails', function () {
- var el = $(this);
- if (el.triggerAndReturn('confirm')) {
- if (!confirm(el.attr('data-confirm'))) {
- return false;
- }
- }
- });
-
-
-
- /**
- * remote handlers
- */
- $('form[data-remote]').live('submit.rails', function (e) {
- $(this).callRemote();
- e.preventDefault();
- });
-
- $('a[data-remote],input[data-remote]').live('click.rails', function (e) {
- $(this).callRemote();
- e.preventDefault();
- });
-
- $('a[data-method]:not([data-remote])').live('click.rails', function (e){
- var link = $(this),
- href = link.attr('href'),
- method = link.attr('data-method'),
- form = $('<form method="post" action="'+href+'"></form>'),
- metadata_input = '<input name="_method" value="'+method+'" type="hidden" />';
-
- if (csrf_param !== undefined && csrf_token !== undefined) {
- metadata_input += '<input name="'+csrf_param+'" value="'+csrf_token+'" type="hidden" />';
- }
-
- form.hide()
- .append(metadata_input)
- .appendTo('body');
-
- e.preventDefault();
- form.submit();
- });
-
- /**
- * disable-with handlers
- */
- var disable_with_input_selector = 'input[data-disable-with]',
- disable_with_form_remote_selector = 'form[data-remote]:has(' + disable_with_input_selector + ')',
- disable_with_form_not_remote_selector = 'form:not([data-remote]):has(' + disable_with_input_selector + ')';
-
- var disable_with_input_function = function () {
- $(this).find(disable_with_input_selector).each(function () {
- var input = $(this);
- input.data('enable-with', input.val())
- .attr('value', input.attr('data-disable-with'))
- .attr('disabled', 'disabled');
- });
- };
-
- $(disable_with_form_remote_selector).live('ajax:before.rails', disable_with_input_function);
- $(disable_with_form_not_remote_selector).live('submit.rails', disable_with_input_function);
-
- $(disable_with_form_remote_selector).live('ajax:complete.rails', function () {
- $(this).find(disable_with_input_selector).each(function () {
- var input = $(this);
- input.removeAttr('disabled')
- .val(input.data('enable-with'));
- });
- });
-
- var jqueryVersion = $().jquery;
-
- if ( (jqueryVersion === '1.4') || (jqueryVersion === '1.4.1') || (jqueryVersion === '1.4.2') ){
- alert('This rails.js does not support the jQuery version you are using. Please read documentation.');
- }
-
-});
+/**
+ * Unobtrusive scripting adapter for jQuery
+ *
+ * Requires jQuery 1.4.3 or later.
+ * https://github.com/rails/jquery-ujs
+ */
+
+(function($) {
+ // Make sure that every Ajax request sends the CSRF token
+ function CSRFProtection(fn) {
+ var token = $('meta[name="csrf-token"]').attr('content');
+ if (token) fn(function(xhr) { xhr.setRequestHeader('X-CSRF-Token', token) });
+ }
+ if ($().jquery == '1.5') { // gruesome hack
+ var factory = $.ajaxSettings.xhr;
+ $.ajaxSettings.xhr = function() {
+ var xhr = factory();
+ CSRFProtection(function(setHeader) {
+ var open = xhr.open;
+ xhr.open = function() { open.apply(this, arguments); setHeader(this) };
+ });
+ return xhr;
+ };
+ }
+ else $(document).ajaxSend(function(e, xhr) {
+ CSRFProtection(function(setHeader) { setHeader(xhr) });
+ });
+
+ // Triggers an event on an element and returns the event result
+ function fire(obj, name, data) {
+ var event = new $.Event(name);
+ obj.trigger(event, data);
+ return event.result !== false;
+ }
+
+ // Submits "remote" forms and links with ajax
+ function handleRemote(element) {
+ var method, url, data,
+ dataType = element.attr('data-type') || ($.ajaxSettings && $.ajaxSettings.dataType);
+
+ if (element.is('form')) {
+ method = element.attr('method');
+ url = element.attr('action');
+ data = element.serializeArray();
+ // memoized value from clicked submit button
+ var button = element.data('ujs:submit-button');
+ if (button) {
+ data.push(button);
+ element.data('ujs:submit-button', null);
+ }
+ } else {
+ method = element.attr('data-method');
+ url = element.attr('href');
+ data = null;
+ }
+
+ $.ajax({
+ url: url, type: method || 'GET', data: data, dataType: dataType,
+ // stopping the "ajax:beforeSend" event will cancel the ajax request
+ beforeSend: function(xhr, settings) {
+ if (settings.dataType === undefined) {
+ xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
+ }
+ return fire(element, 'ajax:beforeSend', [xhr, settings]);
+ },
+ success: function(data, status, xhr) {
+ element.trigger('ajax:success', [data, status, xhr]);
+ },
+ complete: function(xhr, status) {
+ element.trigger('ajax:complete', [xhr, status]);
+ },
+ error: function(xhr, status, error) {
+ element.trigger('ajax:error', [xhr, status, error]);
+ }
+ });
+ }
+
+ // Handles "data-method" on links such as:
+ // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
+ function handleMethod(link) {
+ var href = link.attr('href'),
+ method = link.attr('data-method'),
+ csrf_token = $('meta[name=csrf-token]').attr('content'),
+ csrf_param = $('meta[name=csrf-param]').attr('content'),
+ form = $('<form method="post" action="' + href + '"></form>'),
+ metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
+
+ if (csrf_param !== undefined && csrf_token !== undefined) {
+ metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
+ }
+
+ form.hide().append(metadata_input).appendTo('body');
+ form.submit();
+ }
+
+ function disableFormElements(form) {
+ form.find('input[data-disable-with]').each(function() {
+ var input = $(this);
+ input.data('ujs:enable-with', input.val())
+ .val(input.attr('data-disable-with'))
+ .attr('disabled', 'disabled');
+ });
+ }
+
+ function enableFormElements(form) {
+ form.find('input[data-disable-with]').each(function() {
+ var input = $(this);
+ input.val(input.data('ujs:enable-with')).removeAttr('disabled');
+ });
+ }
+
+ function allowAction(element) {
+ var message = element.attr('data-confirm');
+ return !message || (fire(element, 'confirm') && confirm(message));
+ }
+
+ function requiredValuesMissing(form) {
+ var missing = false;
+ form.find('input[name][required]').each(function() {
+ if (!$(this).val()) missing = true;
+ });
+ return missing;
+ }
+
+ $('a[data-confirm], a[data-method], a[data-remote]').live('click.rails', function(e) {
+ var link = $(this);
+ if (!allowAction(link)) return false;
+
+ if (link.attr('data-remote') != undefined) {
+ handleRemote(link);
+ return false;
+ } else if (link.attr('data-method')) {
+ handleMethod(link);
+ return false;
+ }
+ });
+
+ $('form').live('submit.rails', function(e) {
+ var form = $(this), remote = form.attr('data-remote') != undefined;
+ if (!allowAction(form)) return false;
+
+ // skip other logic when required values are missing
+ if (requiredValuesMissing(form)) return !remote;
+
+ if (remote) {
+ handleRemote(form);
+ return false;
+ } else {
+ // slight timeout so that the submit button gets properly serialized
+ setTimeout(function(){ disableFormElements(form) }, 13);
+ }
+ });
+
+ $('form input[type=submit], form button[type=submit], form button:not([type])').live('click.rails', function() {
+ var button = $(this);
+ if (!allowAction(button)) return false;
+ // register the pressed submit button
+ var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null;
+ button.closest('form').data('ujs:submit-button', data);
+ });
+
+ $('form').live('ajax:beforeSend.rails', function(event) {
+ if (this == event.target) disableFormElements($(this));
+ });
+
+ $('form').live('ajax:complete.rails', function(event) {
+ if (this == event.target) enableFormElements($(this));
+ });
+})( jQuery );

0 comments on commit 029c06a

Please sign in to comment.
Something went wrong with that request. Please try again.