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\/switchStyle.js\"><\/script>");
document.writeln("    <script src=\"http:\/\/" + parent.hostPath + "\/umservice_gbk\/jsjac.js\"><\/script>");
document.writeln("    <script language=\"JavaScript1.2\">");
document.writeln("      <!--");
document.writeln("var jid;");
document.writeln("var srcW; \/\/ the source window with necessary data");
document.writeln("");
document.writeln("function sendSub() {");
document.writeln("	if (!document.forms[0].to.value || document.forms[0].to.value == \"\") {");
document.writeln("		alert(\"邀请好友不能为空。\");");
document.writeln("		document.forms[0].to.focus();");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	var to = document.forms[0].to.value;");
document.writeln("	if (to.indexOf(\"@\") == -1) {");
document.writeln("		\/*if(document.forms[0].services.value==\"0\"){");
document.writeln("			if(document.forms[0].c_services.value ==\"\"){");
document.writeln("				alert(\"服务器不能为空\");");
document.writeln("				document.forms[0].c_services.focus();");
document.writeln("				return false;");
document.writeln("			}");
document.writeln("			to += \"@\" + document.forms[0].c_services.value;");
document.writeln("		}else{");
document.writeln("			to += \"@\" + document.forms[0].services.value;");
document.writeln("		}*\/");
document.writeln("		to += \"@\" + srcW.UMWEBSERVER;");
document.writeln("	}");
document.writeln("	var t_group=\"\";");
document.writeln("	if(document.forms[0].groups.value==\"0\"){");
document.writeln("		if(document.forms[0].c_groups.value ==\"\"){");
document.writeln("			alert(\"组名不能为空\");");
document.writeln("			document.forms[0].c_groups.focus();");
document.writeln("			return false;");
document.writeln("		}");
document.writeln("		t_group=document.forms[0].c_groups.value;");
document.writeln("	}else{");
document.writeln("		t_group=document.forms[0].groups.value;");
document.writeln("	}");
document.writeln("	var nickname=document.forms[0].nickname.value==\"\"?to.substring(0,to.indexOf(\"@\")):document.forms[0].nickname.value;");
document.writeln("	");
document.writeln("	 if (passedArgs[\"isSub\"]){");
document.writeln("	    var aPresence = new JSJaCPresence();");
document.writeln("	    aPresence.setTo(to);");
document.writeln("	    aPresence.setType(\'subscribed\');");
document.writeln("	    srcW.con.send(aPresence);");
document.writeln("	 }");
document.writeln("	");
document.writeln("	iq = new JSJaCIQ();");
document.writeln("	var group=iq.getDoc().createElement(\"group\");");
document.writeln("	group.appendChild(iq.getDoc().createTextNode(t_group));");
document.writeln("	var item=iq.getDoc().createElement(\"item\");");
document.writeln("	item.setAttribute(\"jid\",to);");
document.writeln("	item.setAttribute(\"name\",nickname);");
document.writeln("	item.appendChild(group);");
document.writeln("	iq.setIQ(null, \"set\", \"subscribe_\" + srcW.con._rid);");
document.writeln("	var query = iq.setQuery(\"jabber:iq:roster\");");
document.writeln("	query.appendChild(item);");
document.writeln("	srcW.con.send(iq);");
document.writeln("	closeWindow();");
document.writeln("	return false;");
document.writeln("}");
document.writeln("");
document.writeln("function selectCustom(selbox,obj) {");
document.writeln("	var el = selbox.options[selbox.selectedIndex];");
document.writeln("	if (el.value == \'0\'){");
document.writeln("		document.getElementById(obj).style.display=\"\";");
document.writeln("	}else{");
document.writeln("		document.getElementById(obj).style.display=\"none\";");
document.writeln("	}");
document.writeln("}");
document.writeln("");
document.writeln("function init() {");
document.writeln("	if(typeof(DD_belatedPNG) != \'undefined\'){DD_belatedPNG.fix(\'span\');}");
document.writeln("  \/\/ determine source window");
document.writeln("	srcW = parent;");
document.writeln("  passedArgs=new Array();");
document.writeln("	if(srcW.param.length>0){");
document.writeln("		argList = srcW.param.split(\'&\');");
document.writeln("	    for(var i=0; i<argList.length; i++){");
document.writeln("	      newArg = argList[i];");
document.writeln("	      newArg = argList[i].split(\'=\');");
document.writeln("	      passedArgs[unescape(newArg[0])] = unescape(newArg[1]);");
document.writeln("	    }");
document.writeln("	}");
document.writeln("	var jid = (passedArgs[\"jid\"]) ? passedArgs[\"jid\"] : \"\"; ");
document.writeln("	document.title = \"发送邀请\";");
document.writeln("	document.title += (jid) ? \" 至 \" + jid : \"\";");
document.writeln("	if (jid) {");
document.writeln("		document.forms[0].to.value = jid;");
document.writeln("	}");
document.writeln("	\/* detect services ");
document.writeln("	var services = document.forms[0].elements[\"services\"];");
document.writeln("	var optidx = 0;");
document.writeln("	services.options[optidx++] = new Option(srcW.UMWEBSERVER, srcW.UMWEBSERVER);");
document.writeln("	for (var i in srcW.disco) {");
document.writeln("		if (!srcW.disco[i].getNode) {");
document.writeln("			continue;");
document.writeln("		}");
document.writeln("		if (srcW.disco[i].getNode().getElementsByTagName(\"identity\").item(0)) {");
document.writeln("			var item = srcW.disco[i].getNode().getElementsByTagName(\"identity\").item(0);");
document.writeln("			if (item.getAttribute(\"category\") == \"gateway\") {");
document.writeln("				services.options[optidx++] = new Option(item.getAttribute(\"name\"), srcW.disco[i].getFrom());");
document.writeln("			}");
document.writeln("		}");
document.writeln("	}");
document.writeln("	var sOption = new Option(\"自定义服务器\", \"0\");");
document.writeln("	sOption.style.color = \"red\";");
document.writeln("	services.options[optidx] = sOption;*\/");
document.writeln("	\/* detect groups *\/");
document.writeln("	var groups = document.forms[0].elements[\"groups\"];");
document.writeln("	optidx = 0;");
document.writeln("	var rosterGroups = srcW.roster.groups;");
document.writeln("	for (var i = 0; i < rosterGroups.length; i++) {");
document.writeln("		groups.options[optidx++] = new Option(rosterGroups[i].name, rosterGroups[i].name);");
document.writeln("	}");
document.writeln("	sOption = new Option(\"定义新的分组\", \"0\");");
document.writeln("	sOption.style.color = \"red\";");
document.writeln("	groups.options[optidx] = sOption;");
document.writeln("	if(groups.options.length==1){");
document.writeln("		document.getElementById(\"c_g\").style.display=\"\";");
document.writeln("	}");
document.writeln("	if (passedArgs[\"isSub\"]){");
document.writeln("	    document.getElementById(\"searchId\").style.display=\"none\";");
document.writeln("	    document.getElementById(\"to\").readOnly=\"readonly\";");
document.writeln("	}");
document.writeln("	if (passedArgs[\"nick\"]){");
document.writeln("	    document.getElementById(\"nickname\").value=passedArgs[\"nick\"];");
document.writeln("	}");
document.writeln("}");
document.writeln("		");
document.writeln("function keyPressed(e) {");
document.writeln("  if (e.ctrlKey && e.keyCode == 13)");
document.writeln("    sendSub();");
document.writeln("  else if (e.keyCode == 27){");
document.writeln("  	closeWindow();");
document.writeln("  }");
document.writeln("}");
document.writeln("function closeWindow(){");
document.writeln("	if (passedArgs[\"isSub\"]){");
document.writeln("	    srcW.closeAndRemove(\"openSubscription\" + srcW.makeWindowName(passedArgs[\"jid\"]),\"subscriptionWindow\" + srcW.makeWindowName(passedArgs[\"jid\"]));");
document.writeln("	}else{");
document.writeln("		srcW.windowMinimize(\"openSubscription\");");
document.writeln("	}");
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("      	sendSub();");
document.writeln("      if (window.event.keyCode == 27)");
document.writeln("      	closeWindow();");
document.writeln("      \/\/-->");
document.writeln("    <\/script>");
document.writeln("  <\/head>");
document.writeln("  <body>");
document.writeln("    <form name=\"sub\" style=\"border:0;padding:0;margin:0;\">");
document.writeln("		<table width=\"100%\" height=\"100%\" border=0 cellpadding=0 cellspacing=0>");
document.writeln("			<tr height=\"100%\"><td class=\"menuWindowColor\">");
document.writeln("		      <table border=0 cellpadding=0  cellspacing=5 style=\"padding:0 5px\" width=\"100%\" height=\"100%\">");
document.writeln("		          <!-- <tr id=\"searchId\"><td nowrap>搜索用户:<\/td><td><button onClick=\"return srcW.openSearch();\">打开搜索<\/button><\/td><\/tr>");
document.writeln("		          <tr><td colspan=2><hr noshade size=\"1\" size=\"100%\"><\/td><\/tr> -->");
document.writeln("		          <tr>");
document.writeln("		            <td align=\"right\" nowrap><label for=\"to\">发送邀请到<\/label><\/td>");
document.writeln("		            <td width=\"100%\"><input type=\"text\" id=\"to\" name=\"to\" size=\"1\" style=\"width:100%;\" tabindex=\"1\"><\/td>");
document.writeln("		            <td id=\"searchId\"><nobr><button onClick=\"return srcW.openSearch();\">搜索好友<\/button><\/nobr><\/td>");
document.writeln("		          <\/tr>");
document.writeln("		          <!-- <tr>");
document.writeln("		            <td nowrap align=\"right\"><label for=\"services\">服务器<\/label><\/td>");
document.writeln("		            <td width=\"100%\" colspan=2>");
document.writeln("		              <select name=\"services\" id=\"services\" onChange=\"selectCustom(this,\'c_s\');\" tabindex=\"2\"><\/select>");
document.writeln("		            <\/td>");
document.writeln("		          <\/tr>");
document.writeln("		          <tr id=\"c_s\" style=\"display:none;\">");
document.writeln("		            <td nowrap align=\"right\"><\/td>");
document.writeln("		            <td width=\"100%\" colspan=2>");
document.writeln("		              <input type=\"text\" id=\"c_services\" name=\"c_services\" size=\"1\" style=\"width:100%;\" tabindex=\"3\">");
document.writeln("		            <\/td>");
document.writeln("		          <\/tr> -->");
document.writeln("		          <tr>");
document.writeln("		            <td nowrap align=\"right\"><label for=\"groups\">好友分组<\/label><\/td>");
document.writeln("		            <td width=\"100%\" colspan=\"2\">");
document.writeln("		              <select name=\"groups\" id=\"groups\" onChange=\"selectCustom(this,\'c_g\');\" tabindex=\"4\"><\/select>");
document.writeln("		            <\/td>");
document.writeln("		          <\/tr>");
document.writeln("		          <tr id=\"c_g\" style=\"display:none;\">");
document.writeln("		            <td nowrap align=\"right\"><\/td>");
document.writeln("		            <td width=\"100%\" colspan=\"2\">");
document.writeln("		              <input type=\"text\" id=\"c_groups\" name=\"c_groups\" size=\"1\" style=\"width:100%;\" tabindex=\"5\">");
document.writeln("		            <\/td>");
document.writeln("		          <\/tr>");
document.writeln("		          <tr>");
document.writeln("		            <td nowrap align=\"right\"><label for=\"nickname\">好友称呼<\/label><\/td>");
document.writeln("		            <td width=\"100%\" colspan=\"2\">");
document.writeln("		              <input type=\"text\" id=\"nickname\" name=\"nickname\" size=\"1\" style=\"width:100%;\" tabindex=\"6\">");
document.writeln("		            <\/td>");
document.writeln("		          <\/tr>");
document.writeln("		          <!-- ");
document.writeln("		          <tr height=\"100%\">");
document.writeln("		            <td colspan=2>");
document.writeln("		              <textarea id=\"msg\" wrap=\"physical\" class=\"msgBox\" tabindex=\"6\">我想将您新增为我的好友。<\/textarea>");
document.writeln("		            <\/td>");
document.writeln("		          <\/tr>");
document.writeln("		           -->");
document.writeln("		      <\/table>");
document.writeln("			<\/td><\/tr>");
document.writeln("			<tr><td align=\"right\" id=\"savebox\" style=\"padding-top:4px;\">");
document.writeln("				<span tabindex=\"7\" 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\"  onClick=\"return sendSub();\"><div class=\"wrap_btn common_color\">发送<\/div></span>");
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=\"closeWindow();return false;\"><div class=\"wrap_btn common_color\">取消<\/div></span>");
document.writeln("			<\/td><\/tr>");
document.writeln("		<\/table>");
document.writeln("    <\/form>");
document.writeln("  <\/body>");
document.writeln("<\/html>");
document.writeln("");