/***********************************************************************************
 * Class: CPage
 * Description:
 *   Page functions
 *
 ***********************************************************************************/

	// Contructor
	function CPage() { };

	// Include scripts
	CPage.includeLocal = function(name) { CPage.include(name, '_client/'); };
	CPage.include = function(name, path) {
		if(!window[name]) {
			if(!path)
				path = "../_client/";
				
			var script = document.createElement("script");
			script.type = "text/javascript";
			script.language = "javascript";
			script.src = path+name+".js";
			document.getElementsByTagName("head")[0].appendChild(script);
		}
	};
	
	// Get form attribute
	CPage.getFormAttribute = function(form, name, def) { return form.attributes[name] ? form.attributes[name].value : def; };
	
	// Get form name
	CPage.getFormName = function(form) { return CPage.getFormAttribute(form, "name", ""); }