function open_in_popup_window(url, name, width, height) {
	window.open(url.href,name,'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
	return false;
}

function open_in_new_window(url) {
	window.open(url.href,'external_link','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	return false;
}

function checkEmail(emailPassed)
{
	var email = emailPassed;
	invalidChars = " /:,;?()"
	incorrect ='';
	for (i=0; i<invalidChars.length; i++) 
	{
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) > -1) 
			{
			incorrect += '   -  Invalid Email Address\n';
			break;
			}
		}
		atPos = email.indexOf("@",1)
		if (atPos == -1)
		{
			incorrect += '   -  Invalid Email Address\n';
		}
		if (email.indexOf("@",atPos+1) > -1)
		{
			incorrect += '   -  Invalid Email Address\n';
		}
			periodPos = email.indexOf(".",atPos)
		if (periodPos == -1)
		{
			incorrect += '   -  Invalid Email Address\n';
		}
		if (periodPos+3 > email.length)
		{
			incorrect += '   -  Invalid Email Address\n';
		}	
		if (incorrect != '')
		{
			return true;
		}
		return false;
}
		
function ForgotPassword(){
	//check email address for format
	var alertmessage='';
	if(document.ResetPassword.email.value==''){
		alertmessage+='   Email Address\n';
	}else if(checkEmail(document.ResetPassword.email.value)){
		alertmessage+='   Email Address Invalid\n';
	}

	if (alertmessage == ''){
		//minimise window or somin
		document.ResetPassword.submit();
		//self.moveTo(screen.height,screen.width);
	}else{
		TopMessage = 'You have not entered the following form elements correctly:\n';
		BottomMessage = 'Please correct these fields to continue\n';
		alertmessage = TopMessage + alertmessage + BottomMessage;
		alert(alertmessage);
	}
}