document.writeln("<!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\">");
document.writeln("<html>");
document.writeln("	<head>");
document.writeln("		<title>联信UM - 聊天<\/title>");
document.writeln("		<style type=\"text\/css\">");
document.writeln("		.schedule_text{z-index: 100;width: 100%;position: absolute;left: 0px;top: 0px;text-align: left;overflow: hidden;white-space: nowrap;}");
document.writeln("		.schedule_bar{height:13px;margin:1px 0px !important;margin:0px;padding: 0px;background-color: #A5DD3D;position: absolute;left: 0px;top: 0px;z-index: 10;line-height: 13px;}");
document.writeln("		#up_schedule{border-width: 0px 1px 1px 0px;border-style: solid;border-color: #c1e5f3;line-height: 15px;font-size: 12px;background-color: #ffffff;}");
document.writeln("		#down_schedule{border-width: 0px 1px 1px 0px;border-style: solid;border-color: #c1e5f3;line-height: 15px;font-size: 12px;background-color: #ffffff;}");
document.writeln("		.btn{border-width: 0px 1px 1px 0px;border-style: solid;border-color: #c1e5f3;line-height: 15px;font-size: 12px;background-color: #ffffff;text-align: center;cursor: pointer;}");
document.writeln("		<\/style>");
document.writeln("		<style type=\"text/css\">");
document.writeln("			body{background-color: transparent;}");
document.writeln("			.common_color{color:#000000;}");
document.writeln("		</style>");
document.writeln("		<!--[if IE 6]>");
document.writeln("			<script type=\"text\/javascript\" src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/dd_belatedpng.js\" ><\/script>");
document.writeln("		<![endif]-->");
document.writeln("		<script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/shared.js\"  charset=\'gbk\'><\/script>");
document.writeln("		<script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/emoticons.js\" charset=\'gbk\'><\/script>");
document.writeln("		<script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/switchStyle.js\" charset=\'gbk\'><\/script>");
document.writeln("		<script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/statusLed.js\" charset=\'gbk\'><\/script>");
document.writeln("		<script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/jsjac.js\" charset=\'gbk\'><\/script>");
var user, chatStatus;
var srcW;
var cFrame;
var msgid = 0;
var t_editname = "", t_edittel = "", t_editlinkman = "";
function putMsgHTML(msg) {
	var msgHTML = "";
	var body = "";
	var err = false;
	if (msg.getType() == "error") {
		var error = aJSJaCPacket.getNode().getElementsByTagName("error").item(0);
		if (error && error.getElementsByTagName("text").item(0)) {
			body = error.getElementsByTagName("text").item(0).firstChild.nodeValue;
		}
		err = true;
	} else {
		body = msg.getBody();
	}
	var now = msg.jwcTimestamp ? msg.jwcTimestamp : new Date();
	var mtime = (now.getHours() < 10) ? "0" + now.getHours() : now.getHours();
	mtime += ":";
	mtime += (now.getMinutes() < 10) ? "0" + now.getMinutes() : now.getMinutes();
	mtime += ":";
	mtime += (now.getSeconds() < 10) ? "0" + now.getSeconds() : now.getSeconds();
	if (msg.getTo() == user.jid) { // msg sent by me
		nick = htmlEnc(srcW.roster.nick);
		nickcolor = "blue";
		dir = "to";
	} else {
		nick = user.name;
		nickcolor = "red";
		dir = "from";
	}
	var mid = msg.getTo() + msgid++;
	msgHTML += "<div title=\"@ " + mtime + "\" cDate=\"" + now.getTime() + "\" dir=\"" + dir + "\" body=\"" + htmlEnc(body) + "\"><span class=time>[" + mtime + "] </span>";
	body = msgFormat(body);
	if (err) {
		msgHTML += "<span style=\"color:red;\">&nbsp;";
	} else {
		msgHTML += "<span >&nbsp;";
		if (body.match(/^\/me /)) {
			body = body.replace(/^\/me /, "<span style=\"color:green;font-weight:bold;font-size:12px;font-family:Tahoma;\" class=msgnick>*&nbsp;" + nick + "</span>");
		} else {
			msgHTML += "<span style=\"color:" + nickcolor + ";font-size:12px;font-family:Tahoma;\" class=msgnick>&lt;" + nick + "&gt;</span>&nbsp;";
		}
	}
	msgHTML += "<span id=\"" + mid + "\">" + body + "</span>";
	msgHTML += "</span></div>";
	var auto_scroll = false;
	if (cFrame.body.scrollTop + cFrame.body.clientHeight >= cFrame.body.scrollHeight) { // scrollbar at bottom
		auto_scroll = true;
	}
	cFrame.body.innerHTML += msgHTML;
	if (!err) {
		var font = msg.getNode().getElementsByTagName("font").item(0);
		var obj = cFrame.getElementById(mid);
		if (font && obj != null) {
			for (var j = 0; j < font.childNodes.length; j++) {
				if (font.childNodes[j].nodeName == "fontname") {
					obj.style.fontFamily = font.childNodes[j].firstChild.nodeValue;
				}
				if (font.childNodes[j].nodeName == "size") {
					obj.style.fontSize = font.childNodes[j].firstChild.nodeValue + "pt";
				}
				if (font.childNodes[j].nodeName == "color") {
					obj.style.color = (srcW.is.ie) ? parseInt(font.childNodes[j].firstChild.nodeValue) : "#" + parseInt(font.childNodes[j].firstChild.nodeValue).toString(16);
				}
				if (font.childNodes[j].nodeName == "style") {
					if (font.childNodes[j].firstChild) {
						var temp = font.childNodes[j].firstChild.nodeValue.toLowerCase().split(":");
						var temp1 = "";
						for (var m = 0; m < temp.length; m++) {
							if (temp[m] == "fsbold") {
								obj.style.fontWeight = "bold";
							}
							if (temp[m] == "fsitalic") {
								obj.style.fontStyle = "italic";
							}
							if (temp[m] == "fsunderline") {
								temp1 += " underline";
							}
							if (temp[m] == "fsstrikeout") {
								temp1 += " line-through";
							}
						}
						if (temp1) {
							obj.style.textDecoration = temp1.replace(/(^\s*)|(\s*$)/g, "");
						}
					}
				}
			}
		}
	}
	if (auto_scroll) {
		chat.scrollTo(0, cFrame.body.scrollHeight);
	}
}
function popMsgs() {
	if ((typeof srcW.orgid == "undefined" || srcW.orgid == "") && (typeof srcW.pass == "undefined" || srcW.pass == "")) {
		document.getElementById("login_div").style.display = "block";
	}
	cFrame.body.innerHTML += user.fileMsg;
	user.fileMsg = "";
	while (user.chatmsgs.length > 0) {
		var msg;
		if (srcW.is.ie5 || srcW.is.op) {
			msg = user.chatmsgs[0];
			user.chatmsgs = user.chatmsgs.slice(1, user.chatmsgs.length);
		} else {
			msg = user.chatmsgs.shift();
		}
			
			    // calc date
		putMsgHTML(msg);
	}
	if (srcW.focusWindows) {
		window.focus();
		document.forms.chatform.msgbox.focus();
	}
	if (user.lastsrc != null && user.messages.length == 0) {
		var images = srcW.roster.getUserIcons(user.jid);
		for (var i = 0; i < images.length; i++) {
			images[i].src = user.lastsrc;
		}
		user.lastsrc = null;
		if (srcW.roster.usersHidden && user.status == "unavailable") { // remove user from roster if not available any more 
			srcW.roster.print();
		}
	}
	try {
		document.getElementById("editName").value = unescape(JSJaCCookie.read("editname").getValue());
	}
	catch (e) {
	}
	try {
		document.getElementById("editTel").value = unescape(JSJaCCookie.read("edittel").getValue());
	}
	catch (e) {
	}
	t_editname = document.getElementById("editName").value;
	t_edittel = document.getElementById("editTel").value;
	t_editlinkman = srcW.linkMan;
}
function openUserInfo() {
	return srcW.openUserInfo(user.jid);
}
function openUserHistory() {
	return srcW.openUserHistory(user.jid);
}
function updateUserPresence() {
	if ((typeof parent.orgid == "undefined" || parent.orgid == "") && (typeof parent.uin == "undefined" || parent.uin == "")) {
		document.getElementById("im_ownInfo").style.display = "none";
	}
	var awaymsg = srcW.document.getElementById("contact" + user.jid + "awaymsg");
	srcW.document.getElementById("contact" + user.jid + "user_name").innerHTML = user.name;
	if (user.mind) {
		awaymsg.innerHTML = htmlEnc(user.mind);
	} else {
		if (user.statusMsg) {
			awaymsg.innerHTML = htmlEnc(user.statusMsg);
		}
	}
	srcW.document.getElementById("contact" + user.jid + "_windowheadContent").style.backgroundImage = "url(" + eval(user.status + "Led").src + ")";
	if (srcW.document.getElementById("contact" + user.jid + "taskbarItemContent")) {
		srcW.document.getElementById("contact" + user.jid + "taskbarItemContent").style.backgroundImage = "url(" + eval(user.status + "Led").src + ")";
	}
	if (user.status == "unavailable" && user.status != chatStatus) {
		var now = new Date();
		var mtime = now.getFullYear() + "-";
		mtime += (now.getMonth() + 1 < 10) ? "0" + (now.getMonth() + 1) + "-" : (now.getMonth() + 1) + "-";
		mtime += (now.getDate() < 10) ? "0" + now.getDate() + " " : now.getDate() + " ";
		mtime += (now.getHours() < 10) ? "0" + now.getHours() : now.getHours();
		mtime += ":";
		mtime += (now.getMinutes() < 10) ? "0" + now.getMinutes() : now.getMinutes();
		mtime += ":";
		mtime += (now.getSeconds() < 10) ? "0" + now.getSeconds() : now.getSeconds();
		var msgHTML = "<div cdate=\"" + now.getTime() + "\" style=\"background: url(" + eval(user.status + "Led").src + ") no-repeat scroll 3px center transparent;text-indent:20px;line-height:20px;\"><span style=\"font-family: \u5b8b\u4f53; font-size: 12px;\">";
		msgHTML += "\u5bf9\u65b9\u72b6\u6001\u4e3a\u79bb\u7ebf(\u8bf7\u5728\u6b64\u7559\u8a00)";
		chatStatus = user.status;
		msgHTML += "[" + mtime + "]</span></div>";
		cFrame.body.innerHTML += msgHTML;
		for (var i = 0; i < srcW.apperceive_users.length; i++) {
			if (srcW.apperceive_users[i].offlineMessage != "" && cutResource(user.jid) == (srcW.apperceive_users[i][1] + "@" + srcW.UMWEBSERVER)) {
				var aMessage = new JSJaCMessage();
				aMessage.setType("chat");
				aMessage.setFrom(user.jid);
				aMessage.setTo(srcW.jid);
				aMessage.setBody(srcW.apperceive_users[i].offlineMessage);
				putMsgHTML(aMessage);
			}
		}
	} else if (user.status != "unavailable" && user.status != "stalker" && chatStatus != "available") {
		var now = new Date();
		var mtime = now.getFullYear() + "-";
		mtime += (now.getMonth() + 1 < 10) ? "0" + (now.getMonth() + 1) + "-" : (now.getMonth() + 1) + "-";
		mtime += (now.getDate() < 10) ? "0" + now.getDate() + " " : now.getDate() + " ";
		mtime += (now.getHours() < 10) ? "0" + now.getHours() : now.getHours();
		mtime += ":";
		mtime += (now.getMinutes() < 10) ? "0" + now.getMinutes() : now.getMinutes();
		mtime += ":";
		mtime += (now.getSeconds() < 10) ? "0" + now.getSeconds() : now.getSeconds();
		var msgHTML = "<div cdate=\"" + now.getTime() + "\" style=\"background: url(" + eval(user.status + "Led").src + ") no-repeat scroll 3px center transparent;text-indent:20px;line-height:20px;\"><span style=\"font-family: \u5b8b\u4f53; font-size: 12px;\">";
		msgHTML += "\u5bf9\u65b9\u72b6\u6001\u4e3a\u5728\u7ebf";
		chatStatus = "available";
		msgHTML += "[" + mtime + "]</span></div>";
		cFrame.body.innerHTML += msgHTML;
		for (var i = 0; i < srcW.apperceive_users.length; i++) {
			if (srcW.apperceive_users[i].onlineMessage != "" && cutResource(user.jid) == (srcW.apperceive_users[i][1] + "@" + srcW.UMWEBSERVER)) {
				var aMessage = new JSJaCMessage();
				aMessage.setType("chat");
				aMessage.setFrom(user.jid);
				aMessage.setTo(srcW.jid);
				aMessage.setBody(srcW.apperceive_users[i].onlineMessage);
				putMsgHTML(aMessage);
			}
		}
	}
}
function submitClicked() {
	var obj = document.forms[0].elements["msgbox"];
	var body = obj.value;
	if (body == "") { // don"t send empty message
		return false;
	}
	var aMessage = new JSJaCMessage();
	aMessage.setType("chat");
	aMessage.setTo(user.jid);
	aMessage.setBody(body);
	var aNode = aMessage.getNode().appendChild(aMessage.getDoc().createElement("font"));
	if (srcW.messageFontFamily) {
		var tNode = aMessage.getDoc().createTextNode(srcW.messageFontFamily);
		var family = aNode.appendChild(aMessage.getDoc().createElement("fontname"));
		family.appendChild(tNode);
	}
	if (srcW.messageFontStyle || srcW.messageFontWeight || srcW.messageTextDecoration) {
		var temp = "";
		if (srcW.messageFontStyle) {
			temp = temp + "fs" + srcW.messageFontStyle.substr(0, 1).toUpperCase() + srcW.messageFontStyle.substr(1) + ":";
		}
		if (obj.style.fontWeight) {
			temp = temp + "fs" + srcW.messageFontWeight.substr(0, 1).toUpperCase() + srcW.messageFontWeight.substr(1) + ":";
		}
		if (srcW.messageTextDecoration) {
			var a = srcW.messageTextDecoration.split(" ");
			for (var i = 0; i < a.length; i++) {
				if (a[i] == "line-through") {
					temp = temp + "fsStrikeOut:";
				} else {
					temp = temp + "fsUnderline:";
				}
			}
		}
		var tNode = aMessage.getDoc().createTextNode(temp);
		var textStyle = aNode.appendChild(aMessage.getDoc().createElement("style"));
		textStyle.appendChild(tNode);
	}
	if (srcW.messageFontSize) {
		var tNode = aMessage.getDoc().createTextNode(parseInt(srcW.messageFontSize));
		var textSize = aNode.appendChild(aMessage.getDoc().createElement("size"));
		textSize.appendChild(tNode);
	}
	if (srcW.messageColor) {
		var temp = parseInt(srcW.messageColor.substr(1), 16);
		var tNode = aMessage.getDoc().createTextNode(temp);
		var textSize = aNode.appendChild(aMessage.getDoc().createElement("color"));
		textSize.appendChild(tNode);
	}
	srcW.con.send(aMessage);
			
			  // insert into chat window
	putMsgHTML(aMessage);
			
			  // add message to our message history
	srcW.addtoHistory(body);
	document.forms["chatform"].msgbox.value = ""; // empty box
	document.forms["chatform"].msgbox.focus(); // set focus back on input field
	return false;
}
function init() {
	if(typeof(DD_belatedPNG) != "undefined"){DD_belatedPNG.fix("span");}
	srcW = parent;
	cFrame = document.getElementById("chat").contentWindow.document;
	user = srcW.roster.getUserByJID(jid);
	document.title = "与 "+user.name+" 聊天";
	document.getElementById("user_name").innerHTML = user.name;
	if (typeof(srcW.loghost) == "undefined")
		document.getElementById("hist_button").style.display = "none";
	updateUserPresence();
	
	popMsgs();
	displayTimestamp();
	document.getElementById("msgbox").style.fontFamily=srcW.messageFontFamily;
	document.getElementById("msgbox").style.fontSize=srcW.messageFontSize;
	document.getElementById("msgbox").style.fontStyle=srcW.messageFontStyle;
	document.getElementById("msgbox").style.fontWeight=srcW.messageFontWeight;
	document.getElementById("msgbox").style.color=srcW.messageColor;
	document.getElementById("msgbox").style.textDecoration=srcW.messageTextDecoration;
	userInfo();
}
function userInfo() {
  	var iq = new JSJaCIQ();
	iq.setType("get");
	iq.setTo(jid);
	try{
		var vCard = iq.getNode().appendChild(iq.getDoc().createElementNS("vcard-temp","vCard"));
	}catch(e){
		var vCard = iq.getNode().appendChild(iq.getDoc().createElement("vCard"));
		vCard.setAttribute("xmlns","vcard-temp");
	}
	me = this;
	srcW.con.send(iq,me.handleVCard);
}
function handleVCard(iq) {
	if (!iq) {
		srcW.Debug.log("got empty iq result",1);
		return;
	}
	srcW.Debug.log(iq.getDoc().xml,3);
	if (iq.getNode().getElementsByTagName("vCard").item(0)) {
		for (var i=0; i<iq.getNode().getElementsByTagName("vCard").item(0).childNodes.length; i++) {
			var token = iq.getNode().getElementsByTagName("vCard").item(0).childNodes.item(i);
			tokenname = token.nodeName;
			if (token.firstChild && token.firstChild.nodeType != 3) { // found a container
				for (var j=0; j<token.childNodes.length; j++) {
					if (document.getElementById(tokenname+"."+token.childNodes.item(j).nodeName) && token.childNodes.item(j).firstChild){
						document.getElementById(tokenname+"."+token.childNodes.item(j).nodeName).innerHTML = token.childNodes.item(j).firstChild.nodeValue;
						document.getElementById(tokenname+"."+token.childNodes.item(j).nodeName).setAttribute("title",token.childNodes.item(j).firstChild.nodeValue);
					}
				}
	
      		} else{
				if (document.getElementById(tokenname) && token.firstChild){
					document.getElementById(tokenname).innerHTML = token.firstChild.nodeValue;
					document.getElementById(tokenname).setAttribute("title",token.firstChild.nodeValue);
				}
			}
		}
	}
	document.getElementById("URL").href=(document.getElementById("URL").innerHTML.indexOf("http://")>=0 ? document.getElementById("URL").innerHTML:"http://"+document.getElementById("URL").innerHTML);
	if(iq.getNode().getElementsByTagName("autoanswer").item(0) && typeof(isAuto) != "undefined" && isAuto && isAuto == "1"){
		var i = "online";
		var autoanswer = iq.getNode().getElementsByTagName("autoanswer").item(0);
		if(user.status == "unavailable"){
			i = "offline";
		}
		if(autoanswer.getElementsByTagName(i).item(0).firstChild.firstChild && autoanswer.getElementsByTagName(i).item(0).firstChild.firstChild.nodeValue=="1"){
			var aMessage = new JSJaCMessage();
			aMessage.setType("chat");
			aMessage.setTo(srcW.roster.jid);
			aMessage.setBody(autoanswer.getElementsByTagName(i).item(0).childNodes.item(1).firstChild?autoanswer.getElementsByTagName(i).item(0).childNodes.item(1).firstChild.nodeValue:"");
			putMsgHTML(aMessage);
		}
	}
}
function displayTimestamp() {
	var tstyle;
	if (srcW.is.ie) {
		tstyle = cFrame.styleSheets("timestampstyle");
		tstyle.disabled = srcW.timestamps;
	} else {
		tstyle = cFrame.getElementById("timestampstyle");
		tstyle.sheet.disabled = srcW.timestamps;
	}
}
function msgboxKeyDown(el, e) {
	var keycode = e.keyCode ? e.keyCode : e.which;
	switch (keycode) {
	  case 13:
		if (!!srcW.changeway == e.ctrlKey) {
			return submitClicked();
		}
		break;
	  case 38:				// shift+up
		if (e.ctrlKey) {
			el.value = srcW.getHistory("up", el.value);
			el.focus();
			el.select();
		}
		break;
	  case 40:				// shift+down 
		if (e.ctrlKey) {
			el.value = srcW.getHistory("down", el.value);
			el.focus();
			el.select();
		}
		break;
	  case 76:
		if (e.ctrlKey) {   // ctrl+l
			chat.document.body.innerHTML = "";
			return false;
		}
		break;
	  case 27:
		srcW.windowClose("contact" + jid);
		break;
	}
	return true;
}
function showEmotionsSelect(objName, e) {
	srcW.showEmotionSelection(objName);
	(srcW.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function showFontSelect(objName, e) {
	srcW.showFontNameSelection(objName);
	(srcW.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function showFileSelect(objName, e) {
	srcW.showFileSelection(objName);
	(srcW.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function showCaptureSelect(objName, e) {
	srcW.showCaptureSelection(objName);
	(srcW.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function showAppraiseSelect(objName, e) {
	srcW.showAppraiseSelection(objName);
	(srcW.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function showChangewaySelect(objName, e) {
	srcW.showChangewaySelection(objName);
	(srcW.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function downloadFile(obj, realfilename) {
	if (srcW.downloading) {
		alert("\u5df2\u6709\u6587\u4ef6\u5728\u4e0b\u8f7d\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\uff01");
		return false;
	} else {
		var iq = new JSJaCIQ();
		iq.setIQ(jid, "result", "file_" + srcW.con._rid);
		var query = iq.setQuery("jabber:iq:umofflinefiles");
		var xmldoc = XmlDocument.create("body", "jabber:iq:umofflinefiles");
		xmldoc.loadXML("<body xmlns=\"jabber:iq:umofflinefiles\"><type>201</type><result>true</result><realfilename>" + realfilename + "</realfilename></body>");
		for (var i = 0; i < xmldoc.documentElement.childNodes.length; i++) {
			query.appendChild(xmldoc.firstChild.childNodes.item(i).cloneNode(true));
		}
		srcW.con.send(iq);
		obj.parentNode.style.visibility = "hidden";
		return false;
	}
}
function noDownloadFile(obj, realfilename) {
	var iq = new JSJaCIQ();
	iq.setIQ(jid, "result", "file_" + srcW.con._rid);
	var query = iq.setQuery("jabber:iq:umofflinefiles");
	var xmldoc = XmlDocument.create("body", "jabber:iq:umofflinefiles");
	xmldoc.loadXML("<body xmlns=\"jabber:iq:umofflinefiles\"><type>201</type><result>false</result><realfilename>" + realfilename + "</realfilename></body>");
	for (var i = 0; i < xmldoc.documentElement.childNodes.length; i++) {
		query.appendChild(xmldoc.firstChild.childNodes.item(i).cloneNode(true));
	}
	srcW.con.send(iq);
	obj.parentNode.style.visibility = "hidden";
	cFrame.body.innerHTML += "<div>&nbsp;<span style=\"color:blue;font-size:12px;font-family:Tahoma;font-style: normal;font-weight: normal; \" class=msgnick>&lt;" + htmlEnc(srcW.roster.nick) + "&gt;</span>&nbsp;\u5df2\u62d2\u7edd\u63a5\u6536\u6587\u4ef6&nbsp;[" + srcW.fileDownload[realfilename][1] + "]</div>";
	delete srcW.fileDownload[realfilename];
	return false;
}
function saveas() {
	try {
		var savestyle = "<style type=\"text/css\"> <!--body{margin: 0px; padding: 0px 0px 0px 0px; border: 0px;FONT-SIZE: 9pt; FONT-FAMILY: Tahoma;}td { font-family: Tahoma; font-size: 9pt; }p { margin-top:0px;margin-bottom:0px;FONT-SIZE: 9pt; FONT-FAMILY: Tahoma; }.dialog_content{ width:471px; height:276px;border:2px solid #e3ebf8; word-wrap: break-word; word-break: break-all; font-size:14px;padding-left:5px;padding-top:5px; text-align:left;}--></style>";
		var time = new Date();
		var filename = time.toLocaleDateString();
		filename = "UM\u5ba2\u670d\u8bb0\u5f55" + filename + ".htm";
		var winSave = window.open("about:blank", "_blank", "top=10000");
		winSave.document.open("text/html", "utf-8");
		winSave.document.write("<html><head><base target=\"_blank\">" + savestyle + "</head><body>" + document.getElementById("chat").contentWindow.document.body.innerHTML + "</body></html>");
		winSave.document.execCommand("saveas", true, filename);
		winSave.close();
	}
	catch (e) {
	}
}
function handleClick(e) {
	var firingObj = (srcW.is.ie) ? e.srcElement : e.target;
	if (firingObj.id != "editName" && firingObj.id != "editTel" && (document.getElementById("editName").value != t_editname || document.getElementById("editTel").value != t_edittel)) {
		setOwnInfo();
	}
	parent.c();
}
function setOwnInfo() {
	t_editname = document.getElementById("editName").value;
	t_edittel = document.getElementById("editTel").value;
	new JSJaCCookie("editname", escape(t_editname), 10 * 24 * 3600).write();
	new JSJaCCookie("edittel", escape(t_edittel), 10 * 24 * 3600).write();
	var iq = new JSJaCIQ();
	iq.setIQ(null, "set", "owninfo_1");
	iq.appendNode("query", {xmlns:"jabber:iq:owninfo"}, [["linkman", t_editlinkman], ["username", t_editname], ["usertel", t_edittel]]);
	srcW.con.send(iq);
	return true;
}
window.onblur = window.parent.windowBlur;
window.onfocus = window.parent.windowFocus;
onload = init;
document.writeln("	<\/head>");
document.writeln("	<body onclick=\"handleClick(event);\">");
document.writeln("		<table style=\"height: 100%;width: 100%;border:0px;\" cellspacing=\"0\">");
document.writeln("			<tr style=\"display: none;\">");
document.writeln("				<td colspan=\"2\">");
document.writeln("					<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" style=\"margin-bottom: 5px;\">");
document.writeln("						<tr>");
document.writeln("							<td width=\"100%\" valign=top>");
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/unavailable.png\" name=\"statusLed\" width=16 height=16 border=0 align=left>");
document.writeln("								<span id=\"user_name\" class=\"link\" onClick=\"return openUserInfo();\" style=\"padding:2px;\"><\/span>");
document.writeln("								<span id=\"awaymsg\" class=\"statusMsg\"><\/span>");
document.writeln("							<\/td>");
document.writeln("							<td align=right valign=top>");
document.writeln("								<button id=\'hist_button\' onClick=\"return openUserHistory();\">");
document.writeln("									历史");
document.writeln("								<\/button>");
document.writeln("							<\/td>");
document.writeln("					<\/table>");
document.writeln("				<\/td>");
document.writeln("			<\/tr>");
document.writeln("			<tr>");
document.writeln("				<td style=\"height: 100%;\">");
document.writeln("					<table style=\"height: 100%;width: 100%\" cellspacing=\"0\">");
document.writeln("						<tr>");
document.writeln("							<td height=\"100%\" width=\"100%\" style=\"border: 1px solid #c1e5f3;background-color:#ffffff;\" colspan=\"3\">");
document.writeln("								<iframe id=\"chat\" name=\"chat\" frameborder=0><\/iframe>");
document.writeln("							<\/td>");
document.writeln("						<\/tr>");
document.writeln("						<script type=\"text\/javascript\">");
document.writeln("							document.getElementById(\"chat\").src=\"javascript:\\\"<script src=\'http:\/\/" + parent.hostPath + "\/umservice_gbk\/switchStyle.js\'><\\\/script><script>window.onblur = window.parent.parent.windowBlur;window.onfocus = window.parent.parent.windowFocus;window.onload=function(){document.body.className=\'chatbox\';document.body.style.wordWrap=\'break-word\';}<\\\/script><style type=\'text\/css\' id=\'timestampstyle\'>.time { display:none;}<\\\/style>\\\"\";");
document.writeln("						<\/script>");
document.writeln("						<tr style=\"display: none;\">");
document.writeln("							<td style=\"border-width: 0px 0px 1px 1px;border-style: solid;border-color: #c1e5f3;line-height: 15px;background-color: #ffffff;\">");
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/up.gif\" width=\"14\" height=\"14\" \/>");
document.writeln("							<\/td>");
document.writeln("							<td id=\"up_schedule\" width=\"90%\">");
document.writeln("							<\/td>");
document.writeln("							<td class=\"btn\" onclick=\"srcW.stopSend();\" style=\"text-decoration: underline;color: blue;\">");
document.writeln("								<nobr>中止<\/nobr>");
document.writeln("							<\/td>");
document.writeln("						<\/tr>");
document.writeln("						<tr style=\"display: none;\">");
document.writeln("							<td style=\"border-width: 0px 0px 1px 1px;border-style: solid;border-color: #c1e5f3;line-height: 15px;background-color: #ffffff;\">");
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/down.gif\" width=\"14\" height=\"14\"\/>");
document.writeln("							<\/td>");
document.writeln("							<td id=\"down_schedule\" width=\"90%\">");
document.writeln("							<\/td>");
document.writeln("							<td class=\"btn\" onclick=\"srcW.FlashHelper.getFlash().stopReceive();\" style=\"text-decoration: underline;color: blue;\">");
document.writeln("								<nobr>中止<\/nobr>");
document.writeln("							<\/td>");
document.writeln("						<\/tr>");
document.writeln("						<tr>");
document.writeln("							<td class=\"chatmenubar\" colspan=\"3\">");
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/emotion.gif\" style=\"margin-left: 5px;cursor: pointer;\" onclick=\"showEmotionsSelect(\'contact\'+ jid,event);\">");
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/font.gif\" style=\"margin-left: 5px;cursor: pointer;\" onclick=\"showFontSelect(\'contact\'+ jid,event);\">");
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/file.gif\" style=\"margin-left: 5px;cursor: pointer;\" onclick=\"showFileSelect(\'contact\'+ jid,event);\">");
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/capture.gif\" style=\"margin-left: 5px;cursor: pointer;\" onclick=\"showCaptureSelect(\'contact\'+ jid,event);\">");
if(typeof parent.orgid != "undefined" && parent.orgid !=""){
	document.writeln("							<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/appraise.gif\" style=\"margin-left: 5px;cursor: pointer;\" onclick=\"showAppraiseSelect(\'contact\'+ jid,event);\">");
}
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/save.gif\" style=\"margin-left: 5px;cursor: pointer;\" onclick=\"saveas();\">");
document.writeln("							<\/td>");
document.writeln("						<\/tr>");
document.writeln("						<form name=\"chatform\" style=\"border:0px;margin:0px;padding:0px;\">");
document.writeln("						<tr>");
document.writeln("							<td  style=\"border: 1px solid #c1e5f3;background-color:#ffffff;overflow:hidden;\" colspan=\"3\">");
document.writeln("								<textarea id=\"msgbox\" style=\"width:100%;height:50px;overflow: auto;border: 0px;font-family: Tahoma;font-size: 12pt;color:#000000;\" onKeyDown=\"return msgboxKeyDown(this,event);\"><\/textarea>");
document.writeln("							<\/td>");
document.writeln("						<\/tr>");
document.writeln("						<tr>");
document.writeln("							<td colspan=\"3\">");
document.writeln("								<table border=0 cellpadding=0 cellspacing=0 style=\"width: 100%;height: 100%;\">");
document.writeln("									<tr>");
document.writeln("										<td id=\"im_ownInfo\" class=\"im_ownInfo\">");
document.writeln("											署名<input type=\"text\" style=\"margin-top: 3px;width: 50px;color: #5F6A7B;\" id=\"editName\" class=\"myMindMsg\">");
document.writeln("											电话<input type=\"text\" style=\"margin-top: 3px;width: 55px;color: #5F6A7B;\" id=\"editTel\" class=\"myMindMsg\">");
document.writeln("										<\/td>");
document.writeln("										<td align=right style=\"padding-top:5px;\">");
document.writeln("											<span onClick=\"submitClicked(); return false;\" class=\"wrap_span\" style=\"background-image:url(http://" + parent.hostPath + "/umservice_gbk/images/btn_chat.png);margin-right:4px;\"");
document.writeln("												onmouseover=\"this.style.backgroundImage=\'url(http://" + parent.hostPath + "/umservice_gbk/images/btn_chat_over.png)\';\"");
document.writeln("												onmouseout=\"this.style.backgroundImage=\'url(http://" + parent.hostPath + "/umservice_gbk/images/btn_chat.png)\';\"><div class=\"wrap_btn common_color\">发送</div></span>");
document.writeln("											<span class=\"wrap_span\" style=\"background-image:url(http://" + parent.hostPath + "/umservice_gbk/images/send_option.png);width:12px;\"");
document.writeln("												onmouseover=\"this.style.backgroundImage=\'url(http://" + parent.hostPath + "/umservice_gbk/images/send_option_over.png)\';\"");
document.writeln("												onmouseout=\"this.style.backgroundImage=\'url(http://" + parent.hostPath + "/umservice_gbk/images/send_option.png)\';\" onclick=\"showChangewaySelect(\'contact\'+ jid,event);\"><div class=\"wrap_btn\" style=\"visibility: hidden;\">选</div></span>");
document.writeln("										<\/td>");
document.writeln("									<\/tr>");
document.writeln("								<\/table>");
document.writeln("							<\/td>");
document.writeln("						<\/tr>");
document.writeln("						<\/form>");
document.writeln("					<\/table>");
document.writeln("				<\/td>");
document.writeln("				<td style=\"height: 100%;width:140px;\">");
document.writeln("					<table style=\"height: 100%;background-color:#ffffff;width: 100%;border: #c1e5f3 1px solid;\">");
document.writeln("						<tr>");
document.writeln("							<td style=\"vertical-align: top;height: 116px;text-align: center;padding-top: 10px;\">");
document.writeln("								<img src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/images\/c_service.gif\"\/>");
document.writeln("							<\/td>");
document.writeln("						<\/tr>");
document.writeln("						<tr>");
document.writeln("							<td style=\"vertical-align: top;padding:0px;margin:0px;\">");
document.writeln("								<div style=\"padding: 0px 0px 5px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">姓名：<span style=\"color: #5F6A7B;\"><span id=\"N.FAMILY\"><\/span><span style=\"color: #5F6A7B;\" id=\"N.GIVEN\"><\/span><\/span><\/div>");
document.writeln("								<div style=\"padding: 0px 0px 5px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">职位：<span style=\"color: #5F6A7B;\" id=\"TITLE\"><\/span><\/div>");
document.writeln("								<div style=\"padding: 0px 0px 5px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">部门：<span style=\"color: #5F6A7B;\" id=\"ORG.ORGUNIT\"><\/span><\/div>");
document.writeln("								<div style=\"padding: 0px 0px 5px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">单位：<span style=\"color: #5F6A7B;\" id=\"ORG.ORGNAME\"><\/span><\/div>");
document.writeln("								<div style=\"padding: 0px 0px 5px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">地址：<span style=\"color: #5F6A7B;\" id=\"Street_Add\"><\/span><span style=\"color: #5F6A7B;\" id=\"Zip_Add\"><\/span><\/div>");
document.writeln("								<div style=\"padding: 0px 0px 5px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">电话：<span style=\"color: #5F6A7B;\" id=\"Voice_Add\"><\/span><span style=\"color: #5F6A7B;\" id=\"Fax_Add\"><\/span><\/div>");
document.writeln("								<div style=\"padding: 0px 0px 5px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">手机：<span style=\"color: #5F6A7B;\" id=\"Mobile_Add\"><\/span><\/div>");
document.writeln("								<div style=\"padding: 0px 0px 5px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">邮箱：<span style=\"color: #5F6A7B;\" id=\"EMAIL\"><\/span><\/div>");
document.writeln("								<div style=\"padding: 0px 0px 15px 5px;WHITE-SPACE: nowrap;TEXT-OVERFLOW: ellipsis;OVERFLOW: hidden;width:140px;\">网址：<a href=\"http:\/\/www.cccme.org.cn\" id=\"URL\" target=\"_blank\">www.cccme.org.cn<\/a><\/div>");
document.writeln("								<div id=\"login_div\" style=\"display:none;padding: 15px 0px 5px 5px;word-wrap: break-word;overflow:hidden;width:140px;border-top:#C1E5F3 solid 1px;line-height:1.5em;\">您现在是匿名用户，要获取更多服务请先&nbsp;&nbsp;<a onclick=\"srcW.handleLog('','',parent.dd.elements['contact' + jid + '_frame'].x+(parent.dd.elements['contact' + jid + '_frame'].w-parent.dd.elements['login_frame'].w)/2,parent.dd.elements['contact' + jid + '_frame'].y+(parent.dd.elements['contact' + jid + '_frame'].h-parent.dd.elements['login_frame'].h)/2);return false;\" href=\"\" id=\"URL\" target=\"_blank\">登录<\/a></div>");
document.writeln("							<\/td>");
document.writeln("						<\/tr>");
document.writeln("					<\/table>");
document.writeln("				<\/td>");
document.writeln("			<\/tr>");
document.writeln("		<\/table>");
document.writeln("	<\/body>");
document.writeln("<\/html>");
document.writeln("")