var homeURL         = "";
var homeInitPage    = "";
var nowHostLocation = window.location.hostname;
var searchHomeURL   = "";

if(nowHostLocation == "banking.kdb.co.kr")
{
	homeURL  	    = "http://www.kdb.co.kr";
	searchHomeURL   = "http://www.kdb.co.kr";
	homeInitPage	= "/index.html";
}
else if(nowHostLocation == "bankingk.kdb.co.kr")
{
	homeURL  	    = "http://bankingk.kdb.co.kr";
	searchHomeURL   = "http://bankingk.kdb.co.kr";
	homeInitPage	= "/index.html";
}
else if(nowHostLocation == "bankingd.kdb.co.kr")
{
	homeURL  	    = "http://bankingd.kdb.co.kr";
	searchHomeURL   = "http://bankingd.kdb.co.kr";
	homeInitPage	= "/index.html";
}
else if(nowHostLocation == "bankingb.kdb.co.kr")
{
	homeURL  	    = "http://bankingb.kdb.co.kr";
	searchHomeURL   = "http://bankingb.kdb.co.kr";
	homeInitPage	= "/index.html";
}
else if(nowHostLocation == "172.16.200.104")
{
	homeURL   		= "http://172.16.200.104";
	searchHomeURL   = "http://172.16.200.104";
	homeInitPage	= "/index_hp_t.html";
}
else
{
	//2009-09-30 : È«¼öÁø : È¨ÆäÀÌÁö ÀÎ½ºÅÏ½º »ý¼ºµÊ. ¿¬°á
	//homeURL  	    = "http://172.16.220.101";
	//searchHomeURL   = "http://172.16.220.101";
	//homeInitPage	= "/index.html";

	homeURL   		= "http://10.1.8.117:8501";
	searchHomeURL   = "http://10.1.8.117:8501";
	homeInitPage	= "/index.html";
}

var certPath = "";
if(self.location.pathname.length > 14)
{
	certPath = self.location.pathname.substr(0,14);
}

var homePath = "/screen/jsp/IHBnk/IHBnkUMan00000001K.jsp";

if(certPath == "/jsp/cer/cer5/")
{
	homePath = "/screen/jsp/IHBnk/IHBnkUMan00000001K.jsp?certPath=cib";
}

var toPib 		= "/jsp/logon/login_pib_proc.jsp";
var toCib 		= "/jsp/logon/login_cib_proc.jsp";
var toHome 		= homeURL + homeInitPage;
var toCertHome 	= homeURL + homePath;


//´çÇà°ü¸®ÀÚ È¨
var toKDBHome	= "/jsp/logon/kdb_admin.html";

var ib_fromHPUrl = "";
var ib_kindOfib = "";
var ib_dest = "";

var ib_gate = "/jsp/com/loading_ib.jsp?next=";
var ibcertlogin_gate = "/jsp/com/loading_certlogin.jsp?next=";
var ib_check = "/initech/plugin/site/check.jsp?next="; 

function goCertHome(){
    //alert("jsp/com/ibanking_login.js:goCertHome():toCertHome:[" + toCertHome + "]");
	//top.kdb.location.href = EncLocation(toCertHome);
	//top.kdb.location.href = EncLocation(toCertHome);
	top.kdb.location.href = toCertHome;
}

function certHref(strUrl){
    //alert("jsp/com/ibanking_login.js : certHref");
	//2009-09-30 : È«¼öÁø
	//parent.kdb.location.href=EncLocation(strUrl);
	parent.contentframe.location.href=EncLocation(strUrl);
}

function certHrefTop(strUrl){
    //alert("jsp/com/ibanking_login.js : certHrefTop:[" + strUrl + "]");
	//2009-09-30 : È«¼öÁø
	//parent.kdb.location.href=EncLocation(strUrl);
	parent.contentframe.location.href=EncLocation(strUrl);
}

function uf_newWin( url, winName, sizeW, sizeH, strScroll) {
    //alert("jsp/com/ibanking_login.js : nf_newWin");
	var nLeft  = screen.width/2 - sizeW/2 ;
	var nTop  = screen.height/2 - sizeH/2 ;

	if      ( strScroll     ==      "NO")   strScroll       =       "no";


	opt = "toolbar=no,menubar=no,location=no,scrollbars=" + strScroll + ",status=no";
	var nwin=window.open(url, winName, "left=" + nLeft + ",top=" +  nTop + ",width=" + sizeW + ",height=" + sizeH  + opt );
	nwin.focus();
}


function certHlogin(strUrl)
{
    //alert("jsp/com/ibanking_login.js : certHlogin");
	//alert(ib_check+""+strUrl);

	if(parent.contentframe)
	{	    
		location.href = ib_check + strUrl;              //2009-09-30 ·Î±×ÀÎÃ¢À» ¶ç¿ï¶§´Â check.jsp ºÎºÐ¿¡ ¾ÏÈ£È­°¡ µÇ±â ÀüÀÌ·¡¼­ EncLocation ¾øÀÌ °ªÀ» ´øÁø´Ù.
	}
	else {
		parent.location.href = EncLocation("/index.html");
	}
	return;
}

function menu_Init(){
	if (document.body != null) {
		// ¿À¸¥ÂÊ ¹öÆ° ¹æÁö
		document.body.oncontextmenu=clickRightBtn;
	}
}
function clickRightBtn()
{
	return false;			// Nothing Key Output !!!
	//return event.ctrlKey;	// Only CtrlKey Output !!!
}
//menu_Init();

//*** POP-UP::IB ¿¡¼­ HomePage ·Î ¸µÅ© °É±â
function popHomeLink(url){
	//top.kdb.location.href = EncLocation(homeURL + url);
	location.href = EncLocation(homeURL + url);
}

//*** POP-UP::IB ¿¡¼­ IB ·Î ¸µÅ© °É±â
function popIBLink(strUrl){
	location.href = EncLocation(strUrl);
}

//*** BUTTOM::IB ¿¡¼­ HomePage ·Î ¸µÅ© °É±â
function HomeLink(url){
	// 2009-09-30 : È«¼öÁø º¯°æ
	//top.kdb.location.href=homeURL + url;

	var strUrl = homeURL + url;
	//alert("jsp/com/ibanking_login.js : HomeLink : strUrl[" + strUrl+"]");
	//top.kdb.location.href=EncLocation(strUrl);
	parent.location.href=EncLocation(strUrl);
}

function jsswebLoad_IB(){
	// 2009-09-30 : È«¼öÁø : jssweb Á¦°Å
	//if(top.opener.top.jssweb)
	//	top.opener.top.jssweb.location.href = "/sti/jssweb/jssweb.jsp";
	//else
		top.opener.top.location.href=EncLocation("/index.html");
	return;
}

function go_search1(){
	if(frmSearch.QU.value==''){
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		return;
	}
	frmSearch.action=homeURL+"/screen/jsp/IHEtc/IHEtcUSch09000001K.jsp";
	frmSearch.submit();
}

function bankLogoutLoad(){
	parent.frames[bankLogout].src=homeURL+"/jsp/logon/logCheck.jsp";
}

function ib_popup(strUrl, winName, sizeW, sizeH, strScroll){

	// 2009-09-30 : È«¼öÁø : jssweb Á¦°Å
	//top.jssweb.location.href = homeURL + "/sti/jssweb/jssweb_ib_popup.jsp";
	var winnm;
	var nLeft  = screen.width/2 - sizeW/2 ;
	var nTop  = screen.height/2 - sizeH/2 ;
	if    ( strScroll    ==    "NO")    strScroll    =    "no";

	opt = "toolbar=no,menubar=no,location=no,scrollbars=" + strScroll + ",status=no";
	window.open(EncLocation(homeURL + strUrl), winName, "left=" + nLeft + ",top=" +  nTop + ",width=" + sizeW + ",height=" + sizeH  + opt );
}

function loginFindHref(find, dest){//kindOfib: cib, pib
	if(parent.kdb)
		parent.kdb.location.href=EncLocation(homeURL + ib_gate +"login&homePage="+find+"&dest="+dest+"");
	else
		parent.location.href=EncLocation("/index.html");
	return;
}

