function SendMMSWin(theURL,winName) { //v2.0
  window.open(theURL,winName,'width=10,height=10');
}
//unionstr这里为一个带&号的参数名=参数
//i  ID号
//n  为Title
//f  图片的地址
function pic(unionstr,i,n,f){	//构建单个的图
	var s="<table cellspacing=\"0\" cellpadding=\"0\">";
	s+="<tr><td><img src=\"/images/pic_mobile_top.gif\"></td></tr>";
	s+="<tr><td class=\"img\"><img src=\""+f+"\" alt=\""+n+"\" title=\""+n+"\" href=\"#1\" onclick=\"SendMMSWin('/Send_SubPic.aspx?"+unionstr+"&id="+i+"','send')\"></td></tr>";
	//s+="<tr><td class=\"img\"><a href=\"#1\" onclick=\"SendMMSWin('/Send_SubPic.aspx?id="+i+"','send')\" title=\""+n+"\">"+chipword(n,8)+"</a></td></tr>";
	s+="<tr><td><img src=\"/images/pic_mobile_bottom.gif\"></td></tr>";
	s+="</table>";
	return s;
}
function showpic(unionstr,ids,names,file,cols){		//构建图的列表
	var s="<table class=\"img\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\">";
	var a=ids.length,r=parseInt(a/cols);
	if(r*cols<a)	r++;
	var i=0;var ifend=false;
	for(var y=0;y<r;y++){
		s+="<tr>";
		for(var x=0;x<cols;x++){
			s+="<td>";
			if(i<a)	s+=pic(unionstr,ids[i],names[i],file[i]);
			else	ifend=true;
			s+="</td>";i++;}
		s+="</tr>";
		if(ifend) break;}
	s+="</table>";
	document.write(s);
}
function ring(unionstr,types,ids,names,classid,classname,singerid,singername,hots,isnew,ishot){	//构建一个铃声
	var sendurl="";
	if (types==1){
		sendurl="/Send_SubCRing.aspx?" + unionstr;
	}else{
		sendurl="/Send_SubTRing.aspx?" + unionstr;
		}
	var s="";
	s+="<td height=\"21\" align=\"left\" bgcolor=\"#F2F2F7\"><a title=\""+names+"\" href=\"#1\" onclick=\"SendMMSWin('"+sendurl+"&id="+ids+"','send')\">·"+names+"";
	if (isnew==1) s+="<img src=\"/images/new1.gif\" border=0 width=24 height=11>";
	if (ishot==1) s+="<img src=\"/images/hot.gif\" border=0 width=24 height=11>";
	s+="</a></td>";
	s+="<td align=\"center\" bgcolor=\"#F2F2F7\"><a href=\"?"+unionstr+"&s_id="+classid+"\">"+classname+"</a></td>";
	s+="<td align=\"center\" bgcolor=\"#F2F2F7\"><a href=\"?"+unionstr+"&singer_id="+singerid+"\">"+singername+"</a></td>";
	s+="<td align=\"center\" bgcolor=\"#F2F2F7\"><a href=\"#1\" onclick=\"SendMMSWin('"+sendurl+"&id="+ids+"','send')\"><img src=\"/images/CaiKu_img_43.gif\" border=0 width=17 height=15>送歌</a></td>";
	s+="<td align=\"center\" bgcolor=\"#F2F2F7\"><a href=\"#1\" title=\"立即发送这个铃声\" onclick=\"SendMMSWin('"+sendurl+"&id="+ids+"','send')\"><img src=/images/coloring.gif border=0 width=36 height=18></a></td>";
	s+="<td align=\"center\" bgcolor=\"#F2F2F7\"><a href=\"#1\" title=\"添加到我的收藏\" onclick=\"SendMMSWin('/users/AddtoF.aspx?type=1&filesid="+ids+"&name="+names+"','send')\"><img src=/images/Favorites.gif border=0 width=15 height=15></a></td>";
	s+="<td align=\"center\" bgcolor=\"#F2F2F7\">"+hots+"</td>";
	return s;
}
function showring(unionstr,types,ids,names,classid,classname,singerid,singername,hots,isnew,ishot){		//构建铃的列表
	var s="<table width=\"100%\" align=\"center\" cellspacing=\"1\" cellpadding=\"0\" border=\"0\">";
	s+="<tr bgcolor=\"#CBD0E7\" height=\"25\"><th width=\"38%\">铃声名称</th><th width=\"13%\">类别</th><th width=\"15%\">歌手</th><th width=\"10%\">免费送歌</th><th width=\"7%\">发送</th><th width=\"7%\">收藏</th><th width=\"10%\">人气</th></tr>";
	var a=ids.length;var c=1;
	for(var i=0;i<a;i++){
		if(c==2)c=1;
		else	c=2;
		s+="<tr>";
		s+=ring(unionstr,types,ids[i],names[i],classid[i],classname[i],singerid[i],singername[i],hots[i],isnew[i],ishot[i]);
		s+="</tr>";}
	s+="</table>";
	document.write(s);
}
function chipword(str,len){	//截断字符串
	if(str.replace(/[^\x00-\xff]/g, "**").length <= len*2) return str;
	var l=0;var rs="";
	for(var i=0;i<str.length;i++){
		if(str.charCodeAt(i) > 255 ) l+=2;
		else l++;
		if(l<len*2-1) rs+=str.charAt(i)
		else{rs+="..";break;}}
	return rs;
}

function showlist(class1,urls,ids,names){		//构建列表
	var s="";
	var a=ids.length;var c=1;
	for(var i=0;i<a;i++){
		if(c==2)
		{
			c=1;
		}else{
			c=2;
		}
		s+="<tr>";
		s+="<td class="+class1+"><a href="+urls+ids[i]+" title="+names[i]+">·"+names[i]+"</a></td>";
		s+="</tr>";
		}
	document.write(s);
}
function showlist2(class1,urls,ids,names){		//构建列表
	var s="";
	var a=ids.length;var c=1;
	for(var i=0;i<a;i++){
		if(c==2)
		{
			c=1;
		}else{
			c=2;
		}
		s+="<tr>";
		s+="<td class="+class1+"><a href=\"#1\" onclick=\"SendMMSWin('"+urls+ids[i]+"','send')\" title="+names[i]+">·"+names[i]+"</a></td>";
		s+="</tr>";}
	document.write(s);
}

