playImages = new Array();
playImages[0] = new Image();
playImages[0].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank1.gif";
playImages[1] = new Image();
playImages[1].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank2.gif";
playImages[2] = new Image();
playImages[2].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank3.gif";
playImages[3] = new Image();
playImages[3].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank4.gif";
playImages[4] = new Image();
playImages[4].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank5.gif";
playImages[5] = new Image();
playImages[5].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank6.gif";
playImages[6] = new Image();
playImages[6].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank7.gif";
playImages[7] = new Image();
playImages[7].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank8.gif";
playImages[8] = new Image();
playImages[8].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank9.gif";
playImages[9] = new Image();
playImages[9].src = "http://crbt.nate.com:8081/img/myphone/common/img_player_rank10.gif";

var MusicList = {
    list:null,
    player:null,
    playerViewer:null,
    setOption:function(options) {
        this.list   = options.list;
        this.player = options.player;
        this.playerViewer = options.playerViewer;
    },
    init:function() {
        this.list = this.list.getElementsByTagName('li');
    },
    play:function(rank, m_name, singer, str) {
        if (!this.playerViewer) {
            return false;
        }
        this.playerViewer.style.display = 'none';
        if ('\v' == 'v') {
            this.player.stop();
            this.player.onClickStop();
        }
        this.closeAllList();
        this.attachPlayerViewer(rank);
		document.getElementById("playerImage").src = playImages[rank-1].src;
		document.getElementById("playerMNameSinger").innerHTML = m_name + "<span>" + singer + "</span>";
		document.getElementById("rank").innerHTML = str;
    },
	play2:function(rank, arg) {
		if (!this.playerViewer) {
			return false;
		}
		this.playerViewer.style.display = 'none';
		if ('\v' == 'v') {
			this.player.stop();
			this.player.onClickStop();
		}
		
		//ÀÎ±âÆù²Ù¹Ì±â
		if (arg == "1") {
			this.closeAllList();
			this.attachPlayerViewer(rank);
		//±âº»ÄÃ·¯¸µ
		} else {
			this.attachPlayerViewer2(rank);
		}

	},
	closeAllList: function() {
		var listLength = this.list.length;
		for(var i = 0; i < listLength; i++) {
			this.list[i].className = this.list[i].className.replace('select', '');
		}
	},
	//ÀÎ±âÆù²Ù¹Ì±â¿ë
	attachPlayerViewer: function(rank) {
		rank = rank - 1;
		this.list[rank].appendChild(this.playerViewer);
		this.playerViewer.style.display = 'block';
		this.list[rank].className += ' select';
	},

	//±âº»ÄÃ·¯¸µ¿ë
	attachPlayerViewer2: function(rank) {
		rank = rank - 1;
		//this.list[rank].appendChild(this.playerViewer);
		this.playerViewer.style.display = 'block';
		//this.list[rank].className += ' select';
	},

	classDivList: function(classDiv, strCVcode, strFVcode, strLVcode, strRank) {
        if (classDiv == "") {
			document.all.classDiv.style.display = 'none';
		} else {
			
			document.all.classDiv.style.display ="";

			if ( strCVcode == "00000000000") {
			//ºñÈ°¼º
				document.all("classDivC").className = "unchoice";
				document.all("classDivC").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio02.gif' align='absmiddle'>&nbsp;<label for='p_high'>ÇÏÀÌ¶óÀÌÆ®</label>";
			} else {
				if ( classDiv == "C") {
					document.all("classDivC").className = "choice";
					document.all("classDivC").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio01.gif' align='absmiddle'>&nbsp;<label for='p_high'>ÇÏÀÌ¶óÀÌÆ®</label>&nbsp;";
				} else {
					document.all("classDivC").className = "choice";
					document.all("classDivC").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio03.gif' align='absmiddle' onclick='classDivPlay(\"C^"+strCVcode+"^"+strFVcode+"^"+strLVcode+"^"+strRank+"\");' style='cursor:hand'>&nbsp;<label for='p_high'>ÇÏÀÌ¶óÀÌÆ® </label>";
				}
			}

			if ( strFVcode == "00000000000") {
			//ºñÈ°¼º
				document.all("classDivF").className = "unchoice";
				document.all("classDivF").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio02.gif' align='absmiddle'>&nbsp;<label for='p_front'>Àü¹ÝºÎ</label>";
			} else {
				if (classDiv == "F") {
					document.all("classDivF").className = "choice";
					document.all("classDivF").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio01.gif' align='absmiddle'>&nbsp;<label for='p_front'>Àü¹ÝºÎ</label>";
					
				} else {
					document.all("classDivF").className = "choice";
					document.all("classDivF").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio03.gif' align='absmiddle' onclick='classDivPlay(\"F^"+strCVcode+"^"+strFVcode+"^"+strLVcode+"^"+strRank+"\");' style='cursor:hand'>&nbsp;<label for='p_front'>Àü¹ÝºÎ</label>";
				}
			}

			if (strLVcode == "00000000000") {
			//ºñÈ°¼º
				document.all("classDivL").className = "unchoice";
				document.all("classDivL").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio02.gif' align='absmiddle'>&nbsp;<label for='p_back'>ÈÄ¹ÝºÎ</label>";
			} else {
				if (classDiv == "L") {
					document.all("classDivL").className = "choice";
					document.all("classDivL").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio01.gif' align='absmiddle'>&nbsp;<label for='p_back'>ÈÄ¹ÝºÎ</label>";
					
				} else {
					document.all("classDivL").className = "choice";
					document.all("classDivL").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio03.gif' align='absmiddle' onclick='classDivPlay(\"L^"+strCVcode+"^"+strFVcode+"^"+strLVcode+"^"+strRank+"\");' style='cursor:hand'>&nbsp;<label for='p_back'>ÈÄ¹ÝºÎ</label>";
				}
				
				
			}
			
		}
    },

	//¸¶ÀÌ ÄÃ·¯¸µ Display¿ë
	classDivList2: function(classDiv, strCVcode, strFVcode, strLVcode, strRank) {
		
		//ÅëÇÕ¹ÂÁ÷ÀÎ °æ¿ì, classDiv ¸¦ °¡Á® ¿Ã¼ö ¾ø±â ¶§¹®¿¡ ÇÏÀÌ¶óÀÌÆ®°¡ µðÆúÆ®~~!
		if (classDiv == "") {
			document.all.classDiv.style.display ="";
			
			document.all("classDivC").className = "choice";
			document.all("classDivC").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio01.gif' align='absmiddle'>&nbsp;<label for='p_high'>ÇÏÀÌ¶óÀÌÆ®</label>&nbsp;";
			document.all("classDivF").className = "unchoice";
			document.all("classDivF").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio02.gif' align='absmiddle'>&nbsp;<label for='p_front'>Àü¹ÝºÎ</label>";
			document.all("classDivL").className = "unchoice";
			document.all("classDivL").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio02.gif' align='absmiddle'>&nbsp;<label for='p_back'>ÈÄ¹ÝºÎ</label>";

		} else {
			
			document.all.classDiv.style.display ="";

			if ( strCVcode == "00000000000") {
			//ºñÈ°¼º
				document.all("classDivC").className = "unchoice";
				document.all("classDivC").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio02.gif' align='absmiddle'>&nbsp;<label for='p_high'>ÇÏÀÌ¶óÀÌÆ®</label>";
			} else {
				if ( classDiv == "C") {
					document.all("classDivC").className = "choice";
					document.all("classDivC").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio01.gif' align='absmiddle'>&nbsp;<label for='p_high'>ÇÏÀÌ¶óÀÌÆ®</label>&nbsp;";
				} else {
					document.all("classDivC").className = "choice";
					document.all("classDivC").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio03.gif' align='absmiddle' onclick='classDivPlay(\"C^"+strCVcode+"^"+strFVcode+"^"+strLVcode+"^"+strRank+"\");' style='cursor:hand'>&nbsp;<label for='p_high'>ÇÏÀÌ¶óÀÌÆ® </label>";
				}
			}

			if ( strFVcode == "00000000000") {
			//ºñÈ°¼º
				document.all("classDivF").className = "unchoice";
				document.all("classDivF").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio02.gif' align='absmiddle'>&nbsp;<label for='p_front'>Àü¹ÝºÎ</label>";
			} else {
				if (classDiv == "F") {
					document.all("classDivF").className = "choice";
					document.all("classDivF").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio01.gif' align='absmiddle'>&nbsp;<label for='p_front'>Àü¹ÝºÎ</label>";
					
				} else {
					document.all("classDivF").className = "choice";
					document.all("classDivF").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio03.gif' align='absmiddle' onclick='classDivPlay(\"F^"+strCVcode+"^"+strFVcode+"^"+strLVcode+"^"+strRank+"\");' style='cursor:hand'>&nbsp;<label for='p_front'>Àü¹ÝºÎ</label>";
				}
			}

			if (strLVcode == "00000000000") {
			//ºñÈ°¼º
				document.all("classDivL").className = "unchoice";
				document.all("classDivL").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio02.gif' align='absmiddle'>&nbsp;<label for='p_back'>ÈÄ¹ÝºÎ</label>";
			} else {
				if (classDiv == "L") {
					document.all("classDivL").className = "choice";
					document.all("classDivL").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio01.gif' align='absmiddle'>&nbsp;<label for='p_back'>ÈÄ¹ÝºÎ</label>";
					
				} else {
					document.all("classDivL").className = "choice";
					document.all("classDivL").innerHTML ="<img src='http://crbt.nate.com:8081/img/myphone/btn/bt_radio03.gif' align='absmiddle' onclick='classDivPlay(\"L^"+strCVcode+"^"+strFVcode+"^"+strLVcode+"^"+strRank+"\");' style='cursor:hand'>&nbsp;<label for='p_back'>ÈÄ¹ÝºÎ</label>";
				}
				
				
			}
			
		}
    }

};
