document.writeln("<script type=\"text\/javascript\" src=\"http:\/\/" + parent.hostPath + "\/umservice\/switchStyle.js\"><\/script>");
document.writeln("<script type=\"text\/javascript\" src=\"http:\/\/" + parent.hostPath + "\/umservice\/shared.js\"><\/script>");
document.writeln("<html><body onload=\"parent.rosterLoaded = true;if(typeof(DD_belatedPNG) != \'undefined\'){DD_belatedPNG.fix(\'img,span\');}\" onclick=\"(typeof parent.orgid != 'undefined')?parent.c():handleClick(event)\">");
document.writeln("		<style type=\"text/css\">");
document.writeln("			body{background-color: transparent;}");
document.writeln("			.common_color{color:#000000;}");
document.writeln("			.common_background_color{background-color:#50bbff;}");
document.writeln("		</style>");
document.writeln("		<!--[if IE 6]>");
document.writeln("			<script type=\"text\/javascript\" src=\"http:\/\/" + parent.hostPath + "\/umservice\/dd_belatedpng.js\" ><\/script>");
document.writeln("		<![endif]-->");
var ow,groupw;
function openOptions(isShow) {
	return parent.openOptions(isShow);
}
function addUser() {
	parent.openSubscription();
	return false;
}
function openGroupchat() {
	if (!groupw || groupw.closed) {
		groupw = open("http://" + parent.hostPath + "/umservice/joingroupchat.html", "joingroupw" + makeWindowName(parent.jid), "width=330,height=250,resizable=yes");
	}
	groupw.focus();
	return false;
}
function openChangeStatus(isShow) {
	return parent.openChangeStatus(isShow);
}
function keyPressed(e) {
	if (e.ctrlKey && e.keyCode == 74) {
		parent.Debug.start();
	}
}
function cleanUp() {
	if (ow && !ow.closed) {
		ow.close();
	}
	if (groupw && !groupw.closed) {
		groupw.close();
	}
}
function clickDiv(obj, e) {
	parent.hideAllChatSelecitons("statusMenuDiv");
	var flyMenuDiv = document.getElementById("statusMenuDiv");
	if (flyMenuDiv.style.visibility == "visible") {
		flyMenuDiv.style.visibility = "hidden";
	} else {
		flyMenuDiv.style.visibility = "visible";
	}
	(parent.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function showPickerSelect(objName, e) {
	parent.showPickerSelection(objName);
	(parent.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function highlightie5(e) {
	var firingobj = (parent.is.ie) ? event.srcElement : e.target;
	if (firingobj.className == "menuitems") {
		firingobj.style.backgroundColor = "#ffffff";
		firingobj.style.border = "1px solid #c1e5f3";
	}
}
function lowlightie5(e) {
	var firingobj = (parent.is.ie) ? event.srcElement : e.target;
	if (firingobj.className == "menuitems") {
		firingobj.style.backgroundColor = "";
		firingobj.style.border = "1px solid #E0EFF9";
	}
}
function handleClick(e) {
	var firingObj = (parent.is.ie) ? e.srcElement : e.target;
	if (firingObj.id == "myMind" && !firingObj.selected) {
		if (parent.currentMind == "") {
			firingObj.value = "";
		}
		firingObj.className = "myMindMsgSelected";
		firingObj.selected =! firingObj.selected;
	} else {
		setStatusMessage();
	}
	parent.c();
}
function setStatusMessage() {
	var el = document.getElementById("myMind");
	if (!el.selected) {
		return true;
	}
	el.className = "myMindMsg";
	el.selected = !el.selected;
	if (el.value == "") {
		if (parent.currentMind == "") {
			el.value = "\u70b9\u51fb\u8bbe\u7f6e\u4e2a\u6027\u7b7e\u540d";
			return true;
		} else {
			parent.currentMind = "";
			el.value = "\u70b9\u51fb\u8bbe\u7f6e\u4e2a\u6027\u7b7e\u540d";
		}
	} else {
		if (parent.Len(el.value) > 30) {
			alert("\u7b7e\u540d\u4e0d\u80fd\u8d85\u8fc730\u4e2a\u5b57\u7b26(\u4e00\u4e2a\u6c49\u5b57\u7b49\u4e8e2\u4e2a\u5b57\u7b26)");
			if (parent.currentMind == "") {
				el.value = "\u70b9\u51fb\u8bbe\u7f6e\u4e2a\u6027\u7b7e\u540d";
			} else {
				el.value = parent.currentMind;
			}
			return true;
		} else {
			parent.currentMind = el.value;
		}
	}
	parent.changeMind(parent.currentMind);
	el.blur();
	return true;
}
window.onblur = window.parent.windowBlur;
window.onfocus = window.parent.windowFocus;
//onunload = cleanUp;
onkeydown = keyPressed;
document.writeln("    <script for=\"document\" event=\"onkeydown()\" language=\"JScript\">");
document.writeln("    if (window.event)");
document.writeln("      keyPressed(window.event);");
document.writeln("    <\/script>");
document.writeln("    <STYLE type=\"text\/css\">");
document.writeln("    	div.menuitems {");
document.writeln("			background:#E0EFF9 none repeat scroll 0 0;");
document.writeln("			border:1px solid #E0EFF9;");
document.writeln("			cursor:pointer;");
document.writeln("			font-size:11px;");
document.writeln("			padding:2px 10px;");
document.writeln("			white-space: nowrap;");
document.writeln("		}");
document.writeln("    <\/STYLE>");
document.writeln("<div class=\"statusMenu common_background_color\" style=\"padding: 1px; visibility: hidden; position: absolute; z-index: 10000;\" onmouseout=\"lowlightie5(event)\" onmouseover=\"highlightie5(event)\" id=\"mainMenuDiv\">");
document.writeln("	<div class=\"menuitems\" onclick=\"return openChangeStatus(1);\">修改在线状态<\/div>");
document.writeln("	<div class=\"menuitems\" onclick=\"return parent.openUserInfo(parent.cutResource(parent.jid))\">修改个人资料<\/div>");
if(parent.isBlog == 0){
	document.writeln("	<div class=\"menuitems\" onclick=\"addUser();\">添加好友<\/div>");
}
document.writeln("	<!--<div class=\"menuitems\" onclick=\"return openOptions(1);\" style=\"border: 1px solid rgb(224, 239, 249);\">系统设置<\/div>");
document.writeln("	<div style=\"margin: 1px; background-color: rgb(204, 204, 204); background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; -moz-background-size: auto auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; line-height: 1px;\">&nbsp;<\/div>");
document.writeln("	<div class=\"menuitems\" onclick=\"parent.logout()\" id=\"sendMessageMenuId\" style=\"border: 1px solid rgb(224, 239, 249);\">注销<\/div>-->");
document.writeln("<\/div>");
document.writeln("<table style=\"height: 100%;width: 100%;border:0px;\" cellspacing=\"0\">");
document.writeln("<tr>");
document.writeln("	<td colspan=2 class=\"rosterInnerElement\" style=\"padding-bottom:0px;");
if(typeof parent.orgid != "undefined"){
	document.writeln("display:none;");
}
document.writeln("		\"><table style=\"height: 100%;width: 100%;\" border=0 cellspacing=0 cellpadding=0>");
document.writeln("			<tr>");
document.writeln("				<td>");
document.writeln("      				<img id=\"statusLed\" name=\"statusLed\" src=\"http:\/\/" + parent.hostPath + "\/umservice\/images\/unavailable.png\" align=\"left\">");
document.writeln("      			<\/td>");
document.writeln("      			<td>");
document.writeln("					<table title=\"点击这里\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"des\" onmouseover=\"this.className=\'sel\';\" onmouseout=\"this.className=\'des\';\" onclick=\"clickDiv(this,event);\" id=\"myStatusDiv\">");
document.writeln("						<tbody>");
document.writeln("							<tr>");
document.writeln("								<td id=\"myNickname\"><\/td>");
document.writeln("								<td nowrap=\"nowrap\"><span style=\"font-size: 11px;\" id=\"statusMsg\" align=\"right\"><\/span><img height=\"12\" border=\"0\" src=\"http:\/\/" + parent.hostPath + "\/umservice\/images\/design2009\/main\/arrow_down.gif\" alt=\"\"\/><\/td>");
document.writeln("							<\/tr>");
document.writeln("						<\/tbody>");
document.writeln("					<\/table>");
document.writeln("					<div id=\"statusMenuDiv\" class=\"statusMenu common_background_color\" onmouseover=\"highlightie5(event)\" onmouseout=\"lowlightie5(event)\" style=\"padding: 1px; position: absolute; visibility: hidden; z-index: 10000;\">");
document.writeln("						<!--<div style=\"border: 1px solid rgb(223, 239, 254); width: 120px;\" id=\"sendMessageMenuId\" onclick=\"changeStatus(\'NLN\')\" class=\"menuitems\">Online<\/div>");
document.writeln("						<div id=\"sendMessageMenuId\" onclick=\"changeStatus(\'AWY\')\" class=\"menuitems\" style=\"border: 1px solid rgb(223, 239, 254);\">Away<\/div>");
document.writeln("						<div id=\"sendMessageMenuId\" onclick=\"changeStatus(\'BRB\')\" class=\"menuitems\" style=\"border: 1px solid rgb(223, 239, 254);\">Be Right Back<\/div>");
document.writeln("						<div id=\"sendMessageMenuId\" onclick=\"changeStatus(\'LUN\')\" class=\"menuitems\" style=\"border: 1px solid rgb(223, 239, 254);\">Out to Lunch<\/div>");
document.writeln("						<div id=\"sendMessageMenuId\" onclick=\"changeStatus(\'BSY\')\" class=\"menuitems\" style=\"border: 1px solid rgb(223, 239, 254);\">Busy<\/div>");
document.writeln("						<div id=\"sendMessageMenuId\" onclick=\"changeStatus(\'PHN\')\" class=\"menuitems\" style=\"border: 1px solid rgb(223, 239, 254);\">On the Phone<\/div>");
document.writeln("						<div id=\"sendMessageMenuId\" onclick=\"changeStatus(\'HDN\')\" class=\"menuitems\" style=\"border: 1px solid rgb(223, 239, 254);\">Invisible<\/div>-->");
document.writeln("						<div class=\"menuitems\" onclick=\"return openChangeStatus(1);\" style=\"border: 1px solid rgb(224, 239, 249);\">修改在线状态<\/div>");
document.writeln("						<div class=\"menuitems\" onclick=\"return parent.openUserInfo(parent.cutResource(parent.jid))\" style=\"border: 1px solid rgb(224, 239, 249);\">修改个人资料<\/div>");
if(parent.isBlog == 0){
	document.writeln("						<div class=\"menuitems\" onclick=\"addUser();\" style=\"border: 1px solid rgb(224, 239, 249);\">添加好友<\/div>");
}
document.writeln("						<!--<div class=\"menuitems\" onclick=\"return openOptions(1);\" style=\"border: 1px solid rgb(224, 239, 249);\">系统设置<\/div>");
document.writeln("						<div style=\"margin: 1px; background-color: rgb(204, 204, 204); background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; -moz-background-size: auto auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; line-height: 1px;\">&nbsp;<\/div>");
document.writeln("						<div class=\"menuitems\" onclick=\"parent.logout()\" id=\"sendMessageMenuId\" style=\"border: 1px solid rgb(224, 239, 249);\">注销<\/div>-->");
document.writeln("					<\/div>");
document.writeln("				<\/td>");
document.writeln("				<td align=\"right\">");
document.writeln("					<div style=\"cursor:pointer;background: url(http://" + parent.hostPath + "/umservice/images/picker.png) no-repeat scroll center center transparent;width:16px;height:16px;\"");
document.writeln("						onmouseover=\"this.style.backgroundImage=\'url(http://" + parent.hostPath + "/umservice/images/picker_over.png)\';\"");
document.writeln("						onmouseout=\"this.style.backgroundImage=\'url(http://" + parent.hostPath + "/umservice/images/picker.png)\';\" onclick=\"showPickerSelect('main',event);\">&nbsp;</div>");
document.writeln("				<\/td>");
document.writeln("			<\/tr>");
document.writeln("		<\/table>");
document.writeln("    <\/td>");
document.writeln("<\/tr>");
document.writeln("<!-- the roster himself -->");
document.writeln("<tr>");
document.writeln("	<td class=\"rosterInnerElement\" colspan=\"2\" style=\"padding-bottom: 0px;");
if(typeof parent.orgid != "undefined" || parent.isBlog == 1){
	document.writeln("display:none;");
}
document.writeln("		\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">");
document.writeln("			<tbody><tr>");
document.writeln("				<td colspan=\"2\"><input type=\"text\" value=\"点击设置个性签名\" class=\"myMindMsg\" title=\"点击设置个性签名\" id=\"myMind\" style=\"width: 100%;\"><\/td>");
document.writeln("			<\/tr>");
document.writeln("		<\/tbody><\/table>");
document.writeln("	<\/td>");
document.writeln("<\/tr>");
document.writeln("<tr><td height=\"100%\" colspan=2 class=\"rosterInnerElement\"><iframe name=\"iRoster\" id=\"iRoster\" scrolling=\"auto\" style=\"width:100%;height:100%;border:1px solid #c1e5f3;\" frameborder=0><\/iframe><\/td><\/tr>");
document.writeln("<script type=\"text\/javascript\">");
document.writeln("	document.getElementById(\"iRoster\").src=\"javascript:\\\"<script src=\'http:\/\/" + parent.hostPath + "\/umservice\/iRoster.js\' charset=\'utf-8\'><\\\/script>\\\"\";");
document.writeln("<\/script>");
document.writeln("<!-- buttonbar -->");
document.writeln("<tr><td colspan=2 class=\"rosterInnerElement\" style=\"padding-bottom:12px;\">");
if(typeof parent.orgid != "undefined" && parent.orgid !=""){
	document.writeln("<img id=\"orgLogoImg\" src=\"http:\/\/" + parent.hostPath + "\/umservice\/images\/logo.png\" onerror=\"loadLogo(this);\" width=\"130\" height=\"36\"/>");
}else{
	document.writeln("<span onclick=\"main_menu(this,event);\"");
	document.writeln("			style=\"background-image: url(http:\/\/" + parent.hostPath + "\/umservice\/images\/btn_chat.png); margin-right:4px;\"");
	document.writeln("			onmouseover=\"this.style.backgroundImage=\'url(http://" + parent.hostPath + "/umservice/images/btn_chat_over.png)\';\"");
	document.writeln("			onmouseout=\"this.style.backgroundImage=\'url(http://" + parent.hostPath + "/umservice/images/btn_chat.png)\';\"");
	document.writeln("			class=\"wrap_span\" id=\"mainMenu_Button\"><div class=\"wrap_btn common_color\">菜单</div><\/span>");
if(parent.isBlog == 0){
	document.writeln("		<span class=\"wrap_span\"");
	document.writeln("			style=\"background-image: url(http:\/\/" + parent.hostPath + "\/umservice\/images\/add_user.png); background-position: left center;width:73px;\"");
	document.writeln("			onclick=\"addUser();\" title=\"添加好友\"><div class=\"wrap_btn common_color\" style=\"text-indent:15px;\">添加好友</div><\/span>");
}
	document.writeln("		<!--<span class=\"actionButton\"");
	document.writeln("			style=\"background-image: url(http:\/\/" + parent.hostPath + "\/umservice\/images\/sysset.gif); width: 38px; height: 24px;\"");
	document.writeln("			onclick=\"openOptions(1);\" title=\"系统设置\"><\/span>");
	document.writeln("<img class=\"actionButton\" src=\"images\/searchuser.png\" onMouseOver=\"changePic(this,searchuserOver);\" onMouseOut=\"changePic(this,searchuser);\" align=\"left\" onClick=\"searchUser();\" title=\"搜索用户\"><img class=\"actionButton\" src=\"images\/groupchat.png\" onMouseOver=\"changePic(this,groupchatOver);\" onMouseOut=\"changePic(this,groupchat);\" onClick=\"openGroupchat();\" title=\"加入组聊\"> --><\/td><\/tr>");
}
document.writeln("<\/table>");
document.writeln("  <\/body></html>");
function getTop(e) {
	var offset = e.offsetTop;
	if (e.offsetParent != null) {
		offset += getTop(e.offsetParent);
	}
	return offset;
}
function getLeft(e) {
	var offset = e.offsetLeft;
	if (e.offsetParent != null) {
		offset += getLeft(e.offsetParent);
	}
	return offset;
}
function main_menu(obj, e) {
	parent.hideAllChatSelecitons("mainMenuDiv");
	var flyMenuDiv = document.getElementById("mainMenuDiv");
	if (flyMenuDiv.style.visibility == "visible") {
		flyMenuDiv.style.visibility = "hidden";
	} else {
		flyMenuDiv.style.visibility = "visible";
	}
	flyMenuDiv.style.Left = getLeft(document.getElementById("mainMenu_Button")) + "px";
	flyMenuDiv.style.top = (getTop(document.getElementById("mainMenu_Button")) - document.getElementById("mainMenuDiv").offsetHeight) + "px";
	(parent.is.ie) ? e.cancelBubble = true : e.stopPropagation();
}
function loadLogo(logoImg) {
	if (logoImg.src.indexOf(".gif") > 0) {
		logoImg.src = logoImg.src.replace(".gif", ".jpg");
	} else {
		if (logoImg.src.indexOf(".jpg") > 0) {
			logoImg.src = logoImg.src.replace(".jpg", ".jpeg");
		} else {
			logoImg.src = "http://" + parent.hostPath + "/umservice/images/logo.png";
		}
	}
}