// JavaScript Document
function $(id){return document.getElementById(id);}
function closeMessagePopup(){
	hs.close($('msgClose'));
	//document.body.removeChild($('popupBlock'));
	return false;
}
function closeAddFriend(){
	hs.close($('addFriendClose'));
	return false;
}
function messagePopup(obj,fmbID,fmID){
	/*popupNode=document.createElement('div');
	popupNode.id="popupBlock";
	popupNode.style.position="absolute";
	popupNode.innerHTML="<div style=\"width:600px;height:20px;padding:2px;background-color:#FFFFFF;\">"
		+"<a href=\"#\" onclick=\"return closeMessagePopup();\" id=\"msgClose\" class=\"control\">Close</a></div>"
		+"<div class=\"popup-body\" style=\"padding: 0 10px 10px 2px\">"
		+"<iframe scrolling=\"no\" frameborder=\"0\" src=\""+obj.href+"\" "
		+"width=\"600px\" height=\"300px\"></iframe></div>";
	document.body.appendChild(popupNode);
	setCenter('popupBlock');
	return false;
	*/
	if(document.getElementById('messagepopup'+fmID)==null){
		try{
		msgPopNode=document.createElement('div');
		msgPopNode.className="popup-content";
		msgPopNode.setAttribute('id','messagepopup'+fmID);
		msgPopNode.innerHTML="<div style=\"width:600px;height:20px;padding:2px;background-color:#FFFFFF;\">"
		+"<a href=\"#\" onclick=\"return closeMessagePopup();\" id=\"msgClose\" class=\"control\">Close</a></div>"
		+"<div class=\"popup-body\" style=\"padding: 0 10px 10px 2px\">"
		+"<iframe scrolling=\"no\" frameborder=\"0\" src=\"message_popup.php?fmb_id="+fmbID+"\" width=\"600px\" height=\"300px\"></iframe></div>";
		document.body.appendChild(msgPopNode);
		}catch(e){}
	}
	return hs.htmlExpand(obj,{contentId:'messagepopup'+fmID,align: 'center'});
}
function addFriendPopup(obj,fmbID){
	if(document.getElementById('addfriendpopup')==null){
		try{
		friendPopNode=document.createElement('div');
		friendPopNode.className="popup-content";
		friendPopNode.setAttribute('id','addfriendpopup');
		friendPopNode.innerHTML="<div style=\"width:600px; height:20px; padding: 2px;background-color:#FFFFFF;\">"
		+"<a href=\"#\" onclick=\"return hs.close(this);\" id=\"addFriendClose\" class=\"control\">Close</a></div>"
		+"<div class=\"popup-body\" style=\"padding: 0 10px 10px 2px\">"
		+"<iframe scrolling=\"no\" frameborder=\"0\" src=\"message_newfriend_add_popup.php?fmb_id="+fmbID+"\" width=\"600px\" height=\"300px\"></iframe></div>";
		document.body.appendChild(friendPopNode);
		}catch(e){}
	}
	return hs.htmlExpand(obj,{contentId:'addfriendpopup',align:'center'});
}