

// JavaScript Document

function GetPassword()
{

	var sReturn;
	var sParam;
	var sEmail = document.getElementById('txtUserNameForgotten').value;
	var divMessage = document.getElementById('divMessage');
	var divPasswordForm = document.getElementById('divPasswordForm');
	
	if (sEmail !='')
	{
		sParam = 'method=SITE_SEND_PASSWORD&site=' + msOnDemandSiteId + '&logon=' + sEmail + '@d9800';
		//sParam = 'method=SITE_SEND_PASSWORD&document=26139&sendoption=26139&site=' + msOnDemandSiteId + '&logon=' + sEmail;

		sReturn = onDemandSite(sParam);
		
		if (sReturn.substring(0, 2) == 'OK')
		{

//			window.alert('Password Reset Performed.');
			
			var aValues = sReturn.split("|");

			if (aValues[1] == 'OK')
			{
//				window.alert('Password Reset OK');
							
				divPasswordForm.style.display = 'none';	
				divMessage.innerHTML = 'Thank you, your password has been sent to your email';
				divMessage.style.display = 'block';
			}
			else
			{
				window.alert('Could not recover your password.');
			}

		}	
		else
		{
			window.alert('Could not recover your password.');
		}
	}
	else
	{
		window.alert('You need to enter your email address.');
	}

}

