/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */

(function(a,e,f){function d(a){i.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>';g.insertBefore(j,b);c=i.offsetWidth==42;g.removeChild(j);return c}function h(a){var b=d(a.media);if(a._listeners&&a.matches!=b){a.matches=b;for(var b=0,c=a._listeners.length;b<c;b++)a._listeners[b](a)}}if(!e.matchMedia||a.userAgent.match(/(iPhone|iPod|iPad)/i)){var c,g=f.documentElement,b=g.firstElementChild||g.firstChild,j=f.createElement("body"),i=f.createElement("div");i.id="mq-test-1";i.style.cssText=
"position:absolute;top:-100em";j.style.background="none";j.appendChild(i);e.matchMedia=function(a){var b,c=[];b={matches:d(a),media:a,_listeners:c,addListener:function(a){typeof a==="function"&&c.push(a)},removeListener:function(a){for(var b=0,d=c.length;b<d;b++)c[b]===a&&delete c[b]}};e.addEventListener&&e.addEventListener("resize",function(){h(b)},false);f.addEventListener&&f.addEventListener("orientationchange",function(){h(b)},false);return b}}})(navigator,window,document);
(function(a,e,f){if(!a.onMediaQuery){var d={},h=e.matchMedia&&e.matchMedia("only all").matches;a(f).ready(function(){for(var c in d)a(d[c]).trigger("init"),d[c].matches&&a(d[c]).trigger("valid")});a(e).bind("load",function(){for(var c in d)d[c].matches&&a(d[c]).trigger("valid")});a.onMediaQuery=function(c,g){var b=c&&d[c];if(!b)b=d[c]=e.matchMedia(c),b.supported=h,b.addListener(function(){a(b).trigger(b.matches?"valid":"invalid")});a(b).bind(g);return b}}})(jQuery,window,document);
(function(a,e,f){a.fn.responsiveMenu=function(d){function h(c,d){var b="";a(c).children().each(function(){var c=a(this);c.children("a, span.separator").each(function(){var e=a(this),f=e.is("a")?e.attr("href"):"",k=e.is("span")?" disabled":"",m=d>1?Array(d).join("-")+" ":"",n=e.find(".title").length?e.find(".title").text():e.text();b+='<option value="'+f+'" class="'+e.attr("class")+'"'+k+">"+m+n+"</option>";c.find("ul.level"+(d+1)).each(function(){b+=h(this,d+1)})})});return b}d=a.extend({current:".current"},
d);return this.each(function(){var c=a(this),g=a("<select/>"),b="";c.find("ul.menu").each(function(){b+=h(this,1)});g.append(b).change(function(){f.location.href=g.val()});g.find(d.current).attr("selected",true);/iPhone|iPad|iPod/.test(e.platform)&&/OS [1-5]_[0-9_]* like Mac OS X/i.test(e.userAgent)&&e.userAgent.indexOf("AppleWebKit")>-1&&g.find(":disabled").remove();c.after(g)})}})(jQuery,navigator,window);
(function(a,e){function f(){h.setAttribute("content",g);b=true}if(/iPhone|iPad|iPod/.test(e.platform)&&/OS [1-5]_[0-9_]* like Mac OS X/i.test(e.userAgent)&&e.userAgent.indexOf("AppleWebKit")>-1){var d=a.document;if(d.querySelector){var h=d.querySelector("meta[name=viewport]"),d=h&&h.getAttribute("content"),c=d+",maximum-scale=1",g=d+",maximum-scale=10",b=true,j,i,l,k;h&&(a.addEventListener("orientationchange",f,false),a.addEventListener("devicemotion",function(d){k=d.accelerationIncludingGravity;
j=Math.abs(k.x);i=Math.abs(k.y);l=Math.abs(k.z);(!a.orientation||a.orientation===180)&&(j>7||(l>6&&i<8||l<8&&i>6)&&j>5)?b&&(h.setAttribute("content",c),b=false):b||f()},false))}}})(this,navigator);
