//ÀÌ¹ÌÁö ¸®»çÀÌÂ¡ ÇÔ¼ö
function img_resize(imgObj, maxWidth, maxHeight)
{
	var thisWidth = imgObj.width;
	var thisHeight = imgObj.height;

	var fixWidth = 0;
	var fixHeight = 0;
	var resizing_rate = 0;

	if (thisWidth > thisHeight) //ÀÌ¹ÌÁö °¡·Î°¡ ±æ °æ¿ì
	{
		if (thisWidth >= maxWidth) //ÀÌ¹ÌÁö °¡·Î°¡ ÃÖ´ë °¡·Îº¸´Ù ±æ °æ¿ì
		{
			fixWidth = maxWidth;
			fixHeight = (maxWidth * thisHeight) / thisWidth; //ºñÀ²¿¡ ¸Â°Ô Ãà¼Ò
		}else 
		{
			fixWidht = thisWidth;
			fixHeight = thisWidth;
		}

		if (fixHeight >= maxHeight) //Á¶Á¤µÉ ¼¼·Î°¡ ÃÖ´ë ¼¼·Îº¸´Ù ±æ °æ¿ì
		{
			fixHeight = maxHeight;
			fixWidth = (maxHeight * fixWidth) / fixHeight; //ºñÀ²¿¡ ¸Â°Ô Ãà¼Ò
		}
	}else //ÀÌ¹ÌÁö Å©±â°¡ °¡·Î ¼¼·Î °°°Å³ª ¼¼·Î°¡ ±æ °æ¿ì
	{
		if (thisHeight >= maxHeight) //ÀÌ¹ÌÁö ¼¼·Î°¡ ÃÖ´ë ¼¼·Îº¸´Ù ±æ °æ¿ì
		{
			fixHeight = maxHeight;
			fixWidth = (maxHeight * fixWidth) / fixHeight; //ºñÀ²¿¡ ¸Â°Ô Ãà¼Ò
		}else
		{
			fixHeight = thisHeight;
			fixWidth = thisWidth;
		}

		if (fixWidth >= maxWidth) //Á¶Á¤µÈ ÀÌ¹ÌÀÚ °¡·Î°¡ ÃÖ´ë °¡·Îº¸´Ù ±æ °æ¿ì
		{
			fixWidth = maxWidth;
			fixHeight = (maxWidth * fixHeight) / fixWidth; //ºñÀ²¿¡ ¸Â°Ô Ãà¼Ò
		}
	}

	imgObj.width = fixWidth;
	imgObj.height = fixHeight;
}

//ÀÌ¹ÌÁö ¸®»çÀÌÂ¡ ÇÔ¼ö2
function img_resize2(imgObj, maxWidth, maxHeight)
{
	//img : 445, 433
	//max : 456, 376
	var thisWidth = imgObj.width;
	var thisHeight = imgObj.height;
	var flg;
	
	if(thisWidth  < maxWidth) maxWidth = thisWidth;
	if(thisHeight < maxHeight) maxHeight = thisHeight;

	if((thisWidth / maxWidth) > (thisHeight / maxHeight))
	{
		maxHeight = Math.round(thisHeight * (maxWidth / thisWidth));
	}else if((thisWidth / maxWidth) < (thisHeight / maxHeight))
	{
		maxWidth = Math.round(thisWidth * (maxHeight / thisHeight));
	}

	imgObj.width = maxWidth;
	imgObj.height = maxHeight;
}

//ÀÌ¹ÌÁö ¸®»çÀÌÂ¡ ÇÔ¼ö3
function img_resize3(imgObj, imgWidth, imgHeight, strNewSrc) { 
  // ÀÌ¹ÌÁö º°µµ ·ÎµùÀ¸·Î ¿ø·¡ »çÀÌÁî ÃßÃâ 
  var imgOriginal = new Image(); 
	
	 
  //if(imgOriginal.width > 0)
  //{
	  imgOriginal.src = strNewSrc; 
	  // °¡·Î¿Í ¼¼·Î Áß ¾î´À°É ±âÁØÀ¸·Î ÁÙÀÏÁö °áÁ¤ 
	  var baseAxis; 
	  if ( (imgOriginal.width / imgWidth) > (imgOriginal.height / imgHeight) ) 
		baseAxis = 'width'; 
	  else 
		baseAxis = 'height'; 
	  // °áÁ¤µÈ ±âÁØÀ» ¹ÙÅÁÀ¸·Î ³ª¸ÓÁö ±æÀÌ¸¦ ¸®»çÀÌÂ¡ 
	  if (baseAxis == 'width') { 
		imgHeight = Math.round(imgOriginal.height * (imgWidth / imgOriginal.width)); 
	  } else { // baseAxis == 'height' 
		imgWidth = Math.round(imgOriginal.width * 
		  (imgHeight / imgOriginal.height)); 
	  }

		imgObj.width = imgWidth;
		imgObj.height = imgHeight;
  //}
} 

//¹®ÀÚ¿­¿¡ ÀÖ´Â Æ¯Á¤¹®ÀÚÆÐÅÏÀ» ´Ù¸¥ ¹®ÀÚÆÐÅÏÀ¸·Î ¹Ù²Ù´Â ÇÔ¼ö
function replace(targetStr, searchStr, replaceStr)
{
    var len, i, tmpstr;
    len = targetStr.length;
    tmpstr = "";
    for ( i = 0 ; i < len ; i++ ) {
		if ( targetStr.charAt(i) != searchStr ) {
			tmpstr = tmpstr + targetStr.charAt(i);
        } else {
			tmpstr = tmpstr + replaceStr;
		}
	}
	return tmpstr;
}

//ÁÂ¿ì °ø¹é Á¦°Å
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}

//ÁÂ °ø¹é Á¦°Å
String.prototype.ltrim = function() {
return this.replace(/^\s+/,"");
}

//¿ì °ø¹é Á¦°Å
String.prototype.rtrim = function() {
return this.replace(/\s+$/,"");
}

//check ¹Ú½º ¼±ÅÃ°ª ¸®ÅÏ
function getCheckBox(obj)
{
	var strChecked = "";
	if (typeof(obj[0]) != "undefined") 
	{
		// 2~
		for (var idxe = 0 ; idxe < obj.length ; idxe++) 
		{
			if (obj[idxe].checked == true) 
			{
				strChecked += obj[idxe].value + ",";
			}
		}
		//¸¶Áö¸· , ÀÚ¸£±â
		strChecked = strChecked.substring(0, strChecked.length - 1);
	}else 
	{
		// only 1
		if (obj.checked == true) 
		{
			strChecked += obj.value;
		}
	}

	return strChecked;
}

//radio ¼±ÅÃ°ª ¸®ÅÏ
function getRadio(obj)
{
	var strChecked = "";
	if (typeof(obj[0]) != "undefined") 
	{
		// 2~
		for (var idxe = 0 ; idxe < obj.length ; idxe++) 
		{
			if (obj[idxe].checked == true) 
			{
				strChecked = obj[idxe].value;
				break;
			}
		}
	}else 
	{
		// only 1
		if (obj.checked == true) 
		{
			strChecked = obj.value;
		}
	}

	return strChecked;
}

//ÁÙ¹Ù²Þ
function nl2br(str) 
{
	var r, re; 
	re = /\n/g; 
	return str.replace(re, "<br>"); 
}

//¹è¿­¿ä¼Ò¿¡ ÀÖ´Â °Ë»ç
function inArray(ar, str) 
{
	var i;
	for (i=0; i < ar.length; i++) {
		if (ar[i] == str) {
			return true;
		}
	}
	return false;
}

//ÆÛ°¡±â¿ë ³»¿ë º¹»ç
function setClipBoard(x)
{
	window.clipboardData.setData('Text', x);
	alert('º¹»çµÇ¾ú½À´Ï´Ù.\nº¹»çÇÑ ³»¿ëÀ» ºÙ¿©³Ö±â ÇÏ¼¼¿ä.');
}

function product_info_copy(LayerID)
{
	var ObjLayerID = document.getElementById(LayerID);
	var infoTEXT = ObjLayerID.innerHTML;

	//infoTEXT = infoTEXT.toLowerCase();

	infoTEXT = infoTEXT.replace(/src=\"\//gi,"src=\"http://" + location.host + "\/");

	infoTEXT = infoTEXT.replace(/src = \"\//gi,"src=\"http://" + location.host + "\/");

	window.clipboardData.setData('Text', infoTEXT);

	//hideJongBox();
	showMessageJongBox2(cyon_now_copy_address_confirm(),315, 126);
}

//·¹ÀÌ¾î ÆË¾÷°ü·Ã ÇÔ¼öµé
//·Î±×ÀÎ Ã¼Å©
function layer_login_check(user_id)
{
	if (user_id == "")
	{

		showMessageJongBox2(login_chk(),315, 126);
		
		return false;
	}else
	{
		return true;
	}
}

//tv ±¤°í ÆÛ°¡±â
function tv_cf_copy(file_url)
{
	var str = '<embed base="." src="http://' + location.host + '/lgcyon/flash/flv_player/wa_flvp_456x376.swf?flvurl=' + file_url + '" quality="best" width="456" height="376" menu="false" scale="noscale" id="lg_cyon_tv_cf" salign="LT" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>' ;
	//var doc = document.body.createTextRange();
	//$('temp').innerHTML = str;
	//doc.moveToElementText($('temp'));
	//doc.execCommand('copy');
	//$('temp').innerHTML = "";
	
	window.clipboardData.setData('Text', str);
	
	showMessageJongBox2(cyon_now_copy_address_confirm(),315, 126);
}

//tv ±¤°í ½ºÅ©·¦
function tv_cf_scrap(owner, fileid)
{
	var thisForm = document.scrap_frm;
	var userid = thisForm.userid.value;
	var thumb_s_name = thisForm.thumb_s_name.value;
	var thumb_s_path = thisForm.thumb_s_path.value;

	if (layer_login_check(userid))
	{
		//baseLayerDIV();
		//$('ShowLayer').innerHTML = cyon_now_scrap();
		showMessageJongBox2(cyon_now_scrap(),532, 430);

		thisForm.owner.value = owner;
		thisForm.fileid.value = fileid;

		$('scrap_thumb').src = thumb_s_path + "/" + thumb_s_name;

		//³» ¾Ù¹ü ¸®½ºÆ® °¡Á®¿À±â
		getMyAlbumList(userid);
	}
}

//¸¶ÀÌ¾Ù¹ü °¡Á®¿À±â
function getMyAlbumList(userid)
{
	var url = "/lgcyon/common/jsp/get_my_album.jsp";
	var pars = "userid=" + userid;

	var myAjax = new Ajax.Request(
		url,
		{
			method: 'get',
			parameters: pars,
			onComplete: setMyAlbumList,
			onFailure: showError
		}
	);
}

//¸¶ÀÌ¾Ù¹ü ¸®½ºÆ® ¼¼ÆÃÇÏ±â
function setMyAlbumList(originalRequest)
{
	var myAlbumListXml = originalRequest.responseXML;

	var myAlbumRowNode	= myAlbumListXml.getElementsByTagName("my_album_row");

	var albumIDNode		= myAlbumListXml.getElementsByTagName("album_id");
	var albumNameNode	= myAlbumListXml.getElementsByTagName("album_name");

	var strAlbumID = "";
	var strAlbumName = "";

	var opt = null;
	var obj = document.scrap_frm_layer.scrapalbum;

	var intMyAlbumRowCnt = myAlbumRowNode.length;

	//±âÁ¸ ¿É¼Ç Áö¿ì±â
	while(obj.length)  //Ç×¸ñµéÀÌ 0ÀÌ µÉ¶§±îÁö
	obj.options.remove(0);  //Áö¿ó´Ï´Ù.

	//³»¿ëÃâ·Â
	if (intMyAlbumRowCnt > 0)
	{
		for (var i = 0 ; i < intMyAlbumRowCnt ; i++ )
		{
			strAlbumID		= albumIDNode[i].childNodes[0].nodeValue;
			strAlbumName	= albumNameNode[i].childNodes[0].nodeValue;
				
			opt = document.createElement("option");
			obj.options.add(opt);
			opt.innerText = strAlbumName;
			opt.value = strAlbumID;
		}
	}else
	{
		opt = document.createElement("option");
		obj.options.add(opt);
		opt.innerText = "»ý¼ºµÈ ¾Ù¹üÀÌ ¾ø½À´Ï´Ù.";
		opt.value = 0;
	}

	makeSelectBox03('scrapalbum');
}

//½ºÅ©·¦ÇÏ±â ÆûÃ¼Å©
function scrap_check(thisForm)
{
	var checker = new FormChecker(thisForm);
	
	if (thisForm.scrapalbum.value == 0)
	{
		alert("»ý¼ºµÈ ¾Ù¹üÀÌ ¾ø½À´Ï´Ù.");
		return;
	}
	checker.checkRequired('scrapalbum', '¾Ù¹üÀ» ¼±ÅÃÇÏ¼¼¿ä', true);

	checker.checkRequired('title', 'Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.', true);
	checker.checkRequired('content', '³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.', true);

	checker.checkAtLeastOneChecked('public', '°ø°³ ¼³Á¤À» ¼±ÅÃÇÏ¼¼¿ä.', false);
	
	if (checker.validate()) 
	{
		//½ºÅ©·¦ÇÏ±â
		var thisForm2 = document.scrap_frm;
		thisForm2.scrapalbum.value = thisForm.scrapalbum.value;
		thisForm2.title.value = thisForm.title.value;
		thisForm2.content.value = thisForm.content.value;
		thisForm2.public.value = getRadio(thisForm.public);

		var url = "/lgcyon/common/jsp/my_album_action.jsp";
		var pars = "";

		var myAjax = new Ajax.Request(
			url,
			{
				method: 'get',
				parameters: Form.serialize($(thisForm2)),
				onComplete: scrapResult,
				onFailure: showError
			}
		);		

	}
}

//½ºÅ©·¦ °á°ú
function scrapResult(originalRequest)
{
	var strScrapResultXML = originalRequest.responseXML;

	var resultCodeNode	= strScrapResultXML.getElementsByTagName("result_code");

	var strResultCode = resultCodeNode[0].childNodes[0].nodeValue;

	if (parseInt(strResultCode) > 0)
	{
		//LayOff('cyon_webalbum_scrap');
		//LayOn('cyon_scrap');

		//closeBaseLayer();
		//baseLayerDIV();
		//$('ShowLayer').innerHTML = cyon_now_scrap_ok();
		if($('cnt_up_where_value'))
		{
			$('cnt_up_where_value').value = strResultCode;
		}

		showMessageJongBox2(cyon_now_scrap_ok(), 315, 126);
	}
}


//¸ð¹ÙÀÏ ucc ½ºÅ©·¦
function mobile_ucc_scrap()
{
	var thisForm = document.scrap_frm;
	var userid = thisForm.userid.value;
	var thumb_s_name = thisForm.thumb_s_name.value;
	var thumb_s_path = thisForm.thumb_s_path.value;

	if (layer_login_check(userid))
	{
		//baseLayerDIV();
		//$('ShowLayer').innerHTML = mobile_scrap();		
		showMessageJongBox2(mobile_scrap(),532, 430);

		$('scrap_thumb').src = thumb_s_path + "/" + thumb_s_name;

		//³» ¾Ù¹ü ¸®½ºÆ® °¡Á®¿À±â
		getMyAlbumList(userid);
	}
}

//¸ð¹ÙÀÏ ucc ½ºÅ©·¦ÇÏ±â ÆûÃ¼Å©
function mobile_ucc_scrap_check(thisForm)
{
	var checker = new FormChecker(thisForm);
	if (thisForm.scrapalbum.value == 0)
	{
		alert("»ý¼ºµÈ ¾Ù¹üÀÌ ¾ø½À´Ï´Ù.");
		return;
	}
	checker.checkRequired('scrapalbum', '¾Ù¹üÀ» ¼±ÅÃÇÏ¼¼¿ä', true);

	checker.checkRequired('title', 'Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.', true);
	checker.checkRequired('content', '³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.', true);

	checker.checkAtLeastOneChecked('public', '°ø°³ ¼³Á¤À» ¼±ÅÃÇÏ¼¼¿ä.', false);

	if (checker.validate()) 
	{
		//½ºÅ©·¦ÇÏ±â
		var thisForm2 = document.scrap_frm;
		thisForm2.scrapalbum.value = thisForm.scrapalbum.value;
		thisForm2.title.value = thisForm.title.value;
		thisForm2.content.value = thisForm.content.value;
		thisForm2.public.value = getRadio(thisForm.public);

		var url = "/lgcyon/common/jsp/my_album_action.jsp";
		var pars = "";

		var myAjax = new Ajax.Request(
			url,
			{
				method: 'post',
				parameters: Form.serialize($('scrap_frm')),
				onComplete: mobileScrapResult,
				onFailure: showError
				
			}
		);		

	}
}

//¸ð¹ÙÀÏ ½ºÅ©·¦ °á°ú
function mobileScrapResult(originalRequest)
{
	var strScrapResultXML = originalRequest.responseXML;

	var resultCodeNode	= strScrapResultXML.getElementsByTagName("result_code");

	var strResultCode = resultCodeNode[0].childNodes[0].nodeValue;

	if (parseInt(strResultCode) > 0)
	{
		//LayOff('cyon_webalbum_scrap');
		//LayOn('cyon_scrap');
		
		if($('cnt_up_where_value'))
		{
			$('cnt_up_where_value').value = strResultCode;
		}

		//closeBaseLayer();
		//baseLayerDIV();
		//$('ShowLayer').innerHTML = cyon_now_scrap_ok();
		showMessageJongBox2(mobile_scrap_ok(),315, 114);
	}
}

//prototype ajax error Ã³¸®
function showError()
{
	alert("error !!!");
}

//°¢Á¾ Ä«¿îÅÍ ¿Ã¸®±â(ajax)
function setCountUp(strTableName, strCountUpField, strWhereField, strWhereValue)
{
	var url = "/lgcyon/common/jsp/set_count_up.jsp";
	var pars = "table=" + strTableName + "&cnt_up_field=" + strCountUpField + "&cnt_up_where_field=" + strWhereField + "&cnt_up_where_value=" + strWhereValue;

	var myAjax = new Ajax.Request(
		url,
		{
			method: 'get',
			parameters: pars,
			onComplete: resultCntUp,
			onFailure: showError
		}
	);
}

function resultCntUp(originalRequest)
{
	var cnt_up_result = originalRequest.responseTEXT;
	//alert(cnt_up_result);
}

//·¹ÀÌ¾î ¼ø¼­ º¯°æ
function change_layer_index(layer_name, layer_index)
{
	$(layer_name).style.zIndex = layer_index;
}

function left_flash() 
{
	var ofsHeight = 170;

	switch (chkBrowser())
	{
		case "MSIE 6.0":
			ofsHeight = 170;
			break;
		case "MSIE 7.0":
			ofsHeight = 220;
			break;
	}
	document.getElementById("leftflash").style.pixelTop = document.getElementById("leftMenu").offsetHeight + ofsHeight;
}



function chkBrowser()
{
	var navName = navigator.appName; //ºê¶ó¿ìÁ® ÀÌ¸§...

	var brVer = navigator.userAgent;//ºê¶ó¿ìÁ® Á¤º¸

	var vrber = "";

	if (navigator.appName == 'Microsoft Internet Explorer')
	{
		var brVerId = brVer.indexOf('MSIE');//ºê¶ó¿ìÁ® Á¤º¸¿¡¼­ 'MSIE'¶ó´Â ºÎºÐÀÇ ¹®ÀÚ¿­
		brNum = brVer.substr(brVerId,8);//ºê¶ó¿ìÁ® ¹öÀü('MSIE' Æ÷ÇÔ..)..
		brNum2 = brNum.substr(5,3)//ºê¶ó¿ìÁ® ¹ö¹ø. ¼ýÀÚ¸¸...

		brver = brNum
	} else {//NetscapeÀÏ °æ¿ì....
		brver = "NS";
	}

	return brver;
}

window.onload = function () {
	if (document.getElementById("leftflash") != null)
	{
		left_flash();
//		mzImageChecks();
//		mzImageRadios();
	}
}

//À¥¾Ù¹ü ¸Þ½ÃÁö º¸¿©ÁÖ±â
function showMessage(actionid)
{
	$("apDiv1").style.display = "";
	$("content_layer_03").innerHTML = actionid.innerHTML;
}

//»çÁø/µ¿¿µ»ó ÇÁ·Î±×·¥ È£Ãâ
function openAgent(userid, encpw, album, content, flg)
{	
	try
	{
		var agent = new ActiveXObject("PnMLauncher.PnMLauncherCtl.1");

		if(agent)
		{
			agent.setUserID(userid, encpw);
			switch(flg)
			{
				case "toPC" :
							agent.toPC(album, content);
							break;
				case "toPhone" :
							agent.toPhone(album, content);
							break;
				case "toOtherSite" :
							agent.toOtherSite(album, content);
							break;
				case "makeNewContent" :
							agent.makeNewContent();
							break;
			}
		}else
		{
			msg="MobileSyncIII°¡ ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù. ¼³Ä¡ÇÏ½Ã°Ú½À´Ï±î?"
			if(confirm(msg)==true)
			{
				location.href="/lgcyon/common/jsp/download_sw.jsp?filename=MobileSyncII_Setup.exe";
			}
		}
	}
	catch (ex)
	{
		try
		{
			var agent2 = new ActiveXObject("PnMLauncher.PnMLauncherCtl.1");

			if(agent2)
			{
				agent2.setUserID(userid);
				switch(flg)
				{
					case "toPC" :
								agent2.toPC(album, content);
								break;
					case "toPhone" :
								agent2.toPhone(album, content);
								break;
					case "toOtherSite" :
								agent2.toOtherSite(album, content);
								break;
					case "makeNewContent" :
								agent2.makeNewContent();
								break;
				}
			}else
			{
				msg="MobileSyncIII°¡ ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù. ¼³Ä¡ÇÏ½Ã°Ú½À´Ï±î?"
				if(confirm(msg)==true)
				{
					location.href="/lgcyon/common/jsp/download_sw.jsp?filename=MobileSyncII_Setup.exe";
				}
			}
		}
		catch (ex2)
		{
			msg="MobileSyncIII°¡ ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù. ¼³Ä¡ÇÏ½Ã°Ú½À´Ï±î?"
			if(confirm(msg)==true)
			{
				location.href="/lgcyon/common/jsp/download_sw.jsp?filename=MobileSyncII_Setup.exe";
			}
		}
	}
}

//Áöµµ ±×¸®±â
function draw_map(obj_id, width, height, map_x, map_y, scale, zoom, save, addr)
{
	var mapObj = new NMap(document.getElementById(obj_id), width, height);
	mapObj.setCenterAndZoom(new NPoint(map_x, map_y), scale);

	//ÁÖ¼ÒÁö ¸¶Å·
	var pos = new NPoint(map_x,map_y);
	//var iconUrl = 'http://static.naver.com/local/map_img/set/icos_free_'+String.fromCharCode(96+1)+'.gif';
	var iconUrl = '/lgcyon/04_global/03_search/images/icon/AS_icon.gif';
	var marker = new NMark(pos,new NIcon(iconUrl,new NSize(59,36)));
	
	if (addr != "")
	{
		var infowin = new NInfoWindow();
		mapObj.addOverlay(infowin);

		NEvent.addListener(marker,"mouseover",function(pos){infowin.set(pos,"<TABLE border=1><TR><TD bgcolor='#FFFFFF' align='center'>" + addr + "</TD></TR></TABLE>");infowin.showWindow()});
		NEvent.addListener(marker,"mouseout",function(){infowin.hideWindow();});
	}

	mapObj.addOverlay(marker);

	if (zoom)
	{
		// ÃàÃ´ ½½¶óÀÌµå¹Ù¸¦ »ý¼ºÇÕ´Ï´Ù.
		var zoom =new NZoomControl();
		// ÃàÃ´ ½½¶óÀÌµå¹Ù¸¦ Áöµµ»óÀÇ ¿À¸¥ÂÊ, ¾Æ·¡·Î ÀÌµ¿ ½ÃÅµ´Ï´Ù
		zoom.setAlign("right");
		zoom.setValign("bottom");
		// ºñµµ °´Ã¼¿¡ ÃàÃ´ ½½¶óÀÌµå¹Ù ÄÁÆ®·ÑÀ» µî·ÏÇÕ´Ï´Ù.
		mapObj.addControl(zoom);
	}

	if (save)
	{
		// ÀúÀå ¹öÆ°À» »ý¼ºÇÕ´Ï´Ù.
		var save = new NSaveBtn();
		// ÀúÀå ¹öÆ°À» Áöµµ»óÀÇ À§ÂÊÀ¸·Î ÀÌµ¿ ½ÃÅµ´Ï´Ù
		save.setValign("top");
		// Áöµµ °´Ã¼¿¡ ÀúÀå ¹öÆ° ÄÁÆ®·ÑÀ» µî·ÏÇÕ´Ï´Ù.
		mapObj.addControl(save);
	}
	
}

function draw_map_no_icon(obj_id, width, height, map_x, map_y, scale, zoom, save, addr)
{
	var mapObj = new NMap(document.getElementById(obj_id), width, height);
	mapObj.setCenterAndZoom(new NPoint(map_x, map_y), scale);

	//ÁÖ¼ÒÁö ¸¶Å·
	var pos = new NPoint(map_x,map_y);
	//var iconUrl = 'http://static.naver.com/local/map_img/set/icos_free_'+String.fromCharCode(96+1)+'.gif';
	//var iconUrl = '/lgcyon/04_global/03_search/images/icon/AS_icon.gif';
	//var marker = new NMark(pos,new NIcon(iconUrl,new NSize(59,36)));
	
	if (addr != "")
	{
		var infowin = new NInfoWindow();
		mapObj.addOverlay(infowin);

		NEvent.addListener(marker,"mouseover",function(pos){infowin.set(pos,"<TABLE border=1><TR><TD bgcolor='#FFFFFF' align='center'>" + addr + "</TD></TR></TABLE>");infowin.showWindow()});
		NEvent.addListener(marker,"mouseout",function(){infowin.hideWindow();});
	}

	//mapObj.addOverlay(marker);

	if (zoom)
	{
		// ÃàÃ´ ½½¶óÀÌµå¹Ù¸¦ »ý¼ºÇÕ´Ï´Ù.
		var zoom =new NZoomControl();
		// ÃàÃ´ ½½¶óÀÌµå¹Ù¸¦ Áöµµ»óÀÇ ¿À¸¥ÂÊ, ¾Æ·¡·Î ÀÌµ¿ ½ÃÅµ´Ï´Ù
		zoom.setAlign("right");
		zoom.setValign("bottom");
		// ºñµµ °´Ã¼¿¡ ÃàÃ´ ½½¶óÀÌµå¹Ù ÄÁÆ®·ÑÀ» µî·ÏÇÕ´Ï´Ù.
		mapObj.addControl(zoom);
	}

	if (save)
	{
		// ÀúÀå ¹öÆ°À» »ý¼ºÇÕ´Ï´Ù.
		var save = new NSaveBtn();
		// ÀúÀå ¹öÆ°À» Áöµµ»óÀÇ À§ÂÊÀ¸·Î ÀÌµ¿ ½ÃÅµ´Ï´Ù
		save.setValign("top");
		// Áöµµ °´Ã¼¿¡ ÀúÀå ¹öÆ° ÄÁÆ®·ÑÀ» µî·ÏÇÕ´Ï´Ù.
		mapObj.addControl(save);
	}
	
}

//Áöµµ ±×¸®±â È£Ãâ
function call_draw_map(obj_cnt)
{
	var div_obj = null;
	for (var i = 0 ; i < obj_cnt ; i++)
	{
		div_obj = document.getElementById("asmap_" + i);
		if (div_obj.getAttribute("map_x") != "" && div_obj.getAttribute("map_y") != "")
		{
			//commonÀÇ ÇÔ¼ö È£Ãâ
			draw_map("asmap_" + i, 111, 75, div_obj.getAttribute("map_x"), div_obj.getAttribute("map_y"), 2, false, false, "");
		}
	}
}

//·Î±×ÀÎ ÀÌµ¿
function go_login()
{
	if($('goLoginForm'))
	{
		$('goLoginForm').submit();
	}else
	{
		document.location.href = "/lgcyon/04_global/01_login/login.jsp";
	}
}

//ÆäÀÌÂ¡
function paging(intTotalCnt, intCurPage, intListCnt, intPageCnt)
{
	var strPagingLink = "";
	
	var intTotalPage = 0;
	var intTotalBlock = 0;
	var intCurBlock = 0;
	var intStartPage = 0;

	if (parseInt(intTotalCnt) > 0)
	{
		//ÀüÃ¼ ÆäÀÌÁö
		intTotalPage = Math.ceil(intTotalCnt / intListCnt);

		//ÀüÃ¼ ºí·°
		intTotalBlock = Math.ceil(intTotalPage / intPageCnt);

		//ÇöÀç ºí·°
		intCurBlock = Math.ceil(intCurPage / intPageCnt);

		//½ÃÀÛ ÆäÀÌÁö
		intStartPage = (intCurBlock - 1) * intPageCnt + 1;

		strPagingLink  = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
		strPagingLink += "<tr>\n";

		//ÀÌÀü ºí·° °¡±â
		if (intCurBlock > 1)
		{
			strPagingLink += "<td><a href=\"javascript:GoPage(" + ( intStartPage - 1 ) + ")\"><img src=\"/lgcyon/common/img/page_list_l.gif\" width=\"15\" height=\"25\" alt=\"ÀÌÀü " + intPageCnt +"  ÆäÀÌÁö\" border=\"0\"></a></td>\n";
		}else
		{
			strPagingLink += "<td><img src=\"/lgcyon/common/img/page_list_l.gif\" width=\"15\" height=\"25\" alt=\"\" border=\"0\"></td>\n";
		}


		//ºí·°³» ÆäÀÌÁö ¸®½ºÆ®
		strPagingLink += "<td style=\"padding:0 10px;\">";
		for (var i = intStartPage ; (i < (intCurBlock * intPageCnt) + 1) && (i <= intTotalPage) ; i++)
		{
			if (intCurPage == i)
			{
				strPagingLink += "<a href=\"#\" class=\"pagelistN\">" + i + "</a>&nbsp;\n";
			}else
			{
				strPagingLink += "<a href=\"javascript:GoPage(" + i + ")\" class=\"pagelist\">" + i + "</a>&nbsp;\n";
			}
		}
		strPagingLink += "</td>\n";

		//´ÙÀ½ ºí·° °¡±â
		if (intCurBlock < intTotalBlock)
		{
			strPagingLink += "<td><a href=\"javascript:GoPage(" + ( intCurBlock * intPageCnt + 1 ) + ")\"><img src=\"/lgcyon/common/img/page_list_r.gif\" width=\"15\" height=\"25\" alt=\"´ÙÀ½ " + intPageCnt +"  ÆäÀÌÁö\" border=\"0\"></a></td>\n";
		}else
		{
			strPagingLink += "<td><img src=\"/lgcyon/common/img/page_list_r.gif\" width=\"15\" height=\"25\" alt=\"\" border=\"0\"></td>\n";
		}

		strPagingLink += "</tr>\n";
		strPagingLink += "</table>\n";

	}

	return strPagingLink;
}

//±ÛÀÚÀÚ¸£±â
function cut_string(str, maxlength, detail)
{
	var ls_str		= str; // ÀÌº¥Æ®°¡ ÀÏ¾î³­ ÄÁÆ®·ÑÀÇ value °ª
	var li_str_len	= maxlength; // ÀüÃ¼±æÀÌ

	// º¯¼öÃÊ±âÈ­
	var li_max = maxlength; // Á¦ÇÑÇÒ ±ÛÀÚ¼ö Å©±â
	var i = 0; // for¹®¿¡ »ç¿ë
	var li_byte = 0; // ÇÑ±ÛÀÏ°æ¿ì´Â 2 ±×¹Ü¿¡´Â 1À» ´õÇÔ
	var li_len = 0; // substringÇÏ±â À§ÇØ¼­ »ç¿ë
	var ls_one_char = ""; // ÇÑ±ÛÀÚ¾¿ °Ë»çÇÑ´Ù
	var ls_str2 = ""; // ±ÛÀÚ¼ö¸¦ ÃÊ°úÇÏ¸é Á¦ÇÑÇÒ¼ö ±ÛÀÚÀü±îÁö¸¸ º¸¿©ÁØ´Ù.

	for(i=0; i< li_str_len; i++)
	{
		// ÇÑ±ÛÀÚÃßÃâ
		ls_one_char = ls_str.charAt(i);

		// ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
		if (escape(ls_one_char).length > 4)
		{
			li_byte += 2;
		}
		// ±×¹ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
		else
		{
			li_byte++;
		}

		// ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
		if(li_byte <= li_max)
		{
			li_len = i + 1;
		}
	}

	// ÀüÃ¼±æÀÌ¸¦ ÃÊ°úÇÏ¸é
	if(li_byte > li_max)
	{
		ls_str2 = ls_str.substr(0, li_len) + detail;
	}else
	{
		ls_str2 = str;
	}

	return ls_str2;
}

/*
ÇÔ¼ö ¼³¸í : ¿µ¹®°ú ¼ýÀÚ¸¸ ÀÖ´Â StringÀÎÁö ºñ±³ ÇÏ´Â ÇÔ¼ö
ÀÔ·Â°ª : String
¸®ÅÏ°ª : Á¶°Ç¿¡ ¸Â´Â ÇüÅÂÀÏ °æ¿ì false,  ¾Æ´Ò°æ¿ì true
*/
function chkEngNum(str)
{ 
	var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" 
	var bFlag = false; 
	var temp; 
		
	for (var i=0; i<str.length; i++)
	
		{ 
		temp = "" + str.substring(i, i+1); 
		if (valid.indexOf(temp) == "-1") bFlag = true; 
		} 

	if (bFlag)		
	{
		return true; //¿Ã¹Ù¸£Áö ¾ÊÀº
	}

	return false;//¿Ã¹Ù¸¥
}

/*
ÇÔ¼ö ¼³¸í : ¼ýÀÚ¸¸ ÀÖ´Â StringÀÎÁö ºñ±³ ÇÏ´Â ÇÔ¼ö
ÀÔ·Â°ª : String
¸®ÅÏ°ª : Á¶°Ç¿¡ ¸Â´Â ÇüÅÂÀÏ °æ¿ì false,  ¾Æ´Ò°æ¿ì true
*/
//Á¤¼ö Ã¼Å©
function chkNum(temp){	
	if (temp.search(/^[0-9]+$/) == -1){
		return true;//¿Ã¹Ù¸£Áö ¾ÊÀº ¹øÈ£
	}
		return false;//¿Ã¹Ù¸¥ ¹øÈ£
}

function chkNum_f(obj)
{
	var numPattern = /([^0-9])/;
    numPattern = obj.value.match(numPattern);
	if (numPattern != null) 
	{
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
        obj.value = obj.value.substring(0,obj.value.length-1);
        obj.focus();
	}
}

/*
ÇÔ¼ö ¼³¸í : ÁÖ¹Îµî·Ï ¹øÈ£°¡ ¿Ã¹Ù¸¥Áö È®ÀÎÇÏ´Â ÇÔ¼ö
ÀÔ·Â°ª : String, String
¸®ÅÏ°ª : ÁÖ¹Îµî·Ï ¹øÈ£ÀÇ ÇüÅÂÀÏ °æ¿ì false,  ¾Æ´Ò°æ¿ì true
*/
function peridCheck(strPerid1, strPerid2)
{
var idnumber = strPerid1+strPerid2;

a = new Array(13);
for(var i=0; i<13;i++)

	{
	a[i] = parseInt(idnumber.charAt(i));
	}

var j = a[0]*2 + a[1]*3 + a[2]*4 + a[3]*5 + a[4]*6 + a[5]*7 + a[6]*8 + a[7]*9 + a[8]*2 + a[9]*3 + a[10]*4 + a[11]*5;
var j = j % 11;
var k = 11 - j;

if(k > 9)

	{
	k = k % 10
	}

if(k != a[12])

	{
	return true; //¿Ã¹Ù¸£Áö ¾ÊÀº ¹øÈ£
	}

else
	
	{
	return false; //¿Ã¹Ù¸¥ ¹øÈ£
	}
}

//Æù ¾÷±×·¹ÀÌµå ½ÃÀÛÇÏ±â
function phone_upgrade_start()
{
	//var mypage="http://csmg.lgmobile.com:9002/csmg/popup/activex/jsp/upgrade_start.html";
	var mypage = "http://updateinstall.lgmobile.com/";
	//var myname="";
	//var w="50";
	//var h="50";
	//var winl = (screen.width - w) / 2;
	//var wint = (screen.height - h) / 2;
	//winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=0'
	win = window.open(mypage)
	//win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	
}

function phone_upgrade_start2()
{
	//var mypage="http://csmg.lgmobile.com:9002/csmg/popup/activex/jsp/upgrade_start.html";
	//var mypage = "http://updateinstall.lgmobile.com/";
	var mypage = "/update.html";
	var myname="";
	var w="50";
	var h="50";
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=0'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//Æù ¾÷±×·¹ÀÌµå Áö¿ø¸ðµ¨»ó¼¼º¸±â ÆË¾÷
function upgrade_model_pop()
{
	showMessageJongBox2(upgrade_model_layer_pop(), 535, 277);

	get_upgrade_model_list("");
}

//Æù ¾÷±×·¹ÀÌµå ÁÖ¿ä °øÁö»çÇ×
function phone_upgrade_notice()
{
	var url = "http://csmg.lgmobile.com:9002/csmg/popup/help_management_list_ko.jsp";
	var name = "";
	var winprops = "scrollbars=yes, left=0, top=0, width=848 height=460";
	win = window.open(url, name, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//Áõ»óº° ´ëÃ³¹æ¾È
function fnc_so(){
	//window.open('http://www.cyon.co.kr/good/popup/cs_popup_guide_so.jsp','','scrollbars=yes, left=0, top=0, resizable=1, width=557 height=500');
	window.open("/lgcyon/04_global/04_service/guide_popup/step_guide.jsp","guide_popup","scrollbars=yes, left=0, top=0, resizable=1, width=530 height=500");
}

//µµ¿ò¸»
function fnc_help(flag)
{
	if (flag == "1")  window.open('http://www.cyon.co.kr/good/popup/cs_popup_guide_msync.jsp','','scrollbars=yes, left=0, top=0, width=617 height=700');	 //LG Mobile Sync ´Ù¿î·Îµå
	else if(flag == "1_1") window.open('http://www.cyon.co.kr/good/popup/cs_popup_guide_msync08.jsp','','scrollbars=yes, left=0, top=0, width=617 height=700');	 //LG Mobile Sync ´Ù¿î·Îµå
	//else if(flag == "1_2") window.open('http://www.cyon.co.kr/good/popup/cs_popup_guide_kh1200.jsp','','scrollbars=yes, left=0, top=0, width=557 height=540');	//LG-KH1200 Sync ´Ù¿î·Îµå
	else if(flag == "1_2") window.open('http://www.cyon.co.kr/lgcyon/04_global/04_service/pop/cs_popup_guide_kh1200.jsp','','scrollbars=yes, left=0, top=0, width=527 height=540');	//LG-KH1200 Sync ´Ù¿î·Îµå
	else if(flag == "1_3") window.open('http://www.cyon.co.kr/good/popup/cs_popup_guide_ezsync2.jsp','','scrollbars=yes, left=0, top=0, width=557 height=540');	//ez sync ´Ù¿î·Îµå
	else if(flag == "5_1") window.open('http://www.cyon.co.kr/good/popup/cs_popup_guide_msync08.jsp#02','','scrollbars=yes, left=0, top=0, width=617 height=700');	//USB µå¶óÀÌ¹ö
	else if(flag == "5_2") window.open('/lgcyon/04_global/04_service/pop/skt_usb_drive_pop.jsp','','scrollbars=yes, left=0, top=0, width=558 height=700');
}

//°¡ÀÌµå
function fnc_guide(tab_id)
{
	if (tab_id == '1')
	{
		//window.open('http://www.cyon.co.kr/good/cs/Help_cdma/Help_cdma.html','','scrollbars=no, left=0, top=0, resizable=1, width=883 height=420');
		//window.open('/lgcyon/04_global/04_service/03_sw/pop/sync2_installguide/Help_cdma.html','','scrollbars=no, left=0, top=0, resizable=0, width=883 height=420');
		//location.href="/data_svc/service/sw/Guide_MobileSyncIII.zip";
		window.open('/lgcyon/04_global/04_service/03_sw/pop/sync3_installguide/Help_cdma.html','','scrollbars=no, left=0, top=0, resizable=0, width=883 height=420');
	}else if (tab_id == '2')
	{
		//window.open('http://www.cyon.co.kr/good/popup/cs_popup_guide_dmb.jsp','','scrollbars=yes, left=10, top=10, width=556 height=540');
		dmb_player_install_guide_popup()
	}else if (tab_id == '2_1')
	{
		window.open('http://www.cyon.co.kr/good/cs/usb_help/install_guide.html','','scrollbars=no, left=10, top=10, width=840 height=400');
	}else if(tab_id == '4')
	{
		window.open('http://www.cyon.co.kr/good/popup/cs_popup_model_sktusbset2.jsp','','scrollbars=yes, left=10, top=10, width=556 height=540');
	}else if (tab_id == "sync1")
	{
		window.open('http://www.cyon.co.kr/good/popup/cs_popup_guide_ms.jsp','','scrollbars=yes, left=10, top=10, width=556 height=540');
	}
}

//ez sync II ¼³Ä¡ °¡ÀÌµå
/*
function ez_sync_2_help() 
{
	var window_width	= 530;
	var window_height	= 410;
	var window_left		= (screen.width  - window_width) / 2;
	var window_top		= (screen.height - window_height) / 2 - 5;
	var parm1			= "width=" + window_width + ",height=" + window_height + ",left=" + window_left + ",top=" + window_top + ",status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no";
	remote=window.open('', "vodd", parm1);
	remote.location.href = "/lgcyon/04_global/04_service/pop/faq_down.jsp";
}
*/
function ez_sync_2_help() 
{
	var window_width	= 1010;
	var window_height	= 750;
	var window_left		= (screen.width  - window_width) / 2;
	var window_top		= (screen.height - window_height) / 2 - 5;
	var parm1			= "width=" + window_width + ",height=" + window_height + ",left=" + window_left + ",top=" + window_top + ",status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";
	remote=window.open('', "vodd", parm1);
	remote.location.href = "/lgcyon/04_global/04_service/pop/ms3_introduce/flash_help_index.html";
}

//ez sync ´Ù¿î·Îµå
function ez_sync_download() 
{
	var window_width	= 530;
	var window_height	= 410;
	var window_left		= (screen.width  - window_width) / 2;
	var window_top		= (screen.height - window_height) / 2 - 5;
	var parm1			= "width=" + window_width + ",height=" + window_height + ",left=" + window_left + ",top=" + window_top + ",status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no";
	remote=window.open('', "vodd", parm1);
	remote.location.href = "/lgcyon/04_global/04_service/pop/pop_EZSync.jsp";
}

//ÆË¾÷Â÷´Ü¾È³»ÆË¾÷
function no_popup() 
{
	var window_width	= 531;
	var window_height	= 420;
	var window_left		= (screen.width  - window_width) / 2;
	var window_top		= (screen.height - window_height) / 2 - 5;
	var parm1			= "width=" + window_width + ",height=" + window_height + ",left=" + window_left + ",top=" + window_top + ",status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";
	remote=window.open('', "vodd", parm1);
	remote.location.href = "/lgcyon/04_global/04_service/pop/pop_interception.jsp";
}

//ÀÔ·Â±ÛÀÚ¼ö Á¦ÇÑ
function fc_chk_byte(aro_name, ari_max)
{
	var ls_str = aro_name.value; // ÀÌº¥Æ®°¡ ÀÏ¾î³­ ÄÁÆ®·ÑÀÇ value °ª
	var li_str_len = ls_str.length; // ÀüÃ¼±æÀÌ

	// º¯¼öÃÊ±âÈ­
	var li_max = ari_max; // Á¦ÇÑÇÒ ±ÛÀÚ¼ö Å©±â
	var i = 0; // for¹®¿¡ »ç¿ë
	var li_byte = 0; // ÇÑ±ÛÀÏ°æ¿ì´Â 2 ±×¹Ü¿¡´Â 1À» ´õÇÔ
	var li_len = 0; // substringÇÏ±â À§ÇØ¼­ »ç¿ë
	var ls_one_char = ""; // ÇÑ±ÛÀÚ¾¿ °Ë»çÇÑ´Ù
	var ls_str2 = ""; // ±ÛÀÚ¼ö¸¦ ÃÊ°úÇÏ¸é Á¦ÇÑÇÒ¼ö ±ÛÀÚÀü±îÁö¸¸ º¸¿©ÁØ´Ù.

	for(i=0; i< li_str_len; i++)
	{
		// ÇÑ±ÛÀÚÃßÃâ
		ls_one_char = ls_str.charAt(i);

		// ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
		if (escape(ls_one_char).length > 4)
		{
			li_byte += 2;
		}
		// ±×¹ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
		else
		{
			li_byte++;
		}

		// ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
		if(li_byte <= li_max)
		{
			li_len = i + 1;
		}
	}

	// ÀüÃ¼±æÀÌ¸¦ ÃÊ°úÇÏ¸é
	if(li_byte > li_max)
	{
		alert( li_max + " Byte¸¦ ÃÊ°ú ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù. \n ÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù. ");
		ls_str2 = ls_str.substr(0, li_len);
		aro_name.value = ls_str2;
	}
	aro_name.focus(); 
}

//ÀÔ·Â ¹ÙÀÌÆ® ¼ö Ç¥½Ã
function fc_chk_byte2(aro_name, ari_max, show_obj_id)
{
	var ls_str = aro_name.value; // ÀÌº¥Æ®°¡ ÀÏ¾î³­ ÄÁÆ®·ÑÀÇ value °ª
	var li_str_len = ls_str.length; // ÀüÃ¼±æÀÌ

	// º¯¼öÃÊ±âÈ­
	var li_max = ari_max; // Á¦ÇÑÇÒ ±ÛÀÚ¼ö Å©±â
	var i = 0; // for¹®¿¡ »ç¿ë
	var li_byte = 0; // ÇÑ±ÛÀÏ°æ¿ì´Â 2 ±×¹Ü¿¡´Â 1À» ´õÇÔ
	var li_len = 0; // substringÇÏ±â À§ÇØ¼­ »ç¿ë
	var ls_one_char = ""; // ÇÑ±ÛÀÚ¾¿ °Ë»çÇÑ´Ù
	var ls_str2 = ""; // ±ÛÀÚ¼ö¸¦ ÃÊ°úÇÏ¸é Á¦ÇÑÇÒ¼ö ±ÛÀÚÀü±îÁö¸¸ º¸¿©ÁØ´Ù.

	for(i=0; i< li_str_len; i++)
	{
		// ÇÑ±ÛÀÚÃßÃâ
		ls_one_char = ls_str.charAt(i);

		// ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
		if (escape(ls_one_char).length > 4)
		{
			li_byte += 2;
		}
		// ±×¹ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
		else
		{
			li_byte++;
		}

		// ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
		if(li_byte <= li_max)
		{
			li_len = i + 1;
		}
	}
	
	//$(show_obj_id).innerHTML = "ÀÔ·Â ¹ÙÀÌ½º ¼ö : " + li_byte + " byte";
	$(show_obj_id).innerHTML = li_byte + " byte / " + ari_max + " byte";

	// ÀüÃ¼±æÀÌ¸¦ ÃÊ°úÇÏ¸é
	if(li_byte > li_max)
	{
		alert( li_max + " Byte¸¦ ÃÊ°ú ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù. \n ÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù. ");
		ls_str2 = ls_str.substr(0, li_len);
		aro_name.value = ls_str2;
	}
	aro_name.focus(); 
}

//±âº» ÀÔ·Â°ª Ã¼Å©
function chk_default_set(obj, strDefaultText)
{
	if (obj.value == strDefaultText)
	{
		obj.value = "";
	}

	//chk_default_set(this, '¿Â¶óÀÎ »ó´ã ¹®ÀÇ´Â ÃÖ´ë 3000¹ÙÀÌÆ®(ÇÑ±Û ¾à 1500ÀÚ)±îÁö ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù.')
}

//sar ÆË¾÷
function sar_popup()
{
//	window.open('/lgcyon/04_global/04_service/pop/phone_passConfirm_addFunc.jsp','sar','scrollbars=yes, left=10, top=10, width=550 height=540');
	
	var window_width  = 680;
    var window_height = 410;
	
	var window_left   = (screen.width  - window_width) / 2;
	var window_top    = (screen.height - window_height) / 2 - 5;
	var parm1			= "width=" + window_width + ",height=" + window_height + ",left=" + window_left + ",top=" + window_top + ",status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no";
	remote=window.open('', "sar", parm1);
	remote.location.href = "/lgcyon/04_global/04_service/pop/sar/sar.jsp";
}

//ÄíÅ°È®ÀÎ
function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	
	return "";
}

//ÄíÅ° ¼¼ÆÃ
function setCookie( name, value, expiredays ) 
{ 
	var todayDate = new Date(); 
        todayDate.setDate( todayDate.getDate() + expiredays ); 
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

//ÆË¾÷ ¶ç¿ì±â
function winOpen(url, name, w, h) 
{
	/* url:¿ÀÇÂÇÒ °æ·Î ¹× ÆÄÀÏ¸í name:ÆË¾÷ ÀÌ¸§ w:³ÐÀÌ h:³ôÀÌ s:resizeable(yes or no)*/
	var window_width  = w;
	var window_height = h;
	var window_left   = (screen.width  - window_width) / 2;
	var window_top    = (screen.height - window_height) / 2 - 5;
	var openParam = "width="+w+", height="+h+", titlebar=no, toolbar=no, menubar=no, location=no, directories=no, status=no,resizable=no,scrollbars=yes"
	var wn = window.open(url, name, openParam);
	wn.focus();
}
//ÆË¾÷ ¶ç¿ì±â(Á¤°¡¿îµ¥)
function winOpen_center(url, name, w, h) 
{
	/* url:¿ÀÇÂÇÒ °æ·Î ¹× ÆÄÀÏ¸í name:ÆË¾÷ ÀÌ¸§ w:³ÐÀÌ h:³ôÀÌ s:resizeable(yes or no)*/
	var window_width  = w;
	var window_height = h;
	var window_left   = (screen.width  - window_width) / 2;
	var window_top    = (screen.height - window_height) / 2 - 5;
	var openParam = "width="+w+", height="+h+", top=" + window_top + ", left=" + window_left + ", titlebar=no, toolbar=no, menubar=no, location=no, directories=no, status=no,resizable=no,scrollbars=yes"
	var wn = window.open(url, name, openParam);
	wn.focus();
}

//ÀÍ½º background ÀÌ¹ÌÁö Ä³½¬ ¹®Á¦ ÇØ°á ½ºÅ©¸³Æ®
try 
{ 
	document.execCommand('BackgroundImageCache', false, true);  
} catch(me) {

}

//ÀÌº¥Æ® ÆË¾÷(µð½ºÅ©Æù)
function disco_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 680
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/disco/main.html";
	window.open(url, "disco_main", "fullscreen");
	//window.open(url,"disco_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(ºñÅ°´ÏÆù)
function vikini_event_popup(strTitle, strKind)
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 680
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/bikini/main.jsp?title=" + strTitle + "&kind=" + strKind;
	window.open(url, "vikini_main", "fullscreen");
	//window.open(url,"vikini_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(½ÃÅ©¸´Æù)
function secret_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 680
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/secret/index.html";
	window.open(url, "secret_main", "fullscreen");
	//window.open(url,"secret_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(¾Ë¸®¹ÙÀÌÆù)
function sh400_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/cyon_sh400/index.jsp";
	window.open(url, "sh400_main", "fullscreen");
	//window.open(url,"sh400_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(edge Æù) 20081107 À±Ã¢Çö Ãß°¡
function edge_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/edge/main.html";
	window.open(url, "edge_main", "fullscreen");
	//window.open(url,"edge_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}
	
//ÀÌº¥Æ® ÆË¾÷(ÇÃ·©Å¬¸° ÇÃ·¡³Ê Æù) 20081214 À± Ã¢ Çö Ãß°¡
function franklin_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/franklin/index.jsp";

	window.open(url, "franklin_main", "fullscreen");

	//window.open(url,"franklin_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(¾ÆÀÌ½ºÅ©¸² 2 Æù) 20090102 À± Ã¢ Çö Ãß°¡
function icecream2_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/icecream2/bottom.html";

	//window.open(url, "icecream2_main", "fullscreen");

	window.open(url,"icecream2_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(sh490 Æù) 20090105 À± Ã¢ Çö Ãß°¡
function sh490_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/sh490/index.jsp";

	//window.open(url, "icecream2_main", "fullscreen");

	window.open(url,"sh490_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes");
}

//ÀÌº¥Æ® ÆË¾÷(¾ÆÀÌ½ºÅ©¸²Æù) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function icecream_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/icecream/main.jsp";

	window.open(url, "icecream_main", "fullscreen");

	//window.open(url,"icecream2_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(wine) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function wine_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/v390/index.html";

	window.open(url, "wine_main", "fullscreen");

	//window.open(url,"icecream2_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(rhapsodymusic) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function rhapsody_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.rhapsodymusic.co.kr/hotchoco/lb3300_main.asp";

	window.open(url, "rhapsody_main", "fullscreen");

	//window.open(url,"icecream2_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(viewty) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function viewty_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 1000
	var intHeight = 660
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/lgcyon/micro_site/viewty_phone/main.html";

	window.open(url, "viewty_main", "fullscreen");

	//window.open(url,"icecream2_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(shinetv) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function shinetv_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 806
	var intHeight = 558
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/shinetv/index.jsp";

	window.open(url, "shinetv_main", "fullscreen");

	//window.open(url,"shinetv_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(shine) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function shine_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 806
	var intHeight = 558
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/shine/index_shine.jsp";

	window.open(url, "shine_main", "fullscreen");

	//window.open(url,"shine_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(blacklabel2) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function blacklabel2_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 806
	var intHeight = 558
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/blacklabel2/index.jsp";

	window.open(url, "blacklabel2_main", "fullscreen");

	//window.open(url,"blacklabel2","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(blacklabel) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function blacklabel_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 806
	var intHeight = 558
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/black/index.jsp";

	window.open(url, "blacklabel_main", "fullscreen");

	//window.open(url,"shinetv_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(blacklabel) 20090113 Á¦°¥±Ç ÀÏ°ýÃß°¡
function tphone_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/tphone/Default.htm";

	window.open(url, "tphone_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(cooky) 20090228 À± Ã¢ Çö Ãß°¡
function cooky_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/cooky/service/index.jsp";

	window.open(url, "cooky_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}


//ÀÌº¥Æ® ÆË¾÷(cooky micro) 20090313 À± Ã¢ Çö Ãß°¡
function cooky_micro_event_popup()
{
	var height = screen.availHeight - 15;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/cooky_micro/main.jsp";

	window.open(url, "cooky__micro_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(lollipop) 20090328 À± Ã¢ Çö Ãß°¡
function lollipop_event_popup()
{
	var height = screen.availHeight - 57;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/lollipop/main.html";

	window.open(url, "lollipop_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//ÀÌº¥Æ® ÆË¾÷(lollipop) 20090416 Á¦ °¥ ±Ç Ãß°¡
function suit_event_popup()
{
	var height = screen.availHeight - 57;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/suit/index.jsp?idx=4";

	window.open(url, "suit_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}
//ÀÌº¥Æ® ÆË¾÷(lollipop) 20090416 Á¦ °¥ ±Ç Ãß°¡
function newchocolate_event_popup()
{
	var height = screen.availHeight - 57;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/newchocolate/main.jsp";

	window.open(url, "newchocolate", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}
//ÀÌº¥Æ® ÆË¾÷(arena) 20090617 Á¦ °¥ ±Ç Ãß°¡
function arena_event_popup()
{
	var url = "http://www.cyon.co.kr/event/arena/index.html";
	window.open(url, "arena_main", "fullscreen");
}

function arena_event_20090714()
{
	var url = "http://www.cyon.co.kr/event/arena/index.html";
	window.open(url, "arena_main", "fullscreen");
}

//ÀÚ¹Ù½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇÑ get¹æ½ÄÀÇ Àü´Þ°ª ±¸ÇÏ±â
function parameter_return(strParameterVar)
{
	var params = window.location.search.substring( 1 ).split( '&' ); //ÆÄ¶ó¸ÞÅÍ ºÎºÐÀ» ±¸ÇÏ¿© &±¸ºÐÀ¸·Î ÀÚ¸§

	var strReturn = "";

	for( var i = 0, l = params.length; i < l; ++i ) 
	{
		var parts = params[i].split( '=' ); 
		if (parts[0] == strParameterVar)
		{
			strReturn = parts[1];
			break;
		}
	}

	return strReturn;
}
//ÀÌº¥Æ® ÆË¾÷(lollipop) 20090328 À± Ã¢ Çö Ãß°¡
function pro_event_popup()
{
	var height = screen.availHeight - 57;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/pro/teaser.html";

	window.open(url, "pro_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}

//¿Â¶óÀÎ¹®ÀÇ ÆË¾÷Ã¢
function qna_online_pop()
{
	var window_width	= 603;
	var window_height	= 426;
	var window_left		= (screen.width  - window_width) / 2;
	var window_top		= (screen.height - window_height) / 2 - 5;
	var parm1			= "width=" + window_width + ",height=" + window_height + ",left=" + window_left + ",top=" + window_top + ",status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";
	remote=window.open('', "vodd", parm1);
	remote.location.href = "/lgcyon/04_global/04_service/01_qna/qna_online_category_pop.jsp";
}
//¿Â¶óÀÎ¹®ÀÇ ÆË¾÷Ã¢
function qna_online_pop_club(strClubId)
{
	var window_width	= 603;
	var window_height	= 426;
	var window_left		= (screen.width  - window_width) / 2;
	var window_top		= (screen.height - window_height) / 2 - 5;
	var parm1			= "width=" + window_width + ",height=" + window_height + ",left=" + window_left + ",top=" + window_top + ",status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";
	remote=window.open('', "vodd", parm1);
	var strUrl = "/lgcyon/04_global/04_service/01_qna/qna_online_category_pop_club.jsp?club_id="+strClubId;
	remote.location.href = strUrl;
}

//¿Â¶óÀÎ¹®ÀÇ ¼­ºñ½ºÁß´Ü¾È³»ÆË¾÷

function qna_online_pop_summer()
{
	var window_width	= 603;
	var window_height	= 426;
	var window_left		= (screen.width  - window_width) / 2;
	var window_top		= (screen.height - window_height) / 2 - 5;
	var parm1			= "width=" + window_width + ",height=" + window_height + ",left=" + window_left + ",top=" + window_top + ",status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";
	remote=window.open('', "vodd", parm1);
	remote.location.href = "https://www.cyon.co.kr/lgcyon/04_global/04_service/01_qna/qna_online_category_pop.jsp?blockCate1=2";
}


//ÅØ½ºÆ® °¡·Î ½ºÅ©·Ñ·¯
var hstid = null; // Å¸ÀÌ¸Ó¸¦ ÃÊ±âÈ­ 

// t´Â ½ºÅ©·ÑÇÒ ÅØ½ºÆ® spanÀÇ id, s´Â 0, vµµ 'p'.. µµµ¹ÀÌ ÇÔ¼ö ÇÏ³ª·Î ´ÙÇØ¸ÔÀ»¶ó°í... 
function ScrollSubj(t, s, v){ 
    var spd = 20; // Èå¸£´Â ¼Óµµ, Áï °»½Å ½Ã°£ ms 
    var dly = 1000; // ³¡¿¡ ´Ù´Ù¸£¸é Àá½Ã µô·¹ÀÌ µÇ´Â ½Ã°£ ms 
    var st = s; 
    var tt = document.getElementById(t); 
    var tW = tt.scrollWidth; 
    var oW = tt.parentNode.parentNode.offsetWidth; 
    var mv = tW - oW + 3; 

    if(mv < 0){ 
        return; 
    } 
    if(v == 'p' && mv >= st){ 
        st = s + 1; 
        tt.style.position = 'relative'; 
        tt.style.right = st + 'px'; 
        if(mv == st){ 
            hstid = setTimeout("ScrollSubj('"+t+"', "+st+", 'p')", dly); 
        }else{ 
            hstid = setTimeout("ScrollSubj('"+t+"', "+st+", 'p')", spd); 
        } 
    }else{ 
        st = s - 1; 
        if(st > 0){ 
            tt.style.position = 'relative'; 
            tt.style.right = st + 'px'; 
            if(st == 1){ 
                hstid = setTimeout("ScrollSubj('"+t+"', "+st+", 'm')", dly); 
            }else{ 
                hstid = setTimeout("ScrollSubj('"+t+"', "+st+", 'm')", spd); 
            } 
        }else{ 
            hstid = setTimeout("ScrollSubj('"+t+"', "+st+", 'p')", spd); 
        } 
    } 
} 
function ScrollSubjX(t){ 
    var tt = document.getElementById(t); 
    tt.style.position = ''; 
    tt.style.right = '0px'; 
    clearTimeout(hstid); 
} 


//ÇÃ·¡½¬ È«º¸¹°»çÀÌÆ® ¸µÅ©¿ë È£Ãâ ½ºÅ©¸³Æ®
function sales()
{
//	var strCurPage = location.pathname;
//
//	if(strCurPage!="/lgcyon/main.jsp")
//	{
//		showMessageJongBox2($('pop_sales').innerHTML, 314, 170);
//	}else{
		window.open('/lgcyon/pop/pop_sales/pop_sales.jsp','sales','height=170, width=314, scrollbars=no, menubar=no, toolbar=no, titlebar=no, directories=no, resizable=no');
//	}
}

//°¢Á¾ ¹®ÀÚ replace
function string_replace(str)
{
	var return_str = "";

	return_str = replace(str, "'", "¡Ç");

	return return_str;
}

var objReject = new Array("select","delete","update","script","iframe","object","embed");
//º¯È¯´ë»ó¸ñ·Ï (¼ø¼­ÁÖÀÇ ;, &, # ÀÌ °¡Àå¸ÕÀú ¿Í¾ßÇÑ´Ù.)
var objLock = new Array(";","<",">","--","'");
//Ä¡È¯¸ñ·Ï (¼ø¼­ÁÖÀÇ º¯È¯´ë»ó¸ñ·Ï°ú ¼ø¼­°¡ ÀÏÄ¡ÇØ¾ßÇÑ´Ù.)
var objKey	= new Array("&#59","&lt;","&gt;","&#45&#45","&#39");

function checkString(strTarget, essential, rejectFlag, replaceFlag)
{
	if(essential == "Y")
	{
		if(strTarget == "" || strTarget.length == 0)
		{
			return false;
		}
	}
	
	//±ÝÁö´Ü¾î¸ñ·Ï
	if(rejectFlag == "Y")
	{
		if(!rejectObj(objReject, strTarget))
		{
			return false;
		}
	}

	return true;
}

// °Ë»ç°ªÀÎ ¹è¿­1°ú º¯È¯°ªÀÎ ¹è¿­2¸¦ °¡Áö°í strTargetÀ» ¾Æ½ºÅ°ÄÚµå·Î Ä¡È¯ÇÑ´Ù.
function replaceObj(arrLock, arrKey ,strTarget) 
{
	var newStr = strTarget;
	for(i=0;i < arrLock.length;i++)
	{
		newStr = newStr.split(arrLock[i]).join(arrKey[i]);
	}
	return newStr;
}
//
function rejectObj(arrReject, strTarget)
{
	var RE_Reject
	var UpperStrTarget = strTarget.toUpperCase();
	for(i=0;i < arrReject.length;i++)
	{
		UpperArrReject = arrReject[i].toUpperCase();
		RE_Reject = new RegExp(UpperArrReject); 
		if(RE_Reject.test(UpperStrTarget))
		{
			alert(arrReject[i]+"´Â Çã¿ëµÇÁö ¾Ê´Â ´Ü¾îÀÔ´Ï´Ù.");
			return false;
		}
	}
	return true;
}
function search_off()
{
	////20091212 ¹öÀü
	//var window_width	= 375;
  //var window_height	= 478;
  //var window_left		=	(screen.width  - window_width) / 2;
	//var window_top		= (screen.height - window_height) / 2 - 5;
  //var parm1			= "width=" + window_width + ",height=" + window_height + ",left=10,top=10,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";
  //remote=window.open('', "off", parm1);
	//remote.location.href = "/lgcyon/service_off/notice_20091212_sub.html";
	//remote.focus();
}
//ÀÌº¥Æ® ÆË¾÷(lollipop) 20090328 À± Ã¢ Çö Ãß°¡
function pro_event_popup_micro()
{
	var height = screen.availHeight - 57;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://cyonv1.cyon.co.kr/pro/index.html";

	window.open(url, "pro_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}
function crystal_event_popup()
{
	var height = screen.availHeight - 57;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/crystal/1st/bottom.html";

	window.open(url, "pro_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}
//ÀÌº¥Æ® ÆË¾÷(lollipop) 20090328 À± Ã¢ Çö Ãß°¡
function lollipop2_event_popup()
{
	var height = screen.availHeight - 57;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/lollipop2/index.html";

	window.open(url, "lollipop2_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}
function maxx_event_popup()
{
	var height = screen.availHeight - 57;
	var width = screen.availWidth - 10;

	var intWidth = 710
	var intHeight = 536
  	//var tempX = (screen.width/2)-(intWidth / 2);
	//var tempY = (screen.height/2)-(intHeight / 2);
	var tempX = 0;
	var tempY = 0;

	var url = "http://www.cyon.co.kr/event/maxx/index.html";

	window.open(url, "lollipop2_main", "fullscreen");

	//window.open(url,"tphone_main","left="+tempX+",top="+tempY+",width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0");
}
