function cursorX(e) 
{
	if (navigator.appName!="Microsoft Internet Explorer")
	{
		return e.pageX;
	}
	
	if (document.documentElement.clientWidth > 0)
	{
		return e.x + document.documentElement.scrollLeft;
	}
	
	return e.x + document.body.scrollLeft;
}

function cursorY(e) 
{
	if (navigator.appName!="Microsoft Internet Explorer")
	{
		return e.pageY;
	}
	
	if (document.documentElement.clientWidth > 0)
	{
		return e.y + document.documentElement.scrollTop;
	}
	
	return e.y + document.body.scrollTop;
}

function getElement(elementId)
{
	return document.getElementById(elementId);
}

function findPosX(obj)
{
	var curleft = 0;
	
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else
	{
		if (obj.x)
		{
			curleft += obj.x;
		}
	}
	
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else
	{
		if (obj.y)
		{
			curtop += obj.y;
		}
	}
	
	return curtop;
}

function openPopup(pageUrl, popupName, popupWidth, popupHeight, showScrollbar) 
{
	var iWidth = popupWidth+30;
	var iHeight = popupHeight+70;
	var leftVal = (screen.width-iWidth)/2;
	var topVal = (screen.height-iHeight)/2;
	
	if (showScrollbar == true) 
	{
		newWindow = window.open(pageUrl, popupName, 'width='+iWidth+',height='+iHeight+',left='+leftVal+',top='+topVal+',scrollbars=yes');
	}
	else
	{
		newWindow = window.open(pageUrl, popupName, 'width='+iWidth+',height='+iHeight+',left='+leftVal+',top='+topVal+',scrollbars=no');
	}
	
	if (parseInt(navigator.appVersion) >= 4) 
	{ 
		newWindow.window.focus(); 
	}

	return false;
}

function openPopupRefCountry(pageUrl) 
{
	var iWidth = 550;
	var iHeight = 450;
	var leftVal = (screen.width-iWidth)/2;
	var topVal = (screen.height-iHeight)/2;
	var popupName = 'popupRefCountry';
	
	newWindow = window.open(pageUrl, popupName, 'width='+iWidth+',height='+iHeight+',left='+leftVal+',top='+topVal+',scrollbars=yes');
	
	if (parseInt(navigator.appVersion) >= 4) 
	{ 
		newWindow.window.focus(); 
	}

	return false;
}