function check_email(form_name)
{
  form = document.form_info;
  if(form_name.options[form_name.selectedIndex].value == "self")
  {
    form.email_url.readOnly = false;
    form.email_url.value = "";
    form.email_url.focus();
  } else {
    form.email_url.readOnly = true;
    form.email_url.value = form_name.options[form_name.selectedIndex].value;
  }
}
function change_emblem(img, dir)
{
	document.all.user_emblem.value = img;
	document.all.user_emblem_pic.src = dir+img+".gif";
}

function userMenu(name,status) { 
	var select_obj;
	var obj=document.all[name];
	var _tmpx,_tmpy, marginx, marginy;
	_tmpx = event.clientX + parseInt(obj.offsetWidth);
	_tmpy = event.clientY + parseInt(obj.offsetHeight);
	_marginx = document.body.clientWidth - _tmpx;
	_marginy = document.body.clientHeight - _tmpy ;
	if(_marginx < 0) _tmpx = event.clientX + document.body.scrollLeft + _marginx ;
	else _tmpx = event.clientX + document.body.scrollLeft ;
	if(_marginy < 0) _tmpy = event.clientY + document.body.scrollTop + _marginy +20;
	else _tmpy = event.clientY + document.body.scrollTop ;
	obj.style.posLeft=_tmpx-12;
	obj.style.posTop=_tmpy-12;
	if(status=='visible') {
		if(select_obj) {
			select_obj.style.visibility='hidden';
			select_obj=null;
		}
		select_obj=obj;
	}else{
		select_obj=null;
	}
	obj.style.visibility=status; 
}

function search_to(uid)
{
	location.href="/03_playground/?board_id=community_01&search_type=user_name&keyword="+uid;
}

function memo_to(user_uid)
{
	window_open(1, 1, '/07_mypage/?_mode=memo_write&user_uid='+user_uid, 'no', 'yes');
}

function viewLayer(layer_name,user_uid,homepage,user_name)
{
	LayerPrint = "<div id='"+layer_name+"' style='position:absolute; left:0px; top:0px; width:99; height:84; z-index:10; visibility: hidden;'>";
  LayerPrint = LayerPrint + "<table width='110' height='90' border='0' cellspacing='0' cellpadding='0' align='right'>";
  LayerPrint = LayerPrint + "<tr>";
  LayerPrint = LayerPrint + "<td width='2' onMouseout=\"javascript:userMenu('"+layer_name+"','hidden')\"></td>";
  LayerPrint = LayerPrint + "<td>";
  LayerPrint = LayerPrint + "<table width='99' border='0' cellspacing='0' cellpadding='0' align='right'>";
  LayerPrint = LayerPrint + "<tr><td height='2'>";
  LayerPrint = LayerPrint + "<img src='/images/board/community/pop_top.gif'\"";
  LayerPrint = LayerPrint + "</td></tr>"
  if(homepage) {
  LayerPrint = LayerPrint + "<tr><td height='21'>";
  LayerPrint = LayerPrint + "<a href=\"javascript:view_homepage('"+homepage+"');\" onfocus=\"blur()\">";
  LayerPrint = LayerPrint + "<img src='/images/board/community/pop_02.gif' border='0' onclick=\"javascript:userMenu('"+layer_name+"','hidden')\"></a>";
  LayerPrint = LayerPrint + "</td></tr>"
  }
  LayerPrint = LayerPrint + "<tr><td height='21'>";
  LayerPrint = LayerPrint + "<a href=\"javascript:memo_to('"+user_uid+"');\" onfocus=\"blur()\">";
  LayerPrint = LayerPrint + "<img src='/images/board/community/pop_03.gif' border='0' onclick=\"javascript:userMenu('"+layer_name+"','hidden')\"></a>";
  LayerPrint = LayerPrint + "</td></tr>"
  if(user_uid) {
  LayerPrint = LayerPrint + "<tr><td height='19'>";
  LayerPrint = LayerPrint + "<a href=\"javascript:search_to('"+user_name+"');\" onfocus=\"blur()\">";
  LayerPrint = LayerPrint + "<img src='/images/board/community/pop_04.gif' border='0' onclick=\"javascript:userMenu('"+layer_name+"','hidden')\"></a>";
  LayerPrint = LayerPrint + "</td>";
  LayerPrint = LayerPrint + "</tr>"
  }
  LayerPrint = LayerPrint + "<tr><td height='2'>";
  LayerPrint = LayerPrint + "<img src='/images/board/community/pop_bot.gif'\"";
  LayerPrint = LayerPrint + "</td></tr>"
  LayerPrint = LayerPrint + "</table>";
  LayerPrint = LayerPrint + "<td width='2' onMouseout=\"javascript:userMenu('"+layer_name+"','hidden')\"></td>";
  LayerPrint = LayerPrint + "</tr>"
  LayerPrint = LayerPrint + "</table>";
  LayerPrint = LayerPrint + "</div>";

  document.writeln(LayerPrint);
}