/*
* jQuery Media Helper Utilities from jQuery Mobile: resolution and CSS media query related helpers and behavior
* Copyright (c) jQuery Project, Scott Jehl, Filament Group, Inc
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
*/
(function(f,i,d){var c=f(i),e=f("html"),k=i.document,h=[500,1024];f.mh={};f.mh.media=(function(){var m={},n=f("<div id='jquery-mediatest'>"),o=f("<body>").append(n);return function(q){if(!(q in m)){var p=f("<style type='text/css'>@media "+q+"{#jquery-mediatest{position:absolute;}}</style>");e.prepend(o).prepend(p);m[q]=n.css("position")==="absolute";o.add(p).remove()}return m[q]}})();var a,b,g;f.event.special.orientationchange=a={setup:function(){if("orientation" in i){return false}g=b();c.bind("resize",l)},teardown:function(){if(f.support.orientation){return false}c.unbind("resize",l)},add:function(m){var n=m.handler;m.handler=function(o){o.orientation=b();return n.apply(this,arguments)}}};function l(){var m=b();if(m!==g){g=m;c.trigger("orientationchange")}}a.orientation=b=function(){var m=k.documentElement;return m&&m.clientWidth/m.clientHeight<1.1?"portrait":"landscape"};function j(){var m=c.width(),q="min-width-",o="max-width-",s=[],p=[],r="px",n;e.removeClass(q+h.join(r+" "+q)+r+" "+o+h.join(r+" "+o)+r);f.each(h,function(t,u){if(m>=u){s.push(q+u+r)}if(m<=u){p.push(o+u+r)}});if(s.length){n=s.join(" ")}if(p.length){n+=" "+p.join(" ")}e.addClass(n)}f.mh.addResolutionBreakpoints=function(m){if(f.type(m)==="array"){h=h.concat(m)}else{h.push(m)}h.sort(function(o,n){return o-n});j()};c.bind("orientationchange.htmlclass resize.htmlclass",function(m){if(m.orientation){e.removeClass("portrait landscape").addClass(m.orientation)}j()});c.trigger("orientationchange.htmlclass")})(jQuery,this);
