function togglemenu(menuid)
{
	menubody = document.getElementById('nav_menubody_' + menuid);
	menutitle = document.getElementById('nav_menutitle_' + menuid);
	if(menubody.style.display == '')
	{
		menubody.style.display = 'none';
		menutitle.innerHTML = '&nbsp;+&nbsp;';
	}
	else
	{
		menubody.style.display = '';
		menutitle.innerHTML = '&nbsp;-&nbsp;';
	}
}
function rotateimages(elementid, interval, images)
{
	element = document.getElementById(elementid);
	source = element.src;
	imagefound = false;
	for(i = 0; i < images.length; i++)
	{
		if(source == images[i])
		{
			imagefound = true;
			if(i == (images.length - 1))
			{
				element.src = images[0];
			}
			else
			{
				element.src = images[i + 1];
			}
		}
	}
	if(!imagefound)
	{
		element.src = images[0];
	}
	imagestexts = "";
	for(i = 0; i < images.length; i++)
	{
		if(i > 0)
		{
			imagestexts += ", ";
		}
		imagestexts += "'" + images[i] + "'";
	}
	window.setTimeout("rotateimages('" + elementid + "', " + interval + ", Array(" + imagestexts + "));", interval * 1000);
}
function checkfields(fieldarray)
{
	for(i = 0; i < fieldarray.length; i = i + 4)
	{
		element = document.getElementById(fieldarray[i]);
		if(element.value == '')
		{
			alert("Das Feld '" + fieldarray[i + 1] + "' darf nicht leer sein!");
			return false;
		}
		if(fieldarray[i + 2] == "Numbers")
		{
			var checkOK = "0123456789";
			var checkStr = element.value;
			var allNum = "";
			for (j = 0;  j < checkStr.length;  j++)
			{
				var CharOK = false;
				for (k = 0;  k < checkOK.length;  k++)
				{
					if(checkStr.charAt(j) == checkOK.charAt(k))
					{
						CharOK = true;
						break;
					}
				}
				if(CharOK == false)
				{
					alert("Geben Sie nur Ziffern in das Feld '" + fieldarray[i + 1] + "' ein.");
					element.focus();
					return false;
				}
				allNum += checkStr.charAt(j);
			}
			var chkVal = allNum;
			var prsVal = parseInt(allNum);
			if ((prsVal < fieldarray[i + 3]) && (fieldarray[i + 3] != ""))
			{
				alert("Geben Sie einen Wert größer oder gleich '" + fieldarray[i + 3] + "' in das Feld '" + fieldarray[i + 1] + "' ein.");
				element.focus();
				return false;
			}
		}
	}
	return true;
}
function editmail(objectid)
{
	object = document.getElementById(objectid);
	var email = object.href;
	email = email.replace(/\(\_at\_\)/, '@');
	object.href = email;
}
function setSelectOptions(the_select, do_check)
{
    selectObject = document.getElementById(the_select);
    selectCount  = selectObject.length;
    for (i = 0; i < selectCount; i++)
	{
        selectObject.options[i].selected = do_check;
    }
}
function settext(text, timeinterval, number)
{
	window.status = text;
	number = number + 10;
	if(number < (timeinterval * 1000))
	{
		window.setTimeout('settext(\'' + text + '\', ' + timeinterval + ', ' + number + ');');
	}
}
function writetext(text, timeinterval, length)
{
	settext(text.substr(0, length), timeinterval, 0);
	text = text.substr(1, text.length - 1) + text.substr(0, 1);
	window.setTimeout('writetext(\'' + text + '\', ' + timeinterval + ', ' + length + ');', timeinterval * 1000)
}
function lauftext(text, timeinterval)
{
	textlength = (2 * text.length);
	for(i = 0; i < textlength; i++)
	{
		text = ' ' + text;
	}
	writetext(text, timeinterval, textlength)
}
function changedetail()
{
	detailtyp = document.getElementById('detailtyp');
	detaillink = document.getElementById('detaillink');
	screenshots = document.getElementById('screenshots');
	report = document.getElementById('report');
	if(detailtyp.options[0].selected == true)
	{
		detaillink.disabled = true;
		detaillink.style.backgroundColor = "#AAAAAA";
		screenshots.disabled = false;
		screenshots.style.backgroundColor = "#FFFFFF";
		report.disabled = false;
		report.style.backgroundColor = "#FFFFFF";
	}
	if(detailtyp.options[1].selected == true)
	{
		detaillink.disabled = true;
		detaillink.style.backgroundColor = "#AAAAAA";
		screenshots.disabled = false;
		screenshots.style.backgroundColor = "#FFFFFF";
		report.disabled = true;
		report.style.backgroundColor = "#AAAAAA";
	}
	if(detailtyp.options[2].selected == true)
	{
		detaillink.disabled = false;
		detaillink.style.backgroundColor = "#FFFFFF";
		screenshots.disabled = true;
		screenshots.style.backgroundColor = "#AAAAAA";
		report.disabled = true;
		report.style.backgroundColor = "#AAAAAA";
	}
	if(detailtyp.options[3].selected == true)
	{
		detaillink.disabled = true;
		detaillink.style.backgroundColor = "#AAAAAA";
		screenshots.disabled = true;
		screenshots.style.backgroundColor = "#AAAAAA";
		report.disabled = true;
		report.style.backgroundColor = "#AAAAAA";
	}
}

