// JavaScript Document
function OpenPDF(sFile) 
{
	var URL = 'http://www.parentingfamilies.org/pdfs/' + sFile; 
	var windowSettings="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,"+
								"resizable=yes,width=650,height=600,top=50,left=300";
    window.open(URL,'',windowSettings);
}

function OpenCustomizedPDF(sFile) 
{
	var URL = 'http://www.parentingfamilies.org/customizedpdfs/' + sFile; 
	var windowSettings="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,"+
								"resizable=yes,width=650,height=600,top=50,left=300";
    window.open(URL,'',windowSettings);
}

function DownloadCustomizedPDF() 
{
	document.frmPDF.download.value = 'yes';
	document.frmPDF.submit(); 	
}

function DownloadPDF(sFileID, sFilename) 
{
	document.frmPDF.fileid.value = sFileID;
	document.frmPDF.pdffile.value = sFilename;
	document.frmPDF.submit(); 	
}

function ValidateLogin() 
{
	var reBlank = /^\s*$/;
	var strValue;
	
	strValue = document.frmLogin.Username.value
	if (reBlank.test(strValue)){
		alert('Please enter your username.') 
		document.frmLogin.Username.focus();
		return false;
	}	

	strValue = document.frmLogin.Password.value
	if (reBlank.test(strValue)){
		alert('Please enter your password.') 
		document.frmLogin.Password.focus();
		return false;
	}
}


function ValidateChangePassword() {
	var reBlank = /^\s*$/;
	var strValue;
	
	strValue = document.frmPassword.OldPassword.value
	if (reBlank.test(strValue)){
		alert('Please enter your old password.') 
		document.frmPassword.OldPassword.focus();
		return false;
	}	

	strValue = document.frmPassword.NewPassword.value
	if (reBlank.test(strValue)){
		alert('Please enter your new password.') 
		document.frmPassword.NewPassword.focus();
		return false;
	}	

	strValue = document.frmPassword.NewPassword2.value
	if (reBlank.test(strValue)){
		alert('Please re-enter your new password.') 
		document.frmPassword.NewPassword2.focus();
		return false;
	}	

	if (document.frmPassword.NewPassword2.value.toLowerCase() != document.frmPassword.NewPassword.value.toLowerCase() ){
		alert('New password does not match.') 
		document.frmPassword.NewPassword2.focus();
		return false;
	}			
	
	//if (document.frmPassword.NewPassword.value == document.frmPassword.OldPassword.value ){
	//	alert('New password is the same as old password.') 
	//	document.frmPassword.NewPassword.focus();
	//	return false;
	//}
}
