﻿/**
*   Document
*
*   Class offers all utility functions with regard to document functionality
*
*   @usage    Used by all pages
*   @author   Daniel Ivanovic dan@anti-blanks.co.uk
*/
var Document = Class.extend(
	{
		init: function() 
		{
			// includes array
			// holds array of included scripts
			this.includes = [];
		},
		
		/**
		*	getPage
		*	
		*	Returns the current page
		*/
		getPage: function()
		{
			var sPath = window.location.pathname;
			return sPath.substring(sPath.lastIndexOf('/') + 1);
		},
		
		/**
		*	includeScript
		*	
		*	Includes a script into the page
		*
		*	@param	s - script name
		*/
		includeScript: function(s)
		{
			if ( this.includes[s] != undefined ) return;
			document.write( '<script type="text/javascript" src="' + s + '"></script>' );
			this.includes[s] = true;
		}
	}
);