document.writeln("<!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\">");
document.writeln("<html>");
document.writeln("  <head>");
document.writeln("    <meta http-equiv=\"content-type\" content=\"text\/html; charset=gbk\">");
document.writeln("    <title>联信UM - 搜索<\/title>");
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\"><\/script>");
document.writeln("    <script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/jabber_x_data.js\"><\/script>");
document.writeln("    <script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/switchStyle.js\"><\/script>");
document.writeln("    <script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/jsjac.js\"><\/script>");
document.writeln("    <script>");
document.writeln("      <!--");
document.writeln("var currentPage=1;");
document.writeln("var totalPage=0;");
document.writeln("function back() {");
document.writeln("	document.getElementById(\'search_form\').style.display = \'\';");
document.writeln("	document.getElementById(\'search_results\').style.display = \'none\';");
document.writeln("");
document.writeln("	\/\/	reset form");
document.writeln("	document.getElementById(\'add_button\').disabled = true;");
document.writeln("	document.getElementById(\'info_button\').disabled = true;");
document.writeln("	resultF.selectedRow = null;");
document.writeln("");
document.writeln("	resultF.document.getElementById(\'results\').innerHTML = \'\';");
document.writeln("");
document.writeln("	return false;");
document.writeln("}");
document.writeln("");
document.writeln("function searchUser() {");
document.writeln("	document.getElementById(\'results_header\').style.visibility = \'\';");
document.writeln("	document.getElementById(\'search_form\').style.display = \'\';");
document.writeln("");
document.writeln("	document.getElementById(\'results_header\').innerHTML = \"查询中……\";");
document.writeln("	\/\/ send query");
document.writeln("	var searchstring = \'\';");
document.writeln("	for (var i=0; i<document.forms[\'searchfields\'].elements.length; i++){");
document.writeln("		if(typeof document.forms[\'searchfields\'].elements[i].name!=\'undefine\' && document.forms[\'searchfields\'].elements[i].name!=\'\'){");
document.writeln("			searchstring += \"<\"+document.forms[\'searchfields\'].elements[i].name+\">\";");
document.writeln("			if (document.forms[\'searchfields\'].elements[i].type == \'checkbox\'){");
document.writeln("				searchstring += (document.forms[\'searchfields\'].elements[i].checked) ? \'true\':\'false\';");
document.writeln("			}else{");
document.writeln("				searchstring += document.forms[\'searchfields\'].elements[i].value;");
document.writeln("			}");
document.writeln("			searchstring +=\"<\/\"+document.forms[\'searchfields\'].elements[i].name+\">\";");
document.writeln("		}");
document.writeln("	}");
document.writeln("	\/\/searchstring +=\"<recordstart>1<\/recordstart><recordstop>20<\/recordstop>\";");
document.writeln("");
document.writeln("	srcW.Debug.log(\"searchstring: \"+ searchstring, 3);");
document.writeln("");
document.writeln("	var iq = new JSJaCIQ();");
document.writeln("	iq.setIQ(srcW.UMWEBSERVER, \"set\", \"search_\" + srcW.con._rid);");
document.writeln("	var query = iq.setQuery(\'jabber:iq:search\');");
document.writeln("");
document.writeln("	var xmldoc = XmlDocument.create(\'body\',\'jabber:iq:search\');");
document.writeln("	xmldoc.loadXML(\'<body xmlns=\\\"jabber:iq:search\\\">\'+searchstring+\'<\/body>\');");
document.writeln("");
document.writeln("	for (var i=0; i<xmldoc.documentElement.childNodes.length; i++)");
document.writeln("		query.appendChild(xmldoc.firstChild.childNodes.item(i).cloneNode(true));");
document.writeln("");
document.writeln("	srcW.Debug.log(\"created query:\" + iq.getDoc().xml,2);");
document.writeln("");
document.writeln("	me = this;");
document.writeln("	srcW.con.send(iq,me.getQueryResult);");
document.writeln("	return false;");
document.writeln("}");
document.writeln("");
document.writeln("function getQueryResult(iq) {");
document.writeln("    if (!iq || iq.getType() != \"result\") {");
document.writeln("        document.getElementById(\"results_header\").innerHTML = \"有错误发生！\";");
document.writeln("        return false;");
document.writeln("    }");
document.writeln("    srcW.Debug.log(\"got result: \" + iq.getDoc().xml, 2);");
document.writeln("    var html = \"<table width=\'100%\' border=0 cellspacing=0 cellpadding=0>\";");
document.writeln("    document.getElementById(\"results_header\").innerHTML = \"以下是您的搜索结果\";");
document.writeln("");
document.writeln("		\/\/ set header");
document.writeln("    html += \"<tr><th nowrap align=\'left\'>帐号<\/th><th nowrap align=\'left\'>姓名<\/th><th nowrap align=\'left\'>称呼<\/th><th nowrap align=\'left\'>邮箱<\/th><th nowrap align=\'left\'>经营目标<\/th><\/tr>\";");
document.writeln("		\/\/ fill in items");
document.writeln("    for (var i = 0; i < iq.getQuery().childNodes.length; i++) {");
document.writeln("        var item = iq.getQuery().childNodes.item(i);");
document.writeln("        html += \"<tr>\";");
document.writeln("        html += \"<td align=\'left\'>\" + item.getAttribute(\"jid\") + \"<\/td>\";");
document.writeln("        html += \"<td align=\'left\' nowrap>\" + (item.getElementsByTagName(\"last\").item(0).hasChildNodes()?item.getElementsByTagName(\"last\").item(0).firstChild.nodeValue:\"\");");
document.writeln("        html += (item.getElementsByTagName(\"first\").item(0).hasChildNodes()?item.getElementsByTagName(\"first\").item(0).firstChild.nodeValue:\"\") + \"&nbsp;<\/td>\";");
document.writeln("        html += \"<td align=\'left\' nowrap>\" + (item.getElementsByTagName(\"nick\").item(0).hasChildNodes()?item.getElementsByTagName(\"nick\").item(0).firstChild.nodeValue:\"&nbsp;\") + \"<\/td>\";");
document.writeln("        html += \"<td align=\'left\' nowrap>\" + (item.getElementsByTagName(\"email\").item(0).hasChildNodes()?item.getElementsByTagName(\"email\").item(0).firstChild.nodeValue:\"&nbsp;\") + \"<\/td>\";");
document.writeln("        html += \"<td align=\'left\' nowrap>\" + (item.getElementsByTagName(\"business\").item(0).hasChildNodes()?item.getElementsByTagName(\"business\").item(0).firstChild.nodeValue:\"&nbsp;\") + \"<\/td><\/tr>\";");
document.writeln("    }");
document.writeln("    html += \"<\/table>\";");
document.writeln("    ");
document.writeln("    resultF.document.getElementById(\"results\").innerHTML = html;");
document.writeln("    resultF.init();");
document.writeln("    return false;");
document.writeln("}");
document.writeln("var srcW;");
document.writeln("function init() {");
document.writeln("  srcW = parent;");
document.writeln("	if(typeof(DD_belatedPNG) != \'undefined\'){DD_belatedPNG.fix(\'span\');}");
document.writeln("	\/\/ init elements ...");
document.writeln("	document.getElementById(\'results_header\').style.visibility = \'hidden\';");
document.writeln("	document.getElementById(\'add_button\').disabled = true;");
document.writeln("	document.getElementById(\'info_button\').disabled = true;");
document.writeln("}");
document.writeln("");
document.writeln("function keyPressed(e) {");
document.writeln("  if (e.ctrlKey && e.keyCode == 13)");
document.writeln("    submitClicked();");
document.writeln("  else if (e.keyCode == 27)");
document.writeln("    window.close();");
document.writeln("}");
document.writeln("onkeydown = keyPressed;");
document.writeln("onload = init;");
document.writeln("      \/\/-->");
document.writeln("    <\/script>");
document.writeln("    <script for=\"document\" event=\"onkeydown()\" language=\"JScript\">");
document.writeln("      <!--");
document.writeln("      if (window.event.ctrlKey && window.event.keyCode == 13)");
document.writeln("      submitClicked();");
document.writeln("      if (window.event.keyCode == 27)");
document.writeln("      window.close();");
document.writeln("      \/\/-->");
document.writeln("    <\/script>");
document.writeln("		<style type=\"text\/css\">");
document.writeln("		th { ");
document.writeln("			font-size: 12px; ");
document.writeln("			text-align: left;");
document.writeln("		}");
document.writeln("		.searchfield { padding: 4px; }");
document.writeln("		<\/style>");
document.writeln("  <\/head>");
document.writeln("");
document.writeln("  <body>");
document.writeln("		<div id=\"search_form\">");
document.writeln("			<form style=\"margin: 0px;\" name=\"searchfields\" id=\"searchfields\">");
document.writeln("				<table width=\"100%\" height=\"100\" border=0 cellpadding=0 cellspacing=0>");
document.writeln("					<tr><td colspan=\"2\" class=\"menuWindowColor\">");
document.writeln("						<table width=\"100%\">");
document.writeln("							<tbody>");
document.writeln("								<tr>");
document.writeln("									<th nowrap>");
document.writeln("										帐号");
document.writeln("									<\/th>");
document.writeln("									<td colspan=\"3\" width=\"100%\">");
document.writeln("										<input type=\"text\" name=\"jid\" style=\"width:100%;\" \/>");
document.writeln("									<\/td>");
document.writeln("								<\/tr>");
document.writeln("								<tr>");
document.writeln("									<th nowrap>");
document.writeln("										姓");
document.writeln("									<\/th>");
document.writeln("									<td width=\"50%\">");
document.writeln("										<input type=\"text\" name=\"first\" style=\"width:100%;\" \/>");
document.writeln("									<\/td>");
document.writeln("									<th nowrap>");
document.writeln("										名");
document.writeln("									<\/th>");
document.writeln("									<td width=\"50%\">");
document.writeln("										<input type=\"text\" name=\"last\" style=\"width:100%;\" \/>");
document.writeln("									<\/td>");
document.writeln("								<\/tr>");
document.writeln("								<tr>");
document.writeln("									<th nowrap>");
document.writeln("										称呼");
document.writeln("									<\/th>");
document.writeln("									<td>");
document.writeln("										<input type=\"text\" name=\"nick\" style=\"width:100%;\" \/>");
document.writeln("									<\/td>");
document.writeln("									<th nowrap>");
document.writeln("										邮箱");
document.writeln("									<\/th>");
document.writeln("									<td>");
document.writeln("										<input type=\"text\" name=\"email\" style=\"width:100%;\" \/>");
document.writeln("									<\/td>");
document.writeln("								<\/tr>");
document.writeln("								<tr>");
document.writeln("									<th nowrap>");
document.writeln("										单位");
document.writeln("									<\/th>");
document.writeln("									<td colspan=\"3\">");
document.writeln("										<input type=\"text\" name=\"company\" style=\"width:100%;\" \/>");
document.writeln("									<\/td>");
document.writeln("								<\/tr>");
document.writeln("								<tr>");
document.writeln("									<th nowrap>");
document.writeln("										部门");
document.writeln("									<\/th>");
document.writeln("									<td>");
document.writeln("										<input type=\"text\" name=\"orgunit\" style=\"width:100%;\" \/>");
document.writeln("									<\/td>");
document.writeln("									<th nowrap>");
document.writeln("										职务");
document.writeln("									<\/th>");
document.writeln("									<td>");
document.writeln("										<input type=\"text\" name=\"orgtitle\" style=\"width:100%;\" \/>");
document.writeln("									<\/td>");
document.writeln("								<\/tr>");
document.writeln("								<tr>");
document.writeln("									<th nowrap>");
document.writeln("										经营目标");
document.writeln("									<\/th>");
document.writeln("									<td>");
document.writeln("										<select name=\"business\" style=\"width:100%;\" >");
document.writeln("											<option value=\"\"><\/option>");
document.writeln("											<option value=\"采购\">采购<\/option>");
document.writeln("											<option value=\"销售\">销售<\/option>");
document.writeln("											<option value=\"两者皆是\">两者皆是<\/option>");
document.writeln("										<\/select>");
document.writeln("									<\/td>");
document.writeln("									<td colspan=\"2\">");
document.writeln("										<input type=\"checkbox\" name=\"online\"\/>在线");
document.writeln("									<\/td>");
document.writeln("								<\/tr>");
document.writeln("							<\/tbody>");
document.writeln("						<\/table>");
document.writeln("					<\/td><\/tr>");
document.writeln("					<tr>");
document.writeln("						<td id=\"results_header\">");
document.writeln("							查询中……");
document.writeln("						<\/td>");
document.writeln("						<td align=\"right\" style=\"padding-top:4px;\">");
document.writeln("							<span style=\"background-image:url(http://" + parent.hostPath + "/umservice_gbk/images/btn_chat.png);\"");
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)\';\" class=\"wrap_span\"  onClick=\"return searchUser();\"><div class=\"wrap_btn common_color\">搜索<\/div></span>");
document.writeln("						<\/td>");
document.writeln("					<\/tr>");
document.writeln("				<\/table>");
document.writeln("			<\/form>");
document.writeln("		<\/div>");
document.writeln("		<div id=\"search_results\">");
document.writeln("			<table width=\"100%\">");
document.writeln("				<tr>");
document.writeln("					<td height=\"100%\" width=\"100%\">");
document.writeln("						<iframe id=\"resultF\" name=\"resultF\"");
document.writeln("							scrolling=\"auto\" style=\"width: 100%;height: 155px;border: 1px solid #c1e5f3;\"><\/iframe>");
document.writeln("					<\/td>");
document.writeln("				<\/tr>");
document.writeln("				<script type=\"text\/javascript\">");
document.writeln("					document.getElementById(\"resultF\").src=\"javascript:\\\"<script src=\'http:\/\/" + parent.hostPath + "\/umservice_gbk\/search_iframe.js\' charset=\'gbk\'><\\\/script>\\\"\";");
document.writeln("				<\/script>");
document.writeln("				<!--<tr>");
document.writeln("					<td align=right>");
document.writeln("						当前第<span id=\"currentPage\"><\/span>页&nbsp;");
document.writeln("						<button onClick=\'return ;\'>");
document.writeln("							<l>");
document.writeln("							上一页");
document.writeln("							<l>");
document.writeln("						<\/button>&nbsp;");
document.writeln("						<button onClick=\'return ;\'>");
document.writeln("							<l>");
document.writeln("							下一页");
document.writeln("							<l>");
document.writeln("						<\/button>");
document.writeln("					<\/td>");
document.writeln("				<\/tr>");
document.writeln("				--><tr>");
document.writeln("					<td align=right style=\"padding-top:4px;\">");
document.writeln("						<span id=\"info_button\"");
document.writeln("							onClick=\"return srcW.openUserInfo(resultF.selectedRow.childNodes[0].innerHTML);\"");
document.writeln("							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)\';\" class=\"wrap_span\"><div class=\"wrap_btn common_color\">用户信息<\/div></span>");
document.writeln("						<span id=\"add_button\"");
document.writeln("							onClick=\"return srcW.openSubscription(resultF.selectedRow.childNodes[0].innerHTML,'',resultF.selectedRow.childNodes[2].innerHTML);\"");
document.writeln("							style=\"background-image:url(http://" + parent.hostPath + "/umservice_gbk/images/btn_chat.png);\"");
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)\';\" class=\"wrap_span\"><div class=\"wrap_btn common_color\">添加好友<\/div></span>");
document.writeln("						<!-- &nbsp;");
document.writeln("						<button onClick=\'return back();\'>");
document.writeln("							<l>");
document.writeln("							上一步");
document.writeln("							<l>");
document.writeln("						<\/button> -->");
document.writeln("					<\/td>");
document.writeln("				<\/tr>");
document.writeln("			<table>");
document.writeln("		<\/div>");
document.writeln("  <\/body>");
document.writeln("<\/html>");
document.writeln("");