MOBILE = window.MOBILE || {};

MOBILE.QUERIES = (function() {
  'use strict';
	// declare document and windows in variables for performace
	var doc = document,
		win = window;
	var _private = {
		set: function(args) {
			// use the HTML5 API matchMedia to target phones and tablets
			var matches = win.matchMedia("(max-width: 1024px)").matches;
			if (matches) {
				this.run();
			}
		},
		run: function() {
			doc.body.onclick = this.event;
		},
		event: function(event) {
			// on clicking links run script
			if (event.target.tagName.toLowerCase().toString() === 'a') {
				var slider, x, l, animationOne, element;
				// add blur class to the body tag
				doc.body.classList.add('blur');
				setTimeout(function() {
					// display ajax loading symbol
					doc.getElementById('ajaxLoader').style.display = 'block';
				}, 100);
				setTimeout(function() {
					doc.getElementById('ajaxLoader').style.display = 'none';
				}, 5000);
			}
		}
	};
	return {
		init: function(args) {
			if (typeof args.matchMedia !== 'undefined') {
				_private.set(args);
			}
		}
	};
}())