﻿<!-- 
/**************************************************************************************************
 File : UserMsg.Js
 Write By : Kevin Xu Wang
 Designed For Kissogram Application Projects
 This Java Script is Designed For Kissogram's User Message Part.This is Used to Keep Alive With User.
 Kissogram System
 Copyright (C) 2006-2008 . All rights reserved.
***************************************************************************************************/
//定义信息类
Kissogram.UserMsg = {
	//定义短消息类
	Msg : {
	//参数设置
		BoxMoveSpeed : 3,	//移动速度，1－10，越大越快
		isPoPupWin : false,	//新消息是否弹出窗口阅读，否则使用动画浮动提示
		LoadPT : 30,	//XML刷新时间10－60（建议20秒）
		DisplayT : 30,	//提示窗弹出后,??秒后消失
		LoadPT2 : 5,	//用户手动关闭后,过??分钟再提醒
		ActiveT : 60,	//发呆??分钟为有效提醒
		BoxStyle : "tableborder5",	//消息表样式
		BodyStyle : "tablebody1",	//消息体样式
		//定义本页变量
		Box : null,
		Count : 0,
		Box_Timer : null,
		Box_spanTop : 0,
		//设置本页面访问时间
		PageStartTime : new Date(),
		//定义默认短消息内容
		MainContent : '',
		OpenScript : '',

		//加载短消息提示窗口
		Load : function () {
			if (Kissogram.Const.Dvbbs_Version[0] == 8) {
				if (Kissogram.Const.Dvbbs_Version[1] == 0)
					this.OpenScript = 'openScript(\'messanger.asp?action=read&id={@Msg_ID}&sender=\'+escape(\'{@Msg_Sender}\'),780,500);';
				else if (Kissogram.Const.Dvbbs_Version[1] == 1)
					this.OpenScript = 'ShadeDiv.ShowFrame(\'messanger.asp?action=read&id={@Msg_ID}&sender=\'+escape(\'{@Msg_Sender}\')+\'&sh=500&sw=780\',this);';
				else
					this.OpenScript = 'DvWnd.open(\'阅读论坛短信息\',\'messanger.asp?action=read&id={@Msg_ID}&sender=\'+escape(\'{@Msg_Sender}\'),600,350,1,{bgc:\'black\',opa:0.5});';
			}
			else
				this.OpenScript = 'openScript(\'messanger.asp?action=read&id={@Msg_ID}&sender=\'+escape(\'{@Msg_Sender}\'),780,500);';
			this.MainContent = '您有 <span style=\"color:red;font-weight:800\">{@Msg_Number}</span> 封新短消息<br/><br/><div align=\"center\">'+
			'<a title=\"点击查看短消息内容\" href=\"'+
			'javascript:{'+ this.OpenScript +
			'Kissogram.UserMsg.Msg.Box_Close(false);void(0);}'+
			'\" style=\"color:red\">'+
			'点击查看<span style=\"color:blue\">{@Msg_Sender}</span>给您的短信</a></div>';
			//定义不使用消息的页面
			var UnLoadPage = new Array(
				"login.asp?action=chk",
				"messanger.asp?"
				);
			for (var i=0;i<UnLoadPage.length;i++) {
				if (Kissogram.HtmlControls.Page.Current.Url.indexOf(UnLoadPage[i])>=0)
					return;
			}

			//创建div元素
			this.Box = document.createElement("div");
			with (this.Box) {
				style.display = "none";
				style.height = "120px";
				style.width = "170px";
				style.position = "absolute";
				onmouseover = new Function("Kissogram.UserMsg.Msg.Count=0;");
				style.filter = "DropShadow(Color=#999999,OffX=1,OffY=2,Positive=1) alpha(opacity=90)";
				//禁止选取文字和右键
				oncontextmenu = new Function("return false");
				onselectstart = new Function("return false");
			}
			var NewTable = document.createElement("table");
			with (NewTable) {
				className = this.BoxStyle;
				style.display = "none";
				style.width = "100%";
				cellPadding = 0;
				cellSpacing = 0;
				border = 0;
			}
			var NewRow = NewTable.insertRow(NewTable.rows.length);
			var NewCol = document.createElement("th");
			with (NewCol) {
				colSpan="1";
				style.width = "95%";
				setAttribute("align","left");
				nowrap = true;
				innerHTML = "★新短消息提示";
			}
			NewRow.appendChild(NewCol);
			NewCol = document.createElement("th");
			with (NewCol) {
				colSpan="1";
				setAttribute("align","right");
				style.width = "5%";
				nowrap = true;
			}
			var ImgDiv = Kissogram.HtmlControls.Html.Element.createCloseImage(function () {
					Kissogram.UserMsg.Msg.Box_Close(true);
					},"关闭!"+ this.LoadPT2 +" 分钟后再次提醒您!");
			NewCol.appendChild(ImgDiv);
			NewRow.appendChild(NewCol);
			//创建内容行
			NewRow = NewTable.insertRow(NewTable.rows.length);
			NewCol = NewRow.insertCell(NewRow.cells.length);
			with (NewCol) {
				setAttribute("id","Kissogram_UserMsg_MsgBody");
				colSpan="2";
				className = this.BodyStyle;
				style.height = "90px";
			}
			//添加Table元素,childNodes(0)
			this.Box.appendChild(NewTable);
			//创建bgsound,childNodes(1)
			var BGSound = document.createElement("bgsound");
			BGSound.loop = 0;
			this.Box.appendChild(BGSound);
			//添加div到页面
			document.body.appendChild(this.Box);
			//创建进程
			setTimeout("Kissogram.UserMsg.Msg.Check();",1000);
		},

		//检测是否有新消息
		Check : function () {
			if (Kissogram.Construction.Dvbbs.UserID==0)
				return;
			//已出现提示框
			if (this.Box.style.display != "none")
				return;
			//超过发呆时间,不再提示
			if (((new Date())-this.PageStartTime) > this.ActiveT*60*1000)
				return;
			//定义服务页
			var ServerPage = Kissogram.Const.Folder_Path +'Xml/Server.asp?action=UserMsg';
			//下面用异步刷新
			Kissogram.Ajax.Xml.Operator.Document.Common.Get(ServerPage +"&tempCode="+ Kissogram.Construction.Common.RndCode(8,true),true,[this.AnalyseXml,this]);
		},

		//分析获得的XML
		AnalyseXml : function (XmlDom) {
			if (Kissogram.Ajax.Error.Error) {
				Kissogram.Ajax.Error.Dispose();
				return;
			}
			if (Kissogram.Construction.Dvbbs.UserID<0)
				Kissogram.Construction.Dvbbs.UserID=Kissogram.Construction.Common.Convert.Int(XmlDom.documentElement.selectSingleNode("UserID").text);
			//未登陆用户
			if (Kissogram.Construction.Dvbbs.UserID<=0) {
				//删除短消息提示框
				if (this.Box)
					document.body.removeChild(this.Box);
				delete(Kissogram.UserMsg.Msg);
			}
			else {
				//读取用户消息数据
				var MsgNumber = Kissogram.Construction.Common.Convert.Int(XmlDom.documentElement.selectSingleNode("MsgNumber").text);
				var MsgID = Kissogram.Construction.Common.Convert.Int(XmlDom.documentElement.selectSingleNode("MsgID").text);
				var MsgSender = XmlDom.documentElement.selectSingleNode("MsgSender").text;
				this.ContentMaker(MsgNumber,MsgID,MsgSender);
			}
		},

		//生成内容信息并呼出动画
		ContentMaker : function (MsgNumber,MsgID,MsgSender) {
			//验证数据有效性
			if (MsgNumber>0 && MsgID>0 && MsgSender!="") {
				this.Box.childNodes(1).src = Kissogram.Const.Folder_Absolute +"skins/default/Mail.wav";
				//10秒后清空声音
				setTimeout(function () {Kissogram.UserMsg.Msg.Box.childNodes(1).src="";}, 10000);
				//打开新窗口
				if (this.isPoPupWin)
					openScript(Kissogram.Const.Folder_Absolute +"messanger.asp?action=read&id="+ MsgID +"&sender="+ MsgSender, 500, 400);
				else {
				//弹出动画提示
					var MsgContent = this.MainContent.replace(/{@Msg_Number}/i,MsgNumber);
					MsgContent = MsgContent.replace(/{@Msg_ID}/i,MsgID);
					MsgContent = MsgContent.replace(/{@Msg_Sender}/ig,MsgSender);
					document.getElementById("Kissogram_UserMsg_MsgBody").innerHTML = MsgContent;
					this.Box_Show();
				}
			}
			//错误则等待下次重试
			else
				setTimeout("Kissogram.UserMsg.Msg.Check();",this.LoadPT*1000);
		},

		//关闭短消息动画
		Box_Close : function (TrueColse){
			var NextCheckTime;
			this.Count = 0;
			this.Box.style.display = "none";
			if (TrueColse)
				NextCheckTime = this.LoadPT2*60;
			else
				NextCheckTime = this.LoadPT;
			setTimeout("Kissogram.UserMsg.Msg.Check();",NextCheckTime*1000);
		},

		//显示短消息动画
		Box_Show : function () {
			try{
				with (this.Box) {
					style.display="block";
					childNodes(0).style.display="block";
					style.top = Kissogram.HtmlControls.Page.Current.documentBody.scrollTop() + Kissogram.HtmlControls.Page.Current.documentBody.clientHeight();
					style.left = Kissogram.HtmlControls.Page.Current.documentBody.scrollLeft() + Kissogram.HtmlControls.Page.Current.documentBody.pageWidth() - this.Box.offsetWidth - 6;
				}
				this.Box_Move();
			}
			catch(e) {}
		},

		//消息框移动
		Box_Move : function () {
			try{
				var MsgBox_spanH = parseInt(this.Box.offsetHeight);
				var MsgBox_docH = Kissogram.HtmlControls.Page.Current.documentBody.clientHeight();
				if (parseInt(this.Box.style.top)<=parseInt(MsgBox_docH - MsgBox_spanH + Kissogram.HtmlControls.Page.Current.documentBody.scrollTop())) {
					this.Box_Resize();
					this.Box.style.top = this.Box_spanTop;
				}
				else
					this.Box_Timer = setTimeout("Kissogram.UserMsg.Msg.Box_Move();",10);
				this.Box_spanTop = parseInt(this.Box.style.top);
				this.Box.style.top = this.Box_spanTop - this.BoxMoveSpeed;
			}
			catch(e) {}
		},

		//消息框重定位
		Box_Resize : function () {
			this.Count++;
			if (this.Count>this.DisplayT*10) {
				this.Box_Close(false);
				return;
			}
			if (this.Box.style.display=="none")
				return;
			try{
				this.Box.style.top = Kissogram.HtmlControls.Page.Current.documentBody.clientHeight() - this.Box.offsetHeight + Kissogram.HtmlControls.Page.Current.documentBody.scrollTop();
				this.Box.style.left = Kissogram.HtmlControls.Page.Current.documentBody.clientWidth() - this.Box.offsetWidth + Kissogram.HtmlControls.Page.Current.documentBody.scrollLeft() - 6;
				window.clearTimeout(this.Box_Timer);
				this.Box_Timer = setTimeout("Kissogram.UserMsg.Msg.Box_Resize();",100);
			}
			catch(e) {}
		}
	},

	//定义弹出消息类
	Alert : {
		Box : null,
		Process : new Array(),
		BoxStyle : "tableborder5",	//消息表样式
		BodyStyle : "tablebody1",	//消息体样式

		//加载弹出层(消息标题,消息体,消息类型{警告[0],选择是否[1],锁定[2]}[,锁定时间:秒,-1时为永久锁定[,回调函数[,选择状态时默认为是/否]]])
		Load : function (MsgTitle,MsgContent,BoxType,LockTime,callBackFunction,FocusWhere) {
			//对于管理页面重定义
			if (Kissogram.Construction.Dvbbs.Page_Admin) {
				this.BoxStyle = "tableBorder";
				this.BodyStyle = "forumrow";
			}
			//窗口已经显示,将本次请求添加到进程
			if (this.Box) {
				this.Process[this.Process.length] = Array.prototype.slice.apply(arguments);
				return;
			}
			LockTime = Kissogram.Construction.Common.Convert.Int(LockTime);
			//锁定时间为0,直接触发下一个进程
			if (BoxType==2 && LockTime==0) {
				checkProcess();
				return
			}
			//检测回调函数正确性
			if (typeof callBackFunction != 'function')
				callBackFunction = function () {};
			FocusWhere = Boolean(FocusWhere);
			//页面未加载完则禁止使用
			var BoxWidth=480;	 //提示窗口的宽度
			var BoxHight=100;	 //提示窗口的高度
			var BoxTitleHeight=25	 //提示窗口标题高度
			var BorderColor="#369";    //提示窗口的边框颜色
			var BoxTitleColor="#9cf";    //提示窗口的标题颜色
			//定义3种模式使用的声音文件地址
			var BoxSound=new Array(3);
			BoxSound[0]=Kissogram.Const.Folder_Path +"Sound/Alert.wav";
			BoxSound[1]=Kissogram.Const.Folder_Path +"Sound/Call.wav";
			BoxSound[2]=Kissogram.Const.Folder_Path +"Sound/Lock.wav";
			//屏蔽拖慢显示的声音文件播放 2007.11.2
			BoxSound = ['','',''];
			//获得页面大小
			var PlaceReset_Interval=null,CountDown_Interval=null;
			LockTime = Kissogram.Construction.Common.Convert.Int(LockTime);
			//BoxType的最大值为2
			BoxType = Math.min(Math.abs(Kissogram.Construction.Common.Convert.Int(BoxType)),2);
			//定义遮蔽层
			var ShadeDiv=document.createElement("div");
			with (ShadeDiv.style) {
				position="absolute";
				top="0px";
				//设置半透明
				filter = "alpha(opacity=43)";
				background="#ffffff";
				left="0px";
				zIndex="10000";
				marginLeft = "0px" ;
				marginTop = "0px";
				bottom = "0px" ;
			}
			with (ShadeDiv) {
				//禁止选取文字和右键
				oncontextmenu = new Function("return false");
				onselectstart = new Function("return false");
			}
			//遮蔽Select
			var Iframe=document.createElement("iframe");
			Iframe.src="about:blank";
			with (Iframe.style) {
				position="absolute";
				visibility="inherit";
				top="0px";
				left="0px";
				zIndex="-1";
				filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
			}
			ShadeDiv.appendChild(Iframe);
			//加入到文档
			document.body.appendChild(ShadeDiv);
			resizeShadeDiv();
			//定义主信息框
			this.Box=document.createElement("div");
			with (this.Box.style) {
				textAlign="center";
				background = "#ffffff";
				border = "1px solid " + BorderColor;
				position = "absolute";
				left = "0px";
				top = "0px";
				font = "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
				marginLeft = Kissogram.HtmlControls.Page.Current.documentBody.scrollLeft()+(Kissogram.HtmlControls.Page.Current.documentBody.pageWidth()-BoxWidth)/2+"px" ;
				marginTop = Kissogram.HtmlControls.Page.Current.documentBody.scrollTop()+(Kissogram.HtmlControls.Page.Current.documentBody.clientHeight()-BoxHight)/2+"px";
				width = BoxWidth + "px";
				textAlign = "center";
				lineHeight ="25px";
				zIndex = "10001";
			}
			with (this.Box) {
				//禁止选取文字和右键
				oncontextmenu = new Function("return false");
				onselectstart = new Function("return false");
			}
			//创建bgsound,childNodes(0)
			var BGSound = document.createElement("bgsound");
			with (BGSound) {
				src = BoxSound[BoxType] || '';
				loop = 0;
			}
			this.Box.appendChild(BGSound);
			var NewTable = document.createElement("table");
			with (NewTable) {
				className = this.BoxStyle;
				style.width = "100%";
				style.height = BoxHight + "px";
				cellPadding = 0;
				cellSpacing = 0;
				border = 0;
			}
			//创建标题行
			var NewRow = NewTable.insertRow(NewTable.rows.length);
			var NewCol = document.createElement("th");
			with (NewCol) {
				colSpan = "1";
				style.textAlign = "left";
				nowrap = true;
				innerHTML = MsgTitle;
			}
			//定义通用Click事件
			var ThisClose = function() {
				clearInterval(PlaceReset_Interval);
				clearInterval(CountDown_Interval);
				document.body.removeChild(ShadeDiv);
				removeAlertBox();
				checkProcess();
			}
			if (LockTime>0) {
				var CountDownSpan = document.createElement("span");
				CountDownSpan.innerHTML = "[本窗口将在 "+ LockTime +" 秒后自动关闭]";
				//由于延时1秒,所以下面减去1秒
				var TempLockTime = LockTime;
				CountDown_Interval=setInterval(function () {
					CountDownSpan.innerHTML = "[本窗口将在 "+ TempLockTime +" 秒后自动关闭]";
					TempLockTime--;
					//超时关闭
					if (TempLockTime<0) {
						callBackFunction.call(callBackFunction,FocusWhere);
						ThisClose();
					}
				}, 1000);
				NewCol.appendChild(CountDownSpan);
			}
			NewRow.appendChild(NewCol);
			NewCol = document.createElement("th");
			with (NewCol) {
				colSpan="1";
				style.textAlign="right";
				nowrap = true;
			}
			//锁定模式无法使用按钮
			if (BoxType != 2) {
				var ImgDiv = Kissogram.HtmlControls.Html.Element.createCloseImage(function () {
						callBackFunction.call(callBackFunction);
						ThisClose();
						});
				NewCol.appendChild(ImgDiv);
			}
			NewRow.appendChild(NewCol);
			//创建内容行
			NewRow = NewTable.insertRow(NewTable.rows.length);
			NewCol = NewRow.insertCell(NewRow.cells.length);
			with (NewCol) {
				colSpan="2";
				style.height = "50px";
				className = this.BodyStyle;
				innerHTML = MsgContent;
			}
			//创建确定行
			NewRow = NewTable.insertRow(NewTable.rows.length);
			NewCol = NewRow.insertCell(NewRow.cells.length);
			with (NewCol) {
				style.textAlign="right";
				nowrap = true;
				colSpan="2";
				className = this.BodyStyle;
				style.height = "13px";
			}
			//锁定模式无法使用按钮
			if (BoxType != 2) {
				var ButtonDone = document.createElement("input");
				with (ButtonDone) {
					type = "button";
					value = "确定";
					onmouseout = function() {
						style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C3DAF5);";
					}
					onmouseover = function() {
						style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#D7E7FA);";
					}
				}
				with (ButtonDone.style) {
					borderTop = "#2C59AA 1px solid";
					borderLeft = "#2C59AA 1px solid";
					borderRight = "#2C59AA 1px solid";
					borderBottom = "#2C59AA 1px solid";
					paddingTop = "2px";
					paddingLeft = "2px";
					paddingRight = "2px";
					filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C3DAF5);";
					fontSize = "12px";
					cursor = "pointer";
					color = "black";
				}
				if (BoxType==1) {
					//复制对象,因为要创建两个按钮
					var NewButtonDone = ButtonDone.cloneNode(true);
					//完成确定按钮的事件
					Kissogram.HtmlControls.Html.Compatibility.Set.onClick(ButtonDone,function () {callBackFunction.call(callBackFunction,true);ThisClose();});
					NewButtonDone.value = "取消";
					Kissogram.HtmlControls.Html.Compatibility.Set.onClick(NewButtonDone,function () {callBackFunction.call(callBackFunction,false);ThisClose();});
					NewCol.appendChild(ButtonDone);
					NewCol.appendChild(NewButtonDone);
				}
				else {
					Kissogram.HtmlControls.Html.Compatibility.Set.onClick(ButtonDone,function () {callBackFunction.call(callBackFunction);ThisClose();});
					NewCol.appendChild(ButtonDone);
				}
			}
			this.Box.appendChild(NewTable);
			document.body.appendChild(this.Box);
			if (!FocusWhere && BoxType==1)
				NewButtonDone.focus();
			else if (BoxType != 2)
				ButtonDone.focus();
			//只有当消息框的高比可视区域小时才自动滚动
			if (Kissogram.HtmlControls.Page.Current.documentBody.clientHeight()>this.Box.offsetHeight)
				//定时运行
				PlaceReset_Interval=setInterval(function () {
					Kissogram.UserMsg.Alert.Box_PlaceReset.call(Kissogram.UserMsg.Alert);
					resizeShadeDiv();
					},100);
			else
				PlaceReset_Interval=setInterval(function () {resizeShadeDiv();},100);
			//移除主信息框
			function removeAlertBox() {
				//关闭声音
				with (Kissogram.UserMsg.Alert) {
					Box.removeChild(BGSound);
					document.body.removeChild(Box);
					Box=null;
				}
			}
			//重新定位遮蔽层大小
			function resizeShadeDiv() {
				with (Iframe.style) {
					width=Kissogram.HtmlControls.Page.Current.documentBody.pageWidth() + "px";
					height=Kissogram.HtmlControls.Page.Current.documentBody.pageHeight() + "px";
				}
				with (ShadeDiv.style) {
					width=Kissogram.HtmlControls.Page.Current.documentBody.pageWidth() + "px";
					height=Kissogram.HtmlControls.Page.Current.documentBody.pageHeight() + "px";
				}
			}
			//检测下一个进程
			function checkProcess() {
				//加载进程
				with (Kissogram.UserMsg) {
					if (Alert.Process.length>0)
						Alert.Load.apply(Alert,Alert.Process.shift());
				}
			}
		},

		//校对主信息框的位置
		Box_PlaceReset : function () {
			if (!this.Box)
				return;
			this.Box.style.marginTop = Kissogram.HtmlControls.Page.Current.documentBody.scrollTop()+(Kissogram.HtmlControls.Page.Current.documentBody.clientHeight()-this.Box.offsetHeight)/2+"px";
		}
	},

	//便条(注意,便条具有即时性,一旦创建,无法对其再操作)
	Scrip : {
		BoxWidth : 300,
		BoxHeight : 100,
		BoxStyle : "tableborder5",	//消息表样式
		BodyStyle : "tablebody1",	//消息体样式

		//唯一的Method:创建便条
		Create : function ($MsgTitle,$MsgBody,$BoxStyle,$BGSound) {
			if (!$MsgBody)
				return;
			//创建div元素
			var Box = document.createElement("div");
			with (Box.style) {
				position = "absolute";
				filter = "DropShadow(Color=#999999,OffX=1,OffY=2,Positive=1) alpha(opacity=85)";
				width = this.BoxWidth+"px";
				left = "0px";
				top = "0px";
				background = "#ffffff";
				zIndex = 10000;
				font = "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
				marginLeft = Kissogram.HtmlControls.Page.Current.documentBody.scrollLeft()+(Kissogram.HtmlControls.Page.Current.documentBody.pageWidth()-this.BoxWidth)/2+"px" ;
				marginTop = Kissogram.HtmlControls.Page.Current.documentBody.scrollTop()+(Kissogram.HtmlControls.Page.Current.documentBody.clientHeight()-this.BoxHeight)/2+"px";
			}
			var NewTable = document.createElement("table");
			with (NewTable) {
				//用和短消息提示一样的风格
				className = $BoxStyle || this.BoxStyle;
				style.height = this.BoxHeight+"px";
				style.width = "100%";
				style.zIndex = "100";
				cellPadding = 0;
				cellSpacing = 0;
				//禁止选取文字和右键
				oncontextmenu = new Function("return false");
				onselectstart = new Function("return false");
				border = 0;
			}
			var NewRow = NewTable.insertRow(NewTable.rows.length);
			var NewCol = document.createElement("th");
			with (NewCol) {
				colSpan="1";
				style.width = "95%";
				style.textAlign="left";
				style.lineHeight=style.height;
				nowrap = true;
				innerHTML = $MsgTitle || "★便条";
			}
			NewRow.appendChild(NewCol);
			NewCol = document.createElement("th");
			with (NewCol) {
				colSpan="1";
				style.textAlign="right";
				style.lineHeight=style.height;
				style.width = "5%";
				nowrap = true;
			}
			var ImgDiv = Kissogram.HtmlControls.Html.Element.createCloseImage(function () {
					document.body.removeChild(Box);
					});
			NewCol.appendChild(ImgDiv);
			NewRow.appendChild(NewCol);
			//创建内容行
			NewRow = NewTable.insertRow(NewTable.rows.length);
			NewCol = NewRow.insertCell(NewRow.cells.length);
			with (NewCol) {
				colSpan="2";
				className = this.BodyStyle;
				style.height = "90px";
				innerHTML = $MsgBody;
			}
			//添加Table元素,childNodes(0)
			Box.appendChild(NewTable);
			if ($BGSound) {
				//创建bgsound
				var BGSound = document.createElement("bgsound");
				BGSound.loop = 0;
				BGSound.src = $BGSound;
				Box.appendChild(BGSound);
			}
			//设置层可拖动
			Kissogram.HtmlControls.Html.Layer.Drag(Box);
			//添加div到页面
			document.body.appendChild(Box);
		}
	}
}

//注册到主程序
Kissogram.Construction.Program.Add("UserMsg",
	function (){
		if (!Kissogram.Construction.Dvbbs.Page_Admin)
			this.Msg.Load();
		else
			delete(this.Msg);
	}
	,2,Kissogram.UserMsg);

//-->
