if (typeof TINYFLY === 'undefined') {
	var TINYFLY = {};
}

TINYFLY.hcard_builder = {
	get_self_html: function ($el) {
		return $('<div>').append($el.clone()).remove().html();
	},
	build_it: function () {
		var $info = $('#contact_info'),
			$parent = $info.parent(),
			email,
			tel,
			$urls,
			url_blog,
			url_twit,
			html = '';

		// remove bare contact info from the dom
		$info.remove();

		// grab the html for each hcard line
		email = this.get_self_html($info.find('span.email'));
		$urls = $info.find('span.url');
		url_blog = this.get_self_html($urls.eq(0));
		url_twit = this.get_self_html($urls.eq(1));

		// create new html
		html += '&lt;div class=&quot;vcard&quot;&gt;';
		html += '<span>&lt;span class=&quot;email&quot;&gt;' + email + '&lt;/span&gt;</span>';
		html += '<span>&lt;span class=&quot;url&quot;&gt;' + url_blog + '&lt;/span&gt;</span>';
		html += '<span>&lt;span class=&quot;url&quot;&gt;' + url_twit + '&lt;/span&gt;</span>';
		html += '&lt;/div&gt;';

		// add new markup back in
		$info.html(html)
		$parent.append($info);
	}
};

TINYFLY.hcard_builder.build_it();

