﻿
// Returns true if real estate will be layed out by the browser for the specified element.
function VElementDisplayed(elem)
{
	if	((elem.style.display != null) && (elem.style.display != 'undefined'))
	{
		if (elem.style.display == 'none')
		{
			return false;
		}
	}
	var parent = elem.parentNode; //elem.parentElement;
	while ((parent != null) && (parent.nodeName.toLowerCase() != 'body')) // stop at body, no need to go further.
	{
		if	((parent.style.display != null) && (parent.style.display != 'undefined'))
		{
			if (parent.style.display == 'none')
			{
				return false;
			}
		}
		parent = parent.parentNode; //parent.parentElement;
	}
	return true;
}

// Gets the actual number of pixels an element is positioned from the top of the screen.
function VGetScreenTop(el)
{
	var top = 0;
	var cur = el;
	while (cur != null)
	{
		top += cur.offsetTop;
		cur = cur.offsetParent;
	}
	return top;
}

// Gets the actual number of pixels an element is positioned from the left edge of the screen.
function VGetScreenLeft(el)
{
	var left = 0;
	var cur = el;
	while (cur != null)
	{
		left += cur.offsetLeft;
		cur = cur.offsetParent;
	}
	return left;
}

// Returns true if page client validation succeeded, otherwise false.
function VPageClientValidated()
{
	if (typeof(Page_ClientValidate) != 'function')
	{
		return true;
	}
	return Page_ClientValidate();
}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();