function show_mail(mail)
	{
	mail = mail.replace(/~/g, "");
	document.write("<a class=email href='mailto:" + mail + "'>" + mail + "</a>");
	return;
	}

function page(id)
	{
	document.forms.control.elements.task.value = "";
	document.forms.control.elements.page.value = id;
	document.forms.control.submit();
	}

function dotask(task)
	{
	document.forms.control.elements.task.value = task;
	document.forms.control.submit();
	}

function pagetask(id, task)
	{
	document.forms.control.elements.page.value = id;
	document.forms.control.elements.task.value = task;
	document.forms.control.submit();
	}

function cmd(id)
	{
	document.forms.control.elements.command.value = id;
	document.forms.control.submit();
	}

function setref(ref)
	{
	document.forms.control.elements.ref.value = ref;
	}

function setanchor(anchor)
	{
	document.forms.control.elements.anchor.value = anchor;
	}

function swlang(lang)
	{
	document.forms.control.elements.lang.value = lang;
	document.forms.control.submit();
	}

function swregion(region)
	{
	document.forms.control.elements.region.value = region;
	document.forms.control.submit();
	}

function viewred(id)
	{
	lang = document.forms.control.elements.lang.value;
	popup("usr/viewred.php?id=" + id + "&lang=" + lang, 100, 100, 640, 480, 1, 1);
	}

function popup(target, left, top, width, height, toolbars, sizeable)
	{
	sizeable_cmd = (sizeable == 1) ? "scrollbars=yes,resizable=yes" : "scrollbars=no,resizable=no";
	toolbars_cmd = (toolbars == 1) ? "toolbar=yes,menubar=yes" : "toolbar=no,menubar=no";
	pop = window.open(target, "popup" + Math.round(Math.random() * 20), "top=" + top + ",left=" + left + ",width=" + width + ",height=" + height + "," + sizeable_cmd + "," + toolbars_cmd);
	window.pop.focus();
	}

function mroll(id, mode)
	{
	if (document.getElementById)
		{
		if (document.getElementById("menu" + id))
			{
			className = document.getElementById("menu" + id).className;
			arr = className.split("_");
			document.getElementById("menu" + id).className = arr[0] + ((mode == 0) ? "_dark" : "_lite");
			}
		}
	}

function proll(id, mode)
	{
	if (document.getElementById)
		{
		if (document.getElementById("menu" + id))
			{
			imgSrc = document.getElementById("menu" + id).src;
			arr = imgSrc.split("~");
			if (arr[1] != mode + ".gif")
				{
				imgSrc = arr[0] + "~" + mode + ".gif";
				document.getElementById("menu" + id).src = imgSrc;
				}
			}
		}
	}


function rollover(id, mode)
	{
	if (document.getElementById)
		{
		if (document.getElementById(id))
			{
			imgSrc = document.getElementById(id).src;
			arr = imgSrc.split("~");
			if (arr[1] != mode + ".jpg")
				{
				imgSrc = arr[0] + "~" + mode + ".jpg";
				document.getElementById(id).src = imgSrc;
				}
			}
		}
	}

function setfocus(focusfeld)
	{
	if (focusfeld != "none")
		{
		if (document.forms[0].elements[focusfeld])
			{
			document.forms[0].elements[focusfeld].focus();
			if (!document.forms[0].elements[focusfeld].options) document.forms[0].elements[focusfeld].select();
			}
		else
			{
			if (document.forms[0].elements[0])
				{
				if (document.forms[0].elements[0].type != "hidden")
					{
					document.forms[0].elements[0].focus();
					if (document.forms[0].elements[0].type != "select-one") document.forms[0].elements[0].select();
					}
				}
			}
		}
	}



