	// added by knight. for gana iworld

	// added by ihchoi. for gana iworld
	function Item_PreView(i_ItemID) {
		window.open('/cgi/item/Item_PreView.aspx?i_ItemID='+i_ItemID,'PreView','width=460,height=388');
	}	

	function goItemPreView(MENUID,ITEMID) {
		var URL = "/cgi/home/preview.aspx?MENUID="+MENUID+"&ITEMID="+ITEMID;
		window.open(URL  ,'PREVIEW','width=930,height=600');
	}	
	 
	function AvatarItem_PreView(i_ItemID) {
		window.open('/cgi/item/AvatarItem_PreView.aspx?i_ItemID='+i_ItemID,'PreView','width=350,height=360');
	}	

	function goCash() {
		location.href='http://hompy.tibikids.com/iworldportal/myInfo/main.aspx?rurl=/cgi/mycash/cash_howto.aspx'
		return false;
	}	

	function PortalLoginTop(strUrl)
	{
		parent.location.href="/iWorldPortal/Login.aspx?refUrl=http://hompy.tibikids.com/iWorldPortal/login/goDetailPortal.aspx?RURL=" + strUrl
	}
	

	function goUseCash()
	{	
		location.href ='http://itemmall.tibikids.com/item_mall/cash_use_detail.asp';
		return false;
	}		

	function Join()
	{	
		location.href ='http://hompy.tibikids.com/iworldportal/join/checkuser.aspx';
		return false;
	}		


	function IdSearchPopup2() {	
 		window.open("http://hompy.tibikids.com/iworldportal/join/popup_find_idpwd.aspx", "_find_id_pwd", "width=271, height=243");
		return false;
	}		
		
	
	// added by ihchoi. for gana iworld
	function presentWithUserID(strUserID)
	{
		var strUrl = "/iWorldPortal/login/goDetailPortal.aspx?RURL=/iWorldPortal/HomepyShop/HomepyShop_Main.aspx";
		try
		{
			opener.location.href=strUrl;
		}
		catch(e)
		{
			window.open(strUrl, "_blank", "");
		}	
	}

	function goHomeWithUserID(strUserID)
	{
		if(strUserID.length > 0)
		{
			top.location.href="http://hompy.i-elite.net/cgi/home/home.aspx?ID=" + strUserID;
		}
	}
	
		
	function goHomeDetail(nHomeID, strURL)
	{
		if(nHomeID > 0)
		{	
			var strURL2 = escape(strURL);
			window.open("http://hompy.i-elite.net/cgi/home/home.aspx?HID=" + nHomeID + "&RURL=" + strURL2, "_blank", "width=930,height=600");
		}
	}
	
	function goHomeDetail2(strUserID, strURL)
	{
		if(strUserID.length > 0)
		{
			re = /&/g;
			var strURL2 = escape(strURL.replace(re, "^"));
			window.open("http://hompy.i-elite.net/cgi/home/home.aspx?ID=" + strUserID + "&RURL=" + strURL2, "iworld_" + strUserID, "width=930,height=600");
		}
	}
	
	
	function goHomeDetailTop(nHomeID, strURL)
	{
		if(nHomeID > 0)
		{	
			var strURL2 = escape(strURL);
			top.location.href = "/cgi/home/home.aspx?HID=" + nHomeID + "&RURL=" + strURL2;
		}
	}
	
	
	function goHome(nHomeID)
	{
		if(nHomeID > 0)
		{
			window.open("/cgi/home/home.aspx?HID=" + nHomeID, "_blank", "width=930,height=600");
		}
	}
	
	
	function goHomeWithParam(nHomeID, nCate1, nCate2, nMaxNumber)
	{
		if(nHomeID > 0)
		{
			window.open("/cgi/home/home.aspx?HID=" + nHomeID + "&CATE1=" + nCate1 + "&CATE2=" + nCate2 + "&MAXNUMBER=" + nMaxNumber, "_blank", "width=930,height=600");
		}
	}
	
	function goHomeWithParam2(strUserID, nCate1, nCate2, nMaxNumber)
	{
		if(strUserID.length > 0)
		{
			window.open("/cgi/home/home.aspx?ID=" + strUserID + "&CATE1=" + nCate1 + "&CATE2=" + nCate2 + "&MAXNUMBER=" + nMaxNumber, "iworld_" + strUserID, "width=930,height=600");
		}
	}
	

	function goHome_UserID(UserID)
	{
		if(UserID.length > 0)
		{
			var strUserID = UserID.replace(' ', '+');
			//var strUserID = escape(UserID);
//			window.status = strUserID;
			window.open("http://hompy.i-elite.net/cgi/home/home.aspx?ID=" + strUserID, "iworld_" + escape(strUserID), "width=930, height=600");
		}
	}

	
	function goHomeTop(nHomeID)
	{
		top.location.href = "/cgi/home/home.aspx?HID=" + nHomeID;
	}
	
	function Login(strUrl, strTarget, strCommand)
	{
		window.open("/iWorldPortal/login/login.aspx?LOGININFO=" + escape(strUrl) + "^" + strTarget + "^" + strCommand + "&ISFORM=1", "_login", "width=643, height=512");
	}
	
	function Logout(strUrl, strTarget, strCommand)
	{
		window.open("/iWorldPortal/login/logout.aspx?LOGININFO=" + escape(strUrl) + "^" + strTarget + "^" + strCommand + "&ISFORM=1", "_login", "width=300, height=300");
	}
	
	function LoginTop(strUrl)
	{
		parent.location.href="http://www.tibikids.com/Unauthorized/login.asp?ref=http://hompy.tibikids.com/iWorldPortal/login/goDetailPortal.aspx?RURL=" + strUrl
	}
	
	function goPortalDetail(strUrl)
	{
		window.location.href = "/iWorldPortal/login/goDetailPortal.aspx?RURL=" + escape(strUrl);
	}
	
	
	function Resize_Frame(name)
	{
		var Frame_Body  = document.frames(name).document.body;
		var Frame_name  = document.all(name);

		Frame_name.style.height= Frame_Body.scrollHeight + (Frame_Body.offsetHeight-Frame_Body.clientHeight) - 20;

		if (Frame_name.style.height == "0px")
		{
			Frame_name.style.height = "300px";      //±âº» iframe ³ôÀÌ
//			window.status = 'iframe resizing fail.';
		}
		else
		{
//			window.status = '';
		}
	}
	
	function iframeResize(frameid)
	{				
		var Frame_Body  = document.frames(frameid).document.body;
		var Frame_name  = document.all(frameid);
//		Frame_name.width = 1;
//		Frame_name.height = 1;

//		Frame_name.width= Frame_Body.scrollWidth + (Frame_Body.offsetWidth-Frame_Body.clientWidth);		
//		Frame_name.height = Frame_Body.scrollHeight + (Frame_Body.offsetHeight-Frame_Body.clientHeight);		

//		alert(Frame_Body.scrollHeight + "," + Frame_Body.offsetHeight + "," + Frame_Body.clientHeight);
//		Frame_name.style.width = Frame_Body.scrollWidth;
		Frame_name.style.height = Frame_Body.scrollHeight;
		
	}	
	
	function SendMemo2()
	{
		window.open("http://hompy.tibikids.com/iWorldportal/memo/popup_SendMemo.aspx", "_send_memo", "width=376,height=283");
	}
	
	function SendMemo3(userid)
	{
		window.open("http://hompy.tibikids.com/iWorldportal/memo/popup_SendMemo.aspx?UserID=" + userid, "_send_memo", "width=376,height=283");
	}
	
	
	/// ¿¡µðÅÍ ¼öÁ¤¿¡ ÀÇÇÑ ÀÌ¹ÌÁö ÀÚµ¿ ¸®»çÀÌÁî
	function resizeImg(imgid)
	{
		window.setTimeout("Rsize('" + imgid + "',500, 500, 1)", 200);
	}
	
	function openImg(imgsrc)
	{
		window.open(imgsrc);
	}
	
	
	function imgRsize(img, rW, rH){				
			var iW = img.width;
			var iH = img.height;
			var g = new Array;
			if(iW < rW && iH < rH) { // °¡·Î¼¼·Î°¡ Ãà¼ÒÇÒ °ªº¸´Ù ÀÛÀ» °æ¿ì
					g[0] =  iW; 
					g[1] =  iH; 
			} else {
					if(img.width > img.height) { // ¿øÅ©±â °¡·Î°¡ ¼¼·Îº¸´Ù Å©¸é
							g[0] = rW;
							g[1] = Math.ceil(img.height * rW / img.width);
					} else if(img.width < img.height) { //¿øÅ©±âÀÇ ¼¼·Î°¡ °¡·Îº¸´Ù Å©¸é
							g[0] = Math.ceil(img.width * rH / img.height);
							g[1] = rH;
					} else {
							g[0] = rW;
							g[1] = rH;
					}
					if(g[0] > rW) { // ±¸ÇØÁø °¡·Î°ªÀÌ Ãà¼Ò °¡·Îº¸´Ù Å©¸é
							g[0] = rW;
							g[1] = Math.ceil(img.height * rW / img.width);
					}
					if(g[1] > rH) { // ±¸ÇØÁø ¼¼·Î°ªÀÌ Ãà¼Ò ¼¼·Î°ª°¡·Îº¸´Ù Å©¸é
							g[0] = Math.ceil(img.width * rH / img.height);
							g[1] = rH;
					}
			}
			g[2] = img.width; // ¿ø»çÀÌÁî °¡·Î
			g[3] = img.height; // ¿ø»çÀÌÁî ¼¼·Î
			return g;
	}

	function Rsize(imgid, ww, hh, aL){
			var img = document.all[imgid];
			var tt = imgRsize(img, ww, hh);
			if(img.width > ww || img.height > hh){ // °¡·Î³ª ¼¼·ÎÅ©±â°¡ Á¦ÇÑÅ©±âº¸´Ù Å©¸é
				img.width = tt[0]; // Å©±âÁ¶Á¤
				img.height = tt[1];
//					img.alt = 'Å¬¸¯ÇÏ½Ã¸é ¿øº»ÀÌ¹ÌÁö¸¦ º¸½Ç¼öÀÖ½À´Ï´Ù.';
				if(aL){ // ÀÚµ¿¸µÅ© on
						img.onclick = function(){
							wT = Math.ceil((screen.width - tt[2])/2.6); // Å¬¶óÀÌ¾ðÆ® Áß¾Ó¿¡ ÀÌ¹ÌÁöÀ§Ä¡.
							wL = Math.ceil((screen.height - tt[3])/2.6);
							mm = window.open("", 'viewOrig', 'width='+tt[2]+',height='+tt[3]+',top='+wT+',left='+wL);
							var doc = mm.document;
							doc.body.style.margin = 0; // ¸¶ÁøÁ¦°Å
							doc.body.style.cursor = "hand";
							var previewimg = doc.createElement("img");
							previewimg.src = img.src;
							doc.body.appendChild(previewimg);
							doc.body.onmousedown = function(){ mm.close();}
							doc.title = '¿øº»»çÁø';
						}
						img.style.cursor = "hand";
				}
			} else {
//					img.onclick = function(){ alert("ÇöÀçÀÌ¹ÌÁö°¡ ¿øº» ÀÌ¹ÌÁöÀÔ´Ï´Ù."); }
			}
	}
	
	
	function goCafeDetail(nCafeID)
	{
		var strRURL = escape(window.location.href);
		window.location.href="http://cafe.tibikids.com/cafe/login.aspx?ISFORM=1&CID=" + nCafeID + "&LOGININFO=" + strRURL;
	}
	
	function AlertCafeMessage(strMessage)
	{
		window.open("http://cafe.tibikids.com/cafe/cafe_alert.aspx?MSG=" + escape(strMessage), "_cafe_alert", "width=300, height=200");
	}

	function goCafe(cid) {
	  location.href='http://cafe.tibikids.com/cafe/main.aspx?cid=' + cid;
	}	
	
	function SendInvitation(nCafeID, strRecUserID, strRecUserName)
	{
		window.open("http://cafe.tibikids.com/cafe/SendInvitation.aspx?CID=" + nCafeID + "RCID=" + strRecUserID + "&RCNAME=" + strRecUserName, "_cafe_send_inviation", "width=360,height=315");
		return false;
	}

	function FindIDPassword()
	{
		window.open("http://hompy.tibikids.com/iworldportal/join/popup_find_idpwd.aspx", "_find_id_pwd", "width=271, height=243");
	}
	
	function goHelper()
	{
		alert("µµ¿ì¹ÌÀÔ´Ï´Ù.home.js.goHelper()");
	}
	
