function fMenuMessageboardChange( nPageID, nMessageID ) {
	oForm = document.getElementById( "frmMaster" );
	oForm.hPageID.value = nPageID;
	oForm.hMessageID.value = nMessageID;
	if( oForm.hViewingOptions ){
		oForm.hViewingOptions.value = "preferences";
	}
	oForm.action = "index.asp";
	oForm.submit();
}

function fMessageBoardChangeMode( nPageID, nMessageBoardMode ) {
	var oForm = document.getElementById( "frmMaster" );
	oForm.hPageID.value = nPageID;
	oForm.hMessageBoardMode.value = nMessageBoardMode;
	if( oForm.hViewingOptions ) {
		oForm.hViewingOptions.value = "preferences";
	}
	oForm.action = "index.asp";
	oForm.submit();
}

function fMessageBoardPost( nPageID, nMessageBoardMode ) {
	var oForm = document.getElementById( "frmMaster" );
	oForm.hPageID.value = nPageID;
	oForm.hMessageBoardMode.value = nMessageBoardMode;
	oForm.action = "4savemessage.asp";
	document.getElementById( "sendmymessage" ).href = "javascript:fEnRoute();";
	oForm.submit();
}
function fMessageBoardPostFormat( nPageID, nMessageBoardMode ) {
	var oForm = document.getElementById( "frmMaster" );
	var oMessage = document.getElementById( "txtMessage" );
	oForm.hPageID.value = nPageID;
	oForm.hMessageBoardMode.value = nMessageBoardMode;
	oForm.hMessageText.value = oMessage.innerHTML;
	oForm.action = "4savemessage.asp";
	document.getElementById( "sendmymessage" ).href = "javascript:fEnRoute();";
	oForm.submit();
}

function fEnRoute() {
	alert( 'No need to click twice, message is en route!' );
}

function fMessageBoardSearch( nPageID, nMessageBoardMode ) {
	var oForm = document.getElementById( "frmMaster" );
	oForm.hPageID.value = nPageID;
	oForm.hMessageBoardMode.value = nMessageBoardMode;
	oForm.action = "index.asp";
	oForm.submit();
}

function fMessageBoardSearchClear( nPageID, nMessageBoardMode ) {
	var oForm = document.getElementById( "frmMaster" );
	oForm.hPageID.value = nPageID;
	oForm.hMessageBoardMode.value = nMessageBoardMode;
	oForm.action = "index.asp";
	oForm.submit();
}

function fMenuGalleryChange( nPageID, nGalleryID, nPersonID ) {
	var oForm = document.getElementById( "frmMaster" );
	if( nGalleryID < 10 ) {
		sGalleryID = "00" + nGalleryID;
	} else {
		if( nGalleryID < 100 ) {
			sGalleryID = "0" + nGalleryID;
		} else {
			sGalleryID = nGalleryID;
		}
	}
	switch ( nPageID ) {
	case 3:
		oForm.action = "../gallery/gallery" + sGalleryID + ".asp";
		break;
	case 4:
		oForm.action = "gallery" + sGalleryID + ".asp";
		break;
	case 5:
		oForm.action = "../sounds/index.asp";
		break;
	default:
		oForm.action = "/gallery/index16.asp";
		break;
	}
	oForm.hGalleryID.value = nGalleryID;
	oForm.hPageID.value = nPageID;
	if( nPersonID ) {
		oForm.hPersonID.value = nPersonID;
	}
	oForm.submit();
}

function cmdExec( cmd, opt ) {
	txtMessage.document.execCommand( cmd, "", opt );
}
