
function _ShowMemInfo(cont,id)	{
	window.open("/cht/club/mbr/popMemberInfo.vw?clubId="+clubId+"&usrId="+id,'memInfo','width=300,Height=220,scrollbar=no,titlebar=no,status=no');
}

function _SendInvite(cont,id)	{
	window.open("/cht/club/mbr/popMemberInvite.vw?clubId="+clubId+"&usrId="+id,'memInvite','width=320,Height=360,scrollbar=no,titlebar=no,status=no');
}

function LayerFormView(oDIV, strLayer) {
	if (document.all) {
		oDIV.innerHTML = strLayer;
		oDIV.style.posLeft = event.clientX - 2;
		oDIV.style.posTop = event.clientY + document.documentElement.scrollTop - 6;
		oDIV.style.visibility = "visible";
	}
}

function mbrLayerForm(MBR_ID) {
	if (document.all) {
		strLayer = "";
		strLayer += "<table width='120' border='0' cellpadding='0' cellspacing='1' bgcolor='#CACACA' onmouseover=\"mouse_on_layer(oDIVLayer1, true);\" onmouseout=\"mouse_on_layer(oDIVLayer1, false);\">\n";
		strLayer += "  <tr onmouseover='this.bgColor=\"#F7F6F5;\"' onmouseout='this.bgColor=\"\";'> \n";
		strLayer += "	<td align='center' bgcolor='#FFFFFF' style='padding: 6 0 6 0'>\n";
		strLayer += "	  <table width='90%' border='0' cellspacing='0' cellpadding='0'>\n";
		strLayer += "		<tr onmouseover='this.bgColor=\"#F7F6F5\";' onmouseout='this.bgColor=\"\";'> \n";
		strLayer += "		  <td style='padding: 5 0 1 2'><a href='#' onclick=\"javascript:_ShowMemInfo('info','" + MBR_ID + "');return false;\">瀏覽會員信息</a></td>\n";
		strLayer += "		</tr>\n";
		strLayer += "		<tr> \n";
		strLayer += "		  <td background='/cht/club/images/club/user/layer_dot_01.gif' height='1'></td>\n";
		strLayer += "		</tr>\n";
		strLayer += "		<tr onmouseover='this.bgColor=\"#F7F6F5\";' onmouseout='this.bgColor=\"\";'> \n";
		strLayer += "		  <td style='padding: 5 0 1 2'><a href='#' onclick=\"javascript:_SendInvite('info','" + MBR_ID + "');return false;\">邀請</a></td>\n";
		strLayer += "		</tr>\n";
		strLayer += "	  </table></td>\n";
		strLayer += "  </tr>\n";
		strLayer += "</table>\n";

		LayerFormView(oDIVLayer1, strLayer);
		is_on_layer1 = true;
	}
}

function mbrLayerForm(MBR_ID, MBR_NICK) {
	if (document.all) {
		strLayer = "";
		strLayer += "<table width='120' border='0' cellpadding='0' cellspacing='1' bgcolor='#CACACA' onmouseover=\"mouse_on_layer(oDIVLayer1, true);\" onmouseout=\"mouse_on_layer(oDIVLayer1, false);\">\n";
		strLayer += "  <tr onmouseover='this.bgColor=\"#F7F6F5;\"' onmouseout='this.bgColor=\"\";'> \n";
		strLayer += "	<td align='center' bgcolor='#FFFFFF' style='padding: 6 0 6 0'>\n";
		strLayer += "	  <table width='90%' border='0' cellspacing='0' cellpadding='0'>\n";
		strLayer += "		<tr onmouseover='this.bgColor=\"#F7F6F5\";' onmouseout='this.bgColor=\"\";'> \n";
		strLayer += "		  <td style='padding: 5 0 1 2'><a href='#' onclick=\"javascript:_ShowMemInfo('info','" + MBR_ID + "');return false;\">瀏覽會員資訊</a></td>\n";
		strLayer += "		</tr>\n";
		strLayer += "		<tr> \n";
		strLayer += "		  <td background='/cht/club/images/club/user/layer_dot_01.gif' height='1'></td>\n";
		strLayer += "		</tr>\n";
		strLayer += "		<tr onmouseover='this.bgColor=\"#F7F6F5\";' onmouseout='this.bgColor=\"\";'> \n";
		strLayer += "		  <td style='padding: 5 0 1 2'><a href='#' onclick=\"javascript:writeMemo('"+MBR_ID+"','" + MBR_NICK + "');return false;\">發送簡訊</a></td>\n";
		strLayer += "		</tr>\n";
		strLayer += "	  </table></td>\n";
		strLayer += "  </tr>\n";
		strLayer += "</table>\n";

		LayerFormView(oDIVLayer1, strLayer);
		is_on_layer1 = true;
	}
}

function writeMemo(mbrId, mbrNick)	{	// Check ID checks the ID to be valid.
	window.open('/cht/club/memo/writeMemoForm.vw?recvId='+mbrId+'&recvNick='+mbrNick, 'write','width=380,height=300,titlebar=no,toobar=no,resizable=no,scrollbars=1,toolbars=0,left=200,top=200');
}

var is_on_layer1 = false;

function mouse_on_layer(oDIV, bool) {
	if (oDIV.id == "oDIVLayer1")
		is_on_layer1 = bool;
}


document.onclick = backclick;
function backclick(e) {
	if (oDIVLayer1)
	{
		var event_target;
		var objEvent;

		if (navigator.appName.indexOf("Microsoft Internet Explorer") == 0) {
			event_target = event.srcElement;
			event_target = event_target.toString();
			objEvent = event;
		}
		else {
			event_target = e.target.href;
			objEvent = e;
		}

		event_check = event_target.indexOf(location.href + "#");

		if (event_check == -1) {
			if (event.srcElement.id.indexOf("ImgLayer") == -1) {
				if (!is_on_layer1) {
					oDIVLayer1.style.visibility = "hidden";
				}
			}
		}
	}
}
