function Redirect(Url)
{
	top.location.href = Url;
}

function ID(ID)
{
	return document.getElementById(ID);
}

function Confirmation(Text, Url)
{
	if (confirm(Text)) Redirect(Url);
}

function Name(Name)
{
	return document.getElementsByName(Name);
}

function getElementsByClassName(ClassName)
{
	var TagIndex = 0;
	var TagMatched = 0;
	var Elements = new Array();

	var Tags = document.getElementsByTagName('*');
	var Condition = ' ' + ClassName + ' ';
	for (TagIndex = 0; TagIndex < Tags.length; TagIndex++)
	{
		var Pattern = ' ' + Tags[TagIndex].className + ' ';
		if (Pattern.indexOf(Condition) != -1)
		{
			Elements[TagMatched] = Tags[TagIndex];
			TagMatched++;
		}
	}
	return Elements;
}

function SetCookie(Name, Value, Days)
{
	if (Days)
	{
		var date = new Date();
		date.setTime(date.getTime() + (Days * 24 * 60 * 60 * 1000));
		var Expires = '; expires=' + date.toGMTString();
	}
	else
	{
		var Expires = '';
	}
	document.cookie = Name + '=' + Value + Expires + '; path=/';
}
function GetCookie(Name)
{
	var NameEQ = Name + '=';
	var Ca = document.cookie.split(';');
	for (var i = 0; i < Ca.length; i++)
	{
		var C = Ca[i];
		while (C.charAt(0) == ' ') C = C.substring(1, C.length);
		if (C.indexOf(NameEQ) == 0) return C.substring(NameEQ.length, C.length);
	}
	return null;
}
function DeleteCookie(Name)
{
	SetCookie(Name, '', -1);
}