function SendMMSWin(theURL,winName) { //v2.0
  window.open(theURL,winName,'top=10,left=10,width=550,height=320,resizable=yes');
}

function pic(unionstr,i,n,f){	//构建单个的图
	var s="<table cellspacing=\"0\" cellpadding=\"0\">";
	s+="<tr><td><img src=images/pic_mobile_top.gif/index.html"></td></tr>";
	s+="<tr><td class=\"img\"><img src="+f+"\" alt=\""+n+"\" title=\""+n+"\" href=\"#1\" onclick=\"SendMMSWin('MMSSend/send1.aspx-sendtype=1&"+unionstr+"&pid="+i+"','send')\"></td></tr>";
	s+="<tr><td><img src=images/pic_mobile_bottom.gif/index.html"></td></tr>";
	s+="</table>";
	return s;
}
function pic2(unionstr,i,n,f){	//构建单个的图
	var s="<table cellspacing=\"0\" cellpadding=\"0\">";
	s+="<tr><td><img src=images/pic_mobile_top.gif/index.html"></td></tr>";
	s+="<tr><td class=\"img\"><img src="+f+"\" alt=\""+n+"\" title=\""+n+"\" href=\"#1\" onclick=\"SendMMSWin('MMSSend/send1.aspx-sendtype=2&"+unionstr+"&pid="+i+"','send')\"></td></tr>";
	s+="<tr><td><img src=images/pic_mobile_bottom.gif/index.html"></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 showpic2(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+=pic2(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="/MMSSend/send1.aspx?sendtype=3&" + unionstr;
	}else{
		sendurl="/MMSSend/send1.aspx?sendtype=4&" + 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/index.html" border=0 width=24 height=11>";
	if (ishot==1) s+="<img src=images/hot.gif/index.html" 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/index.html" 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+">&nbsp;<img src=images/red/sjls_002.gif/index.html" width=\"8\" height=\"8\" hspace=\"3\" align=\"absmiddle\"> <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+"><img src=images/red/sjls_002.gif/index.html" width=\"8\" height=\"8\" hspace=\"3\" align=\"absmiddle\"> <a href=#1\" onclick=\"SendMMSWin('"+urls+ids[i]+"','send')\" title="+names[i]+">"+names[i]+"</a></td>";
		s+="</tr>";}
	document.write(s);
}