UtilityMusic = function() {
	this.event = "utility_music";
	this.play_no= 0;
}

UtilityMusic.prototype = {
	// °ª ±¸ÇÏ±â
	Get : function(type) {
		for(var i=0;i<this.arrMusic.length;i++) {
			if(this.play_no == i) {
				var Row = this.arrMusic[i].split("\n");
				switch(type) {
					case "title":
						return Row[0];
						break;
					case "file":
						return Row[1];
						break;						
				}
			}
		}
	},
	
	// Àç»ý
	Play : function() {
		$("ObjectMusic").FileName = this.Get("file");
		$("DivDisplay").innerHTML = this.Get("title");
		setTimeout("UtilityMusic.PlayProcess()",1000);
	},
	
	// ÁßÁö
	Stop : function() {
		$("ObjectMusic").stop();
	},

	// ÀÌÀü
	Prev : function() {
		if(this.play_no == 0) {
			this.play_no = this.arrMusic.length-1;
		} else {
			this.play_no--;
		}
		this.Play();		
	},
	
	// ´ÙÀ½
	Next : function() {
		if(this.play_no == this.arrMusic.length-1) {
			this.play_no = 0;
		} else {
			this.play_no++;
		}
		this.Play();
	},	
	
	PlayProcess : function() {
		$("ObjectMusic").play();		
	},
	
	// »ý¼ºÀÚ
	UtilityMusic : function() {
		if(this.bgmusic == "y") {
			this.Play();	
		}
	}
}
