function checkmakeroom() {
	var err=false
	if (document.roommaint.Category.value == "" ||document.roommaint.Description.value == "") {
		msg="You must enter a both a <%=containername%> and a description.";
		msg="You must enter a both a topic heading and description.";
		err=true
	}
	
	if (err) {
		alert(msg);
	} else {
		document.roommaint.submit();
	}
}

function checkcreatepost() {
	var err=false
	if (document.createpost.Subject.value == "" ||document.createpost.Article_Text.value == "") {
		msg="You must enter a both a subject and message text.";
		err=true
	}
	
	if (err) {
		alert(msg);
	} else {
		document.createpost.submit();
	}
}

function sendpass() {
	var err=false
	if (document.loginfrm.id.value=="") {
		msg="Please enter your email address (Username).";
		err=true;
	}
	
	if (err) {
		alert(msg);
	} else {
		document.loginfrm.theaction.value="sendpassword";
		document.loginfrm.submit();
	}
}

function addattachment() {
	var err=false
	if (document.createpost.messagechanged.value=='true') {
		// if the touched the subject line or mesage body
		if (document.createpost.Subject.value != "" ||document.createpost.Article_Text.value != "") {
			// and if its not blank
			msg="You have started to construct a message. Please erase or finish it before attaching any files.";
			err=true
		}
	} 

	if (err) {
		alert(msg);
	} else {
		document.attachfiles.attachmentmode.value="addfile";
		document.attachfiles.submit();
	}
}
