
document.write('<link rel="stylesheet" type="text/css" href="http://www.cyworld.com/css/common/nameUI.css?v080418-01" />');
document.write('<script type="text/javascript" src="http://www.cyworld.com/js/cyworld_script_7.0_plus.js?v080122-01"></script>');
var ml_betauser = "";
if (ml_betauser == '1') {
	document.write('<style type="text/css">.NameUI ul.subList{width:93px;}.NameUI ul.subList a{width:89px;}#NameUIInvite{margin-top:-88px;}</style>');
}

// ÀÌ¸§UI Prototype ¼±¾ð
//////////////////////////////////////////////

var nameUI = null;
var isIE = (navigator.userAgent.toUpperCase().indexOf("MSIE") != -1);
var IE4 = (navigator.appName.indexOf("Microsoft Internet Explorer") == 0);  // ¹Ì´ÏÈ¨ÇÇ¿ë Flag Ãß°¡ ÆÐÄ¡ (2007.10.12)

if (isIE) {
	document.onclick = mouseDownEventHandler;
} else if (document.addEventListener) {
	document.addEventListener('click', mouseDownEventHandler, false);
} else if (document.attachEvent) {
	document.attachEvent('click', mouseDownEventHandler);
}


var arrNameUIImagesPath = new Array();

arrNameUIImagesPath[0] = 'http://c1img.cyworld.com/img/common_v7/gnb/ico_nameui.gif';
arrNameUIImagesPath[1] = 'http://c1img.cyworld.com/img/common_v7/gnb/dotline_nameui.gif';

if (document.images) {
	var arrNameUIImages = new Array();
	var j = 0;
	for (var i=0; i<arrNameUIImagesPath.length; i++)
	{
		arrNameUIImages[j] = new Image;
		arrNameUIImages[j++].src=arrNameUIImagesPath[i];
	}
}

function NameUI()
{
	this.nameUILayer;

	this.nameUIEvent;
	this.nameUIPosX;
	this.nameUIPosY;
	this.nameUIDirection;

	this.xmlHttp;
	this.masterId;
	this.userId;
	this.userName;
	this.memberType;

	this.windowOption;

	this.arrMainMenuLayer = [ //{{{
		'liMenuHome',
		'liGift',
		'liSendSMS',
		'liMemo',
		'liOneDegree',
		'liInvite',
		'liMyHome',
		'liMyMail',
		'liMyMemo',
		'liMyOneDegree'
	]; //}}}

	this.arrHasSubMenuLayer = [ //{{{
		'liOneDegree',
		'liInvite',
		'liGift'
	]; //}}}

	this.arrSubMenuLayer = [ //{{{
		'NameUIOneDegree',
		'NameUIGift',
		'NameUIInvite'
	]; //}}}

	this.subMenuStatus = { oneDegree:'0', invite:'0', gift:'0' };

	this.arrDisableMenu;

	this.cyCommon;
}

NameUI.prototype = {

	initNameUI: //{{{
		function () {
			var divNameUI;
			this.nameUILayer= document.createElement("DIV");
			this.nameUILayer.id = "divNameUI";
			this.nameUILayer.style.zIndex = 9999;
			this.nameUILayer.style.position = "absolute";
			this.nameUILayer.style.left = this.nameUILayer.style.top = "0px";
			this.nameUILayer.innerHTML = this.getNameUIHTML();
			document.body.insertBefore(this.nameUILayer, document.body.firstChild);
			this.cyCommon = new CyCommon();
		}, //}}}

	getNameUIHTML: //{{{
		function () {
			return ('<div id="NameUIDefault" class="NameUI">\n' +
					'	<ul>\n' +
					'		<li id="liMenuHome" onmouseover="nameUIMOver(this);" onmouseout="nameUIMOut(this);"><a id="lblMenuHome" href="#¹Ì´ÏÈ¨ÇÇ" class="single" onclick="nameUIExec(\'OPEN_MYHOME\');return false;">¹Ì´ÏÈ¨ÇÇ</a></li>\n' +
					'		<li id="liSendSMS" onmouseover="nameUIMOver(this);" onmouseout="nameUIMOut(this);"><a href="#¹®ÀÚº¸³»±â" class="single" onclick="nameUIExec(\'SEND_SMS\');return false;">¹®ÀÚº¸³»±â</a></li>\n' +
					'		<li id="liMemo" onmouseover="nameUIMOver(this);" onmouseout="nameUIMOut(this);"><a href="#ÂÊÁöº¸³»±â" class="single" onclick="nameUIExec(\'SEND_MEMO\');return false;">ÂÊÁöº¸³»±â</a></li>\n' +
					'		<li class="line"></li>\n' +
					'		<li id="liOneDegree" onmouseover="nameUIMOver(this);" onmouseout="nameUIMOut(this);"><a href="#ÀÎ¸Æ°ü¸®" onclick="nameUIExec(\'ONEDEG\');return false;">ÀÎ¸Æ°ü¸®</a></li>\n' +
					'		<li id="liGift" onmouseover="nameUIMOver(this);" onmouseout="nameUIMOut(this);"><a href="#¼±¹°ÇÏ±â" onclick="nameUIExec(\'PRESENT\');return false;">¼±¹°ÇÏ±â</a></li>\n' +
					'		<li id="liInvite" onmouseover="nameUIMOver(this);" onmouseout="nameUIMOut(this);"><a href="#ÃÊ´ëÇÏ±â" onclick="nameUIExec(\'INVITE\');return false;">ÃÊ´ëÇÏ±â</a></li>\n' +
					'	</ul>\n' +
					'	<div id="NameUIOneDegree">\n' +
					'		<ul class="subList">\n' +
					'			<li id="liOneDegRegister"><a href="#ÀÏÃÌ¸Î±â" onclick="nameUIExec(\'ONEDEG_REGISTER\');return false;">ÀÏÃÌ¸Î±â</a></li>\n' +
					'			<li id="liOneDegModify"><a href="#ÀÏÃÌº¯°æ" onclick="nameUIExec(\'ONEDEG_MODIFY\');return false;">ÀÏÃÌº¯°æ</a></li>\n' +
					'			<li id="liOneDegRemove"><a href="#ÀÏÃÌ²÷±â" onclick="nameUIExec(\'ONEDEG_REMOVE\');return false;">ÀÏÃÌ²÷±â</a></li>\n' +
					'			<li id="liOneDegCoop"><a href="#Á¦ÈÞ½ÅÃ»" onclick="nameUIExec(\'ONEDEG_COOP\');return false;">Á¦ÈÞ½ÅÃ»</a></li>\n' +
					'		</ul>\n' +
					'	</div>\n' +
					'	<div id="NameUIGift">\n' +
					'		<ul class="subList">\n' +
					'			<li id="liGiftItem"><a href="#¾ÆÀÌÅÛ¼±¹°" onclick="nameUIExec(\'GIFT_ITEM\');return false;">¾ÆÀÌÅÛ¼±¹°</a></li>\n' +
					'			<li id="liGiftDotori"><a href="#µµÅä¸®¼±¹°" onclick="nameUIExec(\'GIFT_DOTORI\');return false;">µµÅä¸®¼±¹°</a></li>\n' +
					'		</ul>\n' +
					'	</div>\n' +
					'	<div id="NameUIInvite">\n' +
					'		<ul class="subList">\n' +
					'			<li id="liInviteChat"><a href="#1:1´ëÈ­" onclick="nameUIExec(\'INVITE_CHAT\');return false;">1:1´ëÈ­</a></li>\n' +
					'			<li id="liInviteHome"><a href="#¹Ì´ÏÈ¨ÇÇÃÊ´ë" onclick="nameUIExec(\'INVITE_HOME\');return false;">¹Ì´ÏÈ¨ÇÇÃÊ´ë</a></li>\n' +
					'			<li id="liInviteClub"><a href="#Å¬·´ÃÊ´ë" onclick="nameUIExec(\'INVITE_CLUB\');return false;">Å¬·´ÃÊ´ë</a></li>\n' +
					'			<li id="liInviteNateOn"><a href="#³×ÀÌÆ®¿ÂÃÊ´ë" onclick="nameUIExec(\'INVITE_NATEON\');return false;">³×ÀÌÆ®¿ÂÃÊ´ë</a></li>\n' +
                    '           <li id="liInviteMiniLife"><a href="#¹Ì´Ï¶óÀÌÇÁÃÊ´ë" onclick="nameUIExec(\'INVITE_MINILIFE\');return false;">¹Ì´Ï¶óÀÌÇÁÃÊ´ë</a></li>\n' +
					'		</ul>\n' +
					'	</div>\n' +
					'</div>\n' +
					'<div id="NameUIMine" class="NameUI">\n' +
					'	<ul>\n' +
					'		<li id="liMyHome"><a href="#¹Ì´ÏÈ¨ÇÇ" onclick="nameUIExec(\'MY_HOME\');return false;" class="single">¹Ì´ÏÈ¨ÇÇ</a></li>\n' +
					'		<li id="liMyMail"><a href="#¹ÞÀº¸ÞÀÏÇÔ" onclick="nameUIExec(\'MY_MAIL\');return false;" class="single">¹ÞÀº¸ÞÀÏÇÔ</a></li>\n' +
					'		<li id="liMyMemo"><a href="#¹ÞÀºÂÊÁöÇÔ" onclick="nameUIExec(\'MY_MEMO\');return false;" class="single">¹ÞÀºÂÊÁöÇÔ</a></li>\n' +
					'		<li class="line"></li>\n' +
					'		<li id="liMyOneDegree"><a href="#ÀÎ¸Æ°ü¸®" onclick="nameUIExec(\'MY_ONEDEG\');return false;" class="single">ÀÎ¸Æ°ü¸®</a></li>\n' +
					'	</ul>\n' +
					'</div>'
				);
			}, // }}}

		setScrollHeight: //{{{
			function (xPos, yPos, direction) {
				if(isIE) {
					this.nameUIPosX = xPos;
					this.nameUIPosY = yPos - (direction == 'U' ? 135 : 0);
				} else {
					this.nameUIPosX = xPos;
					this.nameUIPosY = yPos - (direction == 'U' ? 122 : 0);
				}
				this.nameUIDirection = direction;
			}, // }}}

		mouseOver: //{{{
			function (objElement) {
				var status = this.subMenuStatus;
				if (objElement.className == "blink") return;
				if (this.isMainMenu(objElement)) {
					if (this.hasSubMenu(objElement)) {
						status.oneDegree	= (objElement.id=='NameUIOneDegree' ? "1" : "0");
						status.gift		= (objElement.id=='NameUIGift' ? "1" : "0");
						status.invite		= (objElement.id=='NameUIInvite' ? "1" : "0");
					} else this.hideAllSubMenu();
					this.showSubMenuLayer(objElement);
				}

			}, //}}}

		mouseOut: //{{{  //
			function (objElement) {
				var status = this.subMenuStatus;
				if (objElement.className == "blink") return;
				if (objElement.id=='NameUIOneDegree') status.oneDegree = "0";
				if (objElement.id=='NameUIInvite') status.invite = "0";
				if (objElement.id=='NameUIGift') status.gift = "0";
			}, //}}}

		openMenuLayer: //{{{
			function(userId) {
				var objThis = this;
				var fnShowMenuLayer = this.showMenuLayer;

				this.hideAllMenu();
				this.nameUILayer.style.left	= parseInt(this.nameUIPosX) + "px";
				if (userId==''&&this.nameUIDirection=='U')
					this.nameUIPosY = (parseInt(this.nameUIPosY) + 40) + "px";
				this.nameUILayer.style.top	= parseInt(this.nameUIPosY) + "px";

				this.userId = userId;
				this.xmlHttp = this.cyCommon.getXMLHttp();

				this.xmlHttp.open("GET", "/c2Support/infra/MainId.asp?ActionType=Get&id=" + userId + "", true);
				this.xmlHttp.onreadystatechange = function() { fnShowMenuLayer.apply(objThis,arguments); };
				this.xmlHttp.send(null);
			}, //}}}

		showMenuLayer: //{{{
			function () {
				if (ml_betauser != '1') document.getElementById('liInviteMiniLife').style.display = 'none';

				if (this.xmlHttp.readyState == 4)
				{
					if (this.xmlHttp.status == 200)
					{
						var resp = this.xmlHttp.responseText;

						if (resp == "" || resp == null || resp == "null") return;
						this.masterId = this.cyCommon.trim(resp).substring(0, 8);
					}
					else
					{
					    this.masterId = this.userId;
					}
				}
				else
				{
				    this.masterId = this.userId;
				}
				this.memberType = this.cyCommon.getMemberType(this.masterId);

				if (this.memberType == "C2") {
					document.getElementById("lblMenuHome").innerHTML = "ºí·Î±×";
					document.getElementById("lblMenuHome").href = "#ºí·Î±×";
				} else if (this.memberType == "TOWN") {
					document.getElementById("lblMenuHome").innerHTML = "Å¸¿îÈ¨ÇÇ";
					document.getElementById("lblMenuHome").href = "#Å¸¿îÈ¨ÇÇ";
				} else {
					document.getElementById("lblMenuHome").innerHTML = "¹Ì´ÏÈ¨ÇÇ";
					document.getElementById("lblMenuHome").href = "#¹Ì´ÏÈ¨ÇÇ";
				}

				
				document.getElementById("liOneDegCoop").style.display = "none";
				

				// ºñÈ°¼º ¸Þ´º ·¹ÀÌ¾î ¼³Á¤
				this.arrDisableMenu = new Array();

				
				var arrAllMenuId =
					[ "PRESENT", "SEND_SMS", "SEND_MEMO", "ONEDEG", "INVITE", "ONEDEG_REGISTER", "ONEDEG_MODIFY", "ONEDEG_REMOVE", "GIFT_ITEM", "GIFT_DOTORI", "INVITE_CHAT", "INVITE_HOME", "INVITE_CLUB", "INVITE_NATEON", "INVITE_MINILIFE" ];
				var arrAllMenuLayer =
					[ "liGift", "liSendSMS", "liMemo", "liOneDegree", "liInvite", "liOneDegRegister", "liOneDegModify", "liOneDegRemove", "liGiftItem", "liGiftDotori", "liInviteChat", "liInviteHome", "liInviteClub","liInviteNateOn", "liInviteMiniLife" ];
				for (var i=0; i < arrAllMenuId.length; i++) {
					this.arrDisableMenu[this.arrDisableMenu.length] = arrAllMenuId[i];
					document.getElementById(arrAllMenuLayer[i]).className = "blink";
				}
				

				document.getElementById(this.userId == "" || this.masterId =="" ? "NameUIMine" : "NameUIDefault").style.display = "block";

			}, //}}}

		isDisabledMenu: //{{{
			function (subMenuId) {
				for (var i=0; i < this.arrDisableMenu.length; i++) {
					if (this.arrDisableMenu[i] == subMenuId) return true;
				}
				return false;
			}, //}}}

		showSubMenuLayer: //{{{
			function (objElement) {
				if (!this.hideSubMenuLayer()) return;
				if (this.hasSubMenu(objElement)) this.getSubMenuLayer(objElement).style.display = "block";
			}, //}}}

		getMainMenuLayer: //{{{
			function (objElement) {
				switch (objElement.id) {
					case 'NameUIOneDegree':
						return document.getElementById('liOneDegree');
					case 'NameUIInvite':
						return document.getElementById('liInvite');
					case 'NameUIGift':
						return document.getElementById('liGift');
				}
				return null;
			}, //}}}

		getSubMenuLayer: //{{{
			function (objElement) {
				switch (objElement.id) {
					case 'liOneDegree':
						return document.getElementById('NameUIOneDegree');
					case 'liGift':
						return document.getElementById('NameUIGift');
					case 'liInvite':
						return document.getElementById('NameUIInvite');
				}
				return null;
			}, //}}}

		hideSubMenuLayer: //{{{
			function () {
				if (this.subMenuStatus.oneDegree == "1" || this.subMenuStatus.invite == "1" || this.subMenuStatus.gift == "1")
					return false;
				for (var i = 0; i < this.arrSubMenuLayer.length; i++)
					document.getElementById(this.arrSubMenuLayer[i]).style.display = "none";
				return true;
			}, //}}}

		hideAllMenu: //{{{
			function () {
				for (var i = 0; i < this.arrSubMenuLayer.length; i++)
					document.getElementById(this.arrSubMenuLayer[i]).style.display = "none";
				document.getElementById('NameUIDefault').style.display = 'none';
				document.getElementById('NameUIMine').style.display = 'none';
			}, //}}}

		hideAllSubMenu: //{{{
			function () {
				for (var i = 0; i < this.arrSubMenuLayer.length; i++)
					subMenuLayer = document.getElementById(this.arrSubMenuLayer[i]).style.display = "none";
			}, //}}}

		isMainMenu: //{{{
			function (objElement) {
				for (var i = 0; i < this.arrMainMenuLayer.length; i++)
					if (document.getElementById(this.arrMainMenuLayer[i]) == objElement) return true;
				return false;
			}, //}}}

		hasSubMenu: //{{{
			function (objElement) {
				for (var i = 0; i < this.arrHasSubMenuLayer.length; i++)
					if (document.getElementById(this.arrHasSubMenuLayer[i]) == objElement) return true;
				return false;
			}, //}}}

		execCommand: //{{{
			function (command) {

				if (this.isDisabledMenu(command)) return;

				switch (command) {

					case 'OPEN_MYHOME': //{{{
						document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
						switch (this.memberType) {
							case 'C1':
								this.cyCommon.setNDRClick('RNU11');
								if (this.windowOption == 'self') {
									top.location.href = 'http://minihp.cyworld.com/pims/main/pims_main.asp?tid=' + this.masterId;
								} else {
									window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid=' + this.masterId, (this.windowOption=='new'?'':'person_info'), 'height=538,width=932,scrollbars=no,resizable=yes');
								}
								break;
							case 'TOWN':
								this.cyCommon.setNDRClick('RNU13');
								if (this.windowOption == 'self') {
									top.location.href = 'http://minihp.cyworld.com/pims/main/pims_main.asp?tid=' + this.masterId;
								} else {
									window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid=' + this.masterId, (this.windowOption=='new'?'':'person_info'), 'height=538,width=932,scrollbars=no,resizable=yes');
								}
								break;
							case 'C2':
								this.cyCommon.setNDRClick('RNU12');
								if (this.windowOption == 'self') {
									top.location.href = 'http://cyhome.cyworld.com/index.php?mf=&id=' + this.masterId;
								} else if (this.windowOption=='new') {
									window.open('http://cyhome.cyworld.com/index.php?mf=&id=' + this.masterId);
								} else {
									this.openWindow('http://cyhome.cyworld.com/index.php?mf=&id=' + this.masterId);
								}
								break;
						}

						break;
					//}}}

					case 'GIFT_ITEM': //{{{
						this.cyCommon.setNDRClick('RNU21');
						switch (this.memberType) {
							case 'C1':
							case 'TOWN':
								window.open('http://www.cyworld.com/mall/index_frame.asp?wishid=' + this.userId + '&mode=4', 'giftmain');
								break;

							case 'C2':
								window.open('http://www.cyworld.com/mall/index_frame.asp?wishid=' + this.userId + '&mode=4', 'giftmain');
								break;
						}
						break;
					//}}}

					case 'GIFT_DOTORI': //{{{
						this.cyCommon.setNDRClick('RNU22');
						switch (this.memberType) {
							case 'C1':
								window.open('http://www.cyworld.com/mall/popup_dotori_send.asp?wishid='+this.userId+'&present_seq=3399' , 'dotori_popup' ,'height=350,width=417,scrollbars=yes,resizable=no');
								break;
							case 'TOWN':
								break;
							case 'C2':
								window.open('http://www.cyworld.com/mall/popup_dotori_send.asp?wishid='+this.userId+'&present_seq=3399' , 'dotori_popup' ,'height=350,width=417,scrollbars=yes,resizable=no');
								break;
						}
						break;
					//}}}

					case 'SEND_SMS': //{{{
						this.cyCommon.setNDRClick('RNU32');
						switch (this.memberType) {
							case 'C1':
							case 'C2':
								window.open('http://www.cyworld.com/main2/mobile/message/popup/ui.asp?rec_id='+this.userId+'&rec_nm=', 'sms_popup' ,'height=344,width=206,scrollbars=no,resizable=no');
								break;
							case 'TOWN':
								break;
						}
						break;
					//}}}

					case 'SEND_MEMO': //{{{
						this.cyCommon.setNDRClick('RNU41');
						window.open('http://mail.cyworld.com/memo/writeframe.cy?memo_id='+this.userId+'&id=&writer=&fr=y', 'memoreply','height=500,width=360,scrollbars=no,resizable=yes');
						break;
					//}}}

					case 'ONEDEG_REGISTER': //{{{
						this.cyCommon.setNDRClick('RNU51');
						window.open('http://www.cyworld.com/main2/ui/contact_pop.asp?tid=' + this.userId, 'popuo_contacts', 'width=300,height=305,scrollbars=no,toolbar=no,resizable=yes,menubar=no');
						break;
					//}}}

					case 'ONEDEG_MODIFY': //{{{
						this.cyCommon.setNDRClick('RNU52');
						window.open('http://www.cyworld.com/main2/ui/contact_pop.asp?tid=' + this.userId, 'popuo_contacts', 'width=300,height=305,scrollbars=no,toolbar=no,resizable=yes,menubar=no');
						break;
					//}}}

					case 'ONEDEG_REMOVE': //{{{
						this.cyCommon.setNDRClick('RNU53');
						window.open('http://www.cyworld.com/main2/ui/contact_del.asp?tid=' + this.userId + '&id=', 'popuo_contacts', 'width=250,height=170,scrollbars=no,toolbar=no, resizable=yes,menubar=no');
						break;
					//}}}

					case 'ONEDEG_COOP': //{{{
						if (this.memberType != 'TOWN') {
							break;
						}
						window.open('http://www.cyworld.com/main2/ui/coop_pop_request.asp?tid=' + this.userId + '&id=', 'popuo_coop_requst', 'width=250,height=170,scrollbars=no,toolbar=no,resizable=yes,menubar=no');
						break;
					//}}}

					case 'INVITE_NATEON': //{{{
						this.cyCommon.setNDRClick('RNU64');
						
						switch (this.memberType) {
							case 'TOWN':
								break;
							case 'C1':
							case 'C2':
								window.open('http://www.cyworld.com/main2/nateon/nateon_pop_invite.asp?tid=' + this.userId, 'NateOn_Visit', 'height=417,width=450,top=50,left=50,scrollbars=no,resizable=no');
								break;
						}
						break;
						
					//}}}

                    case 'INVITE_MINILIFE': //{{{
                        this.cyCommon.setNDRClick('RNU65');
                        
                        switch (this.memberType) {
                            case 'TOWN':
                                break;
                            case 'C1':
                            case 'C2':
								try {
									window.open('http://minilife.cyworld.com/MinilifeInvitation/InviteForm?fid=' + this.userId, 'MiniLifeInvite', 'height=417,width=450,top=50,left=50,scrollbars=no,resizable=no').focus();
								} catch (e) { }
                                break;
                        }
                        break;
                        
                    //}}}

					case 'INVITE_CHAT': //{{{
						this.cyCommon.setNDRClick('RNU61');
						this.ndrClick('/click_chat/nameui/');
						window.open("http://www.cyworld.com/common/Communications/Chat/ChatBridge.asp?Fromid=&ToId=" + this.userId + "&Onedegrees=1","onetoone","height=225,width=300,scrollbars=no,resizable=no,toolbar=no, menubar=no");
						break;
					//}}}

					case 'INVITE_CLUB': //{{{
						this.cyCommon.setNDRClick('RNU63');
						window.open('http://www.cyworld.com/main2/ui/clubinvite_pop.asp?tid=' + this.userId + '&id=', 'popuo_contacts', 'width=300,height=250,scrollbars=no,toolbar=no,resizable=yes,menubar=no');
						break;
					//}}}

					case 'INVITE_HOME': //{{{
						this.cyCommon.setNDRClick('RNU62');
						window.open('http://minihp.cyworld.com/pims/mhsection/invite/invite_pop_write.asp?tid=' + this.userId +'&id=', 'minihp_invite_write', 'width=300,height=220,scrollbars=no,toolbar=no,resizable=yes,menubar=no');
						break;
					//}}}

					case 'MY_HOME': //{{{
						
						document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
						var win = window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid=','person_info_i','height=538,width=932,scrollbars=no,resizable=yes');
						win.focus();
						
						break;
					//}}}

					case 'MY_ONEDEG': //{{{
						
						this.openWindow('http://www.cyworld.com/main2/mycyworld/mycy_onedeg_contact.asp');
						
						break;
					//}}}

					case 'MY_INVITE': //{{{
						
						this.openWindow('http://www.cyworld.com/main2/mycyworld/mycy_action_all_invite.asp');
						
						break;
					//}}}

					case 'MY_MAIL': //{{{
						this.openWindow('http://mail.cyworld.com/list/listMail.cy?box=INBOX');
						break;

					case 'MY_MEMO': //{{{
						this.openWindow('http://mail.cyworld.com/memo/');
						break;
					//}}}

				}

			}, //}}}

		ndrClick: //{{{
			function (content) {
				var objImage = new Image();
				objImage.src = 'http://statetc.cyworld.com/stat/stat.tiff?cp_url=[cyworld_ndretc.nate.com' + content + ']';
			}, //}}}

		openWindow: //{{{
			function (url) {
				var win = window.open(url, 'from_nameui');
				win.focus();
			} //}}}

};

function nameUIInit()
{
	if (nameUI == null) nameUI = new NameUI();
	nameUI.initNameUI();
}

function nameUIMOver(objElement)
{
	if (nameUI == null) return;
	nameUI.mouseOver(objElement);
}

function nameUIMOut(objElement)
{
	if (nameUI == null) return;
	nameUI.mouseOut(objElement);
}

function nameUIExec(command)
{
	if (nameUI == null) return;
	nameUI.execCommand(command);
}

function nameUIOpen(id) { nameUIOpen(id, 'D'); }

function nameUIOpen(id, direction)
{
	id = String(id).substring(0, 8);
	if (nameUI != null) nameUI.openMenuLayer(id);
}

function mouseDownEventHandler(e) {

	var eventTarget;
	var eventTargetString;

	if (nameUI == null) nameUIInit();

	if (isIE)
	{
		if (event.srcElement.parentElement == null) {
			nameUI.hideAllMenu();
			return;
		}

		if (event.srcElement.parentElement == "A")
			eventTarget = event.srcElement.parentElement;
		else
			eventTarget = event.srcElement;

		eventTargetString = eventTarget.toString();
		nameUI.nameUIEvent = window.event;
	}
	else
	{
		eventTargetString = e.target.href;
		nameUI.nameUIEvent = e;
	}

	if (eventTargetString == null || eventTargetString == "undefined") { // FF Null Exception
		nameUI.hideAllMenu();
		return;
	}

	var xPos, yPos, yAdd;
	xPos = (isIE) ? parseInt(document.body.scrollLeft) + parseInt(nameUI.nameUIEvent.clientX) : parseInt(nameUI.nameUIEvent.pageX);
	yPos = (isIE) ? parseInt(nameUI.nameUIEvent.clientY) + parseInt(document.body.scrollTop) : parseInt(nameUI.nameUIEvent.pageY);
	yAdd = (document.body.scrollTop == 0) ? parseInt(document.documentElement.scrollTop) : 0;
	if (isIE) yPos += yAdd;

	if ( eventTargetString.indexOf("PZPopup(") > -1 || eventTargetString.indexOf("nameUIOpen(") > -1 )
	{
		if ( eventTargetString.indexOf("nameUIOpen(") > -1 &&
				(eventTargetString.indexOf("'UN')") > -1 || eventTargetString.indexOf("'NU')") > -1) )
		{
			nameUI.setScrollHeight(xPos, yPos, "U");
			nameUI.windowOption = 'new';
		}
		else if ( eventTargetString.indexOf("nameUIOpen(") > -1 &&
			(eventTargetString.indexOf("'US')") > -1 || eventTargetString.indexOf("'SU')") > -1) )
		{
			nameUI.setScrollHeight(xPos, yPos, "U");
			nameUI.windowOption = 'self';
		}
		else if ( eventTargetString.indexOf("nameUIOpen(") > -1 &&
			(eventTargetString.indexOf("'ND')") > -1 || eventTargetString.indexOf("'N')") > -1) )
		{
			nameUI.setScrollHeight(xPos, yPos, "D");
			nameUI.windowOption = 'new';
		}
		else if ( eventTargetString.indexOf("nameUIOpen(") > -1 &&
			(eventTargetString.indexOf("'SD')") > -1 || eventTargetString.indexOf("'S')") > -1) )
		{
			nameUI.setScrollHeight(xPos, yPos, "D");
			nameUI.windowOption = 'self';
		}
		else if ( eventTargetString.indexOf("nameUIOpen(") > -1 && eventTargetString.indexOf("'U')") > -1 )
		{
			nameUI.setScrollHeight(xPos, yPos, "U");
			nameUI.windowOption = 'default';
		}
		else
		{
			nameUI.setScrollHeight(xPos, yPos, "D");
			nameUI.windowOption = 'default';
		}
	}
	else if ( eventTargetString.indexOf("PZPopup_top(") > -1 || eventTargetString.indexOf("PZPopupTop(") > -1 )
	{
		nameUI.setScrollHeight(xPos, yPos, "U");
		nameUI.windowOption = 'default';
	}
	else
	{
		nameUI.hideAllMenu();
		return;
	}

	var fCnt, bCnt, cuttingStr;
	fCnt = eventTargetString.indexOf("(") + 1;
	bCnt = eventTargetString.indexOf(")");
	cuttingStr = String(eventTargetString).substring(fCnt, bCnt);

	if ( String(cuttingStr).substring(0, 1) != "'" ) {
		if(String(cuttingStr).substring(0, 1) >= "a")
			eval(String(cuttingStr).substring(0, 8) + "='" + String(cuttingStr).substring(0, 8) +"';");
	}
}

function PZPopup(id) { nameUIOpen(id, "D"); }
function PZPopup_top(id) { nameUIOpen(id, "U") }
function PZPopupTop(id) { nameUIOpen(id, "U") }


// Popup Script Prototype
//////////////////////////
function CyPopup()
{
	this.xmlHttp;
	this.userId;
	this.masterId;
	this.windowOption;

	this.cyCommon;
}

CyPopup.prototype = {

	init: //{{{
		function() {
			this.cyCommon = new CyCommon();
		}, //}}}

	openHome: //{{{
		function(userId) {
			var objThis = this;
			var fnCallBack = this.showHome;
			this.userId = userId;
			this.windowOption = "D";
			this.xmlHttp = this.cyCommon.getXMLHttp();
			this.xmlHttp.open("GET", "/c2Support/infra/MainId.asp?ActionType=Get&id=" + this.userId + "", true);
			this.xmlHttp.onreadystatechange = function() { fnCallBack.apply(objThis,arguments); };
			this.xmlHttp.send(null);
		}, //}}}

	openHome: //{{{
		function(userId, windowOption) {
			var objThis = this;
			var fnCallBack = this.showHome;
			this.userId = userId;
			this.windowOption = windowOption;
			this.xmlHttp = this.cyCommon.getXMLHttp();
			this.xmlHttp.open("GET", "/c2Support/infra/MainId.asp?ActionType=Get&id=" + this.userId + "", true);
			this.xmlHttp.onreadystatechange = function() { fnCallBack.apply(objThis,arguments); };
			this.xmlHttp.send(null);
		}, //}}}

	showHome: //{{{
		function () {
			if (this.xmlHttp.readyState == 4)
			{
				if (this.xmlHttp.status == 200)
				{
					var resp = this.xmlHttp.responseText;
					if (resp == "" || resp == null || resp == "null") return;
					this.masterId = this.cyCommon.trim(resp).substring(0, 8);
				}
				else return;
			} else return;

			var memberType = this.cyCommon.getMemberType(this.masterId);

			if (memberType == 'C2') {
				if (this.windowOption=='S') {
					top.location.href = "http://cyhome.cyworld.com/?home_id=" + this.masterId;
				} else {
					window.open("http://cyhome.cyworld.com/?home_id=" + this.masterId);
				}
				return;
			} else if (memberType == 'TOWN') {
				if (this.windowOption=='S') {
					document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
					top.location.href = 'http://town.cyworld.com/pims/main/pims_main.asp?tid='+ this.masterId;
				} else if (this.masterId == '') {
					document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
					window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ this.masterId, (this.windowOption=='N'?'':'person_info_i'), 'height=565,width=932,scrollbars=no,resizable=yes');
				} else {
					document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
					window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ this.masterId, (this.windowOption=='N'?'':'person_info'), 'height=565,width=932,scrollbars=no,resizable=yes');
				}
				return;
			} else {
				if (this.windowOption=='S') {
					document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
					top.location.href = 'http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ this.masterId;
				} else if (this.masterId == '') {
					document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
					window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ this.masterId, (this.windowOption=='N'?'':'person_info_i'), 'height=565,width=932,scrollbars=no,resizable=yes');
				} else {
					document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
					window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ this.masterId, (this.windowOption=='N'?'':'person_info'), 'height=565,width=932,scrollbars=no,resizable=yes');
				}
				return;
			}
			return;
		} //}}}
}


// Text GNB Prototype
////////////////////////////////

function TextGnb()
{
	this.cyCommon;
}

TextGnb.prototype = {

	init: //{{{
		function (layerId) {
			this.cyCommon = new CyCommon();
			document.getElementById(layerId).innerHTML = this.getTextGnbHTML();
		}, //}}}

	getTextGnbHTML: //{{{
		function () {
			var gnbHTML =
			'<ul class="gnbmenu">\n' +
				'<li class="first"><a href="http://www.cyworld.com/" onclick="goCyworldMain();return false;" title="½ÎÀÌ¿ùµå">½ÎÀÌ¿ùµå</a></li>\n' +
				'<li><a href="http://my.cyworld.com" title="¸¶ÀÌ½ÎÀÌ¿ùµå">¸¶ÀÌ½ÎÀÌ¿ùµå</a></li>\n' +
				'<li><a href="http://www.cyworld.com/pims/mhsection/mh_index.asp" title="¹Ì´ÏÈ¨ÇÇ">¹Ì´ÏÈ¨ÇÇ</a></li>\n' +
				'<li><a href="http://home.cyworld.com/" title="ºí·Î±×">ºí·Î±×</a></li>\n' +
				'<li><a href="http://club.cyworld.com/club/clubsection2/index.asp" title="Å¬·´">Å¬·´</a></li>\n' +
				'<li><a href="http://www.cyworld.com/mall/mall5_index.asp" title="¼±¹°°¡°Ô">¼±¹°°¡°Ô</a></li>\n' +
				'<li><a href="http://cyplaza.cyworld.com" title="±¤Àå">±¤Àå</a></li>\n' +
				'<li><a href="http://video.cyworld.com" title="µ¿¿µ»ó">µ¿¿µ»ó</a></li>\n' +
				'<li><a href="http://music.cyworld.com" title="¹ÂÁ÷">¹ÂÁ÷</a></li>\n' +
				'<li><a href="http://market.cyworld.com" title="¸¶ÄÏ">¸¶ÄÏ</a></li>\n' +
				'<li class="serviceall"><a href="#ÀüÃ¼º¸±â" id="gnbserviceall" class="default" onclick="textGnb.viewAllService();return false;" title="¼­ºñ½º ÀüÃ¼º¸±â">ÀüÃ¼º¸±â</a></li>\n' +
				
				'<li class="loginout"><a href="javascript:textGnb.login();"><img src="http://c1img.cyworld.com/img/common_v7/gnb/btn_gnblogin.gif" border="0" alt="·Î±×ÀÎ" title="·Î±×ÀÎ" /></a></li>\n' +
				
			'</ul>\n' +
			'<ul id="gnbList" style="display:none;">\n' +
				'<li class="top"></li>\n' +
				'<li><a href="http://www.cyworld.com/main2/nateon/3.7/cy_nateon_main_intro.asp" title="³×ÀÌÆ®¿Â ¹Ù·Î°¡±â">³×ÀÌÆ®¿Â</a></li>\n' +
				'<li><a href="http://cynews.cyworld.com/Service/news/ShellIndex.asp" title="´º½º ¹Ù·Î°¡±â">´º½º</a></li>\n' +
				'<li><a href="http://dotori.cyworld.com/daram-G/main.jsp" title="µµÅä¸®ÃæÀü¼Ò ¹Ù·Î°¡±â">µµÅä¸®ÃæÀü¼Ò</a></li>\n' +
				'<li><a href="http://comics.cyworld.com/main/" title="¸¸È­ ¹Ù·Î°¡±â">¸¸È­</a></li>\n' +
				'<li><a href="http://www.cyworld.com/main2/mobile/mbsection3/mb_index.asp" title="¸ð¹ÙÀÏ ¹Ù·Î°¡±â">¸ð¹ÙÀÏ</a></li>\n' +
				'<li><a href="http://cytogether.cyworld.com/campaign/campaign_main.asp" title="»çÀÌÁÁÀº¼¼»ó ¹Ù·Î°¡±â">»çÀÌÁÁÀº¼¼»ó</a></li>\n' +
				'<li><a href="http://www.cyworld.com/main2/studio/studio_main.asp" title="½ºÆ©µð¿À ¹Ù·Î°¡±â">½ºÆ©µð¿À</a></li>\n' +
				'<li><a href="http://movie.cyworld.com/main/" title="¿µÈ­ ¹Ù·Î°¡±â">¿µÈ­</a></li>\n' +
				'<li><a href="http://club.cyworld.com/school/schoolSection/main/section_main.asp" title="¿ì¸®ÇÐ±³ ¹Ù·Î°¡±â">¿ì¸®ÇÐ±³</a></li>\n' +
				'<li><a href="http://fortune.cyworld.com/" title="¿î¼¼ ¹Ù·Î°¡±â">¿î¼¼</a></li>\n' +
				'<li><a href="http://www.cyworld.com/event/eventsection/event_main.asp" title="ÀÌº¥Æ® ¹Ù·Î°¡±â">ÀÌº¥Æ®</a></li>\n' +
				'<li><a href="http://map.cyworld.com/menu/home.map" title="Áöµµ ¹Ù·Î°¡±â">Áöµµ</a></li>\n' +
				'<li><a href="http://www.cyworld.com/pims/Tsection/tsect_index.asp" title="Å¸¿î ¹Ù·Î°¡±â">Å¸¿î</a></li>\n' +
				'<li><a href="http://paper.cyworld.com/paper/psect/psect_index.asp" title="ÆäÀÌÆÛ ¹Ù·Î°¡±â">ÆäÀÌÆÛ</a></li>\n' +
				'<li><a href="http://www.cyworld.com/planner/section/section_index.asp" title="ÇÃ·¡³Ê ¹Ù·Î°¡±â">ÇÃ·¡³Ê</a></li>\n' +
				'<li><a href="http://people.cyworld.com/" title="ÇÇÇÃ ¹Ù·Î°¡±â">ÇÇÇÃ</a></li>\n' +
				'<li><a href="http://happy-click.cyworld.com/" title="ÇØÇÇÅ¬¸¯ ¹Ù·Î°¡±â">ÇØÇÇÅ¬¸¯</a></li>\n' +
				'<li class="footerService"><a href="http://helpdesk.cyworld.com/main.asp" title="ÇïÇÁµ¥½ºÅ© ¹Ù·Î°¡±â">ÇïÇÁµ¥½ºÅ©</a></li>\n' +
				'<li><a href="http://guardian.cyworld.com/main.asp" title="±Ç¸®º¸È£¼¾ÅÍ ¹Ù·Î°¡±â">±Ç¸®º¸È£¼¾ÅÍ</a></li>\n' +
				'<li><a href="http://www.cyworld.com/main2/info/sitemap.asp" title="»çÀÌÆ®¸Ê ¹Ù·Î°¡±â">»çÀÌÆ®¸Ê</a></li>\n' +
			'</ul>';
			return gnbHTML;

		}, //}}}

	login: //{{{
		function () {
			location.href = "http://www.cyworld.com/main2/login.asp?loginstr=direct&redirection=" + this.cyCommon.urlEncode(location.href);
		}, //}}}

	logout: //{{{
		function () {
			location.href = "http://www.cyworld.com/main2/logout.asp";
		}, //}}}

	viewAllService: //{{{
		function () {
			try {
				var obj = document.getElementById("gnbList");
				if (obj.style.display=="none") {
					obj.style.display = "block";
					document.getElementById("gnbserviceall").className = "open";
				} else {
					obj.style.display = "none";
					document.getElementById("gnbserviceall").className = "default";
				}
			} catch (e) { }
		} //}}}
}

function person_info2(tid)
{
	tid = String(tid);

	if (tid == '') {
		document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';

		if(tid.substr(0,1) == "7")
		{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
		else
		{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes')};
	} else {
		document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
		if(tid.substr(0,1) == "7")
		{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
		else
		{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
	}
	return;
}

function showmyhome(tid,url)
{
	if (tid=="") {
		alert("·Î±×ÀÎÇÏ½Å ÈÄ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
	}
	else
	{
		tid = String(tid);

		if (tid == '') {
			if (url == "cale") {
				document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

				if(tid.substr(0,1) == "7")
				{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=diar&urlstrsub=cal','person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
				else
				{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=diar&urlstrsub=cal','person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
				return;
			} else {
				document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

				if(tid.substr(0,1) == "7")
				{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
				else
				{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
				return;
			}
		}
		else {
			if (url == "cale") {
				document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

				if(tid.substr(0,1) == "7")
				{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=diar&urlstrsub=cal','person_info','height=565,width=932,scrollbars=no,resizable=yes');}
				else
				{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=diar&urlstrsub=cal','person_info','height=565,width=932,scrollbars=no,resizable=yes');}
				return;
			} else {
				document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

				if(tid.substr(0,1) == "7")
				{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
				else
				{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
				return;
			}
		}
	}
}

function showmyhome2(tid,url,seq)
{
	if (tid=="") {
		alert("·Î±×ÀÎÇÏ½Å ÈÄ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
	}
	else {
		tid = String(tid);

		if (tid == '') {
			document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

			if(tid.substr(0,1) == "7")
			{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&seq=' + seq,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
			else
			{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&seq=' + seq,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
			return;
		}
		else {
			document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

			if(tid.substr(0,1) == "7")
			{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&seq=' + seq,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
			else
			{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&seq=' + seq,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
			return;
		}
	}
}

function showmyhome3(tid,url,seq)
{
	if (tid=="") {
		alert("·Î±×ÀÎÇÏ½Å ÈÄ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
	}
	else {
		tid = String(tid);

		if (tid == '') {
			if (url.indexOf(",") > 0 && url.split(",")[1] != "0"){
				document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

				if(tid.substr(0,1) == "7")
				{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&seq=' + url.split(",")[1],'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
				else
				{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&seq=' + url.split(",")[1],'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
				return;
			}else{
				document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

				if(tid.substr(0,1) == "7")
				{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url.split(",")[0],'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
				else
				{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url.split(",")[0],'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
				return;
			}
		}
		else {
			if (url.indexOf(",") > 0 && url.split(",")[1] != "0"){
				document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

				if(tid.substr(0,1) == "7")
				{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&seq=' + url.split(",")[1],'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
				else
				{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&seq=' + url.split(",")[1],'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
				return;
			}else{
				document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

				if(tid.substr(0,1) == "7")
				{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url.split(",")[0],'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
				else
				{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url.split(",")[0],'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
				return;
			}
		}
	}
}

function showmyhome5(tid,url,item_seq)
{
	if (tid=="") {
		alert("·Î±×ÀÎÇÏ½Å ÈÄ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
	}
	else {
		tid = String(tid);

		if (tid == '') {
			document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

			if(tid.substr(0,1) == "7")
			{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&item_seq=' + item_seq,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
			else
			{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&item_seq=' + item_seq,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
			return;
		}
		else {
			document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

			if(tid.substr(0,1) == "7")
			{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&item_seq=' + item_seq,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
			else
			{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&item_seq=' + item_seq,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
			return;
		}
	}
}

function showmyhome6(tid,url,urlsub,seq) //¹Ì´ÏÈ¨ÇÇ urlstrsub ÁöÁ¤
{

	if (tid=="") {
		alert("·Î±×ÀÎÇÏ½Å ÈÄ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
	}
	else {
		tid = String(tid);

		if (tid == '') {
			document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

			if(tid.substr(0,1) == "7")
			{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&urlstrsub=' + urlsub + '&seq=' + seq,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
			else
			{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&urlstrsub=' + urlsub + '&seq=' + seq,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
			return;
		}
		else {
			document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';

			if(tid.substr(0,1) == "7")
			{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&urlstrsub=' + urlsub + '&seq=' + seq,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
			else
			{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid + '&urlstr=' + url + '&urlstrsub=' + urlsub + '&seq=' + seq,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
			return;
		}
	}
}

function person_info4(tid)
{
	if (tid == '') {
		document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
		window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');
	} else {
		document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
		window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info','height=565,width=932,scrollbars=no,resizable=yes');
	}
	return;
}

function Directurl(tourl){
	if (tourl=="home"){
		person_info_i('');
	}
	else
	{
		if (tourl!="")
		document.location.href = tourl
	}
}

function goVisitbook(tid,visitbookType)
{
	if (tid=="") {
		alert("·Î±×ÀÎÇÏ½Å ÈÄ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
	}
	else
	{
		document.cookie = 'tid2' + '=N; path=/;domain=cyworld.com';
		var urlsub="";
		if (visitbookType=='1')
			urlsub = "my";
		else if (visitbookType=='2')
			urlsub = "se";
		else if (visitbookType=='3')
			urlsub = "ca";
		else
			urlsub ="";
		if (tid=='')
			urlsub="";

		if(tid.substr(0,1) == "7")
		{	var minihpUrl = "http://town.cyworld.com/pims/main/pims_main.asp?tid="+tid+"&urlstr=bang&urlstrsub=" + urlsub;}
		else if(tid.substr(0, 1) == "a")
		{
			window.open ("http://cyhome.cyworld.com/myhompy/index.php?home_id=" + tid + "&requireType=2&intSearchType=2");
			return;
		}
		else
		{	var minihpUrl = "http://minihp.cyworld.com/pims/main/pims_main.asp?tid="+tid+"&urlstr=bang&urlstrsub=" + urlsub;};

		window.open(minihpUrl,'person_info','height=565,width=932,scrollbars=no,resizable=yes');
	}
}

// Common Script Prototype
//////////////////////////////////////////////
function CyCommon()
{
}

CyCommon.prototype = {
	getXMLHttp: //{{{
		function() {
			if (window.XMLHttpRequest) return new XMLHttpRequest();
			else {
				var xmlhttps = new Array("MSXML2.XMLHttp.7.0","MSXML2.XMLHttp.6.0","MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp");
				for (var i=0; i < xmlhttps.length; i++)
				{
					try {
						var req = new ActiveXObject(xmlhttps[i]);
						return req;
					} catch(e) {}
				}
				return null;
			}
		}, //}}}

	trim: //{{{
		function (strText) {
			var strTemp = "";
			for (i = 0; i < strText.length; i++) {
				if (strText.charAt(i) == " " || strText.charCodeAt(i) == 13 || strText.charCodeAt(i) == 10) {
					strTemp = strTemp;
				} else {
					strTemp = strTemp + strText.charAt(i);
				}
			}
			return strTemp;
		}, //}}}

    getMemberType: //{{{
        function (userId) {
			userId = String(userId);
            if (userId.substring(0, 1) >= "1" && userId.substring(0, 1) <= "6") {
				return "C1";
			} else if (userId.substring(0, 1) >= "7" && userId.substring(0, 1) <= "8") {
				return "TOWN";
			} else if (userId.substring(0, 1) >= "a" && userId.substring(0, 1) <= "t") {
				return "C2";
			} else {
				return "C1";
			}
        }, //}}}

	urlEncode: //{{{
		function (url) {
			var SAFECHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";
			var HEX = "0123456789ABCDEF";

			var encoded = "";
			for (var i = 0; i < url.length; i++ ) {
				var ch = url.charAt(i);
				if (ch == " ") {
					encoded += "+";    // x-www-urlencoded, rather than %20
				} else if (SAFECHARS.indexOf(ch) != -1) {
					encoded += ch;
				} else {
					var charCode = ch.charCodeAt(0);
					if (charCode > 255) {
						encoded += "+";
					} else {
						encoded += "%";
						encoded += HEX.charAt((charCode >> 4) & 0xF);
						encoded += HEX.charAt(charCode & 0xF);
					}
				}
			}
			return encoded;
		}, //}}}

	setNDRClick: //{{{
		function (ndrRegionId)
		{
			var i = new Image();
			i.src = "http://statclick.cyworld.com/stat/statclick.tiff?cp_url=[click_ndr.nate.com/??ndrpageid=ca1&ndrregionid=" + ndrRegionId + "]";
		} //}}}
}

var cyPopup = new CyPopup();
cyPopup.init();
