
//############################################################
// ¼³¸í    : ³×ºñ°ÔÀÌ¼Ç ¸µÅ© function
// ÀÛ¼ºÀÚ : ±è¼ö¼±
// ÀÛ¼ºÀÏ : 2007-08-01
//############################################################
var wwwurl_hon = location.host;
wwwurl_hon="http://"+wwwurl_hon;

function openURL(MainCate,SubCate) {

	//±ÍÈ¥¸ÞÀÎ
	if (MainCate == "0" && SubCate == "0") {
		self.location.href= "/";

	//±ÍÈ¥¼Ò½Ä
	}else if (MainCate == "1"){ 
		if (SubCate == "0" || SubCate == "1"){ // °øÁö»çÇ× 
			self.location.href= "/news/default.mgame?rtype=N";
		}else if (SubCate=="2"){ //¾÷µ¥ÀÌÆ®
			self.location.href= "/news/default.mgame?rtype=U";
		}else if (SubCate=="3"){ //ÀÌº¥Æ®ÀÚ·á
			self.location.href= "/news/default.mgame?rtype=E";
		}else if (SubCate=="4"){ //º¸µµÀÚ·á
			self.location.href= "/news/default.mgame?rtype=B";
		}

	//±ÍÈ¥ÀÔ¹®
	}else if (MainCate == "2"){ 
		if (SubCate == "0" || SubCate=="1"){ 
			self.location.href= "/guide/default.mgame?rtype=W";
		}else if (SubCate=="2"){ 
			self.location.href= "/guide/default.mgame?rtype=S";
		}else if (SubCate=="3"){ 
			self.location.href= "/guide/default.mgame?rtype=E";
		}else if (SubCate=="4"){ 
			self.location.href= "/guide/default.mgame?rtype=T";
		}

	//Á¤º¸
	}else if (MainCate == "3"){ 
		if (SubCate == "0" || SubCate=="1"){ 
			self.location.href= "/info/default.mgame?rtype=J";
		}else if (SubCate=="2"){ 
			self.location.href= "/info/default.mgame?rtype=Q";
		}else if (SubCate=="3"){ 
			self.location.href= "/info/default.mgame?rtype=F";
		}else if (SubCate=="4"){ 
			self.location.href= "/info/default.mgame?rtype=D";
		}else if (SubCate=="5"){ 
			self.location.href= "/info/default.mgame?rtype=C";
		}else if (SubCate=="6"){ 
			self.location.href= "/info/default.mgame?rtype=G";
		}else if (SubCate=="7"){ 
			self.location.href= "/info/default.mgame?rtype=I";
		}else if (SubCate=="8"){ 
			self.location.href= "/info/default.mgame?rtype=W";
		}else if (SubCate=="9"){ 
			self.location.href= "/info/default.mgame?rtype=Y";
		}else if (SubCate=="10"){ 
			self.location.href= "/info/default.mgame?rtype=S";
		}else if (SubCate=="11"){ 
			self.location.href= "/info/default.mgame?rtype=N";
		}else if (SubCate=="12"){ 
			self.location.href= "/info/default.mgame?rtype=M";
		}else if (SubCate=="13"){ 
			self.location.href= "/info/default.mgame?rtype=K";
		}

	//±ÍÈ¥°´ÀÜ 
	}else if (MainCate == "4"){ 
		if (SubCate == "0" || SubCate=="1"){ 
			self.location.href= "/community/default.mgame?rtype=B";
		}else if (SubCate=="2"){ 
			self.location.href= "/community/default.mgame?rtype=S";
		}else if (SubCate=="3"){ 
			self.location.href= "/community/default.mgame?rtype=M";
		}else if (SubCate=="4"){ 
			self.location.href= "/community/default.mgame?rtype=K";
		}else if (SubCate=="5"){ //º¯°æ
			self.location.href= "/community/default.mgame?rtype=P";
		}else if (SubCate=="6"){ //º¯°æ
			self.location.href= "/community/default.mgame?rtype=F";
		}else if (SubCate=="7"){ //º¯°æ
			self.location.href= "/community/default.mgame?rtype=L";
		}

	//·©Å·
	}else if (MainCate == "5"){ 
		if (SubCate == "0" || SubCate=="1"){ 
			self.location.href= "/ranking/default.mgame?rtype=R";
		}else if (SubCate=="2"){ 
			self.location.href= "/ranking/default.mgame?rtype=F";
		}else if (SubCate=="3"){ 
			self.location.href= "/ranking/default.mgame?rtype=D";
		}else if (SubCate=="4"){ 
			self.location.href= "/ranking/default.mgame?rtype=H";
		}else if (SubCate=="5"){ 
			self.location.href= "/ranking/default.mgame?rtype=B";
		}

	//³îÀÌÅÍ
	}else if (MainCate == "6"){ 
		if (SubCate == "0" || SubCate=="1"){ 
			self.location.href= "/playground/default.mgame?rtype=F";
		}else if (SubCate=="2"){ 
			window.open('/playground/tarocard_flash.mgame?Game=hon&Issue=hontaro&AD_media=mgame&Meterial=honmain&Slot=subnavi&Date=070108_070115','tarocard','width=800,height=600,top=50,left=100');
		}else if (SubCate=="3"){ 
			self.location.href= "/playground/default.mgame?rtype=C";
		}else if (SubCate=="4"){ 
			self.location.href= "/playground/default.mgame?rtype=T";
		}else if (SubCate=="5"){ 
			self.location.href= "/playground/default.mgame?rtype=S";
		}else if (SubCate=="6"){ 
			self.location.href= "/playground/default.mgame?rtype=U";
		}else if (SubCate=="7"){ 
			self.location.href= "/playground/default.mgame?rtype=G";
		}else if (SubCate=="8"){ 
			self.location.href= "/playground/default.mgame?rtype=A";
		}

	//ÀÚ·á½Ç
	}else if (MainCate == "7"){ 
		if (SubCate == "0" || SubCate=="1"){ 
			self.location.href= "/data/default.mgame?rtype=D";
		}else if (SubCate=="2"){ 
			self.location.href= "/data/default.mgame?rtype=G";
		}else if (SubCate=="3"){ 
			self.location.href= "/data/default.mgame?rtype=M";
		}else if (SubCate=="4"){ 
			self.location.href= "/data/default.mgame?rtype=W";
		}else if (SubCate=="5"){ 
			self.location.href= "/data/default.mgame?rtype=K";
		}

	//°í°´¼¾ÅÍ
	}else if (MainCate == "8"){ 

		if(location.host.indexOf("hangame.com") > 0){
			if (SubCate == "0" || SubCate=="1"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=1";
			}else if (SubCate=="2"){ 
				self.location.href= "/customer/inquiry_center.mgame";
			}else if (SubCate=="3"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=9";
			}else if (SubCate=="4"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=8";
			}else if (SubCate=="5"){ 
				window.open("http://csweb.mgame.com/csagent/helpdesk/reservation/reservation_info.jsp");
			}else if (SubCate=="6"){ 
				self.location.href= "/customer/policy.mgame";
			}else if (SubCate=="7"){ 
	//			self.location.href= "http://alpha-members.hangame.com/myinfo/cancelgame.nhn?gameid=k_hon&period=0&nxtURL=http://alpha-hon.hangame.com";
				 self.location.href= "https://members.hangame.com/myinfo/cancelgame.nhn?gameid=k_hon&period=0&nxtURL=http://hon.hangame.com";
			}else if (SubCate=="8"){
				window.open("http://csweb.mgame.com/csagent/helpdesk/obstacle/index.jsp"); //Àå¾ÖÁ¦º¸¼¾ÅÍ
			}

		} else if(location.host.indexOf("buddybuddy.co.kr") > 0){
			if (SubCate == "0" || SubCate=="1"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=1";
			}else if (SubCate=="2"){ 
				self.location.href= "/customer/inquiry_center.mgame";
			}else if (SubCate=="3"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=9";
			}else if (SubCate=="4"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=8";
			}else if (SubCate=="5"){ 
				window.open("http://csweb.mgame.com/csagent/helpdesk/reservation/reservation_info.jsp");
			}else if (SubCate=="6"){ 
				self.location.href= "/customer/policy.mgame";
			}else if (SubCate=="7"){ 
				window.open("http://csweb.mgame.com/csagent/helpdesk/obstacle/write.jsp?st=2&gubun=±ÍÈ¥"); //Àå¾ÖÁ¦º¸¼¾ÅÍ
			}

		} else {
			if (SubCate == "0" || SubCate=="1"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=1";
			}else if (SubCate=="2"){ 
				self.location.href= "/customer/inquiry_center.mgame";
			}else if (SubCate=="3"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=9";
			}else if (SubCate=="4"){ 
				self.location.href= "/customer/cs_mother.mgame?menu=8";
			}else if (SubCate=="5"){ 
				window.open("http://csweb.mgame.com/csagent/helpdesk/reservation/reservation_info.jsp");
			}else if (SubCate=="6"){ 
				self.location.href= "/customer/policy.mgame";
			}else if (SubCate=="7"){ 
				window.open("http://csweb.mgame.com/csagent/helpdesk/obstacle/write.jsp?st=2&gubun=±ÍÈ¥"); //Àå¾ÖÁ¦º¸¼¾ÅÍ
			}
		}

	//±ÍÈ¥ PC¹æ 
	}else if (MainCate == "11" && SubCate == "0" ){
		window.open("http://pcbang.mgame.com/pcbang/pcbang_search.php");

	//±ÍÈ¥ Áö½ÄÃ¢°í 
	}else if (MainCate == "12" && SubCate == "0" ){
		self.location.href= "/knowledge/index.mgame";
	//±ÍÈ¥Ä«Æä
	}else if (MainCate == "13" && SubCate == "0" ){
		self.location.href= "/cafe/index.mgame";
	//±ÍÈ¥Å×½ºÆ®Á¸ 
	}else if (MainCate == "14" && SubCate == "0" ){
		self.location.href= "/testzone/index.mgame";
	}

}


// Game Start
function ghost_gamestart(val) {
	val = (val == null) ? 1 : val;

	if(!mgameUserCheck()) {
		if(location.host.indexOf('buddybuddy.co.kr')> 0) {
			location.href='/member/login_process.php';

		} else if(location.host.indexOf('hangame.com')> 0) {
			return;
		}else{
			location.href='http://www.mgame.com/member/login_form_big.asp?tu=http://hon.mgame.com/';
		}
	}else {

		if(val == 1)			launch_game('ghost');
		else if (val == 2)		launch_game('ghost2nd');
		else if (val == 3) {

			launch_game('ghosttest');

//			if(cafe_tester=='1')		launch_game('ghosttest');
//			else							alert('Áö±ÝÀº Å×½ºÆ®¼­¹ö°¡ ÁøÇàÁßÀÌÁö ¾Ê½À´Ï´Ù..');

		}
		else if (val == 4)		launch_game('ghosttest2nd');
		else if (val == 9)		alert('Å×½ºÆ®¼­¹ö°¡ ÁøÇàÁßÀÌÁö ¾Ê½À´Ï´Ù..');
		else						alert('Àß¸øµÈ ÄÚµåÀÔ´Ï´Ù.');
	}
}

// main left flash menu
function leftFun(num) {
	switch(num) {
		case 1: location.href="/guide/default.mgame?rtype=T";
			break;
		case 2: location.href="/data/default.mgame?rtype=D";
			break;
		case 3: pcbang();
			break;
		case 4: location.href="/customer/cs_mother.mgame";
			break;
		case 5: location.href="/data/default.mgame?rtype=M";
			break;
		case 6: ghost_gamestart(3);	// Å×½ºÆ®¼­¹ö ¿¬°á (¿¥°ÔÀÓ¸¸)
			break;
	}
}

// ¸ÞÀÎ ÇÃ·¡½Ã ¸µÅ©
function twoyear_01() {
	window.open("/teaser/20071114/","20071114","width=1200,height=774,top=10,left=10");
}
function preview_07() {
	window.open('/event/20080212_hwangol/','20080212hwangol','width=960,height=650,top=50,left=100');
}
function preview_08() {
	window.open('/teaser/20080625/default.mgame','_blank','width=1024,height=768,top=-10,left=-10,toolbar=1,location=1,status=1,menubar=1,scrollbars=1,directories=0,resizable=1');
}
function preview_09() {
	window.open('/event/20081112_3th_anniversary/index.mgame');
}
function pcbang() {
	window.open('http://pcbang.mgame.com/main_event/200711/30/gzone_main.php?Game=GUIHON');
}
function preview_10() {
	window.open('/event/20090211_valentineday/index.mgame');
}
function preview_20() {
	window.open('/event/20090429_necoparty/index.mgame');
}
function preview_30() {	// °­·É
	window.open('/event/20090716_kangryung_ts/');
}
function eventFun() {	// ¾ç¾ÇÆò
	window.open("/event/20100721_yangac_pro/default.mgame","","width=900, height=580");
}
function previewFun() {	// ±ÍÈ¥ÀÚ
	window.open('/event/20091204_guihonja/default.mgame','Guihonja','width=900, height=630');
}