
//###################################################################
// ¼³ ¸í : °øÅë ¿À·ù ÆË¾÷ ¿ÀÇÂ
//###################################################################
// ÆË¾÷¿ë ¿ÀÇÂ
function Mgame_ErrorPopupOpen(strec, strsem){
	changeDomain();
	var goURL = 'http://www.mgame.com/common_popup/main/mgame_message.mgame?ec='+strec+'&sem='+strsem+'&et=popup';
	if (window.showModalDialog) {
		var property ='dialogHeight: 200px; dialogWidth: 346px; edge: Sunken; center: Yes; help: No; resizable: No; status: No; scroll: No;';
		nReturnValue = window.showModalDialog(goURL, window, property);
	} else {
		var posX, posY;
		posX	= Math.ceil((window.screen.availWidth / 2) - 160);
		posY	= Math.ceil((window.screen.availHeight / 2) - 160);
		var property = 'left='+posX+',top='+posY+',width=200,height=200,toolbar=no,directories=no,status=no,linemenubar=no,scrollbars=no,resizable=no,modal=yes,dependent=yes';
		window.open(goURL, 'mgame_errmsg_modaldialog', property);
	}
}
// ·¹ÀÌ¾î¿ë ¿ÀÇÂ
function Mgame_ErrorLayerOpen(strec, strsem) {
	
	strhostname = location.host;
	currentDomain = strhostname.substring(strhostname.indexOf(".")+1);
	
	if(currentDomain != "mgame.com"){			//Ã¤³ÎÀº »ç¿ë±ÇÇÑÀ¸·Î ÀÎÇØ ÆË¾÷À¸·Î ´ëÃ¼
		Mgame_ErrorPopupOpen(strec, strsem);
		return;
	}

//	Mgame_CommonLayerOpen_trans('http://www.mgame.com/common_popup/main/mgame_message.mgame?ec='+strec+'&sem='+strsem+'&et=layer', 350, 260, false);
	Mgame_ErrorLayerOpen_trans(strec, strsem, true);
}
// ·¹ÀÌ¾î¿ë ¿ÀÇÂ - µÚ °ËÀº ¹è°æ »¬¶§ »ç¿ë flag ¿¡ true Àü´ÞÇÏ¸é µÊ.
function Mgame_ErrorLayerOpen_trans(strec, strsem, flag) {
	Mgame_CommonLayerOpen_trans('http://www.mgame.com/common_popup/main/mgame_message.mgame?ec='+strec+'&sem='+strsem+'&et=layer', 350, 260, true);
}
// µÚ °ËÀº ¹è°æ »¬¶§ »ç¿ë flag ¿¡ true Àü´ÞÇÏ¸é µÊ.
function Mgame_CommonLayerOpen_trans(ifrm_url, w, h, flag) {
	Mgame_CommonLayerOpen(ifrm_url, w, h);
	if(flag) {
		document.getElementById('div_Mgame_ErrorPopup').style.visibility = 'hidden';
	}
}
// ·¹ÀÌ¾î¿ë ¿ÀÇÂ
function Mgame_CommonLayerOpen(ifrm_url, w, h) {

	if(location.href.indexOf('myinfo/friend/friendlist.mgame') <= -1 && location.href.indexOf('_t_regist_exp/regist_F_0003.mgx') <= -1 && location.href.indexOf('_t_regist/regist_F_0003.mgx') <= -1) {
		if(!isIE7()) {
			var a;
			var svn = document.getElementsByTagName("SELECT");
			for (a=0;a<svn.length;a++) {
				svn[a].style.visibility = 'hidden';
				svn[a].style.display = 'none';
			}
		}
	}
	var bw = document.body.scrollWidth;
	var bh = (document.body.scrollHeight < document.body.clientHeight) ? document.body.clientHeight : document.body.scrollHeight;
	if(bh <= 400) bh = 500;
	document.getElementById('div_Mgame_ErrorPopup').style.visibility = 'visible';
	document.getElementById('div_Mgame_ErrorPopup').style.width = bw;
	document.getElementById('div_Mgame_ErrorPopup').style.height = bh;

	bw = document.body.clientWidth;
	bh = document.body.clientHeight;

	var goURL = ifrm_url;
	var strHTML = '<iframe id="iframe_ErrorPopup" name="iframe_ErrorPopup" width="'+w+'" height="'+h+'" src="'+goURL+'" scrolling="no" marginwidth="0" marginheight="0" frameborder="no" allowtransparency="true"></iframe>';

	document.getElementById('div_Mgame_ErrorPopup_msg').innerHTML = strHTML;
	bw = (Math.ceil((bw / 2) - (w / 2)) <= 0) ? 0 : Math.ceil((bw / 2) - (w / 2));
	bh = (Math.ceil((bh / 2) - (h / 2) + document.body.scrollTop) <= 0) ? 0 : Math.ceil((bh / 2) - (h / 2) + document.body.scrollTop);

	if(location.host.indexOf('operation7.mgame.com') > -1 || location.host.indexOf('blog.mgame.com') > -1 || location.host.indexOf('baduk.mgame.com') > -1 || location.host.indexOf('holic.mgame.com') > -1){
		bw = document.documentElement.clientWidth;
		bh = document.documentElement.clientHeight;
		if (bw <= 0){ bw = document.body.clientWidth; }
		if (bh <= 0){ bh = document.body.clientHeight; }
		var topOffset = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
		bw = Math.ceil((bw - w) / 2 ) + 'px';
		bh = Math.ceil((bh - h) / 2  + topOffset) + 'px';
	}

	document.getElementById('div_Mgame_ErrorPopup_msg').style.left = bw;
	document.getElementById('div_Mgame_ErrorPopup_msg').style.top = bh;
	document.getElementById('div_Mgame_ErrorPopup_msg').style.width = w;
	document.getElementById('div_Mgame_ErrorPopup_msg').style.height = h;
	document.getElementById('div_Mgame_ErrorPopup_msg').style.visibility = 'visible';

	if((navigator.appName == 'Microsoft Internet Explorer')) {
		window.attachEvent('onresize' , Mgame_ErrorLayerReLoad);
	} else {
		document.addEventListener('resize' , Mgame_ErrorLayerReLoad, false);
	}

	document.getElementById('div_Mgame_ErrorPopup').style.visibility = 'hidden';
}
// ·¹ÀÌ¾î¿ë À§Ä¡ Á¤¸®
function Mgame_ErrorLayerReLoad() {
	if(document.getElementById('div_Mgame_ErrorPopup_msg').style.visibility == 'visible') {
		var bw = document.body.clientWidth;
		var bh = document.body.clientHeight;
		var w = parseInt(document.getElementById('div_Mgame_ErrorPopup_msg').style.width.replace('px', ''));
		var h = parseInt(document.getElementById('div_Mgame_ErrorPopup_msg').style.height.replace('px', ''));

		if(location.host.indexOf('blog.mgame.com') > -1 || location.host.indexOf('baduk.mgame.com') > -1){
			bw = document.documentElement.clientWidth;
			bh = document.documentElement.clientHeight;
			if (bw <= 0){ bw = document.body.clientWidth; }
			if (bh <= 0){ bh = document.body.clientHeight; }
			var topOffset = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			bw = Math.ceil((bw - w) / 2 ) + 'px';
			bh = Math.ceil((bh - h) / 2  + topOffset) + 'px';
		} else {
			bw = (Math.ceil((bw / 2) - (w / 2)) <= 0) ? 0 : Math.ceil((bw / 2) - (w / 2));
			bh = (Math.ceil((bh / 2) - (h / 2)) <= 0) ? 0 : Math.ceil((bh / 2) - (h / 2));
		}
		document.getElementById('div_Mgame_ErrorPopup_msg').style.left = bw;
		document.getElementById('div_Mgame_ErrorPopup_msg').style.top = bh;
	}
}
// ·¹ÀÌ¾î¿ë ÀÌµ¿
function Mgame_CommonLayerMove(l, t) {
	if(l > 0) {
		document.getElementById('div_Mgame_ErrorPopup_msg').style.left = l;
	}
	if(t > 0) {
		document.getElementById('div_Mgame_ErrorPopup_msg').style.top = t;
	}
}
// ·¹ÀÌ¾î¿ë Ãß°¡ ÀÌµ¿
function Mgame_CommonLayerAddMove(l, t) {
	if(l > 0) {
		document.getElementById('div_Mgame_ErrorPopup_msg').style.left = parseInt(document.getElementById('div_Mgame_ErrorPopup_msg').style.left.replace('px', '')) + l;
	}
	if(t > 0) {
		document.getElementById('div_Mgame_ErrorPopup_msg').style.top = parseInt(document.getElementById('div_Mgame_ErrorPopup_msg').style.top.replace('px', '')) + t;
	}
}
// ·¹ÀÌ¾î¿ë Å¬·ÎÁî
function Mgame_ErrorLayerClose() {
	if(location.href.indexOf('myinfo/friend/friendlist.mgame') <= -1 && location.href.indexOf('_t_regist_exp/regist_F_0003.mgx') <= -1 && location.href.indexOf('_t_regist/regist_F_0003.mgx') <= -1) {
		if(!isIE7()) {
			var a;
			var svn = document.getElementsByTagName("SELECT");
			for (a=0;a<svn.length;a++) {
				svn[a].style.visibility = 'visible';
				svn[a].style.display = '';
			}
		}
	}
	document.getElementById('div_Mgame_ErrorPopup_msg').innerHTML = '';
	document.getElementById('div_Mgame_ErrorPopup_msg').style.visibility = 'hidden';
	document.getElementById('div_Mgame_ErrorPopup').style.visibility = 'hidden';
}
// ·¹ÀÌ¾î¿ë ·¹ÀÌ¾î
document.write('<div id="div_Mgame_ErrorPopup" name="div_Mgame_ErrorPopup" style="filter:alpha(opacity:50);-moz-opacity:0.5;opacity:0.5;z-index:1000;background-color:#000000;position:absolute;visibility:hidden;left:0px;top:0px;width:0px;height:0px;"></div>');
document.write('<div id="div_Mgame_ErrorPopup_msg" name="div_Mgame_ErrorPopup_msg" style="z-index:1100;background-color:transparent;position:absolute;visibility:hidden;left:0px;top:0px;width:0px;height:0px;"></div>');


//	È®ÀÎ,Ãë¼Ò°¡ ÀÖ´Â(Confirm) showModalDialog ÆË¾÷ ¶ç¿ì±â
function Mgame_ConfirmPopupOpen(strsem){
	changeDomain();

	height = 260;

	var arrVerStr = window.navigator.appVersion.split('; ');
	if( arrVerStr.length >= 4 ) {
		var arrIEVer = arrVerStr[1].split(' ');
		if( arrIEVer[1] >= 7.0){
			height=parseInt(height,10)-53;
		}
	}

	var goURL = 'http://www.mgame.com/common_popup/main/mgame_confirm.mgame?sem='+strsem;
	if (window.showModalDialog && location.host.indexOf('mgame.com') != -1) {
		var property ='dialogHeight: '+height+'px; dialogWidth: 340px; edge: Sunken; center: Yes; help: No; resizable: No; status: No; scroll: No;';
		nReturnValue = window.showModalDialog(goURL, window, property);
	} else {
		nReturnValue = confirm(strsem);
	}

	return nReturnValue;
}

//###################################################################
//  UCC ¿ë alert Ã³¸® À§ÇØ
//  iframe À¸·Î »ðÀÔµÈ °¡¿îµ¥ frame¿¡¼­ »ç¿ë
//###################################################################
// ·¹ÀÌ¾î¿ë ¿ÀÇÂ
function uccMgame_ErrorLayerOpen(strec, strsem) {
	uccMgame_CommonLayerOpen('http://www.mgame.com/common_popup/main/mgame_message.mgame?ec='+strec+'&sem='+strsem+'&et=layer', 350, 260);
	document.getElementById('div_Mgame_ErrorPopup').style.visibility = 'hidden';
}

// ·¹ÀÌ¾î¿ë ¿ÀÇÂ
function uccMgame_CommonLayerOpen(ifrm_url, w, h) {
	if(!isIE7()) {
		var a;
		var svn = document.getElementsByTagName("SELECT");
		for (a=0;a<svn.length;a++) {
			svn[a].style.visibility = 'hidden';
		}
	}

	var goURL = ifrm_url;
	var strHTML = '<iframe id="iframe_ErrorPopup" name="iframe_ErrorPopup" width="'+w+'" height="'+h+'" src="'+goURL+'" scrolling="no" marginwidth="0" marginheight="0" frameborder="no" allowtransparency="true"></iframe>';
	document.getElementById('div_Mgame_ErrorPopup_msg').innerHTML = strHTML;
	document.getElementById('div_Mgame_ErrorPopup_msg').style.left = 50;
	document.getElementById('div_Mgame_ErrorPopup_msg').style.top = 100
	document.getElementById('div_Mgame_ErrorPopup_msg').style.width = w;
	document.getElementById('div_Mgame_ErrorPopup_msg').style.height = h;
	document.getElementById('div_Mgame_ErrorPopup_msg').style.visibility = 'visible';
	if((navigator.appName == 'Microsoft Internet Explorer')) {
		window.attachEvent('onresize' , Mgame_ErrorLayerReLoad);
	} else {
		document.addEventListener('resize' , Mgame_ErrorLayerReLoad, false);
	}
}

//###################################################################
//  ÀÌº¥Æ®±Ô¾à °øÅë ·¹ÀÌ¾î Ãß°¡ : wjk(090218)
//###################################################################
// ·¹ÀÌ¾î¿ë ¿ÀÇÂ
function Mgame_EventRuleLayerOpen() {
	var ifrm_url = '/common_lib/event_rule.mgame';
	var w = '570';
	var h = '700';
	Mgame_CommonLayerOpen(ifrm_url, w, h);
}

//###################################################################
// ¼³ ¸í : MOADAL DIALOG
//###################################################################
function MSG_MODALDIALOG(poptype,message,height){
	changeDomain();

	var nReturnValue = false;
	var f_width = "280";
	var f_height = height;
	var url = "http://www.mgame.com/common_lib/modaldialog.mgame?poptype="+poptype+"&msg="+message;

	var arrVerStr = window.navigator.appVersion.split('; ');
	if( arrVerStr.length >= 4 ) {
		var arrIEVer = arrVerStr[1].split(' ');
		if( arrIEVer[1] >= 7.0){
			f_width="273";
			f_height=parseInt(height,10)-53;
		}
	}
	if (window.showModalDialog) {
		if(poptype == "confirm" &&(location.host.indexOf('mgame.com')== -1)){
			nReturntemp = confirm(message);
			if(nReturntemp == true){
				nReturnValue = "true";
			}
		}else {
			var property ='dialogWidth:'+f_width+'px;dialogHeight:'+f_height+'px;'+'scroll:no;resizable:no;help:no;center:yes;status:no;edge:sunken;unadorned:yes;';
			nReturnValue = window.showModalDialog(url, window, property);
		}
	}else {
		if(poptype == "confirm"){
			nReturnValue = confirm(message);
			if(nReturntemp == true){
				nReturnValue = "true";
			}
		}else {
			var property = 'left=200,top=100,height='+parseInt(f_height-55,10)+',width=272,toolbar=no,directories=no,status=no,linemenubar=no,scrollbars=no,resizable=no,modal=yes,dependent=yes';
			window.open(url, 'msg_modeless', property);
		}
	}
	return nReturnValue;
}

//###################################################################
// ¼³ ¸í : GUEST USER ¼­ºñ½ºÁ¦ÇÑ ÆË¾÷
//###################################################################
function GUEST_POPUP(reqtype){
	changeDomain();
	//billing : À¯·á°áÁ¦ Á¦ÇÑ
	//billing_pop : À¯·á°áÁ¦ Á¦ÇÑ ÆË¾÷ÀÏ °æ¿ì window.openÀÌ ¾Æ´Ï¶ó location
	//gamestart : °ÔÀÓ½ÇÇà Á¦ÇÑ
	//default : ¼­ºñ½º Á¦ÇÑ
	//default_pop : ¼­ºñ½º Á¦ÇÑ  ÆË¾÷ÀÏ °æ¿ì

	if(reqtype != "billing" &&  reqtype != "gamestart" &&  reqtype != "billing_pop" &&  reqtype != "default_pop"){
		reqtype = "default";
	}
	var url = "http://www.mgame.com/member/guest_msg_window.mgame?reqtype="+reqtype;

	if(reqtype == "billing_pop" || reqtype == "default_pop"){
		//location.href=url;
	}else {
		var property = 'left=200,top=100,width=400,height=515,toolbar=no,directories=no,status=no,linemenubar=no,scrollbars=no,resizable=no,modal=yes,dependent=yes';
		window.open(url, 'guest_pop', property);
	}
}

function GUEST_POPUP2(reqtype){
	changeDomain();
	//billing : À¯·á°áÁ¦ Á¦ÇÑ
	//billing_pop : À¯·á°áÁ¦ Á¦ÇÑ ÆË¾÷ÀÏ °æ¿ì window.openÀÌ ¾Æ´Ï¶ó location
	//gamestart : °ÔÀÓ½ÇÇà Á¦ÇÑ
	//default : ¼­ºñ½º Á¦ÇÑ
	//default_pop : ¼­ºñ½º Á¦ÇÑ  ÆË¾÷ÀÏ °æ¿ì

	if(reqtype != "billing" &&  reqtype != "gamestart" &&  reqtype != "billing_pop" &&  reqtype != "default_pop"){
		reqtype = "default";
	}

	var url = "http://www.mgame.com/member/guest_msg.mgame?reqtype="+reqtype;

	if(reqtype == "billing_pop" || reqtype == "default_pop"){
		//location.href=url;
	}else {
		Mgame_CommonLayerOpen_trans(url, 450, 590, true);
	}
}
//###################################################################
// ¼³ ¸í : À©µµ¿ì ¸®»çÀÌÁî (¸ðµç ºê¶ó¿ìÀú¿¡ Àû¿ë)
//###################################################################
function winResize() {

	var Dwidth = parseInt(document.body.scrollWidth);
	var Dheight = parseInt(document.body.scrollHeight);
	var divEl = document.createElement("div");
	divEl.style.position = "absolute";
	divEl.style.left = "0px";
	divEl.style.top = "0px";
	divEl.style.width = "100%";
	divEl.style.height = "100%";

	document.body.appendChild(divEl);
	window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);
	document.body.removeChild(divEl);

}

//###################################################################
// ¼³ ¸í : AXAX XMLHttpRequest OBJECT
//###################################################################
function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
		if (xmlHttp.overrideMimeType) {
			xmlHttp.overrideMimeType("text/xml");
		}
	}

	return xmlHttp;
}

//startRequest parameter
//method	:Àü¼Û¹æ½Ä
//pUrl		:È£ÃâÇÑ ÆäÀÌÁö ÁÖ¼Ò
//openmode	:¿ÀÇÂ¸ðµå
//sendmode	:Àü¼ÛÆÄ¶ó¹ÌÅÍ
//handleFunctionName : handlestatechange ÇÔ¼ö¸í
function startRequest(method,pURL,opendmode,sendmode,handleFunctionName) {
	try{
		xmlHttp = createXMLHttpRequest();
		xmlHttp.onreadystatechange = eval(handleFunctionName);
		xmlHttp.open(method, pURL, opendmode);
		xmlHttp.send(sendmode);
	}catch(e){
		//alert("startRequest " + e.discription);
	}
}

/*****************************************************
ÇÔ ¼ö ¸í : ajaxRequest
ÀÛ ¼º ÀÚ : ¹Ú ¼º¿í (yarikuri@mgame.com)
*****************************************************/
function ajaxRequest(div,actionfile,param,xml) {
	var ajax		=	createXMLHttpRequest();

	ajax.open("POST",actionfile,false);
	ajax.setRequestHeader("content-type","application/x-www-form-urlencoded");
	ajax.send(param);

	if(ajax == null){
		alert("AJAX NOT SUPPORT.");
		history.back();
	}

	if(xml) {
		eval(div+"(ajax)");
	} else {
		if(!div) return;

		document.getElementById(div).innerHTML	=	ajax.responseText;
	}
}

function isIE() {
 return (navigator.appName == 'Microsoft Internet Explorer') ? true : false;
}

// IE7 Ã¼Å©
function isIE7() {
	var flag = false;
	if(isIE()) {
		var arrVerStr = window.navigator.appVersion.split('; ');
		if( arrVerStr.length >= 4 ) {
			var arrIEVer = arrVerStr[1].split(' ');

			if( arrIEVer[1] >= 7.0){
				flag = true;
			}
		}
	}
	return flag;
}

function addEvent(obj, ev, fnc) {
 if(isIE()) {
  obj.attachEvent(ev , fnc);
 } else {
  ev = ev.replace('on', '');
  obj.addEventListener(ev , fnc, false);
 }
}

//###################################################################
// ¼³ ¸í : ÀÌ¹ÌÁö ¸¶¿ì½º¿À¹ö ÇÔ¼öµé
//###################################################################
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//###################################################################
// ¼³ ¸í : ¿À¸¥ÂÊ ¸¶¿ì½º Å¬¸¯ ±ÝÁö
//###################################################################

function returnEventFalse() {
	event.returnValue = false;
}

function returnEventTrue() {
	event.returnValue = true;
}

function returnEventStatus() {
	window.status=("::: MGame :::");
	return true;
}

var webServerName = location.host;

document.onmouseover	= returnEventStatus;
document.onmouseout		= returnEventStatus;

if (webServerName == "newbeta.mgame.com")
{
	document.oncontextmenu	= returnEventTrue;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "online.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventFalse;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "pub.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventFalse;
	document.onselectstart	= returnEventTrue;
}
//2006025 ±îÆä º¯°æ ±âÁØ
else if (webServerName == "cafe.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
//20070111 ±îÆä º¯°æ ±âÁØ
else if (webServerName == "club.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
//20060304 Áö½Ä º¯°æ ±âÁØ
else if (webServerName == "know.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "premium.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventFalse;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "holic.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "sign.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "clan.mgame.com")
{
	document.oncontextmenu	= returnEventTrue;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "lapis2008.mgame.com")
{
	document.oncontextmenu	= returnEventTrue;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "legue.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventFalse;
	document.onselectstart	= returnEventFalse;
}
// mg´Â ¸ðµÎ ¸¶¿ì½º ÀÌº¥Æ® Á¦°Å - 2007.09.13 ¹Ú ¼º¿í
else if (webServerName != "mgame.com" && webServerName.substr(0,2) == "mg")
{
	document.oncontextmenu	= returnEventTrue;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;

}
else if (webServerName == "blog.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventFalse;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "auction.mgame.com")
{
	document.oncontextmenu	= returnEventTrue;
	document.ondragstart	= returnEventTrue;
	document.onselectstart	= returnEventTrue;
}
else if (webServerName == "guild.mgame.com")
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventFalse;
	document.onselectstart	= returnEventTrue;
}

else
{
	document.oncontextmenu	= returnEventFalse;
	document.ondragstart	= returnEventFalse;
	document.onselectstart	= returnEventFalse;
}

// µµ¸ÞÀÎ º¯°æ - 20090428 (¼Û´ö¿ë ÆÀÀå´Ô~¤»¤»)
function changeDomain()
{
	strhostname = location.host;

	if(location.host.indexOf("daum.net") > 0){
		document.domain		=	"daum.net";
	} else if(location.host.indexOf("hangame.com") > 0){
		document.domain		=	"hangame.com";
	}else{
		currentDomain = strhostname.substring(strhostname.indexOf(".")+1);
		document.domain = currentDomain;
	}
	
	return;
}
