function EmailPage()
{
	location.href = "mailto:?subject=" + document.title + "&body=" + location.href;
}

function BookmarkPage(anchor)
{
	var href = (anchor) ? anchor.href : location.href;
	var title = (anchor) ? anchor.title : document.title;

	if (window.external)
	{
		window.external.AddFavorite(href, title);
	}
	return false;
}

function Coalesce()
{
	for (var i = 0; i < arguments.length; i++)
	{
		var arg = arguments[i];
		if (!IsNull(arg))
		{
			return arg;
		}
	}
}

function IsNull(value)
{
	return (typeof(value) == "undefined" || value == null);
}

function DefaultFocused(parentControl, submitFunction)
{
	document.forms[0].onsubmit = function (e)
	{
		submitFunction();
		return false;
	};
}

function DefaultBlured(parentControl)
{
	document.forms[0].onsubmit = null;
}

function SetElementValue(value, elementID, property)
{
	var element = document.getElementById(elementID);
	
	if (element)
	{
		element[property] = value;
	}
}