document.title = 'ÇÏ³ªUBSÀÚ»ê¿î¿ë Global Solutions within Your Reach';

//¿ÜºÎ¸µÅ© ÆË¾÷Ã¢ ¸µÅ©
function popWin_s(url,widthX,heightY) {
	var positionX = (screen.width-500)/2;
	var positionY = (screen.height-526)/2;
	window.open(url,"","left="+positionX+",top="+positionY+",width=" +widthX+ ",height=" +heightY+ ",statusbar=no,toolbar=no,scrollbars=no" );
}

//¸µÅ©¾øÀ» ¶§
function noLink(){
	 alert("Not Available");
}

/**********  PNG24 Åõ¸íÃ³¸®  **********************/
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='';  
	return ''; 
}

/*iframe resize*/   
function reSize(){
	var objBody = iframe.document.body;
	var objFrame = document.getElementById();
	objFrame.style.height = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
}

/*show Layer*/
function showLayer(num,tot,show){
	for (i=1; i<=tot; i++)  {
		document.getElementById(show + i).style.display = "none";
	}
	document.getElementById(show + num).style.display = "block";
}  

/*img rollover*/
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;
}

/*FAQ*/
function over(obj){
	obj.className='faq_over';
}
function out(obj){
	obj.className='faq_out';
}
var rollFlag=0;
   
   function txt_roll(str) {

       sub_num = str.substring(str.length - 2);
       sub_str = str.substring(0, str.length -2);
   
       if (document.getElementById(str).style.display=="") {
           document.getElementById(str).style.display="none";
           rollFlag=0;
           return;
       }
       else {
           if(rollFlag != 0) {
               document.getElementById(sub_str+rollFlag+"_q").style.display="";
               document.getElementById(sub_str+rollFlag).style.display="none";
               document.getElementById(str).style.display="";
           }
       
           document.getElementById(str).style.display="";
           document.getElementById(str+"_q").style.display="none";
           rollFlag=sub_num;
       }
   }


/*popup open*/
function uf_popOpen(url) {
	var positionX = 0;
	var positionY = 0;
//	var positionX = (screen.width-450)/2;
//	var positionY = (screen.height-250)/2;
	window.open(url,"","left="+positionX+",top="+positionY+",width=622,height=500,status=yes,toolbar=no,scrollbars=no" );
}

/*popup resize*/
function uf_popResize(_addx) {
	if( !_addx ) _addx = 0;
	
	var thisX = document.getElementById("offsetTable").offsetWidth + _addx;
	var thisY = document.getElementById("offsetTable").offsetHeight;
	var maxThisX = screen.width - 50;
	var maxThisY = screen.height - 80;
	if (window.navigator.userAgent.indexOf("SV1") != -1){
	var marginY = 50; //¸¶Áö¸· ¼ö´Â »óÈ²¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	} else if (window.navigator.userAgent.indexOf("MSIE 7") != -1){
	var marginY = 88; //¸¶Áö¸· ¼ö´Â »óÈ²¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	} else {
	var marginY = 75; //¸¶Áö¸· ¼ö´Â »óÈ²¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	}	
	
	if (thisX > maxThisX) {
		window.document.body.scroll = "yes";
		thisX = maxThisX;
	}
	if (thisY > maxThisY - marginY) {
		window.document.body.scroll = "yes";
		thisX += 19;
		thisY = maxThisY - marginY;
	}
	
	var windowX = (screen.width - (thisX+10))/2;
	var windowY = (screen.height - (thisY+marginY))/2 - 20;
//	window.moveTo(windowX,windowY);
	window.resizeTo(thisX+10,thisY+marginY);
}

function printGoods(){
	window.onbeforeprint = function(){
		document.getElementById("Gnb").style.display = "none";
		document.getElementById("MidArea").style.margin = "10px 0 0 10px;";
		document.getElementById("Visual").style.display = "none";
		document.getElementById("Quick").style.display = "none";
		document.getElementById("Footer").style.display = "none";
	}
	window.onafterprint = function(){
		document.getElementById("Gnb").style.display = "block";
		document.getElementById("MidArea").style.margin = "-23px 0 0 0;";
		document.getElementById("Visual").style.display = "block";
		document.getElementById("Quick").style.display = "block";
		document.getElementById("Footer").style.display = "block";
	}
	
	window.print();
}

function getAdobe(){
	window.open("http://www.adobe.com/kr/products/acrobat/readstep2.html");
}

/*GNB ***************************/
function goTop() {  
	window.location.href = "#top" 
}

function goHome() {
	window.location.href = "/index.jsp";
}

function goContactus() {
	window.location.href = "/company/location/location.jsp";
}

function goSitemap() {
	window.location.href = "/etc/siteMap.jsp";
}

function goEnglish() {
	window.location.href = "/english/index.jsp";
}

function goDenial() {
	window.open("/etc/popEmailDenial.jsp","","left=0,top=0,width=622,height=500,status=yes,toolbar=no,scrollbars=no");
}



/****GNB 1*****/
function goGoods() {
	window.location.href = "/goods/main.jsp";
}

function goGoods_01() {
	window.location.href = "/goods/recommend/recommend03.jsp";
}

function goGoods_02() {
	window.location.href = "/goods/new/new01.jsp";
}

function goGoods_03() {
	window.location.href = "/goods/goods/goods01.jsp";
}

function goGoods_04() {
	window.location.href = "/goods/publicNotice/publicNoticeList.jsp";
}

function goGoods_05() {
	window.location.href = "/operation/report/report.jsp";
}

function goGoods_06() {
	window.location.href = "/customer/join/joinStep1.jsp";
}

function goGoods_07() {
	window.location.href = "/goods/top_products/recommend04.jsp";
}

function goGoods_08() {
	window.location.href = "/goods/foreign/foreign.jsp";
}


/****GNB 2*****/
function goOperation() {
	window.location.href = "/operation/main.jsp";
}

function goOperation_01() {
	window.location.href = "/operation/philosophy/philosophy01.jsp";
}
function goOperation_0102() {
	window.location.href = "/operation/philosophy/philosophy02.jsp";
}

function goOperation_02() {
	window.location.href = "/operation/system/system01.jsp";
}
function goOperation_0202() {
	window.location.href = "/operation/system/system02.jsp";
}
function goOperation_0203() {
	window.location.href = "/operation/system/system03.jsp";
}

function goOperation_03() {
	window.location.href = "/operation/manager/manager.jsp";
}
function goOperation_0302() {
	window.location.href = "/operation/manager/manager_02.jsp";
}
function goOperation_0303() {
	window.location.href = "/operation/manager/manager_03.jsp";
}

function goOperation_04() {
	window.location.href = "/operation/report/report.jsp";
}

/****ÅõÀÚÁ¤º¸****/
function goMarketInfo() {
	window.location.href = "/marketInfo/stock/invest.jsp";
}

function goMarketInfo_01() {
	window.location.href = "/marketInfo/bond/invest_01.jsp";
}


/****GNB 3*****/
//function goMarketInfo() {
	//window.location.href = "/marketInfo/main.jsp";
//}
//
//function goMarketInfo_01() {
	//window.location.href = "/marketInfo/stock/stockList.jsp";
//}

//function goMarketInfo_02() {
	//window.location.href = "/marketInfo/bond/bondList.jsp";
//}

//function goMarketInfo_03() {
	//window.location.href = "/marketInfo/abroad/abroadList.jsp";
//}


/****GNB 4*****/
function goCustomer() {
	window.location.href = "/customer/main.jsp";
}

function goCustomer_01(){
	window.location.href = "/customer/join/joinStep1.jsp";
}

function goCustomer_02(){
	window.location.href = "/customer/guide/guide.jsp";
}
function goCustomer_0201(){
	window.location.href = "/customer/guide/guide01.jsp";
}
function goCustomer_0202(){
	window.location.href = "/customer/guide/guide02.jsp";
}

function goCustomer_03(){
	window.location.href = "/customer/faq/faqList.jsp";
}

function goCustomer_04(){
	window.location.href = "/customer/counsel/counselWrite.jsp";
}

function goCustomer_05(){
	window.location.href = "/customer/notice/noticeList.jsp";
}

function goCustomer_06(){
	window.location.href = "/customer/request/fund_request.jsp";
}

function goCustomer_07(){
	//window.location.href = "http://www.kofia.or.kr", target="_blank";
	window.open('http://www.kofia.or.kr','','');
}

function goCustomer_08(){
	window.open('http://s119.fss.or.kr','','');
}

function goCustomer_09(){
	window.open('http://www.fss.or.kr','','');
}

function goCustomer_10(){
	window.location.href = "/customer/distributor/opening_soon.jsp";
}



/****GNB 4*****/
function goCompany() {
	window.location.href = "/company/main.jsp";
}

function goCompany_01(){
	window.location.href = "/company/summary/summary.jsp";
}

function goCompany_02(){
	window.location.href = "/company/ceo/ceo.jsp";
}

function goCompany_03(){
	window.location.href = "/company/history/history.jsp";
}

function goCompany_04(){
	window.location.href = "/company/oranization/oranization.jsp";
	//noLink();
}

function goCompany_05(){
	window.location.href = "/company/capacitive/capacitive.jsp";
}

function goCompany_06(){
	window.location.href = "/company/asset/asset.jsp";
}

function goCompany_07(){
	window.location.href = "/company/finance/finance01.jsp";
}
function goCompany_0702(){
	window.location.href = "/company/finance/finance02.jsp";
}

function goCompany_08(){
	window.location.href = "/company/news/newsList.jsp";
}

function goCompany_09(){
	window.location.href = "/company/recruit/recruitList.jsp";
}

function goCompany_10(){
	window.location.href = "/company/introduction/introduction01.jsp";
}
function goCompany_1002(){
	window.location.href = "/company/introduction/introduction02.jsp";
}


function goContactus(){
	window.location.href = "/location/location.jsp";
}


function createForm(_name,_method,_action) {
	var f = document.createElement("form");
	f.name=_name;
	f.method=_method;
	f.action=_action;
	return f;
}

function addHidden(f,n,v) {
	var i = document.createElement("input");
	i.type="hidden";
	i.name=n;
	i.value=v;
	f.insertBefore(i);
	return f;
}

function goUnionSearch(searchString){
	var frm=createForm("frm", "post", "/goods/goods/goods01.jsp");
	frm = addHidden(frm, "unionSearch", searchString);
	document.insertBefore(frm);
	frm.submit();
}

function goKeywordLink(keyword) {
	var frm=createForm("frm", "post", "/goods/goods/goods01.jsp");
	frm = addHidden(frm, "keyword", keyword);
	document.insertBefore(frm);
	frm.submit();
}
/*GNB ***************************/


/*********** RIA *********************/
//1. ÆÝµå¸Ê /////////////////////////////////////////////////////////////////////////////////
function searchRiaMap(dataArr){
	var frm = createForm("frm","post","/goods/goods/goods01.jsp");
	frm = addHidden(frm, "area", dataArr[0]);			//ÅõÀÚÁö¿ªÄÚµå°ª
	frm = addHidden(frm, "area_order", dataArr[1]);	//ÅõÀÚÁö¿ª¼ø¼­°ª(boldÃ³¸®À§ÇÑ)
	frm = addHidden(frm, "type", dataArr[2]);			//ÆÝµåÀ¯ÇüÄÚµå°ª
	document.insertBefore(frm);
	frm.submit();
};

//2. »ó¼¼°Ë»ö/////////////////////////////////////////////////////////////////////////////////
function searchRiaDetail(dataArr){
	var qry = "";
	var total = dataArr.length;
	for(i = 0;i<total; i++){
		qry += "&val"+i+"="+dataArr[i];
	}
//	alert("qry : "+qry);
	var frm = createForm("frm","post","/goods/searchResult.jsp");
	frm = addHidden(frm, "area", dataArr[0]);				//Áö¿ª
	frm = addHidden(frm, "type", dataArr[1]);				//À¯Çü
	frm = addHidden(frm, "sale_flag", dataArr[2]);			//ÆÇ¸Å¿©ºÎ
	frm = addHidden(frm, "fund_name", dataArr[3]);		//ÆÝµå¸í
	frm = addHidden(frm, "prepay_fee", dataArr[4]);		//¼±Ãë¼ö¼ö·á
	frm = addHidden(frm, "set_date", dataArr[5]);			//¼³Á¤ÀÏ
	frm = addHidden(frm, "set_money", dataArr[6]);		//¼³Á¤¾×
	frm = addHidden(frm, "company_code", dataArr[7]);	//È¸»çÄÚµå
	frm = addHidden(frm, "company_name", dataArr[8]);	//È¸»ç¸í
	document.insertBefore(frm);
	frm.submit();
}

function searchRiaRate(fundcode){
	window.open("/goods/goods/popQuickInquiry.jsp?fund="+ fundcode,"hanaUBS","width=400, height=200, toolbar=no, directories=no, status=no, menubar=no, scrollbars=no");
}

/*********** RIA *********************/

var domain = document.URL;
var mainPage = domain.substring(domain.lastIndexOf("/")+1,domain.length);
var isBlock = 0;
var search = location.search;

if (search.length=="" || search.substring(1,5)=="fund") {
	if(domain.indexOf("pop")>-1) isBlock = 1;
	if(mainPage == "index.html") isBlock = 1;
	if(isBlock < 1){
		if (top.blankframe == undefined) {
			window.location.href= "/index.html";
		}
	}
}

document.write('<script type="text/javascript" src="/common/js/selectBox.js"></script>');
document.write('<script type="text/javascript" src="/common/js/flashLayer.js"></script>');