var DOMAIN_HTTP = 'http://www.truefriend.com';


/*
 Util Function
*********************************************************/
String.prototype.trim = function(str) { 
	str = this != window ? this : str; 
	return str.replace(/^\s+/g,'').replace(/\s+$/g,''); 
}
String.prototype.replaceQuot = function(str) {
	str = this != window ? this : str;
	str = str.replace(/\\/g,'\\\\');
	str = str.replace(/\"/g,'\\\"');
	str = str.replace(/\'/g,'\\\'');
	return str;
}
String.prototype.escapeXml = function(str) {
	str = this != window ? this : str;
	str = str.replace(/&/g,'&amp;');
	str = str.replace(/\'/g,'&#039;');
	str = str.replace(/\"/g,'&#34;');
	str = str.replace(/</g,'&lt;');
	str = str.replace(/>/g,'&gt;');
	return str;
}

function returnValue(obj,defaultValue) {
	defaultValue = (defaultValue==null) ? "" : defaultValue;
	return (obj==null) ? defaultValue : obj;
}



function wts()
{
	//alert("11¿ù 14ÀÏ(ÀÏ¿äÀÏ) ÀçÇØº¹±¸¼¾ÅÍ ÀüÈ¯ÈÆ·ÃÀ¸·Î ÀÎÇÏ¿© \n11:00 ~ 17:00±îÁö Á¢¼ÓÀÌ Áß´ÜµË´Ï´Ù.");
	//return;
	//alert("¾È³çÇÏ½Ê´Ï±î? µ¿¿øÁõ±ÇÀÔ´Ï´Ù. \n¾ÈÁ¤µÈ ¼­ºñ½º¸¦ À§ÇØ ÀÎÅÍ³Ý È¸¼± Á¡°Ë ÀÛ¾÷ÀÌ ÀÖÀ» ¿¹Á¤ ÀÔ´Ï´Ù.\nÀÛ¾÷½Ã°£³»¿¡´Â True Friend WebÀ» ÀÌ¿ë ÇÒ ¼ö ¾øÀ¸´Ï °í°´ºÐµé²²¼­´Â Âü°í ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n\n1. Á¡°ËÀÏ½Ã : 12¿ù 3ÀÏ(±Ý) 22:00 ~ 12¿ù 4ÀÏ(Åä) 01:00\n\n2. Á¡°Ë³»¿ë : \n - ÀÎÅÍ³Ý È¸¼± Á¡°Ë\n - Á¡°Ë½Ã°£³»¿¡ ¼­ºñ½º ºÒ°¡´É");
	//return;
	//alert("ÇöÀç TRUE FRIEND Web ½Ã½ºÅÛ ±ä±Þ Á¡°ËÁßÀÔ´Ï´Ù.\n°í°´´Ô²²¼­´Â TRUE FRIEND Net ¶Ç´Â TRUE FRIEND Speed¸¦ ÀÌ¿ëÇÏ½Ã±â ¹Ù¶ó¸ç,\nÇØ´ç ÇÁ·Î±×·¥Àº ´Ù¿î·Îµå ÆäÀÌÁö¿¡¼­ ¼³Ä¡ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù. \nÃÖ´ëÇÑ ºü¸¥ ½Ã°£³»¿¡ Á¡°ËÀ» ¿Ï·áÇÏµµ·Ï ÇÏ°Ú½À´Ï´Ù.\n");
	//return;]

	var how_many_ads = 2; // ·£´ýÇÒ ¼­¹ö ¼ö .... Ãß°¡ ÇßÀ»°æ¿ì ÀÌ ¼ýÀÚµµ ´Ã¸®¸é µÊ
	var now = new Date(); 
	var sec = now.getSeconds();
	var randVal = sec % how_many_ads;
	randVal +=1;
	
	
	var url1;
		//alert("±ÝÀÏ 18:00ºÎÅÍ 22:00±îÁö ½Ã½ºÅÛ ¾÷±×·¹ÀÌµå ¹× ³×Æ®À§Å© \nÁ¡°ËÀ¸·Î ÀÎÇÏ¿© Á¢¼ÓÀÌ Â÷´ÜµË´Ï´Ù.\n°í°´´ÔÀÇ ¸¹Àº ¾çÇØ ¹Ù¶ø´Ï´Ù.")
		if ( randVal == 1 ) {
			url1 = "http://efwts2.truefriend.com/jsp/WTSLoad.jsp";
		} else if ( randVal == 2 ) {
			url1 = "http://efwts4.truefriend.com/jsp/WTSLoad.jsp";
		} else	{
			url1 = "http://efwts2.truefriend.com/jsp/WTSLoad.jsp";
		}

  		window.open( url1, "tfwts", "width=430,height=200,scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no" );
	}

/**** ¿Â¶óÀÎÁöÁ¡  È­¸é¹øÈ£**/
function wts1(nVal)
{
	//alert("11¿ù 14ÀÏ(ÀÏ¿äÀÏ) ÀçÇØº¹±¸¼¾ÅÍ ÀüÈ¯ÈÆ·ÃÀ¸·Î ÀÎÇÏ¿© \n11:00 ~ 17:00±îÁö Á¢¼ÓÀÌ Áß´ÜµË´Ï´Ù.");
	//return;
	//alert("¾È³çÇÏ½Ê´Ï±î? µ¿¿øÁõ±ÇÀÔ´Ï´Ù. \n¾ÈÁ¤µÈ ¼­ºñ½º¸¦ À§ÇØ ÀÎÅÍ³Ý È¸¼± Á¡°Ë ÀÛ¾÷ÀÌ ÀÖÀ» ¿¹Á¤ ÀÔ´Ï´Ù.\nÀÛ¾÷½Ã°£³»¿¡´Â True Friend WebÀ» ÀÌ¿ë ÇÒ ¼ö ¾øÀ¸´Ï °í°´ºÐµé²²¼­´Â Âü°í ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n\n1. Á¡°ËÀÏ½Ã : 12¿ù 3ÀÏ(±Ý) 22:00 ~ 12¿ù 4ÀÏ(Åä) 01:00\n\n2. Á¡°Ë³»¿ë : \n - ÀÎÅÍ³Ý È¸¼± Á¡°Ë\n - Á¡°Ë½Ã°£³»¿¡ ¼­ºñ½º ºÒ°¡´É");
	//return;
	//alert("ÇöÀç TRUE FRIEND Web ½Ã½ºÅÛ ±ä±Þ Á¡°ËÁßÀÔ´Ï´Ù.\n°í°´´Ô²²¼­´Â TRUE FRIEND Net ¶Ç´Â TRUE FRIEND Speed¸¦ ÀÌ¿ëÇÏ½Ã±â ¹Ù¶ó¸ç,\nÇØ´ç ÇÁ·Î±×·¥Àº ´Ù¿î·Îµå ÆäÀÌÁö¿¡¼­ ¼³Ä¡ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù. \nÃÖ´ëÇÑ ºü¸¥ ½Ã°£³»¿¡ Á¡°ËÀ» ¿Ï·áÇÏµµ·Ï ÇÏ°Ú½À´Ï´Ù.\n");
	//return;]

	var how_many_ads = 2; // ·£´ýÇÒ ¼­¹ö ¼ö .... Ãß°¡ ÇßÀ»°æ¿ì ÀÌ ¼ýÀÚµµ ´Ã¸®¸é µÊ
	var now = new Date(); 
	var sec = now.getSeconds();
	var randVal = sec % how_many_ads;
	randVal +=1;
	
	
	var url1;
	//alert("±ÝÀÏ 18:00ºÎÅÍ 22:00±îÁö ½Ã½ºÅÛ ¾÷±×·¹ÀÌµå ¹× ³×Æ®À§Å© \nÁ¡°ËÀ¸·Î ÀÎÇÏ¿© Á¢¼ÓÀÌ Â÷´ÜµË´Ï´Ù.\n°í°´´ÔÀÇ ¸¹Àº ¾çÇØ ¹Ù¶ø´Ï´Ù.")
	if ( randVal == 1 ) {
		url1 = "http://efwts2.truefriend.com/jsp/WTSLoad.jsp";
	} else if ( randVal == 2 ) {
		url1 = "http://efwts4.truefriend.com/jsp/WTSLoad.jsp";
	} else	{
		url1 = "http://efwts4.truefriend.com/jsp/WTSLoad.jsp";
	}

	window.open( url1, "tfwts", "width=430,height=200,scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no" );
}


/**** tfweb ***/
function tfwts(nSvr,arg)
{
	//alert("11¿ù 14ÀÏ(ÀÏ¿äÀÏ) ÀçÇØº¹±¸¼¾ÅÍ ÀüÈ¯ÈÆ·ÃÀ¸·Î ÀÎÇÏ¿© \n11:00 ~ 17:00±îÁö Á¢¼ÓÀÌ Áß´ÜµË´Ï´Ù.");
	//return;
	//alert("¾È³çÇÏ½Ê´Ï±î? µ¿¿øÁõ±ÇÀÔ´Ï´Ù. \n¾ÈÁ¤µÈ ¼­ºñ½º¸¦ À§ÇØ ÀÎÅÍ³Ý È¸¼± Á¡°Ë ÀÛ¤·¹öÀÌ ÀÖÀ» ¿¹Á¤ ÀÔ´Ï´Ù.\nÀÛ¾÷½Ã°£³»¿¡´Â True Friend WebÀ» ÀÌ¿ë ÇÒ ¼ö ¾øÀ¸´Ï °í°´ºÐµé²²¼­´Â Âü°í ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n\n1. Á¡°ËÀÏ½Ã : 12¿ù 3ÀÏ(±Ý) 22:00 ~ 12¿ù 4ÀÏ(Åä) 01:00\n\n2. Á¡°Ë³»¿ë : \n - ÀÎÅÍ³Ý È¸¼± Á¡°Ë\n - Á¡°Ë½Ã°£³»¿¡ ¼­ºñ½º ºÒ°¡´É");
	//return;
	//alert("ÇöÀç TRUE FRIEND Web ½Ã½ºÅÛ ±ä±Þ Á¡°ËÁßÀÔ´Ï´Ù.\n°í°´´Ô²²¼­´Â TRUE FRIEND Net ¶Ç´Â TRUE FRIEND Speed¸¦ ÀÌ¿ëÇÏ½Ã±â ¹Ù¶ó¸ç, ÇØ´ç ÇÁ·Î±×·¥Àº\n ´Ù¿î·Îµå ÆäÀÌÁö¿¡¼­ ¼³Ä¡ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.ÃÖ´ëÇÑ ºü¸¥ ½Ã°£³»¿¡ Á¡°ËÀ» ¿Ï·áÇÏµµ·Ï ÇÏ°Ú½À´Ï´Ù.\n");
	//return;
	var how_many_ads = 2; // ·£´ýÇÒ ¼­¹ö ¼ö .... Ãß°¡ ÇßÀ»°æ¿ì ÀÌ ¼ýÀÚµµ ´Ã¸®¸é µÊ
	var now = new Date(); 
	var sec = now.getSeconds();
	var randVal = sec % how_many_ads;
	randVal +=1;
	
	
	var url1;
		//alert("±ÝÀÏ 18:00ºÎÅÍ 22:00±îÁö ½Ã½ºÅÛ ¾÷±×·¹ÀÌµå ¹× ³×Æ®À§Å© \nÁ¡°ËÀ¸·Î ÀÎÇÏ¿© Á¢¼ÓÀÌ Â÷´ÜµË´Ï´Ù.\n°í°´´ÔÀÇ ¸¹Àº ¾çÇØ ¹Ù¶ø´Ï´Ù.")
		if ( randVal == 1 ) {
			url1 = "http://efwts2.truefriend.com/jsp/WTSLoad.jsp?scr_num=7800";
		} else if ( randVal == 2 ) {
			url1 = "http://efwts4.truefriend.com/jsp/WTSLoad.jsp?scr_num=7800";
		} else {
			url1 = "http://efwts2.truefriend.com/jsp/WTSLoad.jsp?scr_num=7800";
		}

	window.open( url1, "tfwts", "width=430,height=200,scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no" );
}

//ÇÑÅõ ¿Â¶óÀÎ ÁöÁ¡

function gohantuOnline(id) {
	//var theurl1 = "http://www.hantutams.com/customer/hantuOnline/index.html";
	var theurl1 = "http://www.hantutams.com/customer/hantuOnline/index.html";
	if(id) { theurl1 = theurl1+"\?ID="+id;  }
	winopen(theurl1,"width=640,height=650"); 
}

//ÇÑÅõ WTS

function MM_openBrWindow1(theurl1)
{ 
	var features = "width=1014,height=716,left=0,top=0";
	var winName = "HT_stock";

    window.open(theurl1,winName,features);
}
function MM_openBrWindow2(theurl1)
{ 
	var features = "width=1014,height=586,left=0,top=0";
	var winName = "HT_stock1";

    window.open(theurl1,winName,features);
}
function MM_openBrWindow3(theurl1)
{ 
	document.location.href = "http://file.hantutams.com/download/SlimTraderSetup.exe";
}



function wts5()
{
	var how_many_ads = 2; // ·£´ýÇÒ ¼­¹ö ¼ö .... Ãß°¡ ÇßÀ»°æ¿ì ÀÌ ¼ýÀÚµµ ´Ã¸®¸é µÊ
	var now = new Date(); 
	var sec = now.getSeconds();
	var randVal = sec % how_many_ads;
	randVal +=1;
	
	var url1;
	if ( randVal == 1 ) {
		url1 = "http://efwts2.truefriend.com/jsp/WTSLoad.jsp";
	} else if ( randVal == 2 ) {
		url1 = "http://efwts4.truefriend.com/jsp/WTSLoad.jsp";
	} else	{
		url1 = "http://efwts4.truefriend.com/jsp/WTSLoad.jsp";
	}

	window.open( url1, "tfwts", "width=430,height=200,scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no" );
}


/**** 2006.3.6 Ãß°¡ : guestÃ³¸® ¿Â¶óÀÎÁöÁ¡ È­¸é ¶ç¿ì±â **/
function wts6(nVal)
{
	var how_many_ads = 2; // ·£´ýÇÒ ¼­¹ö ¼ö .... Ãß°¡ ÇßÀ»°æ¿ì ÀÌ ¼ýÀÚµµ ´Ã¸®¸é µÊ
	var now = new Date(); 
	var sec = now.getSeconds();
	var randVal = sec % how_many_ads;
	randVal +=1;
	
	
	var url1;
	//alert("±ÝÀÏ 18:00ºÎÅÍ 22:00±îÁö ½Ã½ºÅÛ ¾÷±×·¹ÀÌµå ¹× ³×Æ®À§Å© \nÁ¡°ËÀ¸·Î ÀÎÇÏ¿© Á¢¼ÓÀÌ Â÷´ÜµË´Ï´Ù.\n°í°´´ÔÀÇ ¸¹Àº ¾çÇØ ¹Ù¶ø´Ï´Ù.")
	if ( randVal == 1 ) {
		url1 = "http://efwts2.truefriend.com/jsp/WTSLoad.jsp?scr_num="+nVal;
	} else if ( randVal == 2 ) {
		url1 = "http://efwts4.truefriend.com/jsp/WTSLoad.jsp?scr_num="+nVal;
	} else	{
		url1 = "http://efwts2.truefriend.com/jsp/WTSLoad.jsp?scr_num="+nVal;
	}

	window.open( url1, "tfwts", "width=430,height=200,scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no" );
}


function fileDownload(fpath,fname) {

	var hostName = "http://file.truefriend.com";//È£½ºÆ® ³×ÀÓÀº ³ªÁß¿¡ º¯°æµÇ¸é °íÄ¡¼À.

	var url = hostName + "/servlet/Download?file_path=" + fpath + "/&file_name=" + fname;

	location.href=url;

}


function print_all_self()
{

	var licUrl, configUrl;
	licUrl = DOMAIN_HTTP + "/download/truefriend_com.lic";
	configUrl = DOMAIN_HTTP + "/download/config.ini";	
	pm_UID="kis_02";
	pm_FormFile="http://www.truefriend.com/webprint/yangsic.xml";
	frmae_nm = '';
	try
	{
		PrintMade.Run(configUrl, "/ie:{ieh} /h:0 /fid:\"" + frmae_nm + "\"  /lic:\"" + licUrl + "\" /ffk:\""+ pm_UID + "\" /ff:\"" + pm_FormFile +  "\" /ws:1060|0 /sc:2");
		
		//PrintMade.Capture("_MAIN",1024,768);
	}
	catch(e)
	{
		alert("Printmade°¡ Á¤»óÀûÀ¸·Î ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n ");
	}   
}


function print_all()
{
	var licUrl, configUrl;
	licUrl = DOMAIN_HTTP + "/download/truefriend_com.lic";
	configUrl = DOMAIN_HTTP + "/download/config.ini";	
	pm_UID="kis_02";
	pm_FormFile="http://www.truefriend.com/webprint/yangsic.xml";
	frmae_nm = "mainfrm";
	try
	{
		PrintMade.Run(configUrl, "/ie:{ieh} /h:0 /fid:\"" + frmae_nm + "\"  /lic:\"" + licUrl + "\" /ffk:\""+ pm_UID + "\" /ff:\"" + pm_FormFile +  "\" /ws:1060|0 /sc:2");
	}
	catch(e)
	{
		alert("Printmade°¡ Á¤»óÀûÀ¸·Î ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n ");
	}   
}


//Printmade È£Ãâ ÇÔ¼ö (ºÎºÐ ÀÎ¼â)
function print_part()
{
	licUrl = DOMAIN_HTTP + "/download/truefriend_com.lic";
	configUrl = DOMAIN_HTTP + "/download/config.ini";	
	pm_UID="kis_02";
	pm_FormFile="http://www.truefriend.com/webprint/yangsic.xml";
	frmae_nm = "";

	var CROP_SX = "180";
	var CROP_SY = "125";
	var CROP_EX = "85";
	var CROP_EY = "75";

	//var CROP_SX = "180";
	//var CROP_SY = "125";
	//var CROP_EX = "0";
	//var CROP_EY = "75";

	frmae_nm = "mainfrm";
	try
	{
			PrintMade.Run(configUrl, "/ie:{ieh} /h:0 /fid:\"" + frmae_nm + "\" /cr:"+CROP_SX+"|"+CROP_SY+"|"+CROP_EX+"|"+CROP_EY+" /lic:\"" + licUrl + "\" /ffk:\""+ pm_UID + "\" /ff:\"" + pm_FormFile +  "\" /ws:1024|0 /sc:2");
	}
	catch(e)
	{ 
		alert("Printmade°¡ Á¤»óÀûÀ¸·Î ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n ");
	}   
}

function print_part_self()
{
	licUrl = DOMAIN_HTTP + "/download/truefriend_com.lic";
	configUrl = DOMAIN_HTTP + "/download/config.ini";	
	pm_UID="kis_02";
	pm_FormFile="http://www.truefriend.com/webprint/yangsic.xml";
	frmae_nm = "";

	var CROP_SX = "180";
	var CROP_SY = "125";
	var CROP_EX = "85";
	var CROP_EY = "75";

	//var CROP_SX = "180";
	//var CROP_SY = "125";
	//var CROP_EX = "0";
	//var CROP_EY = "75";

	frmae_nm = "";
	try
	{
			PrintMade.Run(configUrl, "/ie:{ieh} /h:0 /fid:\"" + frmae_nm + "\" /cr:"+CROP_SX+"|"+CROP_SY+"|"+CROP_EX+"|"+CROP_EY+" /lic:\"" + licUrl + "\" /ffk:\""+ pm_UID + "\" /ff:\"" + pm_FormFile +  "\" /ws:1024|0 /sc:2");
	}
	catch(e)
	{ 
		alert("Printmade°¡ Á¤»óÀûÀ¸·Î ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n ");
	}   
}

/********************************************************************************************************
	ÆË¾÷Ã¢ ¿ÀÇÂ
********************************************************************************************************/
function popOpen(url, p_w, p_h) {
	window.open(url,"","width="+p_w+",height="+p_h+",toolbar=no,scrollbars=no,resizable=no" );
}

function popOpen_s(url, p_w, p_h) {
	window.open(url,"","width="+p_w+",height="+p_h+",toolbar=no,scrollbars=yes,resizable=no" );
}

/********************************************************************************************************
	ÀÌ¹ÌÁö ¿À¹ö/¾Æ¿ô ÇÔ¼ö
********************************************************************************************************/
function setOver(thisImg, sMode) {
	var sPath = thisImg.src;
	var sCommonPath = sPath.substring(0, sPath.lastIndexOf("_") + 1);
	var sType = sPath.substring(sPath.lastIndexOf("."), sPath.length);
	//alert(sCommonPath + "on" + sType);
	thisImg.src = sCommonPath + sMode + sType;
}

/********************************************************************************************************
	¼­ºê¸Þ´º ÅÇ ¿Â/¿ÀÇÁ ÇÔ¼ö
********************************************************************************************************/
function changeTab(thisImg, totUnit){
	var seq = 1;
	var sPath = thisImg.src;
	var sImgName = sPath.substring(sPath.lastIndexOf("/") + 1, sPath.lastIndexOf("_") - 1);
	var seqTab = sPath.substring(sPath.lastIndexOf("tab") + 4, sPath.lastIndexOf("_"));
	
	while (seq) {
		var objImg = document.getElementById(sImgName + seq);
		if( objImg ) {
			setOver(objImg, "off");
			document.getElementById('list_' + sImgName + seq ).style.visibility="hidden";
			document.getElementById('list_' + sImgName + seq ).style.display="none";
			seq++;
		} else {
			break;
		}
	}

	setOver(thisImg, "on");

	document.getElementById('list_' + sImgName + seqTab ).style.visibility="visible";
	document.getElementById('list_' + sImgName + seqTab ).style.display="";
}


/********************************************************************************************************
	±ÝÀ¶»óÇ° ·¹ÀÌ¾î ¹Ú½º
********************************************************************************************************/

function CH_box(num){
	
	for(i=1;i<4;i++){
		document.getElementById('best_tab0' + i ).src="/images/mall/product/tab_box0" + i + "_off.gif";
		document.getElementById('best_box0' + i ).style.display="none";
	}
	document.getElementById('best_tab0' + num ).src="/images/mall/product/tab_box0" + num + "_on.gif";
	document.getElementById('best_box0' + num ).style.display="block";
}


/********************************************************************************************************
±ÝÀ¶»óÇ°¸ô »óÇ° ÀÌ¹ÌÁö/¿Àµð¿À ÇÃ·¹ÀÌ ÀüÈ¯
********************************************************************************************************/
function show_imgav(sdata) {
	if (sdata == "av") {
		document.getElementById('img_box').style.display = "none";
		document.getElementById('av_box').style.display = "block";
	} else if (sdata == "img") {
		document.getElementById('av_box').style.display = "none";
		document.getElementById('img_box').style.display = "block";
	}
}



/*
 URL¿¡¼­ ÇöÀç ¸Þ´ºÀÇ DepthÁ¤º¸¿Í ¸Þ´ºº° ID(µð·ºÅä¸®¸í)¸¦ °¡Á®¿Â´Ù.
 »ó´Ü ÇÃ·¡½Ã, ÁÂÃø¸Þ´º, Ä«Å×°í¸®Á¤º¸, ºê¶ó¿ìÀúÅ¸ÀÌÆ² µî¿¡¼­ ¸ðµÎ »ç¿ëÇÑ´Ù.
***************************************************************/
/*
var sPathName = location.pathname;
var tempDir = sPathName.split("/");
var dir = new Array;

for (var i=0; i<tempDir.length; i++) {
	if ((tempDir[i].trim()!="")&&(tempDir[i].indexOf(".")<0)) {
		dir[dir.length] = tempDir[i].trim();
	}
}

var sJspParentName = sPathName.substring(sPathName.indexOf("/"), sPathName.indexOf("."));
var tempJsp = sJspParentName.split("/");
for (var i=0; i<tempJsp.length; i++) {
	sJspParentName = tempJsp[i].trim();
}

sJspParentName = sJspParentName.substring(0, sJspParentName.indexOf("_"));

var old_menu = '';
function menuclick(categoryId) {
	var submenu = eval(categoryId);
	
	if(old_menu != submenu) {

		if(old_menu != '') old_menu.style.display = 'none';
		submenu.style.display = 'block';
		old_menu = submenu;
	} else {
		if (submenu != null &&  submenu != '') { 
			submenu.style.display = 'none';
			old_menu = '';
		}
	}
}

function CategoryManager() {
	this.dir = new Array;
	this.add = CategoryManager_add;
	this.getHistory = CategoryManager_getHistory;
	this.setTitleBarText = CategoryManager_setTitleBarText;
}

function CategoryManager_add(_sId,_sTitle,_sUrl, _sSub) {
	var nIndex = this.dir.length;
	this.dir[nIndex] = new Object;
	this.dir[nIndex].id = _sId;
	this.dir[nIndex].title = _sTitle;
	this.dir[nIndex].url = _sUrl;
	this.dir[nIndex].sub = _sSub;
}

function CategoryManager_getHistory() {
	var sHistory = '<a href="/">Home</a>';
	for (var i=0; i<this.dir.length; i++) {
		var sId = this.dir[i].id;
		var sTitle = this.dir[i].title;
		var sUrl = this.dir[i].url;
		if (sTitle!="") {
			sHistory += ' > ';
			if (i<this.dir.length-1) {
				if (sUrl!="") {
					sHistory += '<a href="'+sUrl.escapeXml()+'">';
				}
			} else {
				sHistory += '<strong>';
			}
			sHistory += sTitle.replace(/<br>/g,"");
			if (i<this.dir.length-1) {
				if (sUrl!="") {
					sHistory += '</a>';
				}
			} else {
				sHistory += '</strong>';
			}
		}
	}
	return sHistory;
}

function CategoryManager_setTitleBarText() {
	var sTitleBarText = '';
	for (var i=0; i<this.dir.length; i++) {
		var sId = this.dir[i].id;
		var sTitle = this.dir[i].title;
		var sUrl = this.dir[i].url;
		if (sTitle!="") {
			if (sTitleBarText.length>0) {
				sTitleBarText += ' > ';
			}
			sTitleBarText += sTitle.replace(/<br>/g,"");
		}
	}
	if (sTitleBarText.length>0) {
		sTitleBarText = ' - ' + sTitleBarText;
	}
	
	document.title = "ÇÑ±¹Áõ±Ç" + sTitleBarText;
}

function getParent(_id) {
	if (_id == null || _id == '') 
		return '';
	var r = '';
	var s = _id.split("_");
	for (var i=0; i<s.length-1; i++) { 
		if (i == 0)  r = r + s[i];
		else r = r + '_' +  s[i];
	}
	return r;	
}


function getLI(_id1, _id2, _sub) {
	try {  
		if (_sub == '1') { 
			if (_id1 == getParent(_id2) || _id1 == _id2) {
				return "class='sel' onmouseover=this.className='sel'  onmouseout=this.className='sel' ";	
			} else {
				return "class='' onmouseover=this.className='sel'  onmouseout=this.className='' ";	
			}
		} else { 
		
			if (_id1== _id2 || _id1 == getParent(_id2)) {
				return "class=sel onmouseover=this.className='sel' ";
				//return "class=sel onmouseover=this.className=''";
			} else { 
				if (_sub == '1') {
					return 'class="" onmouseover=this.className="sel" ';	 
				} else if ( _sub != '0' || _id1 == getParent(_id2)) {
					return 'class="" onmouseover=this.className="sel" onmouseout=this.className="" ';	
				} else { 
					return 'class="" onmouseover=this.className="on" onmouseout=this.className="" ';	
					//return 'class="" onmouseover=this.className="sel" onmouseout=this.className="" ';	
				}	
			}
		}
	} catch (E) { }
}
*/


/******************************************************************************************* */
/**************************** ´Ü¼øÈ÷ º¸¿©ÁÖ´Â ±â´ÉÀÇ Flash ·Îµù **************************** */
/******************************************************************************************* */

function Flash_display(sFName, nWidth, nHeight ){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ nWidth + '" height="'+ nHeight + '" id="etc_flash" align="middle">');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie" value="/common/flash/'+ sFName + '.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="/common/flash/'+ sFName + '.swf" quality="high" bgcolor="#ffffff" width="'+ nWidth + '" height="'+ nHeight + '" name="etc_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> ');
	document.write('</object>');
}


function Flash_display_fc(sFName, nWidth, nHeight ){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ nWidth + '" height="'+ nHeight + '" id="etc_flash" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/common/flash/'+ sFName + '.swf?fc=1" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="/common/flash/'+ sFName + '.swf?fc=1" quality="high" bgcolor="#ffffff" width="'+ nWidth + '" height="'+ nHeight + '" name="etc_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> ');
	document.write('</object>');
}


/////////////////////////////// ¸ÞÀÎ¸Þ´º ¸µÅ© ¹è¿­
urls = new Array();


// »ó´Ü À¯Æ¿¸Þ´º
urls[0] = ["/", "/fc/news01_list.jsp", "/corporate/main.jsp", "/cyber/main.jsp", "/customer/main.jsp", "/company/main.jsp", "/eng/main.jsp"];


// Áõ±ÇÅõÀÚ
urls[1] = ["/bond/main.jsp", "/bond/deal/deal01.jsp", "/bond/stock/stock.jsp", "/bond/futures/futures.jsp", "/bond/option/option.jsp", "/bond/media/tv_live.jsp", "/elw/index.jsp"];

// ±ÝÀ¶»óÇ°¹éÈ­Á¡
urls[2] = ["/mall/main.jsp", "/mall/product/fund/fund_outline.jsp", "/mall/trade/fund/new_step1.jsp", "/mall/advise/guide/indirect/indi01.jsp", "fundshop", "/mall/service/club_info.jsp"];

// ¸®¼­Ä¡
urls[3] = ["/research/main.jsp", "/research/strategy/daily/daily_list.jsp", "/research/analysis/corporate/corporate_list.jsp", "/research/fundanalysis/fund/fund_list.jsp", "/research/invest/market/market_list.jsp", "/research/foreign/asia/asia_list.jsp", "/research/english/daily/daily_list.jsp"];

// ÀÚ»ê°ü¸®
urls[4] = ["/asset/main.jsp", "/asset/introduce/intro01.jsp", "/asset/pb/introduce/intro01.jsp", "/asset/analysis/analysis01.jsp"];

// ¿Â¶óÀÎÃ¢±¸
//urls[5] = ["/onlinewicket/main.jsp", "/xecureBridge.jsp?url=/onlinewicket/asset/asset_all.jsp", "/onlinewicket/transfer/transfer_step1.jsp", "/onlinewicket/loan/credit.jsp", "/onlinewicket/subsc/subsc_info.jsp", "/onlinewicket/applic/ca_lost_step1.jsp", "/onlinewicket/info/acc_add_ele.jsp"];
urls[5] = ["/onlinewicket/main.jsp", "/xecureBridge.jsp?url=/onlinewicket/asset/asset_all.jsp", "/onlinewicket/transfer/transfer_step1.jsp", "aa_test", "/onlinewicket/subsc/subsc_info.jsp", "/onlinewicket/applic/ca_lost_step1.jsp", "/onlinewicket/info/acc_add_ele.jsp"];

// ¿Â¶óÀÎÅõÀÚ»ó´ã
urls[6] = ["/online/main.jsp", "/online/info/info.jsp", "/online/item/item_list.jsp", "/online/derive/derive_list.jsp", "/online/finance/finance_list.jsp", "/online/medical/prm01.jsp", "/online/favorite/concern/concern_list.jsp", "/online/information/market/market_list.jsp", "/online/notice/notice_list.jsp"];

/////////////////////////////// °Ë»ö
function goSearch(str){
	if(str != undefined){
//		alert("°Ë»ö: " + str);	
	location.href = "/etc/search/search_all.jsp?query=" + str;
	}
}

// °ü·Ã»çÀÌÆ®
///////////////////////////////////// ¸ÞÀÎ¸Þ´º ¸µÅ©
function goLink(m, s){
	// ¸Þ´º °ªÀÌ ÀÖÀ»¶§¸¸ ½ÇÇà
	if(m != undefined){
		// ¼­ºê°ªÀÌ ¾øÀ¸¸é ÃÊ±â°ª 0
		if(s == undefined){
			s = 0;	
		}
		if(urls[m][s] == "fundshop") {
			popOpen('/mall/fundshop/fundshop.html',687,570)
		} else if(urls[m][s] == "/eng/main.jsp") {
			window.open('http://eng.truefriend.com');
		}  else if(urls[m][s] == "/elw/index.jsp") {
			window.open('http://www.truewarrant.com');
		} else if(urls[m][s] == "aa_test") {
			alert("³»ºÎ¿ÀÇÂ Å×½ºÆ® ±â°£¿¡´Â ¼­ºñ½ºµÇÁö ¾Ê½À´Ï´Ù.")
		}   else {
		window.location.href=(urls[m][s]);
		}
//		alert(urls[m][s]);
//		alert(m + " : " + s);
	}
}

//*****************************************************************************************
// ¿µ¹®»çÀÌÆ® ¸µÅ©
//*****************************************************************************************
/////////////////////////////// ¸ÞÀÎ¸Þ´º ¸µÅ© ¹è¿­
urls_eng = new Array();


// »ó´Ü À¯Æ¿¸Þ´º
urls_eng[0] = ["/eng/main.jsp", "FCÀü¿ëÈ­¸é", "/eng/main.jsp", "/eng/research/newsletter01.jsp", "/eng/etc/contact.html", "/eng/etc/sitemap.html", "KOREASITE"];


// About Company
urls_eng[1] = ["/eng/company/profile.html", "/eng/company/profile.html", "/eng/company/message.html", "/eng/company/chart.html", "/eng/company/network01.html", "/eng/company/team.html", "/eng/company/history01.html"];

// Business
urls_eng[2] = ["/eng/business/snapshot.html", "/eng/business/snapshot.html", "/eng/business/pb.html", "/eng/business/service01.html", "/eng/business/trust.html"];

// Investor Relatiions
urls_eng[3] = ["/eng/investor/information.html", "/eng/investor/information.html", "/eng/investor/financial01_01.html"];

// Research
urls_eng[4] = ["/eng/research/daily_list.jsp", "/eng/research/daily_list.jsp", "/eng/research/company_list.jsp", "/eng/research/sector_list.jsp", "/eng/research/market_list.jsp", "http://www.truefriend.com/eng/research/newsletter01.jsp"];

// Guide to Investment
urls_eng[5] = ["/eng/guide/stock01.html", "/eng/guide/stock01.html", "/eng/guide/fund01.html", "/eng/guide/link.html"];



///////////////////////////////////// ¸ÞÀÎ¸Þ´º ¸µÅ©
function goLinkEng(m, s){
	// ¸Þ´º °ªÀÌ ÀÖÀ»¶§¸¸ ½ÇÇà
	if(m != undefined){
		// ¼­ºê°ªÀÌ ¾øÀ¸¸é ÃÊ±â°ª 0
		if(s == undefined){
			s = 0;	
		}
		if(urls_eng[m][s] == "alert") {
			alert ('ÁØºñÁß')
		} else if(urls_eng[m][s] == "KOREASITE") {
			window.open('http://www.truefriend.com');
		} else {
		window.location.href=(urls_eng[m][s]);
		}
		
		//alert(urls_eng[m][s]);
		//alert(m + " : " + s);
	}
}

/////////////////////////////// °Ë»ö
function goSearchEng(str){
	if(str != undefined){
//		alert("°Ë»ö: " + str);	
	location.href = "/etc/search/search_all.jsp?query=" + str;
	}
}


//*****************************************************************************************
// ÃÖ±Ùº»»óÇ° ¸ñ·Ï
//*****************************************************************************************
	// »óÇ° ÇÑ°³ÀÇ Á¤º¸
	function TFGood(obj, category, code, name) {
		var _codeValue = code.split("/");
		var _code = code;
		var _option = "";
		if (_codeValue.length>1) {
			_code = _codeValue[0];
			_option = _codeValue[1];
		}
		this.category = category;
		this.name = name;
		this.code = _code;
		this.option = _option;
		
		// TFGoodManager()¿¡ Ãß°¡
		if (!obj.exist(category, code))
			obj.add(this);
	}
	
	// »óÇ° °ü¸®ÀÚ
	function TFGoodManager() {
		this.PAGE = 3;

		this.currentPage = 0;
		this.totPage = 0;
		this.listGood = new Array();
	}
	
	TFGoodManager.prototype.getCount = function() {
		return this.listGood.length;
	}
	
	TFGoodManager.prototype.add = function(good) {
		this.listGood[this.listGood.length] = good;
		this.totPage = Math.floor(this.listGood.length/this.PAGE);
		if( (this.listGood.length % this.PAGE) == 0 ) this.totPage--;
	}
	
	TFGoodManager.prototype.exist = function(category, code) {
		var exist = false;
		for (var i=0; i < this.listGood.length; i++) {
			good =  this.listGood[i];
			if (category == good.category &&  code == good.code) {
				exist =  true;
				break;	
			}
		}
		return exist;
	}

	TFGoodManager.prototype.next = function() {
		if( this.currentPage >= this.totPage ) {
			alert("¸¶Áö¸·ÀÔ´Ï´Ù.");
		} else {
			this.currentPage++;
			this.display();
		}

	}
	
	TFGoodManager.prototype.prev = function() {
		if( this.currentPage <= 0 ) {
			alert("Ã³À½ÀÔ´Ï´Ù.");
		} else {
			this.currentPage--;
			this.display();
		}
	}

	TFGoodManager.prototype.display = function() {
		var first = this.currentPage*this.PAGE;
		var end = (this.currentPage+1)*this.PAGE;
		if( end > this.getCount() ) end = this.getCount();
		var goodHTML = "";
		var count = this.getCount();
		
		for( first; first<end; first++ ) {
			if( this.listGood[first] ) {
//				alert("first : " + first + ", end : " + end);
				goodHTML += "<table border='0' cellpadding='0' cellspacing='0'";
				if( (first+1) == end ) {
					goodHTML += " id='tableRecent_no'";
				} else {
					goodHTML += " id='tableRecent'";
				}
				goodHTML += ">";
				goodHTML += "	<tr>";
				goodHTML += "		<td width='15' align='center' valign='top'>";
				if (this.listGood[first].category!="E") {
					goodHTML += "<input type='checkbox' name='todayProductCheckBox' value='"+this.listGood[first].code+"' productType='"+this.listGood[first].category+"' style='width: 10px; height: 10px;'>";
				}
				goodHTML += "</td>";
				goodHTML += "		<td><a href='javascript:goThisTodayProduct(\""+this.listGood[first].category+"\",\""+this.listGood[first].code+"\",\""+this.listGood[first].option+"\");'>" + this.listGood[first].name + "</a></td>";
				goodHTML += "	</tr>";
				goodHTML += "</table>";
			}
		}
		document.getElementById('viewContents').innerHTML = goodHTML;
	}

	TFGoodManager.prototype.main = function() {
		var countHTML="";
		document.getElementById('viewCount').innerHTML = "¡¡";
		//document.getElementById('viewCount').innerHTML = this.getCount() + "°³";
		this.display();
	}
//*****************************************************************************************

var goodManager = new TFGoodManager();



//*****************************************************************************************
// cookie
//*****************************************************************************************

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}



function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}


function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
//*****************************************************************************************


//*****************************************************************************************
// ¿À´Ã º» »óÇ° µî·Ï
//*****************************************************************************************
function goThisTodayProduct(sType, sCode, sOption) {
	var sViewPageUrl = "";
	if (sType=="F") {
		if (sOption=="FOREIGN") {
			sViewPageUrl = "/mall/product/fund/foreign_fund_view.jsp?pfundCd="+sCode+"&fundType=FOREIGN";
		} else {
			sViewPageUrl = "/mall/product/fund/fund_view.jsp?pfundCd="+sCode+"&fundType=DOMESTIC";
		}
	} else if (sType=="E") {
		sViewPageUrl = "/mall/product/els/pro_intro.jsp?num="+sCode;
	} else if (sType=="R") {
		sViewPageUrl = "/mall/product/rap/product/pro_view.jsp?num="+sCode;
	}
	if (sViewPageUrl=="") {
		alert("Àß¸øµÈ Á¤º¸ÀÔ´Ï´Ù.");
	} else {
		location.href = sViewPageUrl;
	}
}

function getCheckedTodayProducts() {
	var products = new Array;
	var obj = document.all.todayProductCheckBox;
	if (obj) {
		if (obj.length>1) {
			for (var i=0; i<obj.length; i++) {
				if (obj[i].checked) {
					products.push({type : obj[i].getAttribute("productType"), code : obj[i].value});
				}
			}
		} else {
			if (obj.checked) {
				products.push({type : obj.getAttribute("productType"), code : obj.value});
			}
		}
	}
	return products;
}

function addToMyProductList() {
	var products = getCheckedTodayProducts();
	if (products.length==0) {
		alert("°ü½Éµî·ÏÇÒ »óÇ°À» ¼±ÅÃÇÏ¼¼¿ä.");
		return;
	} else if (products.length>1) {
		alert("°ü½É»óÇ° µî·ÏÀº ÇÑ°³¾¿¸¸ °¡´ÉÇÕ´Ï´Ù.");
		return;
	}
	
	var iframeName = "TodayProductAddFrame";
	var targetFrame = document.all[iframeName];
	var targetUrl = "about:blank";
	if (products[0].type=="F") {
		targetUrl = "/mall/wish/wish_tr.jsp?mode=insert&productKind=F&chk="+products[0].code;
	} else if (products[0].type=="R") {
		targetUrl = "/mall/wish/wish_tr.jsp?mode=insert&productKind=R&chk="+products[0].code;
	}
	
	if (!targetFrame) {
		var iframe = document.createElement("IFRAME");
		iframe.name = iframeName;
		iframe.src = targetUrl;
		iframe.style.width = "1px";
		iframe.style.height = "1px";
		document.body.appendChild(iframe);
	} else {
		window.open(targetUrl,iframeName,"");
	}
}


function compareCheckedProducts() {
	var products = getCheckedTodayProducts();
	if (products.length==0) {
		alert("ºñ±³ÇÒ »óÇ°À» ¼±ÅÃÇÏ¼¼¿ä.");
		return;
	} else if (products.length<2) {
		alert("ºñ±³ÇÒ »óÇ°À» ÃÖ¼ÒÇÑ 2°³ÀÌ»ó ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
		return;
	}
	
	var badIndex = "";
	var isFund = true;
	var chk = "";
	for (var i=0; i<products.length; i++) {
		if (chk!="") chk += ",";
		chk += products[i].code;
		if (products[i].type!="F") {
			isFund = false;
			badIndex = "" + (i+1);
			break;
		}
	}
	
	if (!isFund) {
		alert("ÆÝµå»óÇ°¸¸ ºñ±³ÇÒ ¼ö ÀÖ½À´Ï´Ù.\n" + badIndex + "¹øÂ° ¼±ÅÃÇÏ½Å »óÇ°Àº ÆÝµå»óÇ°ÀÌ ¾Æ´Õ´Ï´Ù.");
		return;
	}
	
	window.open("/common/popup_compareTodayProduct.jsp?chk="+chk,"popWin","width=780,height=550,toolbar=no,scrollbars=no,resizable=yes" );
	
}

function getPrevProductString(sPrevString,sNowString) {
	if (sPrevString==null) sPrevString = "";
	if (sNowString==null) sNowString = "";
	var tempProductString = sPrevString.split(";");
	var sReturnString = "";
	var nCount = 0;
	for (var i=0; i<tempProductString.length; i++) {
		if (tempProductString[i].trim()!=sNowString.trim()) {
			if (sReturnString!="") {
				sReturnString += ";";
			}
			sReturnString += tempProductString[i];
			if (++nCount>=11) {
				break;
			}
		}
	}
	return sReturnString;
}

function addTodayViewProduct(sType, sCode, sName) {
	if (sType==null) sType = "";
	if (sCode==null) sCode = "";
	if (sName==null) sName = "";
	if (sType==""||sCode==""||sName=="") {
		return;
	}
	var cookieName = "sViewProductCookie";
	var nowValue = sType + "|" + sCode + "|" + sName;
	var prevValue = Get_Cookie(cookieName);
	if (prevValue==null) prevValue = "";
	prevValue = getPrevProductString(prevValue,nowValue);
	var newValue = nowValue;
	if (prevValue.trim()!="") newValue += ";" + prevValue;
	Set_Cookie(cookieName, newValue, 1, "/");
}
//*****************************************************************************************




	// Çã¿ëµÈ byte¸¸Å­ ÀÔ·ÂµµÁß ½Ç½Ã°£À¸·Î stringÀÚ¸£±â
	// <textArea>µî¿¡ »ç¿ëÇÏ¸é µË´Ï´Ù.
	// onKeyup="checkByte(this,Á¦ÇÑÇÒbyte¼ö,"ÇöÀçbyteÁ¤º¸»Ñ·ÁÁÙ¿µ¿ªÀÇID");"
	// ¸¶Áö¸· ÀÎÀÚ´Â ¼±ÅÃ»çÇ×ÀÔ´Ï´Ù.
	// ex)  onKeyup="checkByte(this,200,'nowByteShowArea');"

function getBytes(sString) {
	var c = 0;
	for (var i=0; i<sString.length; i++) {
		c += parseInt(getByte(sString.charAt(i)));
	}
	return c;
}
function getByte(sChar) {
	var c = 0;
	var u = escape(sChar);
	if (u.length < 4) { // ¹Ý°¢¹®ÀÚ : ±âº»ÀûÀÎ ¿µ¹®, ¼ýÀÚ, Æ¯¼ö±âÈ£
		c++; // + 1byte
	} else {
		var s = parseInt(sChar.charCodeAt(0));
		if (((s >= 65377)&&(s <= 65500))||((s >= 65512)&&(s <= 65518))) // ¹Ý°¢¹®ÀÚ À¯´ÏÄÚµå 10Áø¼ö ¹üÀ§ : ÇÑ±¹¾î, ÀÏº»¾î, Æ¯¼ö¹®ÀÚ
			c++; // + 1byte
		else // Àü°¢¹®ÀÚ : À§ Á¶°ÇÀ» Á¦¿ÜÇÑ ¸ðµç ¹®ÀÚ
			c += 2; // + 2byte
	}
	return c;
}
function cutOverText(obj,maxByte,viewAreaID) {
	var sString = obj.value;
	var c = 0;
	for (var i=0; i<sString.length; i++) {
		c += parseInt(getByte(sString.charAt(i)));
		if (c>maxByte) {
			obj.value = sString.substring(0,i);
			break;
		}
	}
	showNowByte(obj.value,viewAreaID);
}
function showNowByte(sString,viewAreaID) {
	var vArea = document.getElementById(viewAreaID);
	if (vArea) vArea.innerHTML = getBytes(sString);
}
function checkByte(obj,maxByte,viewAreaID) {
	var sString = obj.value;
	showNowByte(sString,viewAreaID);
	if (getBytes(sString) > maxByte) {
		alert("ÃÖ´ë "+maxByte+"Bytes(ÇÑ±Û "+(maxByte/2)+"ÀÚ/¿µ¹® "+maxByte+"ÀÚ)±îÁö¸¸ ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
		cutOverText(obj,maxByte,viewAreaID);
	}
}

try {
	parent.topfrm.document.location.href = '/sessionTimer.jsp';
} catch (E) { }


function setValue(sObject, sValue) { 
	sObject.value = sValue;
}


