function GrabId (id)
{
	var toReturn = null;
	
	if (document.all)
	{
		toReturn = document.all[id];
	}
	else
	{
		toReturn = document.getElementById (id);
	}
	
	return toReturn;
}

function HideElementById (id)
{
	var element = GrabId (id);
	
	element.style.visibility = "hidden";
	
	return true;
}

function UnhideElementById (id)
{
	var element = GrabId (id);
	
	element.style.visibility = "visible";
	
	return true;
}

function ClearFormById (id)
{
	var theForm = GrabId (id);
	
	var actionParam = theForm.action.value;
	
	theForm.reset ();
	theForm.action.value = actionParam;
	
	return true;
}

/*
 * getCookie & setCookie
 * -----------------------
 * Some cookie setting/getting functions
 */
function getCookie (doc, name)
{
	var search = name + "=";

	if (doc.cookie.length > 0)
	{
		offset = doc.cookie.indexOf (search);
		if (offset != -1)
		{
			offset += search.length;
			end = doc.cookie.indexOf (";", offset);
			if (end == -1)
			{
				end = doc.cookie.length;
			}

			return unescape(doc.cookie.substring (offset, end));
		}
	}

	return null;
}

function setCookie (doc, name, value, expires)
{
	doc.cookie = name + "=" + escape(value) +
		((expires == null) ? "" : ("; expires=" + expires));
	
	return true;
}
