
	// HELPER CLASS TO GET WINDOW DIMENSIONS ---------------------------
	Window = {
		
		minWidth: 960,
	
		getHeight: function(){
			return (window.innerHeight) ? (window.innerHeight) : (document.documentElement.clientHeight);
		},
	
		getWidth: function(){
			return (window.innerWidth) ? (window.innerWidth) : (document.documentElement.clientWidth);
		},
	
		getYScroll: function(){
			return (self.pageYOffset) ? (self.pageYOffset) : (document.documentElement.scrollTop);
		},
	
		getXScroll: function(){
			return (self.pageXOffset) ? (self.pageXOffset) : (document.documentElement.scrollLeft);
		}
	};

	// HELPER CLASS TO GET DOCUMENT DIMENSIONS -------------------------
	Document = {
		getHeight: function(){
			var scrollHeight = (window.innerHeight && window.scrollMaxY) ?
				(window.innerHeight + window.scrollMaxY) :
				(document.body.offsetHeight);
			
			var windowHeight = (window.innerHeight) ? (window.innerHeight) : (document.documentElement.clientHeight);
		
			return (scrollHeight < windowHeight) ? (windowHeight) : (scrollHeight);
		},
	
		getWidth: function(){
			var scrollWidth = (window.innerHeight && window.scrollMaxY) ?
				(document.body.scrollWidth) :
				(document.body.offsetWidth);
			
			var windowWidth = (window.innerWidth) ? (window.innerWidth) : (document.documentElement.clientWidth);
			
			return (scrollWidth < windowWidth) ? (windowWidth) : (scrollWidth);
		}
	};
	
	// EXTEND THE JQUERY LIBRARY ---------------------------------------
	jQuery.extend({
		scrollTurnedOn: false,
		scrollingOn: function() {
			this.scrollTurnedOn = true;
			$('html').addClass('scroll');
			$('body').css({ 'width': Window.minWidth + 'px', 'overflow-x': 'hidden' });
		},
		scrollingOff: function() {
			this.scrollTurnedOn = false;
			$('html').removeClass('scroll');
			$('body').css({ 'width': '', 'overflow-x': '' });
		}
	});
	
	// WAIT FOR THE WINDOW TO BE RESIZED -------------------------------
	$(window).resize(function(){
		if (Window.getWidth() < Window.minWidth){
			if (!jQuery.scrollTurnedOn) jQuery.scrollingOn();
		} else {
			if (jQuery.scrollTurnedOn) jQuery.scrollingOff();			
		}
	});

	// WAIT FOR THE DOM TO LOAD ----------------------------------------
	$(document).ready(function(){
		if (Window.getWidth() < Window.minWidth){
			jQuery.scrollingOn();
		} else if (typeof jQuery.scrollingOff == 'function') {
			jQuery.scrollingOff();
		}
	});
	
