// OPEN NEW SCREEN-HIGH WINDOW
//function newWindow(feedback) {
//var sHeight = screen.height-100
//var params = 'width=590,height='+sHeight+',resizable=yes,scrollbars=yes,left=0,top=0'
//	noticeWindow = window.open(feedback,'NoticeWindow',params)
//	noticeWindow.focus()
//	}

function feedback () {
	var sHeight=screen.height-200
	noticeWindow = window.open('http://www.breacais.demon.co.uk/feedback/cm.htm','fb','scrollbars=yes,width=600,height='+sHeight+',left=0,top=0')
	noticeWindow.focus()
	}

// OPEN FEEDBACK WINDOW (450 HIGH BY 570 WIDE) - USED BY ALL INDEX PAGES
function newWindow(noticeboard) {
	noticeWindow = window.open(noticeboard,'NoticeWindow','width=570,height=450,left=0,top=0')
	noticeWindow.focus()
	}

// FORM VALIDATION (for feedback.htm only)
// Test for invalid e-mail address
function test_email(form) {
	Ctrl = form.Email____;
	if (Ctrl.value != "" && (Ctrl.value.indexOf ('@', 0) == -1 || Ctrl.value.indexOf ('.', 0) == -1)) {
		validatePrompt (Ctrl,
			"Please enter a valid email address\n(format: 'name@domain.tld') or\nleave the address field blank.")
		return (false);
	} else
		return (true);
}

// Check for no message
function test_text(form) {
	Ctrl = form.Message__;
	if (Ctrl.value == "") {
		validatePrompt (Ctrl, "You have not entered any message!")
		return (false);
	} else
		return (true);
}

// Check that the above checks have both passed
function runSubmit (form, button)  {
	if (!test_email(form)) return;
	if (!test_text(form)) return;
	//alert ("All entries verified OK!");
	document.feedback.submit();		 // un-comment to submit form
	return;
}

//---------
function validatePrompt (Ctrl, PromptStr) {
	alert (PromptStr)
	Ctrl.focus();
	return;
}

function loadDoc() {
	initial.focus;
	document.feedback.Name_____.focus ();
	return;
}

function setFocus() {
 document.forms[0].Name_____.focus();
}