
/**
	Convert a given X,Y to the coordinates on the viewable screen.
	e.g., Screen is scrolled to the bottom but you want a
	dialog at 100,100 -> returns {x:x+scroll,y:y+scroll}
**/
function screenPosition(x,y) {

	var xPos=x,yPos=y;
	try {
		if (window.pageYOffset) {
			yPos += window.pageYOffset;
			xPos += window.pageXOffset;
		} else if ( document.body && document.body.scrollTop ) {
			yPos += document.body.scrollTop ;
			xPos += document.body.scrollLeft;
		} else if ( document.documentElement && document.documentElement.scrollTop ) {
			yPos += document.documentElement.scrollTop;
			xPos += document.documentElement.scrollLeft;
		}
	} catch ( e ) {logDebug(e);}
	
	return {x:xPos,y:yPos}

}