// JavaScript Document

var hex = {
	 Version			: "1.0.0.1"
	,rootPath			: "/library/hex/"
	,$					: function(strID) {
		var objElement = document.getElementById(strID)
		return (objElement != null) ? objElement : null
	}
	,$$					: function (strElement) {
		return (strElement != null || (strElement != "")) ? document.createElement(strElement) : null
	}
}
function isObject() {
		if (arguments[0] == null) {return false;}
		if (typeof arguments[0] == 'object') {
			return true;
		}
		return false;
	}
	function isString() {
		if (arguments[0] == null) {return false;}
		if (typeof arguments[0] == 'string') return true;
		if (typeof arguments[0] == 'object') {
			var criterion = arguments[0].constructor.toString().match(/string/i); 
			return (criterion != null);  
		}
		
		return false;
		
		/*-| Credits |-------------------------------------------------------------------\*
		
		Author: Kas Thomas
		Date:	01 February 2001
		original script found @: http://www.planetpdf.com/developer/article.asp?ContentID=testing_for_object_types_in_ja
		
		changes Made:
			added line "if (arguments[0] == null) {return false;}"
			
		^^^| Credits |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/	
	}
	function isArray() {
		if (arguments[0] == null) {return false;}
		if (typeof arguments[0] == 'object') {  
			var criterion = arguments[0].constructor.toString().match(/array/i); 
 			return (criterion != null);  
		}
		return false;
		
		/*-| Credits |-------------------------------------------------------------------\*
		
		see function "_isString"
			
		^^^| Credits |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/	
	}
	function isNumric() {
		if (arguments[0] == null) {return false;}
		if (typeof arguments[0] == 'number') return true;
		if (isString(arguments[0]) && (!isNaN(arguments[0]))) return true;
		return false;
	}
	
	function cNum() {
		var objNullValue = (arguments[2] != null) ? ((arguments[2] == true) ? arguments[0]  : arguments[2] )  : 0
		if (arguments[0] == null) {return objNullValue;}
		if (isNumric(arguments[0]) || (arguments[1] != null && (arguments[1]==true))) {
			return (!isNaN(parseInt(arguments[0]))) ? parseInt(arguments[0]) : objNullValue
		}
		return objNullValue
	}