function p2fb_init(link)
{
	// create a popup display for an iframe to facebook
	try
	{
		jQuery('body').append(
			jQuery('<div id="p2fb_popup" style="display: none;"></div>')
		);
		var container = jQuery('<div id="p2fb_window" style="display: none;"></div>');
		jQuery('body').append(container);

		container.append(
			jQuery('<div id="p2fb_popup_title"><a href="#" onclick="p2fb_close_Popup();">Close</a></div>')
		);
		container.append(
			jQuery('<div id="p2fb_popup_content"><iframe name="p2fb" id="p2fb_iframe" style="height: 500px" height="500px"></iframe></div>')
		);

		p2fb_show_Popup(link);
	}
	catch(ex)
	{
		alert(ex)
	}
}
function p2fb_show_Popup(link) {
	// shits broken, but not in Fx 3.5, 3.0
	// only broken in IE, iframe is failing to be set correctly.
	// TODO: fit it!
	jQuery('#p2fb_window').fadeIn('fast',function(){
			//jQuery('#p2fb_iframe').attr("src","http://www.facebook.com/share.php?u=" + link);
			document.getElementById('p2fb_iframe').src = "http://www.facebook.com/share.php?u=" + link;
			//jQuery('iframe[name=p2fb]').attr('src',"http://www.facebook.com/share.php?u=" + link);
	});
	//jQuery('#p2fb_popup').fadeIn('fast');

}
function p2fb_close_Popup() {
	jQuery('#p2fb_popup').fadeOut('fast');
	jQuery('#p2fb_window').fadeOut('fast');
}

