//********************************
//* MKMF °øÅë JavaScript
//********************************

// MKMF ÇÃ·¹½¬ ¿µ¿ª ½ÃÀÛ
function mkmf_home(){
	window.location.href = "http://mkmf.mnet.com/2008/AwardVote.asp"
}
function mkmf10th_voteComplete(){
	window.location.href = "http://mkmf.mnet.com/2008/Vote/AwardVoteResult.asp"
}

function mkmf10th_viewMv(id, type) {
	GF_PlayVOD(id,type);
}

function goAuctionSpecial(){
	var goUrl = "http://mkmf.auction.co.kr/vote/vote.asp";
	void(window.open(goUrl,"",""));
}

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://open.mnet.com";
	}else if(n =="4"){
		sWinLink = "http://music.mnet.com/MV/mvMain.asp";
	}else if(n =="5"){
		sWinLink = "http://news.mnet.com/2007/news/news_main.php";
	}else if(n =="6"){
		sWinLink = "http://tvdeep.mnet.com";
	}else if(n =="7"){
		sWinLink = "http://ucsing.mnet.com";
	}else if(n =="8"){
		sWinLink = "http://clubday.mnet.com/";
	}		

	void(window.open(sWinLink,"",""));
	
}

function mkmf_menu(m, s){
	var sWinLink;
	var g_XMLData = '<?xml version="1.0" ?>';
	g_XMLData = g_XMLData + "<REQPARAM>";
	g_XMLData = g_XMLData + "<MAINNO>" + m + "</MAINNO>";
	g_XMLData = g_XMLData + "<SUBNO>" + s + "</SUBNO>";
	g_XMLData = g_XMLData + "</REQPARAM>";
	
	var myXMLGNBClass = new SXC();
	var returnXML = myXMLGNBClass.sendData("/2008/L_inc/IncMenuUrl.asp", g_XMLData, false);

	if (returnXML == "MNET") {
		alert("¼­ºñ½º ÁØºñÁß ÀÔ´Ï´Ù.");
		return;	
	}
	
	if (returnXML == "TEASER") {
		sWinLink = "http://mkmf.mnet.com/2008/Teaser/";
		void(window.open(sWinLink,"",""));
		return;	
	}
	
	if (returnXML == "MKMFVOD") {
		goVodPlay('21762', 'PRG');
		//sWinLink = "http://tvdeep.mnet.com/SrchVod.asp?srchtxt=2008mkmf";
		//sWinLink = "http://player.mnet.com/VODPlayer/VODPlayer.asp?MediaID=21762&MediaType=PRG";
		//window.open(sWinLink, "pop2", 'top=0, left=0, width=800, height=600, scrollbars=no, resizing=no');
		return;	
	}	
	
	if (!returnXML) {
		alert("Àß¸øµÈ °æ·Î ÀÔ´Ï´Ù.");
		window.location.href = "http://mkmf.mnet.com/";
		return;
	}

	window.location.href = returnXML;	
}

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");
	}
}

// MKMF ÇÃ·¹½¬ ¿µ¿ª ³¡

// MKMF À¥ ¿µ¿ª ½ÃÀÛ
function goViewPage(pNo) {
	if (pNo == "07") {
		window.location.href = "http://mkmf.mnet.com/2008/Vote/MnetDown.asp";
	}else {
		var goUrl = "http://mkmf.mnet.com/2008/Vote/VoteView/AwardVoteView_" + pNo + ".asp";
		window.location.href = goUrl;
	}
}
// MKMF À¥ ¿µ¿ª ³¡

function goHallMore(pYear) {
	window.location.href = "http://mkmf.mnet.com/2008/Enjoy/SpecialHallMore.asp?year=" + pYear;
}

function goYearHall() {
	window.location.href = "http://mkmf.mnet.com/2008/Enjoy/SpecialHall.asp";
}

function goViewVoteDo(n){
	mkmf10th_setTurnView(n);
}

function showFlashVer9(file, id_name, width, height, wmode, flashVars, bgColor, allowFullScreen){
	file = file.substr(0, file.length-4);
	if (RunFunction == 0) {
		alert("jsÆÄÀÏÀÌ ·ÎµåµÇÁö ¸øÇß½À´Ï´Ù.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width',width,'height',height,'src',file,
			'quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer',
			'align','top','play','true','loop','false','scale','noscale',
			'wmode',wmode,'devicefont','false','id',id_name,'bgcolor',bgColor,
			'name', id_name,'menu','false','allowFullScreen',allowFullScreen,
			'allowScriptAccess','always','movie',file,'salign','TL','flashVars',flashVars);
	}
}
function goPhotoList(pYear) {
	var formObj = document.forms[0];
	var url = 'http://photo.mnet.com/photoSearchAward.asp?CateID=1030100&CateID2=&phYear=' + pYear + '&ArtName=&IndexCode=&SearchType=1&Keyword=';
	window.open(url,'Photo');
}

function goChangeView(pMasterID) {

	if (selectSubM != pMasterID) {
		var showSubM		= eval("abs_" + pMasterID + ".style");
		var closeSubM		= eval("abs_" + selectSubM + ".style");
		var showDivM		= eval("div_" + pMasterID + ".style");
		var closeDivM		= eval("div_" + selectSubM + ".style");
		
		showSubM.display='block';
		closeSubM.display='none';
		
		showDivM.display='block';
		closeDivM.display='none';
		
		var closeImg = document.getElementById('img_chk_' + pMasterID);
		closeImg.src = closeImg.src.replace('btn_open','btn_close');

		var openImg = document.getElementById('img_chk_' + selectSubM);
		openImg.src = openImg.src.replace('btn_close','btn_open');
		
		selectSubM = pMasterID;
	}else{
		var showSubM		= eval("abs_" + pMasterID + ".style");
		var showDivM		= eval("div_" + pMasterID + ".style");

		if(showSubM.display=='block'){
			var openImg = document.getElementById('img_chk_' + selectSubM);
			openImg.src = openImg.src.replace('btn_close','btn_open');
			showSubM.display='none';
			showDivM.display='none';
		}else{
			var closeImg = document.getElementById('img_chk_' + pMasterID);
			closeImg.src = closeImg.src.replace('btn_open','btn_close');
			showSubM.display='block';
			showDivM.display='block';
		}

	}
}

function goMKMFRealTV(pVodType) {
	
	if (pVodType == "DM") {	// 'MNET'
		var MediaID			= 1;
		var MediaType		= 'MNET';
	} else {	// 'KM'
		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 goMKMFRePlay(pNo) {
	GF_PlayVOD(pNo, "PRG");
}

function goMKMFClose() {
	alert("ÅõÇ¥°¡ Á¾·áµÇ¾ú½À´Ï´Ù.");
	return;
}