// JavaScript Document

JAPI._coordinateLibrary = {

	getScreenWidth : function() {
		var sWidth = 0;
		
		if (self.innerWidth) {
			sWidth = self.innerWidth;
		} else if (document.documentElement && document.documentElement.clientWidth) {
			sWidth = document.documentElement.clientWidth;
		} else if (document.body) {
			sWidth = document.body.clientWidth;
		} // end if..elseif..elseif
		
		return sWidth;
	}, // end function

	getScreenHeight : function() {
		var sHeight = 0;
		
		if (self.innerHeight) {
			sHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientWidth) {
			sHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			sHeight = document.body.clientHeight;
		} // end if..elseif..elseif
		
		return sHeight;
	}, // end function
	
	getCursorXPosition : function(e){
		if(!e) var e=window.event;
		// e = e || window.event;
		var x = e.pageX?e.pageX:e.clientX + document.body.scrollLeft;
		//window.alert(x);
		return x;
	}, // end function
	
	getCursorYPosition : function(e){
		if(!e) var e=window.event;
		// e = e || window.event;
		y = e.pageY?e.pageY:e.clientY + document.body.scrollTop;
		//window.alert(y);
		return y;
	}, // end function

	getElementXPosition : function(element_id){
		var x = document.getElementById(element_id).style.left;
		x = JAPI.common().removePX(x);
		return x;
	}, // end function

	getElementYPosition : function(element_id){
		var y = document.getElementById(element_id).style.top;
		y = JAPI.common().removePX(y);
		return y;
	} // end function


} // end library
