//document.domain="daishin.co.kr";

/**************** loginside *******************************/
//AceCounter(E-Biz) Version 6.0i START
var NL_ag   = 0 ;            
var NL_id   = '';    // ·Î±×ÀÎ»ç¿ëÀÚ ¾ÆÀÌµð
var NL_mr   = '';        // ·Î±×ÀÎ»ç¿ëÀÚ °áÈ¥¿©ºÎ ('single' , 'married')
var NL_gd   = '';           // ·Î±×ÀÎ»ç¿ëÀÚ ¼ºº° ('man' , 'woman')
var NL_skey = '' ;             // ³»ºÎ°Ë»ö¾î
var NL_jn = '' ;               // °¡ÀÔÅ»Åð ¿©ºÎ ( 'join','withdraw' ) 
var NL_jid = '' ;				// È¸¿ø°¡ÀÔ½Ã ÀÔ·ÂÇÑ ID
var NL_ud1 = '' ;				// »ç¿ëÀÚÁ¤ÀÇº¯¼ö 1 ( 1~ 7 Á¤¼ö°ª)
var NL_ud2 = '' ;				// »ç¿ëÀÚÁ¤ÀÇº¯¼ö 2 ( 1~ 7 Á¤¼ö°ª)
var NL_ud3 = '' ;				// »ç¿ëÀÚÁ¤ÀÇº¯¼ö 3 ( 1~ 7 Á¤¼ö°ª)
//AceCounter(E-Biz) Version 6.0i END

if( typeof NU_rl == 'undefined' ){
var NU_rl = 'http://'+'weblog.daishin.co.kr'; var PCHKIMG = new Image(); var NL_bn=navigator.appName;
if( document.URL.substring(0,8) == 'https://' ){ NU_rl = 'https://sslc1.acecounter.com/sslb1'; 
}else{
if( NL_bn.indexOf("Netscape") > -1 || NL_bn=="Mozilla"){ setTimeout("PCHKIMG.src = NU_rl+'/?cookie';",1); } else{ PCHKIMG.src = NU_rl+'/?cookie'; };
}
document.writeln("<scr"+"ipt language='javascript' src='/ctx_kr/sc_common/sg_resource/svc_js/loginside/loginside_mainscript.js'></scr"+"ipt>");
}
/*---------------- loginside end -------------------------*/

/**
* TO-DO
* _kidoGlobal.js
* ÀÌ¿ø±Õ 
* °³¹ßÁß¿¡¸¸ ÆÄÀÏ ºÐ¸®ÇØ ³õÀ½.
* ¿Ï·á ÈÄ global.js¿¡ ÇÕÄ¥ ¿¹Á¤
*/
document.write('<scr'+'ipt type="text/javascr'+'ipt" src="/ctx_kr/sc_common/sg_resource/svc_js/_kidoGlobal.js"></scr'+'ipt>');


//2009.11.30 hwseo
//jquery
document.write('<script language ="javaScript" src="/ctx_kr/sc_common/sg_resource/svc_js/jquery-1.2.6.js"></script>');
document.write('<script language ="javaScript" src="/ctx_kr/sc_common/sg_resource/svc_js/jquery/jquery.simplemodal-1.3.js"></script>');
document.write('<script language ="javaScript" src="/ctx_kr/sc_common/sg_resource/svc_js/modalMsg.js"></script>');
if(document.URL.indexOf("/admin/") > -1 || document.URL.indexOf("/nimda/") > -1){
	
}else{
	document.write('<script language ="javaScript" src="/ctx_kr/sc_common/sg_resource/svc_js/jquery-1.4.1.min.js"></script>');
	document.write('<script language ="javaScript" src="/ctx_kr/sc_common/sg_resource/svc_js/sa.global.js"></script>');
}

/**
* 2008.06.25 °øÅë scriptÃß°¡ by jmkim
*/
// input Form °ü·Ã Ã³¸® script
document.write('<SCRIPT LANGUAGE="JavaScript" SRC="/ctx_kr/sc_common/sg_resource/svc_js/form.js"></SCRIPT>');
// ajaxÃ³¸® script
document.write('<SCRIPT LANGUAGE="JavaScript" SRC="/ctx_kr/sc_common/sg_resource/svc_js/ajax.js"></SCRIPT>');	

// ÇÃ·¡½¬ ¸µÅ© Á¤º¸
document.write('<script type="text/javascript" src="/ctx_kr/sc_common/sg_resource/svc_js/flashLink.js"></script>');
document.write('<script type="text/javascript" src="/ctx_kr/sc_common/sg_resource/svc_js/DSCookie.js"></script>');

/**
* 2011.07.15 °­¼º±Ç SNS Ã³¸® Ãß°¡
*/
document.write('<script type="text/javascript" src="/ctx_kr/sc_common/sg_resource/svc_js/sendSNS.js"></script>');

/********************************************************************************************************
	ÆË¾÷Ã¢ ¿ÀÇÂ
********************************************************************************************************/
function popOpen(url) {
	var positionX = (screen.width-450)/2;
	var positionY = (screen.height-250)/2;
	open(url,"_blank","left="+positionX+",top="+positionY+",width=696,height=600,toolbar=no,scrollbars=no,status=yes" );
}

/****** ÆË¾÷Ã¢ ¸®»çÀÌÁî **************************************************************/
function popResize() {

    var Dwidth = parseInt(document.body.scrollWidth);
    var Dheight = parseInt(document.body.scrollHeight);
    var divEl = document.createElement("div");
    divEl.style.position = "absolute";
    divEl.style.left = "0px";
    divEl.style.top = "0px";
    divEl.style.width = "100%";
    divEl.style.height = "100%";
    
    document.body.appendChild(divEl);
    window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);
    document.body.removeChild(divEl);

	var thisX = Dwidth-divEl.offsetWidth;
	var thisY = Dheight-divEl.offsetHeight;
	
	var windowX = (screen.width - (thisX+10))/2;
	var windowY = (screen.height - (thisY))/2 - 20;
	window.moveTo(windowX,windowY);
	
}

function popResize2() {
	
	var thisX = document.getElementById("p_contents").offsetWidth;
	var thisY = document.getElementById("p_contents").offsetHeight;
	var headerY = document.getElementById("div_header").offsetHeight;
	var footerY = document.getElementById("div_footer").offsetHeight;
	
	var maxThisX = screen.width - 50;
	var maxThisY = screen.height - 80;
	
	var marginY;
	if (window.navigator.userAgent.indexOf("SV1") != -1) {	//IE6.0
		marginY = headerY + footerY + 60; //¸¶Áö¸· ¼ö´Â »óÈ²¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	} else if (window.navigator.userAgent.indexOf("MSIE 7") != -1) { //IE7.0
		marginY = headerY + footerY + 73;
	} else {
		marginY = headerY + footerY + 108; //¸¶Áö¸· ¼ö´Â »óÈ²¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)		
	}
	
	if (thisX > maxThisX) {
		window.document.body.scroll = "yes";
		thisX = maxThisX;
	}
	if (thisY > maxThisY - marginY) {
		window.document.body.scroll = "yes";
		thisX += 25;
		thisY = maxThisY - marginY;
	}
	
	var windowX = (screen.width - (thisX+10))/2;
	var windowY = (screen.height - (thisY+marginY))/2 - 20;
	window.moveTo(windowX,windowY);
	
	var xVal = parseInt(thisX,10);
	var yVal = parseInt(thisY,10)+parseInt(marginY,10);
	
	window.resizeTo(thisX+70,thisY+marginY+20);
	
}



/********************************************************************************************************
	ÆË¾÷Ã¢ ¿ÀÇÂ(°ø¿ë) - ÆË¾÷¸Å´ÏÁ®
	2011.03.31		±èÁ¾¹Ì			popupurlÀ» parameter°¡ ¾Æ´Ï¶ó ÄíÅ°·Î Àü´ÞÇÏµµ·Ï ¼öÁ¤
********************************************************************************************************/
function commonPopOpen(title, url, width, height, needEnc) {
	var width = (width==undefined||width=="") ? 443 : width;
	var height = (height==undefined||height=="") ? 250 : height;
	var positionX = (screen.width - parseInt(width,10))/2;
	var positionY = (screen.height - parseInt(height,10))/2;
	var commonPop = "/ctx_kr/sc_common/sg_common_app/svc_popup/popManager.jsp?title=" + title + 
					"&url=" + escape(url) +
					"&width=" + width +
					"&height=" + height;

	if(needEnc) 
	{
		commonPop += "&needEnc=true";
	}

	var HtsWebLogin = getCookie('HtsWebLogin');
	if(HtsWebLogin == null || HtsWebLogin == "") HtsWebLogin = "";
	if(HtsWebLogin == "") {
		setDSCookie("commonPopUrl", escape(url), "");
	}

	open(commonPop, "_blank", "left="+positionX+",top="+positionY+",width=" + width + ",height=" + height + ",toolbar=no,scrollbars=yes,status=yes" );
}


/********************************************************************************************************
	FAQ List
********************************************************************************************************/
var faqList_z=1;

function faqList(i){
	var answer_i = document.all["answer"+i];
	var faq_text_i=document.all["faq" + i];
	var answer_z = document.all["answer"+faqList_z];
	var faq_text_z=document.all["faq" +faqList_z];
	
	if (answer_i && answer_z) {
		if(faqList_z != 0){
			answer_z.style.display="none"
			faq_text_z.className = "faq_Q_off";
			answer_i.style.display="";
			faq_text_i.className = "faq_Q_on";
		}
		answer_i.style.display="";
		faq_text_i.className = "faq_Q_on";
		faqList_z=i;
	}
}


/********************************************************************************************************
	ÀÌ¹ÌÁö ¿À¹ö/¾Æ¿ô
********************************************************************************************************/
function setOver(thisImg, sMode) {
	var sPath = thisImg.src;
	var sCommonPath = sPath.substring(0, sPath.lastIndexOf("_") + 1);
	var sType = sPath.substring(sPath.lastIndexOf("."), sPath.length);
	thisImg.src = sCommonPath + sMode + sType;
}

/********************************************************************************************************
	¼­ºêÅÇ, ¸µÅ©½ºÅÇ ¿Â/¿ÀÇÁ ÇÔ¼ö
********************************************************************************************************/
function chgSub(thisImg){
	var seq = 1;
	var sPath = thisImg.src;
	var sImgName = sPath.substring(sPath.lastIndexOf("/") + 1, sPath.lastIndexOf("_") - 2);
	var seqTab = sPath.substring(sPath.lastIndexOf("_") - 2, sPath.lastIndexOf("_") );

	while (seq) {
		var tmpSeq;
		if( seq < 10 ) {
			tmpSeq = "0" + seq;
		} else {
			tmpSeq = seq;
		}
		
		var objImg = document.getElementById(sImgName + tmpSeq);
		if( objImg ) {

			setOver(objImg, "off");
			document.getElementById('list_' + sImgName + tmpSeq ).style.visibility="hidden";
			document.getElementById('list_' + sImgName + tmpSeq ).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 Flash_display(sFName, nWidth, nHeight, sVName, BGColor, Wmode ){	
	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="'+ sVName +'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/ctx_kr/sc_common/sg_resource/svc_swf/'+ sFName + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="' + BGColor + '" />');
	document.write('<param name="wmode" value="' + Wmode + '" />');
	document.write('<embed src="/ctx_kr/sc_common/sg_resource/svc_swf/'+ sFName + '" quality="high" bgcolor="#ffffff" width="'+ nWidth + '" height="'+ nHeight + '" name="'+ sVName +'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> ');
	document.write('</object>');	
}

/********************************************************************************************************
 ÇÃ·¡½¬_¹è³Ê
********************************************************************************************************/
function Flash_main_banner(sFName, nWidth, nHeight, sVName, BGColor, Wmode ){ 
	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="'+ sVName +'" align="middle">'); 
	document.write('<param name="allowScriptAccess" value="sameDomain" />'); 
	document.write('<param name="movie" value="/ctx_kr/sc_common/sg_resource/svc_swf/main/' + sFName + '" />'); 
	document.write('<param name="quality" value="high" />'); 
	document.write('<param name="bgcolor" value="'+ sVName +'" />'); 
	document.write('<param name="wmode" value="' + Wmode + '" />');
	document.write('<param name="flashvars" value="flashPath=/ctx_kr/sc_common/sg_resource/svc_swf/main/&rollXml=/ctx_kr/sc_common/sg_common_app/svc_menu/xml/main/rolling.xml">'); 
	document.write('<embed src="ctx_kr/sc_common/sg_resource/svc_swf/main/' + sFName + '" quality="high" bgcolor="#ffffff" width="' + nWidth + '" height="' + nHeight + '" name="'+ sVName +'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); 
	document.write('</object>'); 
}

/********************************************************************************************************
	ÇÃ·¡½¬_IR¹è³Ê
********************************************************************************************************/
function Flash_main_IRbanner(sFName, nWidth, nHeight, sVName, BGColor, Wmode ){	
	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="'+ sVName +'" align="middle">');	
	document.write('<param name="allowScriptAccess" value="sameDomain" />');	
	document.write('<param name="movie" value="/ctx_kr/sc_common/sg_resource/svc_swf/main/' + sFName + '" />');	
	document.write('<param name="quality" value="high" />');	
	document.write('<param name="bgcolor" value="'+ sVName +'" />');	
	document.write('<param name="wmode" value="' + Wmode + '" />');
	document.write('<param name="flashvars" value="flashPath=/ctx_kr/sc_common/sg_resource/svc_swf/main/&rollXml=/ctx_kr/sc_common/sg_common_app/svc_menu/xml/ir/ir_rolling.xml">');	
	document.write('<embed src="ctx_kr/sc_common/sg_resource/svc_swf/main/' + sFName + '" quality="high" bgcolor="#ffffff" width="' + nWidth + '" height="' + nHeight + '" name="'+ sVName +'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');	
	document.write('</object>');	
}


/********************************************************************************************************
	¼¿·ºÆ®¹Ú½º ¸Þ´º ¸µÅ©
********************************************************************************************************/
function goto_byselect_new(sel,w_target) {
	var index  = sel.selectedIndex;
	var selVal = sel.options[index].value;
	
	if (selVal != '' ) { 
		if(w_target == "_blank"){
			window.open(selVal);
		} else {
			location.replace(selVal);
		}
	}
}

/********************************************************************************************************
 ¸®¼­Ä¡¼¾ÅÍ ¼­ºê¸ÞÀÎ > ÀÌº¥Æ®
********************************************************************************************************/
function setPng24(obj) { 
	obj.width=obj.height=1; 
	obj.className=obj.className.replace(/\bpng24\b/i,''); 
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
	obj.src='about:blank';  
	return ''; 
}

function re_site(snum){
	open(snum,"","toolbar=no,scrollbars=no,resizable=no");
}

function open_site(snum){
	window.open(snum);
}

/********************************************************************************************************
	È¸»ç ¼Ò°³ ¸Þ´º ¸µÅ©
********************************************************************************************************/

function goDaishinCompany() {
	open("/ctx_ir/svc_intro/intro.shtml", "_blank", "");
}

/********************************************************************************************************
	´ë½Å IR ¸Þ´º ¸µÅ©
********************************************************************************************************/

function goDaishinIR() {
	open("/ctx_ir/sg_ir/svc_news/news.html", "_blank", "");
}

/********************************************************************************************************
	¿µ¾÷Á¡ ¾È³»  ¸Þ´º ¸µÅ©
********************************************************************************************************/

function goDaishinBranches() {
	open("/ctx_ir/sg_intro/svc_branches/svc_branches.html", "_blank", "");
}

/********************************************************************************************************
	´ë½ÅÁõ±Ç È¨  ¸Þ´º ¸µÅ©
********************************************************************************************************/

function goDaishinHome() {
	open("/ctx_kr/svc_intro/main.html", "_blank", "");
}

/********************************************************************************************************
ÇØ¿ÜÁõ½ÃÁ¤º¸
********************************************************************************************************/

function go7101(idx) {
	var url = "/ctx_kr/sc_invest_info/sg_foreign_market/svc_7101/7101.html";
	
	if(idx)
		url += "?tabidx=" + idx;
	
	open(url, "_blank", "");
}

/********************************************************************************************************
	Á¾¸ñÄÚµå util
********************************************************************************************************/

function getTopFrame() {
	var topFrame = null;
	try {
		topFrame = top;
	} catch(e1) {
		try {
			topFrame = top.opener.top;
		} catch(e2) {
			try {
				topFrame = top.opener.top.opener.top;
			} catch(e3) {
				topFrame = null;
			}
		}
	}

	return topFrame;
}

function searchStockName(code) {
	var tmpFrame = getTopFrame();
	if(tmpFrame == null) {
		alert("ÇÁ·¹ÀÓÀ» Ã£À» ¼ö ¾ø½À´Ï´Ù.");
		return "";
	}
	var name = tmpFrame.SearchStockName(code);
	if(name == null || name == "") {
		//alert("ÇØ´çÇÏ´Â Á¾¸ñ¸íÀ» Ã£À» ¼ö°¡ ¾ø½À´Ï´Ù.");
		name = "";
	}
	return name;
}

function goPension() {
	open("/ctx_pension/");
}

function spyzero() {
	open("http://asz.daishin.co.kr/");
}

/**********************************************************************************
 popupwindow (½ºÅ©·Ñ¹Ù no)
***********************************************************************************/
function popwindow(pop,width,height,winname) {
	var url = pop;  
	var wd = parseInt(width);
	var he = height;
	var name = winname || "";
	var hasScroll = "no";
	
    if (he > screen.height) {
    	wd = wd + 17;
    	hasScroll = "yes";
    }
    
	var win = open(url,name,"toolbar=0,menubar=0,scrollbars="+hasScroll+",resizable=no,width=" + wd +",height=" + he + ";");
	win.focus();
} 


/**********************************************************************************
 popupwindow01(½ºÅ©·Ñ¹Ù yes)
***********************************************************************************/
function popwindow01(pop,width,height) {
	var url = pop;  
	var wd = width;
	var he = height;
	open(url,"","toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd +",height=" + he + ";")
}

/********************************************************************************************************
 ÁÖ¿ä±â´É¼Ò°³
********************************************************************************************************/
function goUcybosInfo() {
	open("/ctx_kr/sc_trading_tool/sg_online/svc_ucybos/global_open/index_001.html","","toolbar=0,menubar=0,scrollbars=no,resizable=no,width=1024,height=768;")
}

/********************************************************************************************************
 µµ¿ò¸»
********************************************************************************************************/
function goDaishinHelp() {
	open("/ctx_webservice/sc_ws_daishin/sg_ws_customer/svc_cyboshelp/help_index.html","","toolbar=0,menubar=0,scrollbars=yes,resizable=yes,width=850,height=768;")
}

/********************************************************************************************************
 OneStopCma Ria Window Open,.
********************************************************************************************************/
function openOneStopCma()
{
	var trcd = arguments[0];
	if (arguments[0] == null || arguments[0] == undefined) trcd = "";
	var url = "/ctx_kr/sc_fnmall/sg_cma/svc_onestop/cma_main.jsp?trcd="+trcd;
	var titleImg = "/ctx_kr/sc_fnmall/sg_cma/svc_onestop/img/title_onestopCma.gif";
	if (memberLoginCheck() == "1")
	{
		DSRiaWindow.open(EncLocation(url), 840, 480, titleImg, 'no');
	}
	else
	{
		if (confirm("ÇØ´ç¸Þ´º´Â Á¤È¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß ÇÕ´Ï´Ù. ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?"))
		{
			javascript:goPage('110101');
		}
	}
}

function openOneStop3341()
{
	var url = "/ctx_kr/sc_fnmall/sg_cma/svc_onestop/cma_main.jsp?trcd=3341";
	var titleImg = "/ctx_kr/sc_fnmall/sg_cma/svc_onestop/img/title_onestopCma.gif";
	if (memberLoginCheck() == "1")
	{
		parent.DSRiaWindow.open(EncLocation(url), 840, 480, titleImg, 'no');
	}
	else
	{
		if (confirm("ÇØ´ç¸Þ´º´Â Á¤È¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß ÇÕ´Ï´Ù. ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?"))
		{
			javascript:goPage('110101');
		}
	}
}


//portfolio ÀÌµ¿:¸Þ´º¿¡¼­ javascript:goPortfolio()·Îµî·ÏÇÑ´Ù.
function goPortfolio(gb)
{
	alert("Æ÷Æ®Æú¸®¿À ÀÛ¾÷ = "+gb);

	/*
	if(gb == '1')
	{
		try
		{
			//goPage_TrCode('7059');			
			var menu = getMenu_TrCode('7059');
			alert(menu.url);
			top.contents.location.replace(menu.url);

		}
		catch (e)
		{
			alert(e);
		}

	}
	else if(gb == '2')
	{
		//goPage_TrCode('portfolio_total');
		var menu = getMenu_TrCode('portfolio_total');
		top.contents.location.replace(menu.url);
	}
	else
	{
	}

		//gb= 1 : "/ctx_kr/sc_stock/sg_stock_info/svc_portfolio/7059.jsp"
		//gb='2' : /ctx_kr/sc_stock/sg_stock_info/svc_portfolio/portfolio_total.html
	*/
}


/**
* String °´Ã¼¿¡ trim() FunctionÀ» Ãß°¡ÇÑ´Ù.
* ¹®ÀÚ¿­ÀÇ ÁÂ¿ì °ø¹é Á¦°Å
*/
String.prototype.trim = function () {
	var s = (this!=null) ? this : "";
	s = s.replace(/^\s+/g,"");
	s = s.replace(/\s+$/g,"");
	return s;
}

/**
* String °´Ã¼¿¡ encodeParameter() FunctionÀ» Ãß°¡ÇÑ´Ù.
* ÆÄ¶ó¹ÌÅÍ·Î URLÀÌ µé¾î°¥¶§ Æ¯Á¤¹®ÀÚ¸¦ º¯È¯ÇÑ´Ù.
*/
String.prototype.encodeLoginParameter = function () {
	var s = (this!=null) ? this : "";
	s = s.replace(/&/g, "|");
	s = s.replace(/=/g, "@@");
	return s;
}
/**
* String °´Ã¼¿¡ appendParameter() FunctionÀ» Ãß°¡ÇÑ´Ù.
* URL¿ëµµ·Î »ç¿ëµÇ´Â String °ª¿¡ ÆÄ¶ó¹ÌÅÍ¸¦ Ãß°¡ÇÑ´Ù.
*/
String.prototype.appendParameter = function (_param) {
	var s = (this!=null) ? this : "";
	if (_param!=undefined&&_param!="") {
		if (s.indexOf("?")>-1) {
			s += "&";
		} else {
			s += "?";
		}
		s += _param;
	}
	return s;
}

/**
 * Input¿¡¼­ Record typeÀÌ ÀÖÀ»°æ¿ì
 * Record Field¿Í °ªÀ» JSONArray·Î ÀÛ¼ºÇÏ¿© 
 * Hidden À¸·Î Record¸¦ ¸¸µé¾îÁØ´Ù.
 */
function setInputRecordField(mainForm, recordFieldName,recordForm)
{

    var recordJSONArray = "[";

    //Ã¹¹øÂ° ÇÊµåÀÇ ÀÌ¸§À» °¡Áö°í RecordÀÇ °¹¼ö¸¦ ±¸ÇÑ´Ù.
    var record_size = 0;
    
    try
    {
        //alert("recordForm.elements[0].length = "+recordForm.elements[0].length);
        var tmpLength = recordForm.elements[recordForm.elements[0].name].length;
        //alert(tmpLength)

        if( tmpLength != "undefined" && tmpLength > 1)
        {
            //alert("array")

             record_size = recordForm.elements[recordForm.elements[0].name].length;
        }
        else
        {
            //alert("field")

            try
            {
                if(recordForm.elements[0].tagName != "")
                {
                    record_size = 1;
                }
                else
                {
                    record_size = 0;
                }
            }
            catch(e)
            {
                //¿©±â±îÁö ¿À¸é Ã³¸®ÇÒ Recordµ¥ÀÌÅ¸°¡ ¾ø´Â °æ¿ì´Ù.
                //´ç¿¬È÷ ¿¡·¯·Î Ã³¸®ÇÔ.
                recordJSONArray ="[{}]";
                //mainFormÀÇ Record¸¦ Àü¼ÛÇÒ ÀÌ¸§¿¡ ÇÒ´ç
                mainForm.elements[recordFieldName].value = recordJSONArray;

                return false;
            }
        }
        
        //alert("Record length ="+record_size+", Form total element length = "+recordForm.elements.length);
    }
    catch(e)
    {
        //alert("[global.js setInputRecordField()] exception = "+e);

        //¿©±â±îÁö ¿À¸é Ã³¸®ÇÒ Recordµ¥ÀÌÅ¸°¡ ¾ø´Â °æ¿ì´Ù.
        //´ç¿¬È÷ ¿¡·¯·Î Ã³¸®ÇÔ.
        recordJSONArray ="[{}]";
        //mainFormÀÇ Record¸¦ Àü¼ÛÇÒ ÀÌ¸§¿¡ ÇÒ´ç
        mainForm.elements[recordFieldName].value = recordJSONArray;

        return false;
    }
	
	//alert("record_size: " + record_size);
    //Record°¡ 1¹ø ÀÌ»ó ¹Ýµ¶µÇ´Â °æ¿ì.
    if (record_size > 1)
    {

      //Record ¼ö¸¸Å­ ¹Ýº¹
      //ÀüÃ¼ field ÃÑÇÕÀ» record ¼ö·Î ³ª´©¸é 1°³ recordÀÇ field¼ö°¡ ³ª¿Â´Ù.
      var fieldNum = recordForm.elements.length/record_size;
      var total = (record_size*fieldNum);
      for (var i = 0,k=0; i < total; i += fieldNum,k++)
      {
          recordJSONArray += "{";

          //recordFormÀÇ ÇÊµå ¼ö¸¸Å­ ¹Ýº¹
          //alert("element[i].length = "+recordForm.elements[i].length+",elements.length = "+recordForm.elements.length);

          var fieldIndex = fieldNum*(k+1);
          for (var j = i; j < fieldIndex; j++)
          {
          	  var val = recordForm.elements[j].value == "undefined" ? "" : recordForm.elements[j].value;
              recordJSONArray +="\""+recordForm.elements[j].name+"\" : \""+val+"\"";

              if ((j+1) < fieldIndex)
              {
                  recordJSONArray += ",";
              }
          }

          recordJSONArray +="}";

          if ((k+1) < record_size )
          {
              recordJSONArray += ",";
          }
      }
    }
    //Record°¡ 1°³ÀÎ°æ¿ì.
    else if(record_size == 1)
    {
        //Record ¼ö¸¸Å­ ¹Ýº¹
        //ÀüÃ¼ field ÃÑÇÕÀ» record ¼ö·Î ³ª´©¸é 1°³ recordÀÇ field¼ö°¡ ³ª¿Â´Ù.
        var fieldNum = recordForm.elements.length/record_size;
        var total = (record_size*fieldNum);
        var fieldIndex = fieldNum;

        recordJSONArray += "{";

        for (var j = 0; j < fieldIndex; j++)
        {
        	var val = recordForm.elements[j].value == "undefined" ? "" : recordForm.elements[j].value;
            recordJSONArray += "\""+recordForm.elements[j].name+"\" : \""+val+"\"";

            recordJSONArray += ",";
        }

        recordJSONArray +="}";
        
    }
    //0°³ÀÎ °æ¿ì.
    else
    {
        recordJSONArray +="{}";
    }

    recordJSONArray += "]";
    
    //alert(recordJSONArray);
    
    //mainFormÀÇ Record¸¦ Àü¼ÛÇÒ ÀÌ¸§¿¡ ÇÒ´ç
    mainForm.elements[recordFieldName].value = recordJSONArray;

    return true;
}


/**
 * mainForm¾È¿¡ Input Record °ªµéÀ» recordFormÀ¸·Î º¹»çÇÑ´Ù.
 * setInputRecordField È£ÃâÇÏ±â Àü¿¡ È£ÃâÇÑ´Ù.
 * mainForm : ½ÇÁ¦ Input Record Array°¡ Á¸ÀçÇÏ´Â Æû
 * recordForm : JSONArray·Î ¸¸µé ´ë»óÀÌ µÇ´Â Æû ( setInputRecordField¿¡¼­ »ç¿ë)
 * mainFormLoopCnt : ¹Ýº¹È½¼ö
 * mainFormRecordSize :  ·¹ÄÚµå °¹¼ö( ÃÑ ·¹ÄÚµå °¹¼ö°¡ ¾Æ´Ñ ´ÜÀÏ ·¹ÄÚµå °¹¼ö)
 */
function setRecordForm(mainForm, recordForm, mainFormLoopCnt, mainFormRecordSize)
{
	if ( mainFormLoopCnt == 0 ) return false;
	
	var recordSize;
	var totalLength = recordForm.elements.length;
	
	if ( totalLength != mainFormLoopCnt * mainFormRecordSize )
	{
		alert("ÃÑ·¹ÄÚµå°¹¼ö°¡  Æ²¸³´Ï´Ù.");
		return false;
	}
	
	var loopCnt = recordForm.elements[recordForm.elements[0].name].length;
	
	// ¹Ýº¹È½¼ö°¡ 1ÀÌ¸é...(¹è¿­Å¸ÀÔÀÌ ¾Æ´Ï¸é)
	if ( loopCnt == null || loopCnt == "undefined" )
	{
		loopCnt = 1;
	}
	
	if ( mainFormLoopCnt != loopCnt )
	{
		alert("¹Ýº¹È½¼ö°¡ Æ²¸³´Ï´Ù.");
		return false;
	}
	
	if ( loopCnt == 1 )
	{
		recordSize = totalLength / loopCnt;
		
		if ( mainFormRecordSize != recordSize )
		{
			alert("·¹ÄÚµå °¹¼ö°¡ Æ²¸³´Ï´Ù.");
			return;
		}
		
		for ( var i=0; i<recordSize; i++ )
		{
			try
			{
				fieldName = recordForm.elements[i].name;
				
				try
				{
					recordForm.elements[fieldName].value = mainForm.elements[fieldName].value;
				}
				catch(e)
				{
					alert(fieldName + " ÇÊµå¸íÀÌ ¾ø½À´Ï´Ù.\n\nÇÊµå¸íÀ» È®ÀÎÇÏ¼¼¿ä.");
					return false;
				}
			}
			catch(e)
			{
				alert(fieldName + " ÇÊµå¸íÀÌ ¾ø½À´Ï´Ù.\n\nÇÊµå¸íÀ» È®ÀÎÇÏ¼¼¿ä.");
				return false;
			}
		}
	}
	else
	{
		recordSize = totalLength / loopCnt;
		
		if ( mainFormRecordSize != recordSize )
		{
			alert("·¹ÄÚµå °¹¼ö°¡ Æ²¸³´Ï´Ù.");
			return false;
		}
		
		for ( var i=0; i<recordSize; i++ )
		{
			try
			{
				fieldName = recordForm.elements[i].name;
				
				for ( var j=0; j<loopCnt; j++ )
				{
					try
					{
						recordForm.elements[fieldName][j].value = mainForm.elements[fieldName][j].value;
					}
					catch(e)
					{
						alert(fieldName + " ÇÊµå¸íÀÌ ¾ø½À´Ï´Ù.\n\nÇÊµå¸íÀ» È®ÀÎÇÏ¼¼¿ä.");
						return false;
					}
				}
			}
			catch(e)
			{
				alert(fieldName + " ÇÊµå¸íÀÌ ¾ø½À´Ï´Ù.\n\nÇÊµå¸íÀ» È®ÀÎÇÏ¼¼¿ä.");
				return false;
			}
		}
	}
	return true;
}

/**
 * Input¿¡¼­ Record typeÀÌ ÀÖÀ»°æ¿ì
 * Record Field¿Í °ªÀ» JSONArray·Î ÀÛ¼ºÇÏ¿©
 * Hidden À¸·Î Record¸¦ ¸¸µé¾îÁØ´Ù.
 */
/*
function setInputRecordField(fieldObject, recordField, fields)
{

    var recordJSONArray = "[";

    var array_size = eval(fieldObject+"."+fields[0]).length;
    if (array_size > 1)
    {
      for (var i = 0; i < array_size; i ++)
      {
          recordJSONArray += "{";
          for (var j = 0; j < fields.length; j++)
          {
              recordJSONArray +="\""+fields[j]+"\" : \""+eval(fieldObject+"."+fields[j])[i].value+"\"";
              if ((j+1) < fields.length )
              {
                  recordJSONArray += ",";
              }
          }
          recordJSONArray +="}";
          if ((i+1) < array_size )
          {
              recordJSONArray += ",";
          }
      }
    }
    else
    {
        recordJSONArray += "{";
        for (var j = 0; j < fields.length; j++)
        {
            recordJSONArray += "\""+fields[j]+"\" : \""+eval(fieldObject+"."+fields[j]).value+"\""

            recordJSONArray += ",";
        }
        recordJSONArray +="}";

    }
    recordJSONArray += "]";
    eval(fieldObject+"." + recordField).value = recordJSONArray;

}
*/

/*
var RecodeArrayObject = 
{
    recordFieldArray : [],
    idx : 0,
    push : function( recordName, recordFormName)
    {
        var recordObj =
        {
            recordName : recordName,
            recordFormName : recordFormName
        };
        
        this.recordFieldArray[this.idx++] = recordObj;
    },
	
    pop : function(idx)
    {
        return this.recordFieldArray[idx];
    }
}
*/

/**
 * Input¿¡¼­ RecordÀÇ field¸í, form¸íÀ» °¡Áø °´Ã¼
 * Record TypeÀÌ ¿©·¯°³ ÀÏ°æ¿ì °¢°¢ÀÇ  Record name, form¸í Á¤º¸¸¦ °¡Áø´Ù  
 * 2008.12.29 hwseo
 */
function RecodeArrayObject() 
{
    this.recordFieldArray = new Array();
    this.idx = 0;
    this.push = function( recordName, recordFormName)
    {
        var recordObj =
        {
            recordName : recordName,
            recordFormName : recordFormName
        };
        this.recordFieldArray[this.idx++] = recordObj;
    },
	
    this.pop = function(idx)
    {
        return this.recordFieldArray[idx];
    }
    
    this.getIdx = function()
    {
    	return this.idx;
    }
}

/**
 * Input¿¡¼­ Record typeÀÌ ¿©·¯°³ ÀÖÀ»°æ¿ì 
 * RecodeArrayObject¿¡¼­ recordÁ¤º¸¸¦ ÇÏ³ª¾¿ ÀÐ¾î ÇØ´ç record¸íÀ¸·Î jsonÇüÅÂÀÇ °ªÀ» ¸¸µç´Ù.
 * 2008.12.29 hwseo
 */
function setInputRecordFieldArray(mainForm, raObject)
{
	var arrCnt = raObject.getIdx();
	
	for( var idx = 0; idx < arrCnt; idx++)
	{
		var recordForm = eval(raObject.pop(idx).recordFormName);
		var recordFieldName = raObject.pop(idx).recordName;
		
		setInputRecordField(mainForm, recordFieldName,recordForm)
		
	}

    return true;
}

/*
 * ajax È£Ãâ½Ã Çì´õÁ¤º¸¼³Á¤ object
 * 2009.09.30 hwseo
 */

function headerWrapObject() 
{
    this.headerArray = new Array();
    this.idx = 0;
    this.push = function(_name, _value)
    {
        var headerObj =
        {
            name : _name,
            value : _value
        };
        this.headerArray[this.idx++] = headerObj;
    }
}

/*
 * Believe ÆäÀÌÁö ¿ÀÇÂ
 * 2010.01.13 swmyung@mz.co.kr
 */

function fn_openBelieve() 
{
	// window.open('/ctx_believe/sc_believe/svc_believe_index/index.jsp', 'Believe', 'width=1016px,height=768px,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	// window.open('/ctx_believe/sc_believe/svc_believe_index/index.jsp', 'Believe', 'width=1016px,height=768px,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	window.open('http://believe.daishin.co.kr/?op=popup', 'Believe', 'width=1020, height=700, scrollbars=yes');
}


/**
* request °´Ã¼¸¦ »ý¼ºÇÑ´Ù.
*/
var request = {
	host : location.host,
	pathname : location.pathname,
	search : location.search,
	getQuery : function() {
		var s = this.search;
		if (s.indexOf("?")==0) {
			s = s.substring(1);
		}
		return s;
	},
	getParameter : function(_name) {
		var q = this.search;
		if (q.length>1&&q.indexOf("?")>-1) q = q.substring(1,q.length);
		var param = q.split("&");
		var paramValue = "";
		for (var i=0; i<param.length; i++) {
			if (param[i].indexOf("=")>-1) {
				var pName = param[i].split("=")[0];
				var pValue = param[i].split("=")[1];
				if (pName==_name) {
					paramValue = pValue.trim();
					break;
				}
			}
		}
		return paramValue;
	}
};

//2010.08.02 hwseo offset Ãß°¡ÇÔ..
function fn_calendar(target_id, offset_top, offset_left){
	//iframeÆäÀÌÁö¿¡¼­ display½Ã Â©¸²Çö»ó¹ß»ý. left offset¼³Á¤À¸·Î ÇØ°á. ex)±â°£¿¹¾àÁÖ¹®È­¸é ±â°£Á¾·áÀÏ
	var otop = offset_top || 0;
	var oleft = offset_left || 0;
	oleft = oleft == 0 ? -130 : oleft;
	
	try{
		var posX = window.event.clientX + (document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);
		var posY = window.event.clientY + (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
		
	    var obj_target = document.getElementById(target_id);
	    var default_val = obj_target.value;
		
		var temp_obj = document.getElementById("div_calendar");
		
		if(temp_obj){
			document.body.removeChild(temp_obj);
		}
	    
		var obj_div = document.createElement("DIV");
		
		obj_div.id = "div_calendar";
		
		//obj_div.style.setAttribute("position","absolute");
		obj_div.style.position = "absolute";
		obj_div.setAttribute("margin","0");
		obj_div.setAttribute("padding","0");
		obj_div.setAttribute("width","229");
		obj_div.setAttribute("height","265");
		
		obj_div.style.top = posY+parseInt(otop, 10) + "px";
		obj_div.style.left = posX+parseInt(oleft, 10) + "px";
		//obj_div.style.setAttribute("top", posY+parseInt(otop, 10) + "px");
		//obj_div.style.setAttribute("left", posX+parseInt(oleft, 10) + "px");
		
		var obj_iframe = document.createElement("IFRAME");
		obj_iframe.frameBorder = "0";
		
		//obj_iframe.setAttribute("frameborder","0");
		obj_iframe.setAttribute("width","229");
		obj_iframe.setAttribute("height","265");
		obj_iframe.setAttribute("marginwidth","0");
		obj_iframe.setAttribute("marginheight","0");
		
		var params = "";
		
		if(default_val != ""){
			params = "?date=" + default_val + "&target_id=" + target_id;
		}else{
			params = "?target_id=" + target_id;
		}
		
		obj_iframe.src = "/ctx_kr/sc_common/sg_common_app/svc_webutils/calendar.jsp" + params;
		
		obj_div.appendChild(obj_iframe);
		
		document.body.appendChild(obj_div);
		
		document.getElementById("div_calendar").setAttribute("position","absolute");
		
		/*
		    <div style="position:absolute;margin:0;padding:0;">
				<iframe src="/ctx_kr/sc_common/sg_common_app/svc_webutils/calendar.jsp" frameborder="0" width="229" height="265" marginwidth="0" marginheight="0" ></iframe>
			</div>
	
		 */
	}catch(e){
		alert(e.message)
	}
	
	try
	{
		after_fn_calendar();//´Þ·ÂÀÌ Àß¸°´Ù¸é ÀÌ ÇÔ¼ö¿¡¼­ À§Ä¡¸¦ ÀûÀýÈ÷ Á¶Á¤ÇÏÀÚ. 2010.09.02 hwseo
	}catch(e){}
}

function fn_calendar_util(cmd, target_id, sel_date){
	if(cmd == "CLOSE"){
		
	}else if(cmd == "SET"){
		var obj = document.getElementById(target_id);
		obj.value = sel_date;
	}
	
	var temp_obj = document.getElementById("div_calendar");
	
	if(temp_obj){
		document.body.removeChild(temp_obj);
	}

}

function fn_open_layer_popup(url,w,h,title_img_path, title_txt){
	try{
		w = w || "560";
		h = h || "300";
		
		w = w+"px";
		h = h+"px";

		title_img_path = title_img_path || "";
		title_txt = title_txt || "&nbsp;";
		
		var doc = null;
		try{
			doc = top.main.content.document;
		}catch(e){
			doc = top.content.document;	// popup
		}
		
		var temp_obj = doc.getElementById("div_layer_popup");
		if(temp_obj){
			doc.body.removeChild(temp_obj);
		}
	    
		var obj_div = doc.createElement("DIV");
		
		obj_div.id = "div_layer_popup";
		
		obj_div.style.setAttribute("position","absolute");
		obj_div.className = "layer";
		
		obj_div.style.setAttribute("margin","0px");
		obj_div.style.setAttribute("padding","0px");
		obj_div.style.setAttribute("width",w);
		obj_div.style.setAttribute("height",h);
		
		obj_div.style.setAttribute("top","50px");
		obj_div.style.setAttribute("left","100px");
		
		var temp_str = "";
		temp_str += "	<div class=\"pop_r_btm\">";
		temp_str += "      <iframe class=\"ie6_select\" style=\"width:100%; height:300px;\" title=\"³»¿ë ¾ø´Â ÇÁ·¹ÀÓ\"></iframe>";
		temp_str += "		<div class=\"pop_l_btm\">";
		temp_str += "			<div class=\"pop_r_top\">";

		temp_str += "				<div class=\"pop_l_top\">";
		
		if(title_img_path != ""){
			temp_str += "					<h2><img src=\"" + title_img_path + "\" alt=\"" + title_txt + "\"></h2>";
		}else{
			temp_str += "					<h2><span class=\"sys_ft\" id=\"layer_popup_title\">" + title_txt + "</span></h2>";
		}
		temp_str += "					<a href=\"#\" class=\"close\" onclick=\"fn_layer_popup('CLOSE');return false;\"><img src=\"/ctx_kr/sc_common/sg_resource/svc_img/popup/img_close.gif\" alt=\"´Ý±â\"></a>";
		temp_str += "					<div class=\"l_tbl_list\">";
		temp_str += "						<iframe src=\"" + EncLocation(url) + "\" frameborder=\"0\" width=\"530\" height=\"" + h + "\" marginwidth=\"0\" marginheight=\"0\" ></iframe>";
		temp_str += "					</div>";
		temp_str += "				</div>";
		temp_str += "			</div>";
		temp_str += "		</div>";
		temp_str += "	</div>";

		obj_div.innerHTML = temp_str;
		
		doc.body.appendChild(obj_div);
		
	}catch(e){
		//alert(e.message);
		
	}
	
}

function fn_layer_popup(cmd){
	if(cmd == "CLOSE"){
		
		var doc = null;
		try{
			doc = top.main.content.document;
		}catch(e){
			doc = top.content.document;	// popup
		}
		
		var temp_obj = doc.getElementById("div_layer_popup");
		
		if(temp_obj){
			doc.body.removeChild(temp_obj);
		}
	}

}

//ajax Åë½Å °´Ã¼ ¹ÝÈ¯
function getXMLHttpRequest_forRia(){
	var xmlHttp = false; //·ÎÄÃ º¯¼ö¸¦ ¼±¾ðÇÏ¿© °´Ã¼¸¦ »ý¼ºÇÔÀ¸·Î½á ºñµ¿±â ¿äÃ»ÀÌ Áßº¹µÉ °æ¿ì¿¡µµ °´Ã¼°¡ ÁßÃ¸µÇ¾î »ç¶óÁö´Â°ÍÀ» ¹æÁöÇÔ.
	
	if(window.ActiveXObject){   //IE¿¡¼­ XMLHttpRequest °´Ã¼ ±¸ÇÏ±â
		try{
			return new ActiveXObject("Msxml2.XMLHTTP");   //New version
		}catch(e){
			try{
				return new ActiveXObject("Microsort.XMLHTTP"); //Old version
			}catch(e2){ 
				return false;
			}
		}
	}else if(window.XMLHTTPRequest){ //ÆÄÀÌ¾îÆø½º µîÀÇ ºê¶ó¿ìÁ®
		xmlHttp =  new XMLHttpRequest();
	}else{
		return false;
	}
	
	return xmlHttp;
}

//·Î±×ÀÎÃ¼Å©
function memberLoginCheck(){
	var result = "";
	var xmlHttp = getXMLHttpRequest_forRia();
	var url2_returnXml = "/ctx_kr/sc_fnmall/sg_fundmall/svc_2102/doMemberChk.jsp";
	
	xmlHttp.open("GET", url2_returnXml, false); //µ¿±â¹æ½Ä
	xmlHttp.send(null);
	result = xmlHttp.responseText; // °á°ú µ¥ÀÌÅ¸ ¹ÞÀ½
	
	var chkInfo = result.split(";");
	
	//alert("chkInfo : "+chkInfo+" , chkInfo[0] : "+chkInfo[0].trim()+" , chkInfo[1] :"+chkInfo[1].trim());
	if(chkInfo[0].trim() == "1" && chkInfo[1].trim() == "1"){ // ·Î±×ÀÎ yes / Á¤È¸¿ø yes
		return "1";
	}else if(chkInfo[0].trim() == "1" && chkInfo[1].trim() == "2"){ // ·Î±×ÀÎ yes / Á¤È¸¿ø no
		return "2";
	}else if(chkInfo[0].trim() == "2" && chkInfo[1].trim() == "2"){ // ·Î±×ÀÎ no / Á¤È¸¿ø no
		return "3";
	}else{
		return "0";
	}
}

function fn_quick_banking(mode, page) {
	mode = mode || 'show';
	page = page || '0722';
	if(mode=='show') {	// Äü¹ðÅ· ¿­±â
		
		if (memberLoginCheck() == "1")
		{
			if($("#quick_banking_layer").length==0) {
				// alert("topGNB wmode 1 : " + $("#topGNB").find("object").attr("wmode"));
				$("#topGNB").find("object").attr("wmode","transparent");
				// alert("topGNB wmode 2 : " + $("#topGNB").find("object").attr("wmode"));
				
				$("#slide_zoom").find("object").attr("wmode","transparent");

				var htmlStr = ""
					+ "<div id=\"fullbg\" style=\"position:absolute;left:0;top:0;width:100%;height:100%;z-index:2;filter:alpha(opacity=30);background-color:#000;\">&nbsp;</div>"
					+ "<div class='quick_layer_wrap' id='quick_banking_layer'>\n"
					+ "	<div class='quick_cont_wrap'>\n"
					+ "	<iframe src=\"\" class=\"ie6_select\" style=\"width:100%; height:800px;\" title=\"³»¿ë ¾ø´Â ÇÁ·¹ÀÓ\"></iframe>"
					+ "		<h2><img src='/ctx_kr/sc_common/sg_resource/svc_img/popup/h2_quick_layer.gif' alt='°£ÆíÇÑ Á¶È¸/ÀÌÃ¼' /></h2>\n"
					+ "		<ul class='quick_tab'>\n"
					+ "			<li><img id='quickbanking_tab_01' src='/ctx_kr/sc_common/sg_resource/svc_img/popup/tab_quick01_on.gif' alt='Á¶È¸' style='cursor:pointer;' /></li>\n"
					+ "			<li><img id='quickbanking_tab_02' src='/ctx_kr/sc_common/sg_resource/svc_img/popup/tab_quick02_off.gif' alt='ÀÌÃ¼' style='cursor:pointer;' /></li>\n"
					+ "		</ul>\n"
					+ "		<iframe id='quickbankingFrame' name='quickbankingFrame' src='about:blank' style='width:100%;height:600px; _margin-bottom:-70px;' frameborder='0' scrolling='no'></iframe>\n"
					+ "		<a href='#none' class='btn_close'><img src='/ctx_kr/sc_common/sg_resource/svc_img/popup/btn_quick_close.gif' alt='Close' style='cursor:pointer;' onclick='fn_quick_banking(\"close\")' /></a>\n"
					+ "	</div>\n"
					+ "</div>\n"
					+ "<input type='hidden' id='quick_pscd' name='quick_pscd' value='82' />";
				
				$(htmlStr).appendTo(document.body);
				
				var sheight = $(document.body).height();
				sheight = (sheight < 940) ? 940: sheight;
				$("#fullbg").css({
					height: sheight + 'px'
				}).bind("click",function() {
					// fn_quick_banking('close');
				});
				
				$(window).resize(function() {
					sheight = $(document.body).height();
					sheight = (sheight < 940) ? 940: sheight;
					$("#fullbg").css({
						height: sheight + 'px'
					});
				});

				fn_quick_banking_tab(page);
				
				$("#quickbanking_tab_01").bind("click",function() {
					fn_quick_banking_tab('0722');
					$(this).attr("src","/ctx_kr/sc_common/sg_resource/svc_img/popup/tab_quick01_on.gif");
					$("#quickbanking_tab_02").attr("src","/ctx_kr/sc_common/sg_resource/svc_img/popup/tab_quick02_off.gif");
				});
				$("#quickbanking_tab_02").bind("click",function() {
					fn_quick_banking_tab('cma_trans_step1');
					$(this).attr("src","/ctx_kr/sc_common/sg_resource/svc_img/popup/tab_quick02_on.gif");
					$("#quickbanking_tab_01").attr("src","/ctx_kr/sc_common/sg_resource/svc_img/popup/tab_quick01_off.gif");
				});
				
				if(page!='0722') {
					$("#quickbanking_tab_02").click();
				}
		
				$("#quick_banking_layer").css("position","absolute");
				$("#quick_banking_layer").css("top","160");
				$("#quick_banking_layer").css("left","250");
				$("#quick_banking_layer").css("zIndex","100");
				$("#quick_banking_layer").css("display","");
			} else {
				$("#quick_banking_layer").show();
			}
		}
		else
		{
			if (confirm("ÇØ´ç¸Þ´º´Â Á¤È¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß ÇÕ´Ï´Ù. ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?"))
			{
				goLogin();
			}
		}
		
	} else {	// Äü¹ðÅ· ´Ý±â
		//$("#topGNB").find("object").attr("wmode","window");
		$("#slide_zoom").find("object").attr("wmode","window");

		$("#fullbg").remove();
		$("#quick_banking_layer").children().remove();
		$("#quick_banking_layer").remove();
	}
}

function fn_quick_banking_tab(page) {
	page = page || '0722';
	var url = '/ctx_kr/sc_branch/sg_biz_banking/svc_quick_banking/' + page + '.jsp';

	$("iframe[id=quickbankingFrame]").attr("src", EncLocation(url));
}

// ¹Ì´ÏÁÖ½Ä ÆË¾÷Ã¢Ãß°¡ (2010.04.27 ¾ç¿ë¼ö)
function fn_mini_stock(stockCode){
	var url = "/ctx_kr/sc_stock/sg_stock_trade/svc_mini_stock/stock_mini_order.jsp";
	
	try{
		if(stockCode != "") url += "?inputcode="+stockCode;		
	}catch(e){}
	
	//url = EncLocation(url);
	window.open(url, 'miniStockPopup', 'width=422px,height=628px,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no');	
}

/**
 * ÇÃ·¡½Ã »ðÀÔ
 * @param furl
 * @param fwidth
 * @param fheight
 * @param transoption
 * @param Id
 * @return
 */
function swfprint(furl,fwidth,fheight,transoption, Id) {
	if (Id) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+ fwidth +'" height="' + fheight +'" align="top" id="'+Id+'">');
	} else {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+ fwidth +'" height="' + fheight +'" align="top">');
	}
	document.write('<param name="movie" value="'+ furl +'"/>');
	document.write('<param name="allowScriptAccess" value="always"/>');
	if (transoption == "t") {
		document.write('<param name="wmode" value="transparent"/>');
	} else if (transoption == "o") {
		document.write('<param name="wmode" value="opaque"/>');
	} else if (transoption == "w") {
		document.write('<param name="wmode" value="window"/>');
	}

	document.write('<!-- Hixie method -->');
	document.write('<!--[if !IE]> <-->');
	document.write('<object type="application/x-shockwave-flash" allowScriptAccess="always" align="top" data="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'"');
	if (transoption == "t") {
		document.write(' wmode="transparent"');
	} else if (transoption == "o") {
		document.write(' wmode="opaque"');
	}
	if (Id) {
		document.write(' id="'+Id+'"');
		document.write(' name="'+Id+'"');
	}
	document.write('></object>');
	document.write('<!--> <![endif]-->');
	document.write('</object>');
}

function swfprinttext(furl,fwidth,fheight,transoption, Id) {
	var return_val = "";
	
	if (Id) {
		return_val += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+ fwidth +'" height="' + fheight +'" align="top" id="'+Id+'">';
	} else {
		return_val += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+ fwidth +'" height="' + fheight +'" align="top">';
	}
	return_val += '<param name="movie" value="'+ furl +'"/>';
	return_val += '<param name="allowScriptAccess" value="always"/>';
	if (transoption == "t") {
		return_val += '<param name="wmode" value="transparent"/>';
	} else if (transoption == "o") {
		return_val += '<param name="wmode" value="opaque"/>';
	} else if (transoption == "w") {
		return_val += '<param name="wmode" value="window"/>';
	}
	return_val += '<!-- Hixie method -->';
	return_val += '<!--[if !IE]> <-->';
	return_val += '<object type="application/x-shockwave-flash" allowScriptAccess="always" align="top" data="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'"';
	if (transoption == "t") {
		return_val += ' wmode="transparent"';
	} else if (transoption == "o") {
		return_val += ' wmode="opaque"';
	}
	if (Id) {
		return_val += ' id="'+Id+'"';
		return_val += ' name="'+Id+'"';
	}
	return_val += '></object>';
	return_val += '<!--> <![endif]-->';
	return_val += '</object>';
	
	return return_val;
}

/* È­¸é È®´ë Ãà¼Ò ½ÃÀÛ IE Àü¿ë */
var nowZoom = 100; // ÇöÀçºñÀ²
var maxZoom = 180; // ÃÖ´ëºñÀ²(500À¸·ÎÇÏ¸é 5¹è Ä¿Áø´Ù)
var minZoom = 70; // ÃÖ¼ÒºñÀ²

function zoomIn() {
 if (nowZoom < maxZoom) {
  nowZoom += 10; //10%¾¿ Ä¿Áø´Ù.
 } else {
  return;
 }
 top.document.body.style.zoom = nowZoom + "%";
 //content.document.body.style.zoom = nowZoom + "%";
}

function zoomOut() {
 if (nowZoom > minZoom) {
  nowZoom -= 10; //10%¾¿ ÀÛ¾ÆÁø´Ù.
 } else {
  return;
 }
 top.document.body.style.zoom = nowZoom + "%";
 //content.document.body.style.zoom = nowZoom + "%";
}
/* È­¸é È®´ë Ãà¼Ò ³¡ */

function fn_zoomer(zoom_val){
	top.document.body.style.zoom = zoom_val + "%";
	sendToActionScript(zoom_val);
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
    } else {
        return document[movieName];
    }
}

function sendToActionScript(value) {
    thisMovie("slide_zoom").returnZoom(value);
}

function openKong(brname) {
	brname = brname || "";
	var url = ""; 
	if(brname == ""){
		url = "http://money2.daishin.co.kr/company/common/group/pop_group_info.html";
	}else{
		url = "http://money2.daishin.co.kr/company/common/group/pop_group_info.html?brname="+brname;
	}
	
	popwindow(url, '813', '812'); 
}

function fn_set_mymain(type,imgobj) {
	try {
		imgobj = imgobj || null;
		setMainFlashCookie(type,30);
		alert('±âº»È­¸éÀ¸·Î ¼³Á¤µÇ¾ú½À´Ï´Ù.');
		
		if(imgobj != null) {
			var imgsrc = imgobj.attr("src");
			imgobj.attr('src', imgsrc.replace('set.gif','set01.gif'));
		}
	} catch(e) { alert(e.description); }
}

function fn_reset_mymain(imgobj) {
	try {
		imgobj = imgobj || null;
		setMainFlashCookie("",30);
		alert('±âº»È­¸éÀÌ ÇØÁ¦µÇ¾ú½À´Ï´Ù.');
		if(imgobj != null) {
			var imgsrc = imgobj.attr("src");
			imgobj.attr('src', imgsrc.replace('set01.gif','set.gif'));
		}
	} catch(e) { alert(e.description); }
}

/**
 * ´º½ºº¸±âÆË¾÷
 */
function popNewsView(title, info_gb, info_kind, date, seq_no, time, sb_flag, showTitle, sbjParam) {
	var param = "title=" + title + "&info_gb=" + info_gb + "&info_kind=" + info_kind + "&date=" + date + "&seq_no=" + seq_no + "&time=" + time;

	var leftPos = (screen.width - 594) / 2;
	var topPos = (screen.height - 500) / 2;
	window.open("/ctx_kr/sc_fnmall/sg_fundmall/svc_search/pop_news_view.jsp?" + param, "popFundFinder", "width=594, height=500, scrollbars=yes, top=" + topPos + ", left=" + leftPos);
}

//password type °ª ¾ò¾î¿À±â..
//2010.05.19 hwseo
function aos_copy_to_form_value( form_object, field_name )
{
	var value="";
	try {
		if(getDSCookie("useMyKD") == "0") return eval("form_object." + field_name +".value");
		
		var mkdLevel = _g_aos_opt_arr['mkd_protect_level'];	
		ownerDocument = form_object.ownerDocument;
		
		ownerDocument.getElementById("MKD25").SkipVerify( 1 ); 
		
		collObjects = form_object.getElementsByTagName( "input" );
		
		var i;
		for( i=0; i<collObjects.length; i++ )
		{
			if(mkdLevel == "default")
			{
				if( collObjects[i].type == "password" && collObjects[i].name == field_name )
				{
					value = ownerDocument.getElementById("MKD25").GetText2( collObjects[i] );	
				}
			}
			else
			{
				if( ( collObjects[i].type == "password" || collObjects[i].type == "text" ) && collObjects[i].name == field_name )
				{				
					value = ownerDocument.getElementById("MKD25").GetText2( collObjects[i] );	
				}
			}
		}
		
		ownerDocument.getElementById("MKD25").SkipVerify( 0 );
	}
	catch(e) {
		//return eval("form_object." + field_name +".value");
		if(confirm("Å°º¸µå º¸¾È ÇÁ·Î±×·¥ÀÌ Á¤»óÀûÀ¸·Î ¼³Ä¡ µÇÁö ¾Ê¾Ò½À´Ï´Ù. ¹ÙÀÌ·¯½º °¨¿°ÀÌ ÀÇ½ÉµË´Ï´Ù.\n\n\"È®ÀÎ\" ¹öÆ°À» Å¬¸¯ÇÏ¼Å¼­ ¹ÙÀÌ·¯½º °Ë»ç ÈÄ ÀÌ¿ëÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.")) {
			window.open("http://v3asec.v3webhard.com/conficker/conficker.html");
			return;
		}
	}
	if ( value == "" || value == "undefined" || typeof(value) == undefined )
	{
		var msg = "Å°º¸µå º¸¾È ÇÁ·Î±×·¥ÀÌ Á¤»óÀûÀ¸·Î µ¿ÀÛÇÏÁö¾Ê½À´Ï´Ù. ¹ÙÀÌ·¯½º °¨¿°ÀÌ ÀÇ½ÉµË´Ï´Ù.\n\n\"È®ÀÎ\" ¹öÆ°À» Å¬¸¯ÇÏ¼Å¼­ ¹ÙÀÌ·¯½º °Ë»ç ÈÄ ÀÌ¿ëÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.";
		if ( confirm(msg) )
		{
			window.open("http://v3asec.v3webhard.com/conficker/conficker.html");
			return;
		}
	}
	return value;
}

/**
 * Á¶±â»óÈ¯Á¤º¸
 */
function popInvestView(ao_code) {
	popWindow('/ctx_kr/sc_fnmall/sg_els/svc_3898/3898E.jsp?itm_cod='+ ao_code, 720, 800, false);
}

/**
 * ELS/DLS »óÇ° Á¤º¸
 */
function popElsDlsView(ao_code, hasButton) {
	
	var url = "/ctx_kr/sc_fnmall/sg_els/svc_dsels/dsels.jsp?pbof_sno=" + ao_code;
	
	if(!hasButton) {
		url += "&maeche_gb=cybos'";
	}

	commonPopOpen("ELS/DLS »óÇ° Á¤º¸", escape(url), 770, 700, false);
}

/**
 * Äü¸Þ´º ±ÝÀ¶ÁÖÄ¡ÀÇ »ó´ã
 * @return
 */

function fun_sangdam(){
	var loginGB = getDSCookie("loginGB");
	if(loginGB=="Member"){
		/*À¥È¸¿ø ·Î±×ÀÎ½Ã*/
		fun_Sangdam_W();
	}else{
		/*Á¤È¸¿øÀÏ °æ¿ì*/
		fun_Sangdam_J();
	}
}

function fun_Sangdam_J() {
	var HtsWebLogin = getCookie('HtsWebLogin');
	if(HtsWebLogin == "employee")
    {
		 alert("ÁöÁ¡¿ë ´Ü¸»±â¿¡¼­´Â Áö¿øµÇÁö ¾Ê´Â È­¸éÀÔ´Ï´Ù");
         return;
    }
	var url = "/ctx_kr/sc_fnmall/sg_fund_ria/svc_3054/3054.jsp";
	commonPopOpen("±ÝÀ¶ÁÖÄ¡ÀÇ »ó´ã", url, '717', '700', false);

}

function fun_Sangdam_W() {
	var HtsWebLogin = getCookie('HtsWebLogin');
	if(HtsWebLogin == "employee")
    {
		 alert("ÁöÁ¡¿ë ´Ü¸»±â¿¡¼­´Â Áö¿øµÇÁö ¾Ê´Â È­¸éÀÔ´Ï´Ù");
         return;
    }
	var url = "/ctx_kr/sc_fnmall/sg_fund_ria/svc_3054/3054_sangdam.jsp";
	commonPopOpen("±ÝÀ¶ÁÖÄ¡ÀÇ »ó´ã", url, '717', '700', false);

}

//ÄÜ¼Ö¿¡ ·Î±×Ãâ·Â. 2010.07.30 hwseo
function log(_log, isAlert)
{
	try
	{
		var hosts_name = document.location.hostname;
		if (hosts_name == "localhost.daishin.co.kr" || (hosts_name.indexOf("gwts") > -1))
		{
			console.log(_log +"\n\n[DSCookie]\n"+getCookie_DSCookie()+" ["+document.domain+"]");
			if ( isAlert )
			{
				var msg = "\n== ÀÌ ¸Þ½ÃÁö´Â °³¹ßÁßÀÏ¶§¸¸ º¸¿©Áý´Ï´Ù ==\n\n\n"+_log;
				alert(msg);
			}
		}
	}catch(e){}
}

//all inputs print
function paramlog()
{
	var paramLog = location.pathname+" [param]\n";
	$(":input").each(function(){
		paramLog += $(this).attr("name") +" = " + $(this).attr("value")+"\n";
	});
	log(paramLog);
}

//ÇØ¿ÜÆÄ»ý¸Þ´º¿¡¼­ ¸ðÀÇÅõÀÚÈ­¸é È£Ãâ½Ã..
function popVts(pop,width,height) {
	var url = "http://vtsweb.daishin.co.kr/ctx_vts/index_fd.html?"+pop;
	var wd = width;
	var he = height;
	//window.open(url,"","toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd +",height=" + he + ";");
	
	window.open(url, 'vtsweb', "toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd +",height=" + he + ";");
	
	//top.main.content.location.href = "/ctx_kr/sc_common/sg_wts_cert/svc_signon/signoff.jsp";
	//commonPopOpen("", url, width, height, "true")
}
function set_e2e()
{
	var coll = document.all.tags("input");

	if(coll!=null)
	{
		for(i=0;i<coll.length;i++)
		{
			if(coll[i].type == "text" && coll[i].name != null && coll[i].name.trim().length > 0 ) 
			{
				var obj = coll[i].name;
				if(coll[i].getAttribute("e2e") != "no")
				{
					
					if(typeof(aosak_setExtE2EField) != "undefined") 
					aosak_setExtE2EField(coll[i].name,"_ExtE2E123_"+coll[i].name);
				}
			}	
		}
		
	}
}
//2011.07.19 ÀÓÇÐÁø(elw°ü·Ãtest)
function chgParam(form){
	var cp = ["pno","password","szPNo"];
	var e = form.elements;
	var strHtml = "";
	var hidden_name = "";
	for(var i=0; i<e.length; i++){
		for(var j=0; j<cp.length; j++){
			if(e[i].name == cp[j]){
				hidden_name = "_E2E123_"+cp[j];
				//alert(hidden_name+" | "+document.getElementById(hidden_name));
			
				if(document.getElementById(hidden_name) === null){
					strHtml = "<input id='"+ hidden_name +"' name='"+ hidden_name +"' type='hidden' value='"+ e[i].value +"'>";
					form.insertAdjacentHTML( "beforeEnd", strHtml );
					document.getElementById(hidden_name).setAttribute( "mkdhidden",hidden_name);
					document.getElementById(hidden_name).setAttribute( "mkde2e_double", "1" );
					
				}else{
					document.getElementById(hidden_name).setAttribute("value",e[i].value);
				}
				//e[i].value = "";
			}
		}
	}
}
//2011.07.19 ÀÓÇÐÁø(elw°ü·Ã test)
function debugForm(form){
	var el = form.elements;
	var strLog = "==== Attributes Values ====\n";
	for(var i=0; i< el.length;i++){
		strLog += "type:"+ el[i].type +"| id:"+el[i].id+"| name:"+el[i].name+"| value:"+el[i].value+"\n";
	}
	console.log(strLog);
}
//2011.07.19 ÀÓÇÐÁø
function getParentSeed(form){
		if($("input[name=_ETEExt_SEED_]").size()===0){
			var strHtml = "<input name='_ETEExt_SEED_' type='hidden' value='"+ parent.document.forms[0]._ETEExt_SEED_.value +"'>";
			form.insertAdjacentHTML( "beforeEnd", strHtml );
		}
}
//2011.07.21 ÀÓÇÐÁø
function setInputAsE2E(form)
{
	var el = form.elements;
	var hidden_name = "";
	for(var i=0; i< el.length;i++){
		if(el[i].type == "text" && el[i].name != null && el[i].name != "" && el[i].name.trim().length > 0 && el[i].getAttribute("e2e")!=null) 
		{
			if(el[i].getAttribute("e2e") == "y" || el[i].getAttribute("e2e") == "Y")
			{
				hidden_name = "_ExtE2E123_"+el[i].name;
				if(typeof(aosak_setExtE2EField2) != "undefined" && document.getElementById(hidden_name) === null) 
					aosak_setExtE2EField2(el[i].name,hidden_name);
			}
		}
	}	
}

