/*
systym: the NIH-syndrome javascript library
copyright (c) 2009 Chris Rose-Mathew
*/

//===================================================
// class: Viewport
//===================================================
// A Viewport object keeps track of an abstract viewport rectangle
// and makes available useful values. Scene objects maintain a
// Viewport attribute
//===================================================
function Viewport()
{
	this.bottom = 0;
	this.top = 0;
	this.left = 0;
	this.right = 0;
	this.width = 0;
	this.height = 0;
	this.scrollbarWidth = 20; // platform specific...
	
	this.resize = function()
	{
		// Test for availability of DOM objects known to provide
		// access to client-window size information
		if (self.innerHeight)
		{
			// all except Explorer
			//alert("Non-explorer");
			this.width = self.innerWidth;
			this.height = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight)
		{
			// Explorer 6 Strict Mode
			//alert("Explorer 6 Strict");
			this.width = document.documentElement.clientWidth;
			this.height = document.documentElement.clientHeight;
		}
		else if (document.body) // other Explorers
		{
			//alert("Explorer other");
			this.width = document.body.clientWidth;
			this.height = document.body.clientHeight;
		}

		//this.width -= this.scrollbarWidth;
		//this.height -= this.scrollbarWidth;
		
	}
}

