
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 goMnetService() {
	window.location.href = "http://www.mnet.com/";
}

function goMenuUrl(pMain, pSub) {
	var url = "/2009/L_Inc/Inc.MAMAMenuUrl.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 == "NOT") {
						alert("¼­ºñ½º ÁØºñÁß ÀÔ´Ï´Ù.");
					} else {
						window.location.href = xmlHttp.responseText;
					}
				}
			}
		}
	}
	catch(e) {alert('´Ù½Ã ½ÃµµÇÏ¼¼¿ä.');}
}

function top_menu(n){
	var sWinLink;
	
	if (n =="0"){
		sWinLink = "http://www.mnet.com/";
	}else if(n =="1"){
		sWinLink = "http://music.mnet.com/MChart/MChart_Top300.asp";
	}else if(n =="2"){
		sWinLink = "http://music.mnet.com/MNew/NewMusic.asp";
	}else if(n =="3"){
		sWinLink = "http://music.mnet.com/MGenre/v3/MGenre.asp";
	}else if(n =="4"){
		sWinLink = "http://open.mnet.com/";
	}else if(n =="5"){
		sWinLink = "http://tv.mnet.com/";
	}else if(n =="6"){
		sWinLink = "http://ucsing.mnet.com/";
	}else {		
		sWinLink = "http://www.mnet.com/";
	}
	
	void(window.open(sWinLink,"",""));
}

function goVodPlay_OLD(pMediaID, pMediaType) {
	var sWinLink = "http://player.mnet.com/VODPlayer/VODPlayer.asp?MediaID=" + pMediaID + "&MediaType=" + pMediaType + "";
	window.open(sWinLink, "pop2", 'top=0, left=0, width=800, height=600, scrollbars=no, resizing=no');
}


function goVodPlay() {
	var MediaID  = (arguments[0] || "1");
	var MediaType = (arguments[1] || "Mnet");
	
	try {
		MnetVODPlayerWindow = window.open("", "P3VODPlayer", "width=920, height=750, left=0, top=0, directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no");
		MnetVODPlayerWindow.focus();
		try {
			MnetVODPlayerWindow.loadMedia(MediaID, MediaType);
		} catch(e) {
			MnetVODPlayerWindow = window.open("http://player.mnet.com/VODPlayerMain/VODPlayer.asp?MediaID="+ MediaID +"&MediaType="+ MediaType, "P3VODPlayer", "width=920, height=750, left=0, top=0, directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no");
		}
	}
	catch (e) {
		MnetVODPlayerWindow = window.open("http://player.mnet.com/VODPlayerMain/VODPlayer.asp?MediaID="+ MediaID +"&MediaType="+ MediaType, "P3VODPlayer", "width=920, height=750, left=0, top=0, directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no");
	}
}


function goRealTV(pVodType) {
	
	if (pVodType == "MNET") {
		var MediaID			= 1;
		var MediaType		= 'MNET';
	} else {
		var MediaID			= 2;
		var MediaType		= 'KM';
	}
	
	var MnetVODPlayerWindow = window.open("", "PopupMnetVODPlayer", "width=880, height=600, left=0, top=0, directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no");
	MnetVODPlayerWindow.focus();
	
	try {
		MnetVODPlayerWindow.loadMedia(MediaID, MediaType);
	} catch(e) {
		MnetVODPlayerWindow = window.open("http://player.mnet.com/VODPlayer/VODPlayer.asp?MediaID="+ MediaID +"&MediaType="+ MediaType, "PopupMnetVODPlayer", "width=880, height=600, left=0, top=0, directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no");
	}
}

function goNoticeSrch(){
	var sF = document.getElementById("SearchField").value;
	var sW =document.getElementById("SearchWord").value;
	 if(sW==''){
		alert("°Ë»ö¾î¸¦ ³Ö¾îÁÖ¼¼¿ä")
	 }else{
		window.location.href="/2009/AwardIntro/AwardNoticeList.asp?SearchField="+sF+"&SearchWord="+sW;
	 }
}

function goEvent(){
	var sWinLink = "http://www.cgv.co.kr/event/running/detail.aspx?idx=7487&templettypecode=504&templetsubtypecode=511";
	void(window.open(sWinLink,"",""));
}

function MAMA_flash_member(){
	alert("Mnet Asian Music Awards´Â ´ëÁßÀ½¾Ç°è¸¦ °á»êÇÏ´Â\n½Ã»ó½ÄÀ¸·Î ¿¥³Ý Á¤È¸¿ø¿¡ ÇÑÇØ ÅõÇ¥ ±ÇÇÑÀÌ ÁÖ¾îÁý´Ï´Ù.");
	var goUrl = 'http://bill.mnet.com/event/2009mkmf/mkmf_popup.asp';
	var winBill = window.open(goUrl,'winsPL','top=250,left=330,width=390,height=200,menubar=no,scrolling=no,status=no');	
}

function MAMA_flash_ipCheck() {
	alert("ÀÌ¿ëÇÏ´Â PCÀÇ ÀÏÀÏ ÅõÇ¥ Á¦ÇÑ ¼ö°¡ ÃÊ°ú µÇ¾ú½À´Ï´Ù.\n³»ÀÏ ´Ù½Ã ÅõÇ¥ÇØ ÁÖ¼¼¿ä.");
}

function MAMA_flash_today() {
	alert("¿À´Ã ÀÌ¹Ì ÅõÇ¥¸¦ ÇÏ¼Ì½À´Ï´Ù.\n³»ÀÏ ´Ù½Ã Âü¿©ÇØ ÁÖ¼¼¿ä.");
}

function MAMA_flash_Foreign() {
	alert("2009 Mnet Asian Music Awards´Â ´ëÇÑ¹Î±¹ ÁÖ¹Îµî·Ï¹øÈ£°¡ ÀÖ´Â\nÀÌ¿ëÀÚ¸¸ ÅõÇ¥¸¦ ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
}

function MAMA_flash_idCheck() {
	alert("ÁË¼ÛÇÕ´Ï´Ù. È¸¿ø´ÔÀÇ ¾ÆÀÌµð ¶Ç´Â IP(PC)¿¡ ÅõÇ¥°¡ Á¦ÇÑµÇ¾î ÀÖ½À´Ï´Ù.\nÀÚ¼¼ÇÑ »çÇ×Àº °í°´¼¾ÅÍ¿¡ ¹®ÀÇÇØ ÁÖ¼¼¿ä.");
}

function go_main(){
	window.location.href = "http://mama.mnet.com/2009/AwardVote/AwardVote.asp";
}

function MAMAVoteEnd() {
	alert("2009 Mnet Asian Music Awards ÅõÇ¥°¡ Á¾·á µÇ¾ú½À´Ï´Ù.");
}

function main_menu(m, s){
//alert(m + " - " + s);	
	var master_id = m + 1;
	var sub_id = s + 1;
	goMenuUrl(master_id, sub_id);
}

function go_cgv(){
	var sWinLink = "http://www.cgv.co.kr/";
	void(window.open(sWinLink,"",""));	
}
