// Thanks to PPK: http://www.quirksmode.org/viewport/compatibility.html
var getScreenDimensions = function () {
	var x, y;
	if (self.innerHeight) {
		// all except Explorer
		x = self.innerWidth;
		y = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight)	{
		// Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	} else if (document.body) {
		// other Explorers
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return {'x': x, 'y': y};
}

var Interface = {
	// Variables
	site_init: false,
	
	// Attach a class of small/medium or large to the body element
	setBodySize: function () {
		var x = getScreenDimensions().x;
	    if (x <= 1280) $('body').attr('class', 'medium');
		if (x > 1280) $('body').attr('class', 'large');
		if (x <=  1161) $('body').attr('class', 'small');
	}
};

// Events for the interface
// $(function () {})  is the same as $(document).ready(function() {})
$(function() {
	Interface.setBodySize();
	$(window).resize(function () { Interface.setBodySize(); })
});
