// XML °´Ã¼ °¡Á®¿À±â
function getXmlHttpRequest() {
	if (window.ActiveXObject) {
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e1) {return null;}
		}
	}
	else if(window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else {
		return null;
	}
}

function go_main() {
	window.location.href = "/NProgram/mcountdown2/index.asp?bidx=mcountdown2";
}

function MCD_F_member(){
	if (confirm("º» ¼­ºñ½º´Â ¿¥³Ý ÀÌ¿ë±ÇÀ» ±¸¸ÅÇÑ Á¤È¸¿ø¿¡ ÇÑÇØ ÀÌ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.\nÀÌ¿ë±ÇÀ» ±¸¸ÅÇÏ½Ã°Ú½À´Ï±î?")) {
		goBillUrl();
	}
}

function MCD_F_ipCheck() {
	alert("ÀÌ¿ëÇÏ´Â PCÀÇ ÅõÇ¥ Á¦ÇÑ ¼ö°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù.\n´ÙÀ½¹ø ÅõÇ¥¿¡ ´Ù½Ã Âü¿©ÇØ ÁÖ¼¼¿ä.");
}

function MCD_F_idCheck() {
	alert("ÀÌ¹Ì ÅõÇ¥¿¡ Âü¿© ÇÏ¼Ì½À´Ï´Ù.\nÅõÇ¥±â°£µ¿¾È ÇÏ·ç¿¡ 1È¸ÅõÇ¥ °¡´ÉÇÕ´Ï´Ù.");
	location.href = "/NProgram/mcountdown2/MCountDownVoteView.asp";
}

function MCD_F_endChk(){
	//alert("ÇöÀç ÅõÇ¥ÁøÇà±â°£ÀÌ ¾Æ´Õ´Ï´Ù.\nÅõÇ¥ ÁøÇà±â°£Àº ¸ÅÁÖ ±Ý¿äÀÏ 11AM~Â÷ÁÖ ¿ù¿äÀÏ 09AM ÀÔ´Ï´Ù.");
	alert("ÇöÀç ÅõÇ¥ÁøÇà±â°£ÀÌ ¾Æ´Õ´Ï´Ù.");
}

function MCD_F_notChoice(){
	alert("ÅõÇ¥´Â 1°îÀ» Ã¼Å©ÇÏ¼Å¾ß ¹Ý¿µµË´Ï´Ù.\n´Ù½Ã È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿À.");
}

function MCD_F_fullChoice(){
	alert("1°³¸¸ Ã¼Å© °¡´ÉÇÕ´Ï´Ù.\nÅõÇ¥°îÀ» È®ÀÎÇÏ½Ã°í ¿Ï·á¹öÆ°À» ´­·¯ÁÖ¼¼¿ä.");
}

function MCD_F_listen(id){
	//fnListenSingle2(id);
	mnetCom.aodPlay(id,'now');
}

function MCD_F_photoView(id){
	location.href = "/NProgram/mcountdown2/PhotoView.asp?bidx=mcountdown_p3&page=1&brdIdx=" + id + "&srtype=&srStr=&brdSN=847&cmtID=mcountdown_p3_" + id;
}

function MCD_F_down(id){
	//fnMP3Download2(id);
	mnetCom.mp3Down(id);
}

function MCD_F_mv(id, type){
	if (type=="MV")
	{
		window.location.href = "http://www.mnet.com/tv/mv/" + id;
	}else if (type=="LC"){
		window.location.href="http://www.mnet.com/tv/vod/" + id;
	}
//	window.location.href = "http://tv.mnet.com/Clip/view.asp?vodID=" + id + "&vodService=" + type;
	//GF_PlayVOD(id, type);
}

function fnVodReplay(id,type){
	window.location.href="http://www.mnet.com/tv/vod/"+id;
	//window.location.href = "http://tv.mnet.com/Clip/view.asp?vodID=" + id + "&vodService=" + type;
	//GF_PlayVOD(id, type);
}

function MCD_F_voteComplete(pMag, pYN){
	if (pYN == "Y") {
		alert(pMag);
		location.href = "/NProgram/mcountdown2/MCountDownVoteView.asp"
	} else {
		alert(pMag);
	}
}

function goVotePgae(){
	location.href = "/NProgram/mcountdown2/MCountDownVote.asp"
}

function MCD_ArtistUrl(artID) {
	//var goUrl  = "http://music.mnet.com/ArtistAlbum/ArtistInfo.asp?ArtistID=" + artID;
	var goUrl  = "http://www.mnet.com/artist/" + artID;
	void(window.open(goUrl,"",""));
}

function MCD_AlbumUrl(albID) {
	//var goUrl  = "http://music.mnet.com/ArtistAlbum/AlbumInfo.asp?AlbumID=" + albID + "&AlbumView=Y";
	var goUrl  = "http://www.mnet.com/album/" + albID;
	void(window.open(goUrl,"",""));
}

function goMenuUrl(pMain, pSub) {
	var url = "/NProgram/mcountdown2/Inc.MenuUrl.asp?pMain=" + pMain + "&pSub=" + pSub;
	var xmlHttp = getXmlHttpRequest();

	try {
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);

		xmlHttp.onreadystatechange = function() {
			if(xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200) {
					if (xmlHttp.responseText == "SERVICE") {
						alert("¼­ºñ½º ÁØºñÁß ÀÔ´Ï´Ù.");
					} else if (xmlHttp.responseText == "VOTE") {
						//alert("ÇöÀç ÅõÇ¥ÁøÇà±â°£ÀÌ ¾Æ´Õ´Ï´Ù.\nÅõÇ¥ ÁøÇà±â°£Àº ¸ÅÁÖ ±Ý¿äÀÏ 11AM~Â÷ÁÖ ¿ù¿äÀÏ 09AM ÀÔ´Ï´Ù.");
						alert("ÇöÀç ÅõÇ¥ÁøÇà±â°£ÀÌ ¾Æ´Õ´Ï´Ù.");
					}else {
						window.location.href = xmlHttp.responseText;
					}
				}
			}
		}
	}
	catch(e) {alert('´Ù½Ã ½ÃµµÇÏ¼¼¿ä.');}
}

function top_menu(n) {
	if (n =="0"){
		sWinLink = "http://www.mnet.com/";
	}else if(n =="1"){
		sWinLink = "http://www.mnet.com/chart/top100";
	}else if(n =="2"){
		sWinLink = "http://www.mnet.com/tv/program/main";
	}else if(n =="3"){
		sWinLink = "http://www.mnet.com/ticket/today/list";
	}else if(n =="4"){
		sWinLink = "http://www.mnet.com/special/today/all/0000";
	}else if(n =="5"){
		sWinLink = "http://my.mnet.com/mnet/promotion";
//	}else if(n =="6"){
//		sWinLink = "http://mobile.mnet.com/MoBileWeb.asp";
//	}else if(n =="7"){
//		sWinLink = "http://imsuperstar.mnet.com/";
	}else {
		sWinLink = "http://www.mnet.com/";
	}

	location.href = sWinLink;
}

function main_menu(m,s){
	if(s == -1){
		goMenuUrl(m, '0');
	}else{
		goMenuUrl(m, s);
	}
}

function goBillUrl(){
	location.href = "http://pay.mnet.com/index.asp?eventvalue=mcountdown2";
}

function goBoardUrl(pBoardName){
	location.href = "/NProgram/mcountdown2/UserBBS.asp?bidx=" + pBoardName;
}




