


	// Browser //
	function isIE(){

		/*@cc_on
		@if (@_jscript)
		return true;
		@else */
		return false; /*
		@end
		@*/

	}



	// File //
	file = new Object();

		file.basename = function(filePath){

			filePath = filePath.split('\\');
			return filePath[filePath.length - 1];

		}

		file.include = function(file_name){

			var html_doc = document.getElementsByTagName('head').item(0);

			var file_path = file_name.split('.');
			var file_type = file_path[file_path.length - 1];

			if (file_type == 'css'){

				var file = document.createElement('link');
				file.setAttribute('rel', 'stylesheet');
				file.setAttribute('type', 'text/css');
				file.setAttribute('href', file_name);
				html_doc.appendChild(file);

			}
			else if (file_type == 'js'){

				var file = document.createElement('script');
				file.setAttribute('language', 'javascript');
				file.setAttribute('type', 'text/javascript');
				file.setAttribute('src', file_name);
				html_doc.appendChild(file);

			}

			return false;

		}



	// Onloader //
	onloader = new Object();

		onloader.functions = new Array();

		onloader.add_function = function(new_function){

			onloader.functions[onloader.functions.length] = new_function;

		}

		onloader.execute = function(){

			for(var i = 0; i < onloader.functions.length; i++) eval (onloader.functions[i]);

		}

	if (document.documentElement != null){

		window.onload = onloader.execute;

	}



	// Onclicker //
	onclicker = new Object();

		onclicker.functions = new Array();

		onclicker.add_function = function(new_function){

			onclicker.functions[onclicker.functions.length] = new_function;

		}

		onclicker.execute = function(e){

			for(var i = 0; i < onclicker.functions.length; i++) eval (onclicker.functions[i]);

		}

	if (document.documentElement != null){

		document.onclick = onclicker.execute;

	}



	// Ajax //
	ajax = new Object();

		ajax.initialize = function(){

			ajax.xml_http = null;

			try {
				ajax.xml_http = new XMLHttpRequest ();
			}
			catch (e){
				try {
					ajax.xml_http = new ActiveXObject ('Msxml2.XMLHTTP')
				}
				catch (e){
					ajax.xml_http = new ActiveXObject ('Microsoft.XMLHTTP');
				}
			}

		}

		ajax.post = function (url, params, onreadystatechange, sync){

			if (typeof sync == 'undefined') sync = true;

			ajax.initialize();
			ajax.xml_http.open ('POST', url, sync);
			ajax.xml_http.onreadystatechange = function(){ if (onreadystatechange != null && (ajax.xml_http.readyState == 4 || ajax.xml_http.readyState == 200)) onreadystatechange.call(); }
			ajax.xml_http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			ajax.xml_http.setRequestHeader('Content-Length', params.length);
			ajax.xml_http.setRequestHeader('Connection', 'close');
			ajax.xml_http.send (params);
			if (onreadystatechange != null){
				try { if (document.addEventListener && ajax.xml_http.onreadystatechanged == null){ if (ajax.xml_http.readyState == 4 || ajax.xml_http.readyState == 200){ onreadystatechange.call(); } } }
				catch (e) { return false; }
			}

		}



	// Window //
	window_ = new Object();

		window_.width = 0;
		window_.height = 0;
		window_.offsetWidth = 0;
		window_.offsetHeight = 0;

		window_.capture = function(){

			// Window: Width, Height //
			if (typeof( window.innerWidth) == 'number') {

				window_.width = window.innerWidth;
				window_.height = window.innerHeight;

			}
			else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {

				window_.width = document.documentElement.clientWidth;
				window_.height = document.documentElement.clientHeight;

			}
			else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {

				window_.width = document.body.clientWidth;
				window_.height = document.body.clientHeight;

			}

			// Window: offsetWidth, offsetHeight //
			if (typeof(window.pageYOffset) == 'number') {

				window_.offsetHeight = window.pageYOffset;
				window_.offsetWidth = window.pageXOffset;

			}
			else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {

				window_.offsetHeight = document.body.scrollTop;
				window_.offsetWidth = document.body.scrollLeft;

			}
			else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {

				window_.offsetHeight = document.documentElement.scrollTop;
				window_.offsetWidth = document.documentElement.scrollLeft;

			}

		}
		window_.capture();
		window.onscroll = window_.capture;



	// Element //
	function get_element_xy (element){

		var top = 0;
		var left = 0;
		var height = element.offsetHeight;
		var width = element.offsetWidth;

		if (element.offsetParent){

			while (true){

				top += element.offsetTop;
				left += element.offsetLeft;

				if (!element.offsetParent) break;
				element = element.offsetParent;

			}

		}
		else if (element.y){

			top += element.y;
			left += element.x;

		}

		var position = new Array();
		position[0] = top;
		position[1] = left
		position[2] = height;
		position[3] = width;
		return position;

	}



	// Mouse //
	if (document.documentElement != null){

		//document.captureEvents(Event.MOUSEMOVE);
		var mouse_x = 0;
		var mouse_x = 0;
		document.onmousemove = function(e){

			if (document.all){

				mouse_x = event.clientX + document.documentElement.scrollLeft;
				mouse_y = event.clientY + document.documentElement.scrollTop;

			}
			else {

				mouse_x = e.pageX;
				mouse_y = e.pageY;

			}

			return true;

		}

	}


	// TextArea //
	textarea = new Object();

		textarea.expand = function(input){

			if (isIE()){

				input.style.height = 0;
				input.style.height = (input.scrollHeight - 4) + 'px';

			}
			else {

				input.style.height = 0;
				input.style.height = (input.scrollHeight + 1) + 'px';

			}

		}




