function toggleVisibilityById(condition, id, type)
{
	if(condition)
		document.getElementById(id).type=type;
	else
		document.getElementById(id).type='hidden';
}

function submitFormWithAction(obj, action)
{
	while(obj.tagName!='FORM')
	{
		obj=obj.parentNode;
		
		if(obj.tagName=='BODY')
			return false;
	}
	
	obj.action.value=action;
	obj.submit();
}

function setValueByName(formid, key, value)
{
	document.getElementById(formid).elements.namedItem(key).value=value;
}

function submitOpByName(formid, name, value)
{
	document.getElementById(formid).elements.namedItem(name).value=value;
	document.getElementById(formid).submit();
}

function promptOp(formid, message, name, value)
{
	if(confirm(message))
	{
		document.getElementById(formid).elements.namedItem(name).value=value;
		document.getElementById(formid).submit();
	}
}

function promptSubmit(formid, message)
{
	if(confirm(message))
	{
		document.getElementById(formid).submit();
	}
}

