<br />
<b>Deprecated</b>:  Function ereg() is deprecated in <b>/home/bernar00/domains/bernardandagnes.com/public_html/home/class.XMLHttpRequest.php</b> on line <b>189</b><br />
<br />
<b>Deprecated</b>:  Function ereg_replace() is deprecated in <b>/home/bernar00/domains/bernardandagnes.com/public_html/home/class.XMLHttpRequest.php</b> on line <b>294</b><br />
<br />
<b>Deprecated</b>:  Function ereg() is deprecated in <b>/home/bernar00/domains/bernardandagnes.com/public_html/home/class.XMLHttpRequest.php</b> on line <b>189</b><br />
<br />
<b>Deprecated</b>:  Function ereg_replace() is deprecated in <b>/home/bernar00/domains/bernardandagnes.com/public_html/home/class.XMLHttpRequest.php</b> on line <b>294</b><br />
var bernardTwitter = {"errors":[{"code":53,"message":"Basic authentication is not supported"}]};
var agnesTwitter = {"errors":[{"code":53,"message":"Basic authentication is not supported"}]};

function renderTwitter(json, containerId)
{
	var container = document.getElementById(containerId)
	if (container == undefined)
	{
		return;
	}
	if (json.error != undefined)
	{
		container.innerHTML = "<p>Updates are not currently available.</p>";
	}
	else
	{
		var newHtml = "<ul>\n";
		var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

		for (var i in json)
		{
			var strGMTJSON = json[i].created_at;
			var strGMT = strGMTJSON.replace('+0000','GMT+0000')
			var postDate = new Date(strGMT);

			postHours = postDate.getHours();
			if (postHours > 12) {
				postAmPm = "pm";
				postHours-=12;
			}
			else if (postHours == 12)
			{
				postAmPm = "pm";
			}
			else
			{
				postAmPm = "am";
			}
			if (postHours < 10) postHours = "0" + postHours;

			postMonth = months[postDate.getMonth()];

			postDay = postDate.getDate();
			var postMinutes = postDate.getMinutes();
			if (postMinutes < 10) postMinutes = "0" + postMinutes;

			postDateString = postMonth + " " + postDay + ", " + postDate.getFullYear() + " " + postHours + ":" + postMinutes + " " + postAmPm;
			newHtml += "\t<li><div class=\"byline\">" + postDateString +  "</div> " + json[i].text + "</li>\n";
		};
		newHtml += "</ul>\n";
		container.innerHTML = newHtml;
	}
}

addLoadEvent(function() { renderTwitter(bernardTwitter, "bernardDiv"); });
addLoadEvent(function() { renderTwitter(agnesTwitter, "agnesDiv"); });

