

function getScreenInfo()
{
	var screenWidth = window.screen.width;
	var screenHeight = window.screen.height;
}

//get absolute left position of an object
function getAbsoluteLeft(objectId) 
{
	var o = document.getElementById(objectId);
	var oLeft = o.offsetLeft;          
	while(o.offsetParent != null) 
	{   
		var oParent = o.offsetParent; 
		oLeft += oParent.offsetLeft; 
		o = oParent;
	}
	return oLeft;
}

//get absolute top position of an object
function getAbsoluteTop(objectId) 
{
	var o = document.getElementById(objectId);
	var oTop = o.offsetTop;         
	while(o.offsetParent != null) 
	{ 
		var oParent = o.offsetParent;
		oTop += oParent.offsetTop; 
		o = oParent;
	}
	return oTop;
}

//get height of an object 
function getElementHeight(objectId) 
{
	var o = document.getElementById(objectId);
	oHeight = o.offsetHeight;
	return oHeight;
}

//get width of an object 
function getElementWidth(objectId)
{
	var o = document.getElementById(objectId);
	oWidth = o.offsetWidth;
	return oWidth;
}

//get mouse X coordinates
function getMouseX(e)
{
	var posx = 0;
	if (!e) var e = window.event;
	if (e.pageX)
	{
		posx = e.pageX;
	}
	else if (e.clientX)
	{
		posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
	}
	
	return posx;
}

//get mouse Y coordinates
function getMouseY(e)
{
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageY) 	
	{
		posy = e.pageY;
	}
	else if (e.clientY)
	{
		posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
	
	return posy;
}

// stops event (e.g. keydown or mousedown) from firing
function PreventDefaultAction(e)
{
	if(e.preventDefault)
	{
		e.preventDefault();
	}
	else
	{
		e.returnValue = false;
	}
}
			

function popupAndFocus(url, title, width, height, resizable)
{
    newWindow = window.open (url, title, 'width=' + width + ', height=' + height + ', toolbar=no, menubar=no, scrollbars=no, resizable=' + resizable + ', location=no, directories=no, status=no');
    
    if(newWindow.focus)
    {
        newWindow.focus();
    }
}
