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>");
document.writeln("      <!--");
document.writeln("var jid;");
document.writeln("var msg;");
document.writeln("var srcW; \/\/ the source window with necessary data");
document.writeln("");
document.writeln("function sendSub() {");
document.writeln("");
document.writeln("  var user = srcW.roster.getUserByJID(jid);");
document.writeln("  if (!user || (user.subscription != \'both\' && user.subscription != \'to\')){");
document.writeln("    srcW.openSubscription(jid,\"1\");");
document.writeln("  }else{");
document.writeln("  	var aPresence = new JSJaCPresence();");
document.writeln("    aPresence.setTo(jid);");
document.writeln("    aPresence.setType(\'subscribed\');");
document.writeln("    srcW.con.send(aPresence);");
document.writeln("    \/\/ maybe we want to subscribe to?");
document.writeln("  }");
document.writeln("");
document.writeln("  srcW.closeAndRemove(\"openSubRequest\" + srcW.makeWindowName(passedArgs[\"jid\"]),\"subRequestWindow\" + srcW.makeWindowName(passedArgs[\"jid\"]));");
document.writeln("}");
document.writeln("");
document.writeln("function sendUnsub() {");
document.writeln("  var aPresence = new JSJaCPresence();");
document.writeln("  aPresence.setTo(jid);");
document.writeln("  aPresence.setType(\'unsubscribed\');");
document.writeln("   srcW.con.send(aPresence);");
document.writeln("  srcW.closeAndRemove(\"openSubRequest\" + srcW.makeWindowName(passedArgs[\"jid\"]),\"subRequestWindow\" + srcW.makeWindowName(passedArgs[\"jid\"]));");
document.writeln("}    ");
document.writeln("");
document.writeln("function init() {");
document.writeln("  \/\/ determine source window");
document.writeln("  srcW = parent;");
document.writeln("	if(typeof(DD_belatedPNG) != \'undefined\'){DD_belatedPNG.fix(\'span\');}");
document.writeln("  passedArgs=new Array();");
document.writeln("	if(param.length>0){");
document.writeln("		argList = 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("  jid = passedArgs[\'jid\'];");
document.writeln("  if (typeof(passedArgs[\'msg\']) != \'undefined\')");
document.writeln("    msg = passedArgs[\'msg\'];");
document.writeln("");
document.writeln("  document.title = \"从 \"+jid+\" 来的邀请请求\";");
document.writeln("");
document.writeln("  var from = \"<b><span class=\\\"link\\\" onClick=\\\"return srcW.openUserInfo(\'\"+jid+\"\');\\\" title=\\\"\"+\"显示用户 \"+jid+\" 的信息\"+\"\\\">\"+jid.substring(0,jid.indexOf(\'@\'))+\"<\/a><\/b> \";");
document.writeln("  ");
document.writeln("  document.getElementById(\"requestingUser\").innerHTML = from;");
document.writeln("  if (msg)");
document.writeln("    msgbox.document.body.innerHTML = msgFormat(msg);");
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("    srcW.closeAndRemove(\"openSubRequest\" + srcW.makeWindowName(passedArgs[\"jid\"]),\"subRequestWindow\" + srcW.makeWindowName(passedArgs[\"jid\"]));");
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("      	srcW.closeAndRemove(\"openSubRequest\" + srcW.makeWindowName(passedArgs[\"jid\"]),\"subRequestWindow\" + srcW.makeWindowName(passedArgs[\"jid\"]));");
document.writeln("      \/\/-->");
document.writeln("    <\/script>");
document.writeln("  <\/head>");
document.writeln("  <body>");
document.writeln("    <table  width=\"100%\" height=\"100%\" border=0 cellpadding=0 cellspacing=0>");
document.writeln("      <tr height=\"100%\"><td>");
document.writeln("        <span id=\"requestingUser\"><\/span> 想加您为他\/她的好友:");
document.writeln("      <\/td><\/tr>");
document.writeln("      <tr><td style=\"display:none;\"><iframe id=\"msgbox\" name=\"msgbox\" scrolling=\"yes\" class=\"msgbox\" frameborder=\"0\" style=\"width:100%;height:100px;\"><\/iframe><\/td><\/tr>");
document.writeln("		<script type=\"text\/javascript\">");
document.writeln("			document.getElementById(\"msgbox\").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("      <form name=\"sub\">");
document.writeln("		<tr><td align=\"right\" id=\"savebox\" style=\"padding-top:4px;\">");
document.writeln("			<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)\';\" class=\"wrap_span\" onClick=\"return sendUnsub();\"><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=\"return sendSub();\"><div class=\"wrap_btn common_color\">允许<\/div></span>");
document.writeln("		<\/td><\/tr>");
document.writeln("      <\/form>");
document.writeln("    <\/table>");
document.writeln("  <\/body>");
document.writeln("<\/html>");
document.writeln("");