	var win = null;

function newWindow(pagelink,pagetitle,w,h,features) {
	// setup window position for centre of screen
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? ((screen.height-h)/2) -20 : 0;

	// set window properties
	settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',' + features;

	// show window
	win = window.open(pagelink,pagetitle,settings);
	return;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function submitNLRequest(formname) {
	var emailRegxp = /^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,4}){1,2}$/;
	var username = formname.txtUsername.value;
	var emailaddr = formname.txtEmail.value;

	if (username.length == 0) {
		alert('You must supply your name!');
	} else {
		if (!emailRegxp.test (emailaddr)){
			alert('Invalid email address!: ' + emailaddr);
		} else {
			//alert('Valid email address! ' + address);
			var linkstr = 'nl_submit.php?u='+username+'&e='+emailaddr;
			newWindow(linkstr, '', 400, 300, '');
			//formname.txtUsername.value = '';
			//formname.txtEmail.value = '';
			return;
		}
	}
}
