function checkForm(userIsNull,showingTopics,userIsAdmin,showingMaxEdit) {
	var loginName = getInputValue(document.myform.loginName);
	var fullName = getInputValue(document.myform.fullName);
	var password1 = getInputValue(document.myform.password1);
	var password2 = getInputValue(document.myform.password2);
	var email = getInputValue(document.myform.email);
	var websites = getInputValue(document.myform.websites);
		
	var mess = '';
	var error=' error';
	i=0;					
	
	if(loginName.length < 3) {
		i++;
		mess = i+'. Please enter a login-name of at least 3 characters in length!\n';
	}				
	
	if(loginName.indexOf(" ") != -1) {
		i++;
		mess = i+'. Your login-name must not contain any spaces!\n';
	}
	if(fullName.length < 2) {
		i++;
		mess += i+'. Your real name is required in the full name field!\n';
	}	
	if(password1.length > 0 && password1.length < 4) {
		i++;
		mess += i+'. Please enter a password of at least 4 characters in length!\n';
	}
	if(password1 != password2) {
		i++;
		mess += i+'. Your passwords don\'t match!\n';
	}
	
	if (websites.length>0) {
		websites = Trim(websites);
		var websiteList = websites.split("\n");
		for (h=0;h < websiteList.length;h++) {
			var line = websiteList[h];
			line = Trim(line);
			if (line.indexOf("[[") == -1 || line.indexOf("]]") == -1) {
					mess += i+'. line with text "' + line + '" is not formatted correctly! websites must be enclosed with double brackets!\n';
					i++
					continue;
			}
			var delimitter = /\]\].*?\[\[/;
			var websiteSubList = line.split(delimitter);
			for (j=0;j < websiteSubList.length;j++) {
				var website = websiteSubList[j];
				if (websiteSubList.length > 1) {
					if (j != websiteSubList.length -1)
						website = website + "]]";
					if (j != 0)
						website = "[[" + website;					
				}
				if (website.indexOf("[[") == -1 || website.indexOf("]]") == -1) {
						mess += i+'. website with text "' + website + '" is not formatted correctly! websites must be enclosed with double brackets!\n';
						i++
						continue;
				}
				if (website.indexOf("|") != -1) {
					var website = website.split("|");
					website = website[0];
				}
				website = replaceAll(website,"[[","");
				website = replaceAll(website,"]]","");
				website = Trim(website);
				if (!isValidHttpURL(website)) {
					i++;
					mess += i+'. The URL, "' + website + '", must begin with "http://" and have a valid domain name, e.g., "http://www.domain.com" !\n';
					
				
				}
			}
		}
	}
	if (!isValidEmail(email)){
		i++;
		mess += i+'. Please enter a valid e-mail address!\n';
	}

	if(userIsNull) {
		if(password1.length == 0) {
			i++;
			mess += i+'. Please enter a password of at least 4 characters in length!\n';
		}
	}

	if (showingTopics && userIsAdmin) {
		var topics = getInputValueFromCheckBoxes("topics");
		var regions	= getInputValueFromCheckBoxes("regions");
		if(topics == null || topics.length == 0) {
			i++;
			mess += i+'. Please specify at least one topic from the topics list!\n';
		}
		if(regions == null || regions.length == 0) {
			i++;
			mess += i+'. Please specify at least one region from the regions list!\n';
		} 
	}

	if (showingMaxEdit) {
		var maxedit = getInputValue(document.myform.maxedit);
		if(maxedit.length == 0) {
			i++;
			mess += i+'. Please specify the maximum entries you are willing to edit per month\n';
		}
		var maxEditF=/^[0-9]{1,2}$/
		if(!maxEditF.test(maxedit) || maxedit.length == 0 || maxedit < 0) {
			i++;
			mess += i+'. The maximum entries you are willing to edit per month must be between 0 and 99\n';
		}	
	}	
	if (i>1)
		error=' errors';
	if (i>0) {
		alert('You have '+i+error+'!\n'+mess);
		return false;
	}else{
		return true;
	}
} 