
function getwnsz(){
	var sPath = window.location.pathname;
	var sSearch = window.location.search;
//	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	var iWidth, iHeight, newurl;
	iWidth = 775;
	if (document.body.clientWidth != null) {
		iWidth = document.body.clientWidth;
		iHeight=document.body.clientHeight;
	}
	if (window.innerWidth != null) {
		iWidth = window.innerWidth;
		iHeight = window.innerHeight; 
	}
	if (iWidth < 640) {
		iWidth = 640
	}
	if (sSearch.length==0) {
		newurl=sPath + "?wnsz=" + iWidth;
	}
	else {
		newurl=sPath + sSearch + "&wnsz=" + iWidth;
	}
	document.location.href=newurl
}

function NoneChecked(field) {
	for(var i = 0; i < field.length; i++) {
		if(field[i].checked) { return false; }
		}
	return true;
}

function ContainsInvalidCharacters(str) {
	return (str.indexOf("<") > -1) || (str.indexOf(">") > -1) || (str.indexOf("\"") > -1);
}


function login(){
	bMissingFields = false
	if (frmLogin.MemberPassword.value.length == 0) {
		frmLogin.MemberPassword.focus();
		bMissingFields = true;
	}
	if (frmLogin.MemberName.value.length == 0) {
		frmLogin.MemberName.focus();
		bMissingFields = true;
	}
	if (bMissingFields == true) {
		alert("To login, you must supply your member name and password.");
		return;
	}
	frmLogin.submit();
}

function post(){
	if (frmPost.PostTitle.value.length == 0) {
		frmPost.PostTitle.focus();
		alert("To post a message, you must enter a Title.");
		return;
	}
	if (frmPost.PostMessage.value.length == 0) {
		frmPost.PostMessage.focus();
		alert("To post, you must enter a Message.");
		return;
	}
	if (NoneChecked(frmPost.PostType)) {
		alert("To post a message, you must select a Post Type.");
		return;
	}
	frmPost.submit();
}
