/// <summary>
        /// 
        /// </summary>
        /// <param name="doc"></param>
        /// <returns></returns>
        public static IPrivateMessage ParsePrivateMessageDocument(HtmlDocument doc)
        {
            var pm = new AwfulPrivateMessage();
            var top = doc.DocumentNode;

            // **** PARSE BODY *****
            var postBodyNode = top.Descendants("td")
                .Where(node => node.GetAttributeValue("class", "").Equals(NEW_MESSAGE_POSTBODY))
                .SingleOrDefault();

            if (postBodyNode != null)
                pm.Body = new MainWebParser(postBodyNode).Body;

            // ***** PARSE AUTHOR *****
            var authorNode = top.Descendants("dt")
                .Where(node => node.GetAttributeValue("class", "").Equals(NEW_MESSAGE_AUTHOR))
                .FirstOrDefault();

            pm.From = authorNode == null ? NEW_MESSAGE_UNKNOWN_AUTHOR : authorNode.InnerText;

            // ***** PARSE MESSAGE ID *****
            var messageIdNode = top.Descendants(NEW_MESSAGE_INPUT_TAG)
                .Where(node => node.GetAttributeValue("name", "").Equals(NEW_MESSAGE_PRIVATEMESSAGEID))
                .FirstOrDefault();

            int id = 0;
            if (messageIdNode != null)
            {
                string value = messageIdNode.GetAttributeValue("value", "");
                int.TryParse(value, out id);
            }
            pm.PrivateMessageID = id;

            // ***** PARSE SUBJECT *****
            var subjectNode = top.Descendants("div")
                .Where(node => node.GetAttributeValue("class", "").Equals("breadcrumbs"))
                .FirstOrDefault();

            if (subjectNode != null)
            {
                pm.Subject = subjectNode.ParseTitleFromBreadcrumbsNode();
            }

            // ***** PARSE POST MARK *****
            var postmarkNode = top.Descendants("td")
                .Where(node => node.GetAttributeValue("class", "")
                    .Equals("postdate"))
                .FirstOrDefault();

            if (postmarkNode != null)
            {
                string postmark = postmarkNode.InnerText;
                pm.Postmark = Convert.ToDateTime(postmark);
            }

            return pm;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="doc"></param>
        /// <returns></returns>
        public static IList<IPrivateMessage> ParseMessageList(HtmlDocument doc)
        {
            List<IPrivateMessage> messages = new List<IPrivateMessage>();
            var top = doc.DocumentNode;
            var messagesNode = top.Descendants("table").FirstOrDefault();
            var messageTable = messagesNode.Descendants("tr").ToArray();

            // remove last element from the table
            messageTable[messageTable.Length - 1] = null;

            foreach (var item in messageTable)
            {

                if (item != null && string.IsNullOrEmpty(item.GetAttributeValue("class", "")) == true)
                {
                    if (item.InnerText.Contains(PRIVATE_MESSAGE_EMPTY_FOLDER_TEXT)) break;
                    var message = new AwfulPrivateMessage();
                    var rows = item.Descendants("td").ToArray();
                    var statusNode = rows[0];
                    message.Status = GetMessageStatusFromNode(statusNode);
                    // skip the thread tag node, since I'm not using those yet
                    var titleNode = rows[2];
                    // title node has our subject and message id
                    message.Subject = GetMessageTitleFromNode(titleNode);
                    message.PrivateMessageID = GetMessageIDFromNode(titleNode);
                    // author node is next <td>
                    var authorNode = rows[3];
                    message.From = GetMessageAuthorFromNode(authorNode);

                    // postmark node is next <td>
                    var postmarkNode = rows[4];
                    message.Postmark = GetPostMarkFromNode(postmarkNode);
                    messages.Add(message);
                }
            }

            return messages;
        }