function dologin(oForm) 
{
	if (oForm.username.value.length == 0 || oForm.password.value.length == 0)
	{
		alert ('You did not fill in all required fields');
		return false;
	}
	else return true;
}

function doeditadmin(oForm) 
{
    var bReturn = true;
	if (oForm.pass1.value != oForm.pass2.value)
	{
		alert ('Your password and your confirmation do not match');
		bReturn = false;
	}
	if (oForm.name.value.length == 0 || oForm.email.value.length == 0)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}
	
	return bReturn;
}

function doaddadmin(oForm) 
{
    var bReturn = true;
	if (oForm.pass1.value != oForm.pass2.value)
	{
		alert ('Your password and your confirmation do not match');
		bReturn = false;
	}
	if ((oForm.name.value.length == 0) || (oForm.email.value.length == 0) || (oForm.pass1.value.length == 0) || 
(oForm.pass2.length == 0))
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}
	
	return bReturn;
}

function doaddfaq(oForm) 
{
	if ((oForm.question.value.length == 0) || (oForm.answer.value.length == 0))
	{
		alert ('You did not fill in all required fields');
		return false;
	}
	else return true;
}

function doeditabout(oForm) 
{
    var bReturn = true;
	if (oForm.text.value.length == 0)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}
	return bReturn;
}

function doaddnews(oForm) 
{
	if ((oForm.title.value.length == 0) || (oForm.message.value.length == 0))
	{
		alert ('You did not fill in all required fields');
		return false;
	}
	else return true;
}

function doeditfile(oForm) 
{
    var bReturn = true;
	if (oForm.title.value.length == 0)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}
	return bReturn;
}

function doaddfile(oForm) 
{
    var bReturn = true;
	if (oForm.title.value.length == 0 || oForm.file.value.length == 0 ||  oForm.category.value == -1)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}
    else
	{
		oForm.go.value = "Uploading... plz wait";
		oForm.go.disabled = true;
	}
	return bReturn;
}

function popup(url,target)
{
	w = screen.width*(5/6);
	h = screen.height*(5/6);
	l = (screen.width-w)/2;
	t = (screen.height-h)/2;
	widthHeight = 
"width="+w+",height="+h+",left="+l+",top="+t+",menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,location=no";
	window.open(url,target,widthHeight);
	return true
}

function openchat(oForm)
{
	if (oForm.nick.value.length == 0)
	{
		alert ('You have to fill in a nickname');
	}
	else
	{
		s = oForm.style.value + '?nick=' + oForm.nick.value;
		popup(s,'chatroom');
	}
	return false;
}

function doaddmanual(oForm) 
{
    var bReturn = true;
	if (oForm.name.value.length == 0 || oForm.description.value.length == 0 ||  oForm.category.value == -1)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}
	return bReturn;
}

function doaddcat(oForm) 
{
    var bReturn = true;
	if (oForm.name.value.length == 0)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}
	return bReturn;
}


function doeditbeta(oForm) 
{
    var bReturn = true;
	if (oForm.version.value.length == 0 || oForm.comments.value.length == 0)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}
	return bReturn;
}

function doaddtrans(oForm) 
{
    var bReturn = true;
	if (oForm.username.value.length == 0 || oForm.file.value.length == 0 || oForm.userpass.value.length == 0)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}

	if (bReturn)
	{
		oForm.go.value = "Uploading... plz wait";
		oForm.go.disabled = true;
	}
	return bReturn;
}

function doaddgui(oForm) 
{
	var bReturn = true;

	if (oForm.username.value.length == 0 || oForm.guifile.value.length == 0 || oForm.userpass.value.length == 0 || 
oForm.title.value.length == 0)
	{
		alert ('You did not fill in all required fields');
		bReturn = false;
	}

	if (bReturn)
	{
		oForm.go.value = "Uploading... plz wait";
		oForm.go.disabled = true;
	}
	return bReturn;
}

function doaddplugin(oForm) 
{
	var bReturn = true;

	if (oForm.action.value == 'added')
	{
		if (oForm.username.value.length == 0 || oForm.pluginfile.value.length == 0 || 
oForm.userpass.value.length == 0 || oForm.title.value.length == 0)
		{
			alert ('You did not fill in all required fields');
			bReturn = false;
		}

		if (bReturn)
		{
			oForm.go.value = "Uploading... plz wait";
			oForm.go.disabled = true;
		}
	}
	else if (oForm.action.value == 'edited') 
	{
		if (oForm.username.value.length == 0 || oForm.userpass.value.length == 0 || oForm.title.value.length 
== 0)
		{
			alert ('You did not fill in all required fields');
			bReturn = false;
		}

		if (bReturn)
		{
			oForm.go.value = "Uploading... plz wait";
			oForm.go.disabled = true;
		}
	}
	
	return bReturn;
}
