
function render_widget(username, page, width, height, page_path, max_posts, network_id) {
    var style_code = "<style>#bp_posts { ";
    var style_code = style_code + "vertical-align: top; border-style: none; margin: 0px;	width: " + width + "px !important; height: " + height + "px !important;	}	</style>";
    var page_width = width - 40;
	var stamp = new Date();
	var ts = (stamp.getMonth()+1) + "_" + stamp.getDate() + "_" + stamp.getHours();
	var frame = "<iframe id=\"bp_posts\" scrolling=\"auto\" frameborder=\"0\" hidefocus=\"true\" src=\"" + page_path + "page.php?u=" + username + "&pg=" + page + "&page_width=" + page_width + "&max_posts=" + max_posts + "&n=" + network_id + "&ts=" + ts + "\"></iframe>";
    document.writeln(style_code+frame);
}
if (typeof page === 'undefined') {page = 'posts';}
if (typeof max_posts === 'undefined') {max_posts = 20;}
if (typeof width === 'undefined') {width = 350;}
if (typeof height === 'undefined') {height = 400;}
if (typeof network_id === 'undefined') {network_id = 0;}
if (typeof page_path === 'undefined') {page_path = 'http://butterflypages.net/';}
if (typeof username === 'undefined') {document.writeln("[WIDGET ERROR: username not defined.]");}
else {render_widget(username,page,width,height,page_path,max_posts,network_id);}
				 

