// javascript document
(function(){

	if(!window.crlw){
		window.crlw = {
			'name': 'crlw'
		}
	}

	// getNode
	function getNode(id){
		var node = null;
		if(node = document.getElementById(id)){
			return node;
		}else{
			return false;
		}
	}
	
	if(!window.crlw.getNode){
		window['crlw']['getNode'] = getNode;
	}

	if(!window.crlw.setOnLoad){
		window.crlw.setOnLoad = new Array();
	}

	if(!window.crlw.callOnLoads){
		window['crlw']['callOnLoads'] = function(){
			///////////////////////////////
			//////////////////////
			if(window.crlw.setOnLoad.length > 0){
				for(var i=0; i < window.crlw.setOnLoad.length; i++){
					////////////
					// alert(window.crlw.setOnLoad[i]);
					////////////
					this.setOnLoad[i]();
				}
			}
		}
	}

	window.onload = function(){
		//////////////////////
		window.crlw.callOnLoads();
	}


	function getMousePos(e){
		e = e || getEventObject(e);
		var x = e.pageX || (e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft));
		var y = e.pageY || (e.clientY + (document.documentElement.scrollTop || document.body.scrollTop));
		return {'x' : x ,'y' : y};
	}

	if(!window.crlw.getMousePos){
		window['crlw']['getMousePos'] = getMousePos;
	}
})();

