/*
pullquote function by Roger Johansson, http://www.456bereastreet.com/

revised by Nate Klaiber
*/
var PullQuote = 
{
	init : function()
	{
		if (!document.getElementById || !document.createElement || !document.appendChild) { return false; };
		
		var oElement, oPullquote, oPullquoteP, oQuoteContent, i, j;
		var arrElements = document.getElementsByTagName('span');
		var arrElemLen = arrElements.length;
		var oRegExp = new RegExp("(^|\\s)summary(\\s|$)");
		
		for(i = 0; i < arrElemLen; i++)
		{
			oElement = arrElements[i];
			if (oRegExp.test(oElement.className)) 
			{
				oPullquote = document.createElement('blockquote');
				oPullquote.className = oElement.className;
				oPullquoteP = document.createElement('p');
				
				for(j = 0; j < oElement.childNodes.length; j++)
				{
					oPullquoteP.appendChild(oElement.childNodes[j].cloneNode(true));
				}
				oPullquote.appendChild(oPullquoteP);
				oElement.parentNode.parentNode.insertBefore(oPullquote, oElement.parentNode);
			}
		}
	}
};

Core.start(PullQuote);