//#############################################################
// ÆÄ ÀÏ ¸í	: launch_game.js
// ÀÌÀüÆäÀÌÁö	: ¾øÀ½
// ´ÙÀ½ÆäÀÌÁö	: http://gstar.mgame.com/launch/launch_°ÔÀÓ¸í.mgame
// ¼³	¸í	: °øµ¿À¸·Î »ç¿ëÇÏ´Â °ÔÀÓ ½ÇÇàÆÄÀÏ
// ¼ö Á¤ ÀÚ	: ¿ì Áø ±¹
// ¼ö Á¤ ÀÏ	: 2008/07
//#############################################################
function launch_game(goUrl) {
	var goUrl;
	var webServer = location.host,launcherServer,wwwServer;
	
	if(webServer.substr(0,2) == "mg"){
		launcherServer = "http://mggstart.mgame.com";
		wwwServer = 'http://mgwww.mgame.com';
	}else{
		launcherServer = "http://gstart.mgame.com";
		wwwServer = 'http://www.mgame.com';
	}
	
//=='hon.sbs.co.kr' || webServer=='mghon.sbs.co.kr'|| webServer=='yulgang.sbs.co.kr' || webServer=='hon.buddybuddy.co.kr')
	if(webServer.indexOf("mgame.com") == -1) {								// CP..
		if (getCookie("mgx", "") != null) {
			if(webServer.indexOf("gameon.nate.com") > 0 || webServer.indexOf("game.daum.net") > 0 || webServer.indexOf("hangame.com") > 0) {
				if(goUrl == "ghost") goUrl = "hon";
				str = "/common_lib/cp_launch/launch_"+goUrl+".mgame?goUrl="+goUrl;

			} else {
				str = "/launch/launch_"+goUrl+".php?goUrl="+goUrl;
			}
			document.getElementById('launch').setAttribute("src",str);
		} else {
			if(webServer.indexOf("gameon.nate.com") > 0) {
			} else {
				location.href = "/member/login_process.php";
			}
		}
	} else { //MGAME
		if (getCookie("MGAME", "") != null) {
			/*
			var n=navigator.appName
			if (n=="Netscape"){
				if(goUrl=="hero"){
					str = wwwServer+"/launch/launch_"+goUrl+"_firefox.mgame?goUrl="+goUrl;
				}else{
					alert('ÆÄÀÌ¾î Æø½º °ÔÀÓ½ÇÇàÀÌ ÁØºñÁßÀÔ´Ï´Ù.');
					str = webServer;
				}
			}else{
				str = wwwServer+"/launch/launch_"+goUrl+".mgame?goUrl="+goUrl;
			}
			*/

			// ÀÌÅÍ³Î½ÃÆ¼ÀÏ °æ¿ì ÀÌÅÍ³Î½ÃÆ¼ È¸¿ø Ã¼Å© ÆäÀÌÁö·Î..
			if(goUrl == "el") {
				str = launcherServer + "/launch/eternalUser/eternalUser_CheckNew.mgame";
			} else {
				str = launcherServer + "/launch/launch_" + goUrl + ".mgame?goUrl=" + goUrl;
			}

			document.getElementById('launch').setAttribute("src",str);
		} else {
			if(goUrl == "yulgang") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://yulgang.mgame.com/");
			} else if(goUrl == "holic2") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://holic2.mgame.com/");
			} else if(goUrl == "holic") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://holic.mgame.com/");
			} else if(goUrl == "yapcar") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://online.mgame.com/game/yapcar/");
			} else if(goUrl == "lapis") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://lapis.mgame.com/");
			} else if(goUrl == "asda") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://asda.mgame.com/");
			} else if(goUrl == "hero") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://hero.mgame.com/");
			} else if(goUrl == "wffm") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://wffm.mgame.com/");
			} else if(goUrl == "el") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://eternalcity.mgame.com/");
			} else if(goUrl == "droiyan") {
				if(getCookie("DROIYAN", "ID")=="") {
					location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://droiyan.mgame.com/");
				} else {
					launch.location.replace(launcherServer + "/launch/launch_droiyan.mgame?goUrl=droiyan");
				}
			} else if(goUrl=="aresnew"){ 
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://ares.mgame.com/"); 
			} else if(goUrl=="knight"){ 
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://knight.mgame.com/");
			} else if(goUrl == "justishow") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://js.mgame.com/");
			} else if(goUrl == "hon") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://hon.mgame.com/");
			} else if(goUrl == "operation7") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://operation7.mgame.com/");
			} else if(goUrl=="crashbattle") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://crashbattle.mgame.com/");
			} else if(goUrl == "strikers") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://strikers.mgame.com/");
			} else if(goUrl == "popstage") {
				location.href = wwwServer + "/member/login_form_big.asp?tu=" + escape("http://popstage.mgame.com/");
			}
		}
	}
	return;
}
