<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock

set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))
myname=cschat.myname

set cschat=nothing
application.unlock
if my_level=0 then  response.end

songzj = replace(replace(replace(Request("songzj"),".",""),"/",""),"\","")
song = Trim(Request("song"))
If songzj = "" Or song = "" Then
 Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><body>"
 Response.Write "<script Language=JavaScript>"
 Response.Write "parent.chcolor();alert('请选择所需曲目。');history.go(-1);"
 Response.Write "</script>"
 Response.End
end if
%>
<html>
<head>
<title>点歌系统</title>
<meta http-equiv='content-type' content='text/html; charset=gb2312'>
<script language="JavaScript">

var userlist = parent.userlist;
var myn = parent.myname;
var songzj = "<%=songzj%>";
var song = "<%=song%>";
var songname = song.substring(0, song.length - 4);
function check(){
 if(document.sendsong.songzj.value == "" || document.sendsong.song.value == ""){
  alert("请选择所需曲目。");
  return false;
 }
 if(document.sendsong.towho.value == ""){
  alert("请指定发送对象。");
  return false;
 }
 if(document.sendsong.towho.value == myn){
  alert("不需要给自己点歌。");
  return false;
 }
 if(document.sendsong.zc.value == ""){
  alert("祝词不能为空。");
  return false;
 }
 if(document.sendsong.zc.value.length > 300){
  alert("祝词不能超过 300 个字符。");
  return false;
 }
 document.sendsong.sdb.disabled = 1;
}
</script>
<link rel="stylesheet" href="chat.css">
</head>
<script>document.write("<body style='"+parent.gbt()+"margin:0'>");</script>
<table height=100% width=100%><tr><td valign=top>
<br>
<div align=center><font color="#336699" style="font-size:12pt">好歌赠好友</font></div>
<hr size=1 color=336699>
<table border="0" width="100%">
<form method="post" action="songsendok.asp" name="sendsong" onsubmit="return(check())">
<tr>
<td>
<p>
<input type="hidden" name="songzj" value="<%=songzj%>">
<input type="hidden" name="song" value="<%=song%>">
曲目：<br>
<script>
document.write("<input type=text name=qm size=12 value=" + songname + " readonly>");
</script>
</p>
<p>送给：<br>
<input type="text" name="towho" size="12" maxlength="10">
<br><br>
<select name="md" onchange="javascript:document.sendsong.towho.value=this.value">
<option value="" selected>-选择对象-</option>
<script Language="JavaScript">var un;
for(var i = 0;i < userlist.length;i++){
 sn = userlist[i].split(" ");
 if(sn[0] != myn){
  un=sn[0];
  if (escape(un) != un && un.length>5 ) un=un.substring(0,5) + "…";
  document.writeln("<option value=" + sn[0] + ">" + un + "</option>");
 }
}
</script>
</select>
</p>
<p>祝词：<span class="p9">&lt;300字符</span><br>
<script>
document.write("<textarea name=zc cols=11 rows=8>谨以《" + songname + "》来表达我对你的祝福</textarea>");
</script>
</p>
<p>
<input class=navy1 type="submit" name="sdb" value="发送">&nbsp;
<input class=navy1 type="button" name="goback" value="返回" onclick="javascript:history.go(-1)">
</p>
</td>
</tr>
</form>
</table>
</body>
</html>