document.write("<div id='ITEMMANIA_g_pt_topLine'></div>");document.write("<div id='ITEMMANIA_g_pt_BG' style='_margin-left:14px;'>");document.write("	<div id='ITEMMANIA_g_pt_HEAD' style='_margin:0 auto;'>");document.write("		<ul>");document.write("			<li id='ITEMMANIA_pt_TOP_LEFT'></li>");document.write("			<li id='ITEMMANIA_pt_TOP_MIDDLE'>");document.write("				<div class='g_left'><div class='ITEMMANIA_logo_top'></div><a href='http://www.itemmania.com'><img src='http://www.itemmania.com/images/portal/sub/sub/top/s_newlogo.gif' width='99' height='47' alt='¾ÆÀÌÅÛ¸Å´Ï¾Æ' /></a><div id='subMenuImage'></div></div>");document.write("				<div id='ITEMMANIA_pt_TOP_MENU'>");document.write("					<ul id='ITEMMANIA_pt_TOP_INFO'>");document.write("						<li onmouseover='fnMyinfo(0);' onmouseout='fnMyinfo(1);' style='cursor:pointer;'>³»°áÁ¦Á¤º¸</li>");document.write("						<li class='g_img' onmouseover='fnMyinfo(0);' onmouseout='fnMyinfo(1);' style='cursor:pointer;'><img src='http://www.itemmania.com/images/portal/_head/arrow.gif' width='13' height='12' /></li>");document.write("						<li class='g_sky'><a href='http://www.itemmania.com/portal/myzone/'>¸¶ÀÌÁ¸</a></li>");document.write("						<li><a href='http://www.itemmania.com/portal/center/'>°í°´°¨µ¿¼¾ÅÍ</a></li>");document.write("						<li><a href='http://www.itemmania.com/portal/center/event/index.html?state=ing'>ÀÌº¥Æ®</a></li>");document.write("						<li><a href='http://www.itemmania.com/portal/center/m_mileageshop'>M¸¶ÀÏ¸®Áö</a></li>");document.write("					</ul>");document.write("					<div id='g_MY_INFO_EDIT' class='g_box3' onmouseover='fnMyInfoEdit(0);' onmouseout='fnMyInfoEdit(1)'>");document.write("					<div class='top_left' id='ITEMMANIA_TOP_LEFT2'></div><div class='top_right' id='ITEMMANIA_TOP_RIGHT2'></div><div class='top'></div>");document.write("					<div class='content'>");document.write("						<ul>");document.write("							<li><a href='http://www.itemmania.com/portal/myzone/myinfo/myinfo_check.html'>È¸¿øÁ¤º¸¼öÁ¤</a></li>");document.write("							<li class='g_last'><a href='http://www.itemmania.com/portal/myzone/myinfo/myinfo_passwd_modify.html'>ºñ¹Ð¹øÈ£¼öÁ¤</a></li>");document.write("						</ul>");document.write("					</div>");document.write("					<div class='bottom'></div><div class='bottom_left' id='ITEMMANIA_BTM_LEFT2'></div><div class='bottom_right' id='ITEMMANIA_BTM_RIGHT2'></div>");document.write("				</div>");document.write("					<div id='g_SUB_SETTLE_INFO' class='g_box3' onmouseover='fnMyinfo(0);' onmouseout='fnMyinfo(1);'>");document.write("						<div class='top_left' id='ITEMMANIA_TOP_LEFT'></div><div class='top_right' id='ITEMMANIA_TOP_RIGHT'></div><div class='top'></div>");document.write("						<div class='content'>");document.write("							<ul>");document.write("								<li><a href='javascript:fnIpointSave();'>i-POINT ÃæÀü</a></li>");document.write("								<li><a href='http://www.itemmania.com/portal/myzone/point/index.html'>i-POINT ÃæÀü³»¿ª</a></li>");document.write("								<li><a href='http://www.itemmania.com/portal/myzone/point/point_used.html'>i-POINT »ç¿ë³»¿ª</a></li>");document.write("								<li><a href='#' onclick=javascript:fnMileageSave('');>¸¶ÀÏ¸®Áö ÃæÀü</a></li>");document.write("								<li class='g_last'><a href='http://www.itemmania.com/portal/myzone/mileage/index.html'>¸¶ÀÏ¸®Áö º¯µ¿³»¿ª</a></li>");document.write("							</ul>");document.write("						</div>");document.write("						<div class='bottom'></div><div class='bottom_left' id='ITEMMANIA_BTM_LEFT'></div><div class='bottom_right' id='ITEMMANIA_BTM_RIGHT'></div>");document.write("					</div>");document.write("					<ul id='ITEMMANIA_pt_TOP_JOIN'>");document.write("						<li class='g_first_btn'><a href='javascript:login();'><img src='http://www.itemmania.com/images/portal/_head/btn_login.gif' width='43' height='19' border='0' /></a></li>");document.write("						<li class='g_first'><a href='http://www.itemmania.com/portal/user/'>È¸¿ø°¡ÀÔÇÏ±â</a></li>");document.write("						<li><a href='http://www.itemmania.com/portal/user/lose/find_form.html'>¾ÆÀÌµð</a>/<a href='http://www.itemmania.com//portal/user/lose/find_form_pw.html'>ºñ¹øÃ£±â</a></li>");document.write("					</ul>");document.write("				</div>");document.write("				<div class='g_finish'></div>");document.write("				<ul id='ITEMMANIA_pt_FAV'>");document.write("					<li onclick='fnFavorite();'><img src='http://www.itemmania.com/images/portal/_head/menu_fav.gif' width='125' height='10' alt='Áñ°ÜÃ£±â' id='g_FAVORITE' /></li>");document.write("					<li onclick='fnStartHome();'><img src='http://www.itemmania.com/images/portal/_head/menu_home.gif' width='74' height='10' alt='½ÃÀÛÆäÀÌÁö·Î' id='g_STARTPAGE' /></li>");document.write("				</ul>");document.write("				<ul id='ITEMMANIA_pt_M_MENU'>");document.write("					<li class='g_first'><a href='http://trade.itemmania.com/'><img src='http://www.itemmania.com/images/portal/_head/menu_itemmania.gif' width='80' height='17' alt='¾ÆÀÌÅÛ¸Å´Ï¾Æ' /></a></li>");document.write("					<li><a href='http://www.gamemania.co.kr' target='_blank'><img src='http://www.itemmania.com/images/portal/_head/menu_gamemania.gif' width='66' height='17' alt='°ÔÀÓ¸Å´Ï¾Æ' /></a></li>");document.write("					<li><a href='http://giftcard.itemmania.com/portal/giftcard/'><img src='http://www.itemmania.com/images/portal/_head/menu_gift.gif' width='56' height='17' alt='»óÇ°±Ç¸ô' /></a></li>");document.write("					<li><a href='http://gamecash.itemmania.com/portal/cashitem/'><img src='http://www.itemmania.com/images/portal/_head/menu_cash.gif' width='37' height='17' alt='°ÔÀÓ¸ô' /></a></li>");document.write("					<li><a href='http://auction.itemmania.com/portal/maniaauction/'><img src='http://www.itemmania.com/images/portal/_head/menu_auction_01.gif' width='74' height='17' alt='¸Å´Ï¾Æ¿Á¼Ç' /></a></li>");document.write("					<li><a href='http://zone.itemmania.com/portal/maniazone/'><img src='http://www.itemmania.com/images/portal/_head/menu_zone_01.gif' width='62' height='17' alt='¸Å´Ï¾ÆÁ¸' /></a></li>");document.write("					<li><a href='http://www.itemmania.com/counter/survey.php?imcounter=banner_combn_BrandadMzinetitle' target='_blank'><img src='http://www.itemmania.com/images/portal/_head/menu_mcommunity.gif' width='61' height='17' alt='MÄ¿¹Â´ÏÆ¼' /></a></li>");document.write("				</ul>");document.write("			</li>");document.write("			<li id='ITEMMANIA_pt_TOP_RIGHT'></li>");document.write("		</ul>");document.write("		<div class='g_finish'></div>");document.write("	</div>");document.write("</div>");var domain = document.domain;

var _BROWSER = {
	name: (navigator.appName.indexOf('Explorer')!=-1) ? 'explorer' : navigator.appName.toLowerCase(),
	version: parseInt((navigator.appName.indexOf('Explorer')!=-1) ? navigator.appVersion.split(';')[1].replace('MSIE','') : navigator.appVersion.substr(0,navigator.appVersion.indexOf('(')))
};

switch(domain)
{
	case "music.itemmania.com" :case "music.newitemmania.net" :
		location.href='http://vod.itemmania.com/';
		break;

	case "vod.itemmania.com" :case "vod.newitemmania.net" :
		_headImage(1);
		break;

	case "manhwa.itemmania.com" :case "manhwa.newitemmania.net" :
		location.href='http://vod.itemmania.com/';
		break;

	case "fortune.itemmania.com" :case "fortune.newitemmania.net" :
		location.href='http://vod.itemmania.com/';
		break;

	case "song.itemmania.com" :case "song.newitemmania.net" :
		location.href='http://vod.itemmania.com/';
		break;

	case "thiat.itemmania.com": case "thiat.newitemmania.net" :		//°íÀçÃá ´ë¸®´Ô ¿äÃ» ÀÛ¾÷
		document.getElementById("ITEMMANIA_TOP_LEFT").style.marginLeft='0px';
		document.getElementById("ITEMMANIA_TOP_RIGHT").style.marginLeft='-10px';
		document.getElementById("ITEMMANIA_BTM_LEFT").style.marginLeft='0px';
		document.getElementById("ITEMMANIA_BTM_RIGHT").style.marginLeft='-10px';

		document.getElementById("ITEMMANIA_TOP_LEFT2").style.marginLeft='0px';
		document.getElementById("ITEMMANIA_TOP_RIGHT2").style.marginLeft='-10px';
		document.getElementById("ITEMMANIA_BTM_LEFT2").style.marginLeft='0px';
		document.getElementById("ITEMMANIA_BTM_RIGHT2").style.marginLeft='-10px';
		if(Math.floor(navigator.appVersion.split(';')[1].replace('MSIE','')) < 8)
		{
			document.getElementById("ITEMMANIA_TOP_RIGHT").style.marginLeft='-9px';
			document.getElementById("ITEMMANIA_BTM_RIGHT").style.marginLeft='-9px';
			document.getElementById("ITEMMANIA_TOP_RIGHT2").style.marginLeft='-9px';
			document.getElementById("ITEMMANIA_BTM_RIGHT2").style.marginLeft='-9px';
		}
		_headImageS();
	break;

	default :
		_headImageS();
	break;
}

function _headImageS()
{
	var url			= document.URL;
	var parentNode	= document.getElementById("subMenuImage");//$("subMenuImage");

	var A			= document.createElement('A');
	var IMG			= document.createElement('IMG');

	if(url.indexOf("http://"+domain+"/portal/myzone/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/myzone/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_myzone.gif');
		IMG.setAttribute('width','69');
		IMG.setAttribute('height','25');

	}
	else if(url.indexOf("http://"+domain+"/portal/center/") == 0 || url.indexOf("http://"+domain+"/portal/customer/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/center/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_center.gif');
		IMG.setAttribute('width','125');
		IMG.setAttribute('height','25');

	}
	else if(url.indexOf("http://"+domain+"/portal/giftcard/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/giftcard/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_gift.gif');
		IMG.setAttribute('width','82');
		IMG.setAttribute('height','25');

	}
	else if(domain == "thiat.itemmania.com" )
	{
		A.setAttribute('href',"http://giftcard.itemmania.com/portal/giftcard/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://giftcard.itemmania.com/images/portal/sub/top/t_gift.gif');
		IMG.setAttribute('width','82');
		IMG.setAttribute('height','25');
	}
	else if(domain == "thiat.newitemmania.net" )
	{
		A.setAttribute('href',"http://giftcard.newitemmania.net/portal/giftcard/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://giftcard.newitemmania.net/images/portal/sub/top/t_gift.gif');
		IMG.setAttribute('width','82');
		IMG.setAttribute('height','25');
	}
	else if(url.indexOf("http://"+domain+"/portal/cashitem/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/cashitem/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_cash.gif');
		IMG.setAttribute('width','63');
		IMG.setAttribute('height','25');
	}
	else if(url.indexOf("http://"+domain+"/portal/itemmall/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/itemmall/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_cash.gif');
		IMG.setAttribute('width','63');
		IMG.setAttribute('height','25');
	}
	else if(url.indexOf("http://"+domain+"/portal/freeitem/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/freeitem/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_cash.gif');
		IMG.setAttribute('width','63');
		IMG.setAttribute('height','25');
	}
	else if(url.indexOf("http://"+domain+"/portal/maniaauction/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/maniaauction/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_auction.gif');
		IMG.setAttribute('width','103');
		IMG.setAttribute('height','25');
		$('g_MY_INFO_EDIT').style.top = '15px';
		$('g_SUB_SETTLE_INFO').style.top = '15px';
	}
	else if(url.indexOf("http://"+domain+"/portal/maniazone/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/maniazone/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_zone.gif');
		IMG.setAttribute('width','81');
		IMG.setAttribute('height','25');
		IMG.setAttribute('alt','¸Å´Ï¾ÆÁ¸');
	}
	else if(url.indexOf("http://"+domain+"/portal/game_info/") == 0)
	{
		A.setAttribute('href',"http://"+domain+"/portal/game_info/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://'+domain+'/images/portal/sub/top/t_info.gif');
		IMG.setAttribute('width','84');
		IMG.setAttribute('height','25');
		IMG.setAttribute('alt','°ÔÀÓÁ¤º¸');
	}

	parentNode.appendChild(IMG);
	A.appendChild(IMG);
	parentNode.appendChild(A);

	if(url.indexOf("http://"+domain+"/portal/maniazone/") == 0)
	{
		//parentNode.removeChild(A);		// ¸Å´Ï¾ÆÁ¸ÀÏ¶§´Â »ý¼ºÇÑ IMG ¿¤¸®¸ÕÆ®¸¦ »èÁ¦ÇÑ´Ù.
		_headImage(999)
	} else if(url.indexOf("http://"+domain+"/portal/user/") == 0) {
		parentNode.removeChild(A);		// ±âÅ¸ IMG ¿¤¸®¸ÕÆ® »èÁ¦
	} else if(url.indexOf("http://"+domain+"/portal/guide/") == 0) {
		parentNode.removeChild(A);		// ±âÅ¸ IMG ¿¤¸®¸ÕÆ® »èÁ¦
	} else if(url.indexOf("http://"+domain+"/portal/company/") == 0) {
		parentNode.removeChild(A);		// ±âÅ¸ IMG ¿¤¸®¸ÕÆ® »èÁ¦
	} else if(url.indexOf("http://"+domain+"/portal/campaign/") == 0) {
		parentNode.removeChild(A);		// ±âÅ¸ IMG ¿¤¸®¸ÕÆ® »èÁ¦
	}
}

function _headImage(host)
{
	var parentNode	= document.getElementById("subMenuImage");
	var SmallImage	= new Array('t_s_movie');		//³ë·¡¹æ Ãß°¡
	var SmallUrl	= new Array('http://vod.itemmania.com');

	if(host == 999)
	{
		nState = 0;
		for(nIndex=0; nIndex < SmallImage.length; nIndex++)
		{
			var A = document.createElement('A');
			A.setAttribute('href',SmallUrl[nIndex]);
			A.setAttribute('target','_self');

			var IMG	= document.createElement('IMG');
			IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/'+SmallImage[nIndex]+'.gif');
			if (SmallImage[nIndex] == 't_s_song')		//³ë·¡¹æ ÀÌ¹ÌÁö Å©±â°¡ ´Þ¶ó ÀÌ¹ÌÁö »çÀÌÁî ÁÖ±â
			{
				IMG.setAttribute('width','43');
				IMG.setAttribute('height','25');
			}
			else
			{
				IMG.setAttribute('width','29');
				IMG.setAttribute('height','25');
			}
			if(nState == 0)
			{
				IMG.setAttribute('id','first');
			}
			A.appendChild(IMG);
			parentNode.appendChild(A);
			if(nState < SmallImage.length-1)
			{
				var IMG	= document.createElement('IMG');
				IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/s_t_line.gif');
				IMG.setAttribute('width','1');
				IMG.setAttribute('height','25');
				parentNode.appendChild(IMG);
			}

			nState++;
		}
	}
	else
	{
		var A	= document.createElement('A');
		var IMG	= document.createElement('IMG');
		A.setAttribute('href',"http://zone.itemmania.com/portal/maniazone/");
		A.setAttribute('target','_self');
		IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/t_zone.gif');
		IMG.setAttribute('width','81');
		IMG.setAttribute('height','25');
		IMG.setAttribute('alt','¸Å´Ï¾ÆÁ¸');

		A.appendChild(IMG);
		parentNode.appendChild(A);


		/* ¡å ¿µÈ­ */
		var A = document.createElement('A');
		A.setAttribute('href','http://vod.itemmania.com');
		A.setAttribute('target','_self');

		strImgName = (host == 1) ? "t_s_movie_on" : "t_s_movie";

		var IMG		= document.createElement('IMG');
		IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/'+strImgName+'.gif');
		IMG.setAttribute('width','29');
		IMG.setAttribute('height','25');
		IMG.setAttribute('alt','¿µÈ­');

		A.appendChild(IMG);
		parentNode.appendChild(A);
		/* ¡ã ¿µÈ­ */

		/* ¡å ¸¸È­ Á¦°Å By ¹éÁ¾ÀÏ (2010/12/30) */
//		var IMG	= document.createElement('IMG');
//		IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/s_t_line.gif');
//		IMG.setAttribute('width','1');
//		IMG.setAttribute('height','25');
//		parentNode.appendChild(IMG);
//
//		/* ¡å ¸¸È­ */
//		var A = document.createElement('A');
//		A.setAttribute('href','http://manhwa.itemmania.com');
//		A.setAttribute('target','_self');
//
//		strImgName = (host == 2) ? "t_s_cartoon_on" : "t_s_cartoon";
//
//		var IMG		= document.createElement('IMG');
//		IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/'+strImgName+'.gif');
//		IMG.setAttribute('width','29');
//		IMG.setAttribute('height','25');
//		IMG.setAttribute('alt','¸¸È­');
//
//		A.appendChild(IMG);
//		parentNode.appendChild(A);
//		/* ¡ã ¸¸È­ */
		/* ¡ã ¸¸È­ Á¦°Å By ¹éÁ¾ÀÏ (2010/12/30) */

//		var IMG	= document.createElement('IMG');
//		IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/s_t_line.gif');
//		IMG.setAttribute('width','1');
//		IMG.setAttribute('height','25');
//		parentNode.appendChild(IMG);
//
//		/* ¡å ¿î¼¼ */
//		var A = document.createElement('A');
//		A.setAttribute('href','http://fortune.itemmania.com');
//		A.setAttribute('target','_self');
//
//		strImgName = (host == 3) ? "t_s_fortune_on" : "t_s_fortune";
//
//		var IMG		= document.createElement('IMG');
//		IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/'+strImgName+'.gif');
//		IMG.setAttribute('width','29');
//		IMG.setAttribute('height','25');
//		IMG.setAttribute('alt','¿î¼¼');
//
//		A.appendChild(IMG);
//		parentNode.appendChild(A);
//		/* ¡ã ¿î¼¼ */
//
//		var IMG	= document.createElement('IMG');
//		IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/s_t_line.gif');
//		IMG.setAttribute('width','1');
//		IMG.setAttribute('height','25');
//		parentNode.appendChild(IMG);
//
//		/* ¡å ³ë·¡¹æ */
//		var A = document.createElement('A');
//		A.setAttribute('href','http://song.itemmania.com');
//		A.setAttribute('target','_self');
//
//		strImgName = (host == 4) ? "t_s_song_on" : "t_s_song";
//
//		var IMG		= document.createElement('IMG');
//		IMG.setAttribute('src','http://www.itemmania.com/images/portal/sub/top/'+strImgName+'.gif');
//		IMG.setAttribute('width','43');
//		IMG.setAttribute('height','25');
//		IMG.setAttribute('alt','³ë·¡¹æ');
//
//		A.appendChild(IMG);
//		parentNode.appendChild(A);
//		/* ¡ã ³ë·¡¹æ */

	}
}

function login()
{
	var User_Referer = document.URL;
	window.open('http://www.itemmania.com/portal/user/login_form.html?returnUrl='+User_Referer,'login', 'height=564,width=330, status=no,toolbar=no,menubar=no,location=no,fullscreen=no,scrollbars=no,resizable=no,titlebar=no');
}

function id_find()
{
	var User_Referer = document.URL;
	window.open('http://www.itemmania.com/portal/user/lose/id_find_form.html?returnUrl='+User_Referer,'id_find', 'height=412,width=350, status=no,toolbar=no,menubar=no,location=no,fullscreen=no,scrollbars=no,resizable=no,titlebar=no');
}

function pw_find()
{
	var User_Referer = document.URL;
	window.open('http://www.itemmania.com/portal/user/lose/pw_find_form.html?returnUrl='+User_Referer,'pw_find', 'height=412,width=350, status=no,toolbar=no,menubar=no,location=no,fullscreen=no,scrollbars=no,resizable=no,titlebar=no');
}

function fnMyinfo(type)
{
	var bUserBrowserSize	= (document.documentElement.clientWidth > 0) ? document.documentElement.clientWidth : document.body.clientWidth;
	var bStartContentsSize	= (bUserBrowserSize > 879) ? Math.floor((bUserBrowserSize-880) / 2) : 0;
	var Ele					= document.getElementById('g_SUB_SETTLE_INFO');

	if(type == 0)
	{
		Ele.style.left		= (bStartContentsSize+555)+'px';
		//Ele.style.left		= '730px';
		Ele.style.display	= 'block';
	}
	else
	{
		Ele.style.display	= 'none';
	}
}

function fnIpointSave()
{
	var User_Referer = document.URL;
	window.open('http://www.itemmania.com/portal/myzone/point/charge/_charge.html?page=onlydbank&returnUrl='+User_Referer,'auto', 'height=640,width=520, status=no,toolbar=no,menubar=no,location=no,fullscreen=no,scrollbars=no,resizable=no,titlebar=no');
}

function fnMileageSave(id)
{
	var User_Referer = document.URL;
	window.open('http://www.itemmania.com/myroom/mileage/charge/realaccount.html?returnUrl='+User_Referer,'mileage_charge_'+id, 'height=640,width=681, status=no,toolbar=no,menubar=no,location=no,fullscreen=no,scrollbars=no,resizable=no,titlebar=no');
}

function fnMyInfoEdit(type)
{
	var bUserBrowserSize	= (document.documentElement.clientWidth > 0) ? document.documentElement.clientWidth : document.body.clientWidth;
	var bStartContentsSize	= (bUserBrowserSize > 879) ? Math.floor((bUserBrowserSize-880) / 2) : 0;
	var Ele					= document.getElementById('g_MY_INFO_EDIT');

	if(type == 0)
	{
		Ele.style.left		= (bStartContentsSize+475)+'px';
		//Ele.style.left		= '646px';
		Ele.style.display	= 'block';
	}
	else
	{
		Ele.style.display	= 'none';
	}
}

// Áñ°ÜÃ£±â
function fnFavorite()
{
	var strTitle= "¢º ¾ÆÀÌÅÛ¸Å´Ï¾Æ ¢¸";

	if(_BROWSER.name == 'explorer')
	{
		window.external.AddFavorite(window.location.href,strTitle)
	}
	else
	{
		window.sidebar.addPanel(strTitle, window.location.href,"")
	}
}

// ½ÃÀÛÆäÀÌÁö
function fnStartHome()
{
	var startpage = document.getElementById("g_STARTPAGE");
	startpage.style.behavior='url(#default#homepage)';
	startpage.setHomePage('http://www.itemmania.com/');
}

function fnwindowopen(name,url,width,height,policy,info)
{
	name = name.replace(/[^a-zA-Z0-9_]/g,'');
	var strPolicy = 'height='+height+',width='+width;
	strPolicy += (!policy) ? 'status=no,toolbar=no,menubar=no,location=no,fullscreen=no,scrollbars=no,resizable=no,titlebar=no' : (','+policy);

	var popup = window.open(url,name,strPolicy);
	if(popup)
	{
		this.center(popup,width,height);
		popup.focus();
		if(info) { return popup }
	}
}


/* ¡å e090929 Ãß¼® ÀÌº¥Æ® */
/* ¡å AJAX */
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;
	}
}
/* ¡ã AJAX */

function e_gift_ricecake(){
	var check1	=	document.getElementById('definemode').value;
	if(check1 == 1 ){
		var loginurl	=	document.getElementById('loginurl').value;
		alert('·Î±×ÀÎ ÈÄ ÀÌ¿ëÇÏ¼¼¿ä');
		var url = "http://www.itemmania.com/portal/user/login_form.html?returnUrl=http://www.itemmania.com/portal/center/event/view.html?linkurl=e090929_chuseok/index.html&all=t&all=t";
		fnwindowopen('login',url,500,500);
		return;
	}

	var frm = document.getElementById("e090929Frm_1");
	var paramsValues = "gkey="+document.getElementById('gKeyS').value;

	/* ¡å AJAX SOCKET */
	httpRequest = getXMLHttpRequest();

	httpRequest.open("POST", "http://www.itemmania.com/portal/center/event/event_ing/e090929_chuseok/gift_item.php", true);
	httpRequest.setRequestHeader("Accept-Language","ko");
	httpRequest.setRequestHeader("Content-Encoding","UTF-8");
	httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	httpRequest.onreadystatechange = receive_Gift;
	httpRequest.send(paramsValues);
	/* ¡ã AJAX SOCKET */
}

function receive_Gift()
{
	if(httpRequest.readyState == 4)
	{
		if(httpRequest.status == 200)
		{
			var returnData = httpRequest.responseText.split(";");

			document.getElementById("div_e090929_1").style.display="none";

			//alert(returnData);
			if(returnData[0] == "true")
			{
				if(confirm("¿À¿¹~! ¼ÛÆí1°³ È¹µæ!! \n\nÀÌº¥Æ® ÆäÀÌÁö¿¡¼­ È®ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
				{
					location.href=returnData[2];
				}
			}
			else
			{
				alert(returnData[1]);
			}
		}
		else
		{
			alert("°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ¼¼¿ä");
		}
	}
}


 function e_gift_moon(){
	var check1	=	document.getElementById('definemode').value;
	if(check1 == 1 ){
		var loginurl	=	document.getElementById('loginurl').value;
		alert('·Î±×ÀÎ ÈÄ ÀÌ¿ëÇÏ¼¼¿ä');
		var url = "http://www.itemmania.com/portal/user/login_form.html?returnUrl=http://www.itemmania.com/portal/center/event/view.html?linkurl=e090929_chuseok/index.html&all=t&all=t";
		fnwindowopen('login',url,500,500);
		return;
	}

	var frm = document.getElementById("e090929Frm_2");
	var paramsValues = "gkey="+document.getElementById('gKeyS').value;

	/* ¡å AJAX SOCKET */
	httpRequest = getXMLHttpRequest();
	httpRequest.open("POST", "http://www.itemmania.com/portal/center/event/event_ing/e090929_chuseok/gift_item_moon.php", true);
	httpRequest.setRequestHeader("Accept-Language","ko");
	httpRequest.setRequestHeader("Content-Encoding","UTF-8");
	httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	httpRequest.onreadystatechange = receive__Gift;

	httpRequest.send(paramsValues);
	/* ¡ã AJAX SOCKET */
}

function receive__Gift()
{
	if(httpRequest.readyState == 4)
	{
		if(httpRequest.status == 200)
		{
			var returnData = httpRequest.responseText.split(";");
			//alert(returnData);

			document.getElementById("div_e090929_2").style.display="none";

			if(returnData[0] == "true")
			{
				if(confirm("¾Æ½Î! º¸¸§´Þ 1°³ È¹µæ!! \n\nÀÌº¥Æ® ÆäÀÌÁö¿¡¼­ È®ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
				{
					location.href=returnData[2];
				}
			}
			else
			{
				alert(returnData[1]);
			}
		}
		else
		{
			alert("°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ¼¼¿ä");
		}
	}
}


function gift_moon(){
document.getElementById('RE_URL').value = document.URL;
var check1	=	document.getElementById('definemode').value;
if(check1 == 1 ){
	var loginurl	=	document.getElementById('loginurl').value;
	alert('·Î±×ÀÎ ÈÄ ÀÌ¿ëÇÏ¼¼¿ä');
	var url = "http://www.itemmania.com/portal/user/login_form.html?returnUrl=http://www.itemmania.com/portal/center/event/view.html?linkurl=e090929_chuseok/index.html&all=t&all=t";
	fnwindowopen('login',url,500,500);
	return false;
}

var frm = document.getElementById('e090929Frm_1');
frm.action	=	'http://www.itemmania.com/portal/center/event/event_ing/e090929_chuseok/gift_item_zone2.php';
return true;
}

function ricecake(){
document.getElementById('RE_URL').value = document.URL;
var check1	=	document.getElementById('definemode').value;
if(check1 == 1 ){
	var loginurl	=	document.getElementById('loginurl').value;
	alert('·Î±×ÀÎ ÈÄ ÀÌ¿ëÇÏ¼¼¿ä');
	var url = "http://www.itemmania.com/portal/user/login_form.html?returnUrl=http://www.itemmania.com/portal/center/event/view.html?linkurl=e090929_chuseok/index.html&all=t&all=t";
	fnwindowopen('login',url,500,500);
	return false;
}

var frm = document.getElementById('e090929Frm_2');
frm.action	=	'http://www.itemmania.com/portal/center/event/event_ing/e090929_chuseok/gift_item_zone.php';
return true;
}


/* ¡ã e090929 Ãß¼® ÀÌ ÀÌº¥Æ® */
