
function getElement(aId)
{ 
	return document.getElementsByName(aId);
} 
function getElmById( aId )
{
	element = element = document.layers[aId]
	if( element != null) {
		return element;
	}
	else{
		 element = document.all[aId];
	}
	return element;
}	

function comparePasswords()
{
    pwd = getElement('userPassword')
	confirmpwd = getElement('confirmUserPassword')
		if( pwd[0].value == confirmpwd[0].value)
		{
		    return true
		}
		else
		{
		    alert("The passwords do not match")
			return false
	    }
}
function distinctPassword( )
{
    oldPwd = getElement('OldUserPassword')
    pwd = getElement('userPassword')
    if( oldPwd[0].value != pwd[0].value)
    {
        return true;
    }
    else
    {
        alert("The old and new passwords cannot be the same");
        return false;
    }

}
