﻿/*+-----------------------------------------------------------------------------------+
 *	文件名称：	hotSingers.js
 *	文件功能：	创建热门歌手HTML

 *	文件作者：	QUANLI
 *	创建时间：	2009-7-9 20:23:46
 *	项目名称：	USP40(河南联通) 		         
 *+-----------------------------------------------------------------------------------+
 *	历史记录：
 *	编号		 日期		     作者		         备注
 *	1.0		  2009-7-9 		    QUAN.LI		           创建
 *+----------------------------------------------------------------------------------*/

//全局变量
var hotSinger_CurProgCode;
var hotSinger_ProgCodes=new Array();

///
///全局方法
///
function chooseProgSingerList(itemDiv)
{
    for(var i=0;i<hotSinger_ProgCodes.length;i++)
    {
         document.getElementById("tableHotSingers_"+hotSinger_ProgCodes[i]).style.display="none"; 
         document.getElementById("divHotSingerItem_"+hotSinger_ProgCodes[i]).className="hotsingerUnChoosed"; 
    } 
    itemDiv.className="hotsingerChoosed indexBackGround sprite-hotsinger_tab"; 
    hotSinger_CurProgCode=itemDiv.id.split("_")[1]; 
    document.getElementById("tableHotSingers_"+hotSinger_CurProgCode).style.display="block";  
}

function showMoreRing()
{  
    location.href="HotSingerRingList.aspx";
}

///
///生成栏目名称的选项
///
function ProgHotSingerItem(progCode,progName)
{
    this.progNo=progCode;
    this.progName=progName;
    hotSinger_ProgCodes.push(progCode); 
}
ProgHotSingerItem.prototype.writeItem=function(choosed)
{
    var choosedClassName="hotsingerUnChoosed";
    if(choosed=="True")
    {
         hotSinger_CurProgCode=this.progNo;
         choosedClassName="hotsingerChoosed indexBackGround sprite-hotsinger_tab"; 
    }
    document.write("<div id='divHotSingerItem_"+this.progNo+"' title='"+this.progName
                        +"' class='"+choosedClassName+"' onclick='chooseProgSingerList(this);'>");
    document.write(this.progName+"</div>");
}


///
///生成栏目的资源列表
///
function ProgSingerTable(progCode)
{
    this.progCode=progCode;
}
ProgSingerTable.prototype.writeTblHeader=function(visible)
{
    document.write("<table id='tableHotSingers_"+this.progCode+"' width='185px' height='400px' border='0' cellpadding='0' "
                        +" cellspacing='0'   style='display:"+visible+";vertical-align:top;'>");     
}
ProgSingerTable.prototype.writeRow=function(singerName,imgPath
                                                          ,singerRing1No,singerRing1Name,singerRing1Author,singerRing1Price,singerRing1ExpeireDate
                                                          ,singerRing2No,singerRing2Name,singerRing2Author,singerRing2Price,singerRing2ExpeireDate)
{
    document.write("<tr><td>")
    document.write("<div class='singerBar'><a href='HotSingerRingList.aspx?singer="+encodeURI(encodeURI(singerName))
                        +"'><img src='"+imgPath+"' alt='"+singerName+"' width='66px' height='66px' border='0' /></a></div>");
                         
    document.write("<div style='float:left; padding-top:10px;'><span >");
    document.write("<div><div class='indexBackGround sprite-star' style='width:11px; height:16px; float:left;'></div>");
    document.write("<div style='width:60px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;float:left;text-align:left;' class='sing'>"
                        +"<a href='HotSingerRingList.aspx?singer="+encodeURI(encodeURI(singerName))+"' title='"+singerName+"'>"+singerName+"</a>"
                        +"</div></div>");
                        
    document.write("<div style='float:left;'><div class='indexBackGround sprite-ico_song1' style='width:14px; height:16px; float:left;'></div>"
                         +"<div style='width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;float:left;' class='sing'>"
                         +"<a href='javascript:showPlayer(\""+singerRing1No+"\",0,\""+this.progCode+"\");' "
//                         +"title='铃音名称："+singerRing1Name+"&#13;作　  者："+singerRing1Author
//                         +"&#13;价    格："+singerRing1Price+"&#13;有 效 期："+singerRing1ExpeireDate+"'>"
                         +"title='"+singerRing1Name+"'>"                         
                         +singerRing1Name+"</a></div><div>" );
                        
     document.write("<div style='float:left;'><div class='indexBackGround sprite-ico_song1' style='width:14px; height:16px; float:left;'></div>"
                     +"<div style='width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;float:left;' class='sing'>"
                     +"<a href='javascript:showPlayer(\""+singerRing2No+"\",0,\""+this.progCode+"\");' "
//                     +"title='铃音名称："+singerRing2Name+"&#13;作　  者："+singerRing2Author
//                     +"&#13;价    格："+singerRing2Price+"&#13;有 效 期："+singerRing2ExpeireDate+"'>"
                     +"title='"+singerRing2Name+"'>"
                     +singerRing2Name+"</a></div></div>" ); 
                         
    document.write("</span></div></td></tr>")
}
ProgSingerTable.prototype.writeTblFoot=function()
{
       document.write("</table>");            
}