Event.observe(window, "load", function() {
	if($("leftArea")) {
		var menuBox = $("leftArea").down("ul");
		var pageUrl = location.href;
		var pageUrlSplit = pageUrl.split("/");
		var now2Depth = pageUrlSplit[3];
		var now3Depth = pageUrlSplit[4];
		now3Depth = now3Depth.split("?");
		if(now3Depth[1]){
			var now4Depth = now3Depth[1].split("boardCode=")[1];//보드코드값만 가져온다.(모든 파라매터는 보드코드가 마지막)
			
			if(now4Depth) {
				if(now4Depth.charAt(1)){
					now4Depth = now4Depth.substring(0,2);
				}else{
					now4Depth = now4Depth.charAt(0);
				}
			}
		}
		now3Depth = now3Depth[0]; 
		var now3DepthView = now3Depth.replace("List","View");
		
		
		var now5Depth;
		var set5depth;
		menuBox.select("li").each(function(item, i) {
			
			
			if(!$(item).hasClassName("pass")) {
				var setUrl = $(item).down("a").href;
				var setUrlSplit = setUrl.split("/");
				var set2depth = setUrlSplit[3];
				var set3depth = setUrlSplit[4];
				set3depth = set3depth+""; //오브젝트 값을 강제로 스트링화 시키는 편법.
				var chk3 = set3depth.split("?");
				
				if(chk3[1] != undefined){
					var set4depth = chk3[1].split("boardCode=")[1];//보드코드값만 가져온다.(모든 파라매터는 보드코드가 마지막)
					
					
					if(set4depth) {
						if(set4depth.charAt(1)){
							set4depth = set4depth.substring(0,2);
						}else{
							set4depth = set4depth.charAt(0);
						}
						set3depth = chk3[0];
						var set3depthView = set3depth.replace("List","View");
					}
				}
				//4depth를 만들어서 ?이하값도 다시 비교-_-!
				
				//alert(set2depth+","+now2Depth);
				
				if(set2depth == now2Depth) {
					if(set3depth == now3Depth || set3depthView == now3DepthView){	
						if(item.up("li")) {
							if(!item.up("ul").hasClassName("hidden")) {
								item.up("ul").show();							
							} else {
								item.up("ul",1).show();
								if(item.up("li",1))item.up("li",1).addClassName("On");
							}
							item.up("li").addClassName("On");
							if(set4depth==now4Depth){
								item.addClassName("On");
							}
						} else {
							if(set4depth==now4Depth){
								item.addClassName("On");
							}
						}
					}
				}
				
			}
		});
	}
});


//* toggle *//
function toggleTab2( num , maxNum , idName ) {
    for( i = 1; i <= maxNum; i ++ ) {
        var obj = eval( "document.getElementById('" + idName + i +"')");
        if( num == i ) obj.style.display = 'block';
        else obj.style.display = 'none';
    }
}
//* image rollover *//
function overImg( obj ) {
    obj.src = obj.src.replace( '.gif', 'On.gif' );
}
function outImg( obj ) {
    obj.src = obj.src.replace( 'On.gif', '.gif' );
}
//* inline display*//
function inlineDisplay(objId){
	var dis = document.getElementById(objId);
	if(dis.style.display != 'block') dis.style.display = 'block';
	else dis.style.display = 'none';
}
function popup(url,w,h,s,target){
	var l, t, objPopup
	if(target == 'undefined' || target=='' || target==null) {
		var target='win1';
	}
	l = (screen.width-w)/2;
	t = (screen.height-h)/2;
	if(s==1 || s=="Y") 
		objPopup  = window.open(url,target,'width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=1');
	else if (s=="" || s==0 || s=="N" || !s || s=="0" ) 
		objPopup = window.open(url,target,'width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=0,status=0');
	else
		objPopup = window.open(url,target,'width='+w+',height='+h+',left='+l+',top='+t+',resizable=1,menubar=1,toolbar=1,scrollbars=1,status=1');
	if (objPopup == null) { 
		alert("차단된 팝업창을 허용해 주십시오."); 
	} 
	return objPopup;
}

// description innerHTML //
function descView(objText) {
	document.getElementById('selectListDesc').innerHTML=objText;
}
// pop Calendar //
function calendar(){
	var dis = document.getElementById('Calendar');
	if(dis.style.display != 'block') dis.style.display = 'block';
	else dis.style.display = 'none';
}
//* FAQ toggle *//
function faqTab( num , maxNum) {
    if (document.all) {
    	block="block"
    } else if (document.getElementById) {
    	block="table-row"
    }

	for( i = 1; i <= maxNum; i ++ ) {
        var obj = document.getElementById('tab' + i);
        var obj2 = document.getElementById('que' + i);
        if (obj && obj2) {
	        if( num == i ) {
				if (obj.style.display != block) {
					obj.style.display = block;
	        		obj2.style.fontWeight = 'bolder';
	        		obj2.style.color = '#4880BE';
	        	} else {
					obj.style.display = 'none';
		        	obj2.style.fontWeight = 'normal';
		        	obj2.style.color = '#666666';
				}
	        } else {
	        	obj.style.display = 'none';
	        	obj2.style.fontWeight = 'normal';
	        	obj2.style.color = '#666666';
	        }
        }
    }
}

function faqView(obj) {
	var obj = $(obj);
	if(obj) {
		var oldIndex = null;
		obj.select("dd").each(function(item) {
			item.hide();
		});
		
		obj.select("dt").each(function(item, i) {
			item.observe("click", function(){
				if(!item.hasClassName("on")) {
					if(oldIndex != null) {
						obj.down("dd", oldIndex).hide();
						obj.down("dd", oldIndex).removeClassName("on");
						obj.down("dt", oldIndex).removeClassName("on");
					}
					item.addClassName("on");	
					item.next("dd").addClassName("on");			
					item.next("dd").show();
					oldIndex = i;
				} else {
					item.next("dd").hide();
					item.next("dd").removeClassName("on");
					item.removeClassName("on");
				}
			});
			
		});
		
	}
}
//* option document.write *//
function selectYear() {for (i=2008;i>=1907;i--) {var inner = "<option value="+i+">"+i+"</option>";document.write(inner);}}
function selectMonth() {for (i=1;i<=12;i++) {var inner = "<option value="+i+">"+i+"</option>";document.write(inner);}}
function selectDate() {for (i=1;i<=31;i++) {var inner = "<option value="+i+">"+i+"</option>";document.write(inner);}}
function selectDds() {
	var dds=new Array() 
	dds[0]="02" 
	dds[1]="031"
	dds[2]="032"
	dds[3]="033"
	dds[4]="041"
	dds[5]="042"
	dds[6]="043"
	dds[7]="051"
	dds[8]="052"
	dds[9]="053"
	dds[10]="054"
	dds[11]="055"
	dds[12]="061"
	dds[13]="062"
	dds[14]="063"
	dds[15]="064"
	for (i=0;i<=dds.length-1 ;i++ ){var inner = "<option value='"+dds[i]+"'>"+dds[i]+"</option>";document.write(inner);}
}
function selectMobile() {
	var mobile=new Array() 
	mobile[0]="010"
	mobile[1]="011"
	mobile[2]="016"
	mobile[3]="017"
	mobile[4]="018"
	mobile[5]="019"
	for (i=0;i<=mobile.length-1 ;i++ ){var inner = "<option value='"+mobile[i]+"'>"+mobile[i]+"</option>";document.write(inner);}
}

function changeContent() {
	var s=document.getElementById('selectChange');
	document.getElementById('if1').src=s.options[s.selectedIndex].value;
}

function layerDisplay(objId){
	var dis = document.getElementById(objId);
	if(dis.style.display != 'inline') dis.style.display = 'inline';
	else dis.style.display = 'none';
}

function windowOpen(objLink, winTit, wid, hei){
	if (!hei){
		var hei = wid;
		var wid = winTit;
		var winTit = "nullTit";
	}
	window.open(objLink, winTit, 'scrollbars=no, status=no,width='+wid+',height='+hei);
}

function checkVersion() {
	var result = DetectFlashVer(9,0,20);
	return ((result == true) || (ControlVersion() == -1));
	return true;
}

/* Flash load(url, width, height, id) */
function getFlash(swfName, widLength, heiLength, id){
	//document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+widLength+'" height="'+heiLength+'" id="'+id+'">');
	//document.write('<param name="movie" value="'+swfName+'">');
	//document.write('<param name="quality" value="high">');
	//document.write('<param name="allowScriptAccess" value="always">');
	//document.write('<embed src="'+swfName+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widLength+'" height="'+heiLength+'" allowScriptAccess="sameDomain" name="'+id+'"></embed></object>');
	
	var isFlashverURL = (window.location.href.indexOf("/flash/071001/flashver.jsp") != -1);
	swfName = swfName.substring(0, swf.lastIndexOf(".swf"));
	if (checkVersion()) {
		AC_FL_RunContent(
			"src", swfName,
			"width", widLength,
			"height", heiLength,
			"id", id,
			"quality", "high",
			"name", id,
			"allowScriptAccess","always",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
		if (isFlashverURL) {
			location.href = "/";
		}
	} else {
		document.write("<img src='" + swfName + ".gif' width='" + widLength + "' height='" + heiLength + "' border='0' />");
		if (!isFlashverURL) {
			Event.observe(window, "load", function() {
				$("layerFlashPlayer").style.display = "";
			});
		}
	}
}

/* Flash Transparent load(url, width, height, id) */
function getFlashTrans(swfName, widLength, heiLength, id){
	var isFlashverURL = (window.location.href.indexOf("/flash/071001/flashver.jsp") != -1);
	swfName = swfName.substring(0, swfName.lastIndexOf(".swf"));
	if (checkVersion()) {
		AC_FL_RunContent(
			"src", swfName,
			"width", widLength,
			"height", heiLength,
			"id", id,
			"quality", "high",
			"wmode", "transparent",
			"name", id,
			"allowScriptAccess","always",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
		if (isFlashverURL) {
			location.href = "/";
		}
	} else {
		document.write("<img src='" + swfName + ".gif' width='" + widLength + "' height='" + heiLength + "' border='0' />");
		if (!isFlashverURL) {
			Event.observe(window, "load", function() {
				$("layerFlashPlayer").style.display = "";
			});
		}
	}
}

function addFlashTrans(swfName, widLength, heiLength, id, layerId) {
	var str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+widLength+'" height="'+heiLength+'" id="'+id+'">';
	str += '<param name="movie" value="'+swfName+'">';
	str += '<param name="quality" value="high">';
	str += '<param name="wmode" value="transparent">';
	str += '<param name="allowScriptAccess" value="always">';
	str += '<embed src="'+swfName+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widLength+'" height="'+heiLength+'" allowScriptAccess="always" wmode="transparent" name="'+id+'"></embed></object>';
	
	var element = document.getElementById(layerId);
	if (element) {
		element.innerHTML = "";
		element.innerHTML = str;
	} else {
		alert("ID does not exist: " + layerId); 
	}
}

function getFlashTransHTML(swfName, widLength, heiLength, id){
	var html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+widLength+'" height="'+heiLength+'" id="'+id+'">';
	html += '<param name="movie" value="'+swfName+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="allowScriptAccess" value="always">';
	html += '<embed src="'+swfName+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widLength+'" height="'+heiLength+'" allowScriptAccess="sameDomain" wmode="transparent" name="'+id+'"></embed></object>';
	return html;
}

/* gnb menu :: fund search */
var searchData;
var searchTimer;
function sendSearchData(x) {
	if (x) {
		openApp();

		searchData = x;
		searchTimer = setInterval(sendSearchDataTimer, 100);
	}
}

function sendSearchDataTimer() {
	var result = null;
	try {
		var myApp = document.getElementById("myApplycation");
		result = myApp.setSearchKeyword(searchData);
	} catch (e) {
	}
	
	try {
		result = document["myApplycation"].setSearchKeyword(searchData);
	} catch (e) {
	}

	if (result) clearInterval(searchTimer);
}

// fundSearch - 펀드찾기
// earningRate - 수익률조회
// interested - 관심펀드
// calculator - 펀드계산기
// fundIndex - 금융지수
// dictionary - 용어사전
var comboData;
var comboTimer;
function sendComboData(x){
	if (x) {
		switch (x) {
			case 'interested':
			case 'calculator':
				if (!isLogin()) {
					if (confirm("로그인을 하셔야 사용하실 수 있습니다. 로그인을 하시겠습니까?")) {
						self.location.href = "/member/login.do";
					}
				} else {
					openApp();
	
					comboData = x;
					comboTimer = setInterval(sendComboDataTimer, 100);
				}
				break;
			default:
				openApp();

				comboData = x;
				comboTimer = setInterval(sendComboDataTimer, 100);
				break;
		}
	}
}

function sendComboDataTimer() {
	var result = null;
	try {
		var myApp = document.getElementById("myApplycation");
		result = myApp.setInitPosition(comboData);
	} catch (e) {
	}
	
	try {
		result = document["myApplycation"].setInitPosition(comboData);
	} catch (e) {
	}

	if (result) clearInterval(comboTimer);
}

function disableScroll() {
	scroll(0,0);
}

var previousGetClickedPage = null;
function openApp() {
	$("myApply").setStyle({ display: "block", height: "100%" });
	$("myApp2").setStyle({ display: "block", top: "100px" });
	$$("select").each(function(selectElement) {
		selectElement.hide();
	});

	Event.observe(document.body, "scroll", disableScroll);
}

function closeApp(){
	$('myApply').style.display = 'none';
	$('myApp2').style.top = '-2000px';
	$$("select").each(function(selectElement) {
		selectElement.show();
	});
	
	Event.stopObserving(document.body, "scroll", disableScroll);
}




/***** 오늘 본 펀드 *********/
function fundScrap() {				
	var cnt = getMultiCheckedNum("myFund");
	if (cnt > 0) {								
		if(!confirm("관심펀드로 등록하시겠습니까?")) return;
		listForm.funds.value = getMultiCheckedString("myFund", "|");
		listForm.submit();
	} else {
		alert("선택하신 펀드가 없습니다.");
		return;
	}
}
var barStatus = 0;
function scrollFund(direction) {
	var scraperDivi = document.getElementById('scraperDivi');
	var getSpan = scraperDivi.getElementsByTagName('span');
	var height=0;
	if (direction == 'up'){
		if (barStatus == 0 || getSpan.length <= 3) {
			alert("가장 위 입니다.");
		} else {
			var height = 0;
			for (var i=0; i<barStatus-1; i++) {
				height += getSpan[i].offsetHeight;
			}
			scraperDivi.style.marginTop = -(height) + "px";
			barStatus--;
		}
	}
	if (direction == 'down') {
		if ((getSpan.length - barStatus) <= 3 || getSpan.length <= 3) {
			alert("가장아래입니다.");
		} else {
			var height = 0;
			for (var i=0; i<=barStatus; i++) {
				height += getSpan[i].offsetHeight;
			}			
			scraperDivi.style.marginTop = -(height) + "px";
			barStatus++;
		}
		
	}
}

function getCookie(cookieName) {
    var cookies = document.cookie.split(";");
    for (var i=0; i<cookies.length; i++) {
    	var param = cookies[i];
    	if (param.indexOf("=") != -1) {
    		var name = param.split("=")[0];
    		var value = param.split("=")[1];
    		
    		if (name == cookieName) return unescape(value);
    	}
    }
    return null;
}

function getSessionId() {
	return getCookie("JSESSIONID");
}

function setChartURL(chartId, url) {
	var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(chartId);
	try {
		if (chartObj) {
			chartObj.setXMLURL(url);
		} else {
			//alert("Chart object does not exist: " + chartId);
			return false;
		}
	} catch (e) {
		//alert("ChartId: " + chartId + ", " + e);
		return false;
	}
	return true;
}

function addChart(layerId, chartId, url, swfName, width, height) {
	addFlashTrans(swfName, width, height, chartId, layerId);
	new PeriodicalExecuter(function(pe) {
		if (setChartURL(chartId, url)) {
			pe.stop();
		}
	}, 0.5);
}

function putChart(chartId, url, swfName, width, height) {
	getFlashTrans(swfName, width, height, chartId);
	new PeriodicalExecuter(function(pe) {
		if (setChartURL(chartId, url)) {
			pe.stop();
		}
	}, 0.5);
}

function remoteCtr(element,checkInput) {
	var obj = element;
	var topPosition = 150; // 기본 top 포지션
	var topLimit = 150; // top limit
	var highScrollSpeed = 30; // 빠른 속도 
	var lowScrollSpeed = 10; // 느린속도
	var btmLimit = 570; // btm limit
	var Body = document.body ? document.documentElement : document.body ;
	obj.initTop = topPosition;
	obj.topLimit = topLimit;
	obj.bottomLimit = Body.scrollHeight - obj.offsetHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.style.top = obj.top + "px";
	
	obj.checker = function(){
		return checkInput.checked;
	}
	

	obj.getTop = function() {
		if (Body.scrollTop) {
			return Body.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}

	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(Body.clientHeight) {
			return Body.clientHeight;
		} else {
			return 500;
		}
	}

	obj.getLeft = function() {
		if (Body.scrollTop) {
			return Body.scrollLeft;
		} else if (window.pageXOffset) {
			return window.pageXOffset;
		} else {
			return 0;
		}
	}

	obj.getWidth = function() {
		if (self.innerWidth) {
			return self.innerWidth;
		} else if(Body.clientWidth) {
			return Body.clientWidth;
		} else {
			return 500;
		}
	}

	obj.move = function() {
			var startPoint, endPoint, refreshTime; 
			startPoint = obj.style.top; 
			endPoint = obj.getTop + topPosition; 
			if (endPoint < topPosition) endPoint = topPosition;
			refreshTime = highScrollSpeed; 
			if ( startPoint != endPoint ) refreshTime = lowScrollSpeed;
			pos = obj.getTop() + topPosition;
			if (pos > obj.bottomLimit)
				pos = obj.bottomLimit;
			if (pos < obj.topLimit)
				pos = obj.topLimit;
			if(!obj.checker()){
				interval = obj.top - pos;
			}else{
				interval = obj.top - 150;
			}
			obj.top = obj.top - interval / 15;
			obj.style.top = obj.top + "px";
			obj.style.left = 955 + "px";
			
			timer = setTimeout (obj.move, refreshTime);
			//timer = setTimeout (obj.move, refreshTime);
	};

	obj.Init = function(){
		obj.style.left = 955 + "px";
		obj.move();
	};
	obj.Init();
}



var panelName; //펀드파인더에 들어갈 전역변수(클로징 필요)
var fundAppTimer; //펀드파인더에 값 넣는거
function funcCtr(){
	var altdivSet;
	$("btnQ").select(".btnQDiv").each(function(item,i){
		
		// alt를 불러와서 over시 보여주는 div 생성 (구조작업)
		altdivSet = document.createElement("div");
		altdivSet2 = document.createElement("div");
		altTxtSet = item.down("img").readAttribute("alt");
		altdivSet2.innerHTML = altTxtSet;
		altdivSet.appendChild(altdivSet2);
		item.appendChild(altdivSet);
		
		//스타일시트 작성
		item.setStyle({
			position:"relative"
		})
		$(altdivSet).setStyle({
			position:"absolute",
			right:"35px",
			background:"url('/images/quick/bgRollover.gif') no-repeat right top",
			paddingRight:"8px",
			whiteSpace:"nowrap",
			height:"17px",
			fontSize:"11px",
			color:"#5a71a2"
		});
		if(i!=0){
			$(altdivSet).setStyle({
				top:"10px"
			});
		}else{
			$(altdivSet).setStyle({
				top:"15px"
			});
		}
		$(altdivSet2).setStyle({
			background:"url('/images/quick/bgRollover.gif') no-repeat",
			paddingLeft:"6px",
			fontWeight:"bold"
		});
		
		$(altdivSet).hide(); // 마지막에 숨기기
	});
	
	//버튼들에 액션을 추가
	$("btnQ").select("a").each(function(item,i){
		item.observe("mouseover",function(){
			this.next("div").show();
		});
		item.observe("mouseout",function(){
			this.next("div").hide();
		})
	});
	
	//펀드 파인더 띄우기.
	$("btnQ").select("a").each(function(item,i){
		item.onclick = function(){
			assigningTimer(i);
			return false;
		};
	});
};


//펀드파인더 값때려넣기  
function assignPanelNameToApp(){
	var resultApp = null;
	try{
		var fundAppObj = document.getElementById("fundApp");
		resultApp = fundAppObj.setInitPosition(panelName);
	}catch (e) {
	}
	if(resultApp){
		clearInterval(fundAppTimer);
		panelName=null;
	};
}


function assigningTimer(num){
	if(num==2 || num==3){
		if(!isLogin()){
			alert("로그인이 필요합니다.");
			location.href="/member/login.do";
			return false;
		}
	};
	$("fundFinderDiv").show();
	$("fundFinderSwf").show();
	setEm = new setEmbed();
	setEm.init('/images/flashes/fundFinder/FundFinderApplication.swf','968','555','fundApp');
	setEm.param('allowScriptAccess','always');
	setEm.param('wmode', 'transparent');
	setEm.show($("fundFinderSwf"));
	var panelNameArr = ["fundSearch","inquiry","interested","calculator","index","dictionary"];
	panelName = panelNameArr[num];
	fundAppTimer = setInterval(assignPanelNameToApp, 500);
}
//펀드파인더 숨기기
function closeFund(){
	$("fundFinderDiv").hide();
	$("fundFinderSwf").hide();
}

// 펀드 파인더 띄우기.
function fundFinderShow() {
	$("fundFinderDiv").show();
	$("fundFinderSwf").show();
}

function fundCtr(){
	$("todayFundLayer").hide();
	$("clearScrollArea").hide();
	$("todayFundLayer").select("label").each(function(item,i){
		item.observe("mouseover",function(){
			this.setStyle({
				color:"#ff6600"
			});
		});
		item.observe("mouseout",function(){
			this.setStyle({
				color:"#666666"
			});
		});
	});
	$("fundCloser").observe("click",function(){
		$("todayFundLayer").hide();
		$("clearScrollArea").hide();
	});
	$("fundnoneCloser").observe("click",function(){
		$("todayFundLayer").hide();
		$("clearScrollArea").hide();
	});
	$("todayQ").onclick = function(){
		$("todayFundLayer").toggle();
		$("clearScrollArea").toggle();
		todaysViewFunds();
		$("clearScrollArea").setStyle({
			height:$("todayFundLayer").getHeight()+"px"
		});
		return false;
	}
};

/* tab */
var Tab = Class.create();
Tab.prototype = {
	container: null,

	initialize: function(container) {	
		this.container = $(container);
		var oldIndex = 0;
		var tabTitle = this.container.down(".GreetTab");
		var tabContent = this.container.select(".legend");
	
		tabContent.each(function(item, i) {				
			if(i == oldIndex) {
				this.onEvent(i);					
			} else {
				this.offEvent(i);					
			}
		}.bind(this));

		tabTitle.select("li").each(function(item, i) {
			item.observe("click", function() {
				if(i != oldIndex) {
					this.onEvent(i);
					this.offEvent(oldIndex);
					oldIndex = i;
				}
			}.bind(this));
			
		}.bind(this));
	},

	onEvent: function(index) {			
		var title = this.container.down(".GreetTab").down("img", index);
		title.up("li").addClassName("On");
		this.container.down(".legend", index).show();
		this.imgChange("on", title);
		
	},
	
	offEvent: function(index) {
		var title = this.container.down(".GreetTab").down("img", index);
		title.up("li").removeClassName("On");
		this.container.down(".legend", index).hide();
		this.imgChange("off", title);
	},

	imgChange: function(state, obj) {
		if(state == "on") {
			obj.src = obj.src.replace(".gif", "On.gif");
		} else if(state == "off") {
			obj.src = obj.src.replace("On.gif", ".gif");
		}
	}
};

/*
	paging 옆에 달린 페이지 이동
*/
function gotoPage( totalPage, pageNoId, frmId ) {
	if ( !frmId ) {
		frmId = "searchForm";
	}
	if ( !pageNoId ) {
		pageNoId = "cPage";
	}
	var frm = document.getElementById( frmId );
	var pageNo = document.getElementById( pageNoId ); // 현재 페이지
	var gotoPage = document.getElementById( "gotoPage" ); // 가고싶은 페이지
	
	if ( isNum( gotoPage ) ) {
		
		var iTotalPage = parseInt( totalPage );
		var iGotoPage = parseInt( gotoPage.value );
		
		if ( iGotoPage <= 0 ) {
			alert( "1 이상의 숫자를 입력해 주세요." );
			gotoPage.focus();
			return;
		}
		else if ( iGotoPage > iTotalPage ) {
			alert( "이동 할 페이지가 전체 페이지 숫자보다 큽니다.\n\n" + iTotalPage + " 보다 낮은 페이지 숫자를 입력해 주세요." );
			gotoPage.focus();
			return;
		}
		
		pageNo.value = gotoPage.value;
		frm.submit();
	}
	else {
		alert( "이동 할 페이지를 숫자로만 입력해 주세요." );
		gotoPage.focus();
		return;
	}
}


function sitemapOpen() {
	$("topSitemap").setStyle({ 
		 height: '290px'
	}); 	
}

function sitemapClose() {
	$("topSitemap").setStyle({ 
		 height: '30px'
	}); 
}


function globalFamilyOpen() {
	$("navFlash").setStyle({
		height: '393px',
		marginTop: '-319px'
	});
}

function globalFamilyClose() {
	$("navFlash").setStyle({
		height: '74px',
		marginTop: '0'
	});
	
}




function getFlashPlayerVersion() {
	var ver = "9.0.22.87";
	return ver;
}


function popupGetFlashPlayer() {
	alert("이동합니다");
	location.href = "http://get.adobe.com/kr/flashplayer/";
}

function activateApplication(obj) {
	switch(obj) {
		case "fundSearch" :
			assigningTimer(0);
			break;
		case "earningRate" : 
			assigningTimer(1);
			break;
		case "interested" : 
			assigningTimer(2);
			break;
		case "calculator" : 
			assigningTimer(3);
			break;
		case "fundIndex" : 
			assigningTimer(4);
			break;
		case "dictionary" : 
			assigningTimer(5);
			break;			
		 default: 
		 	assigningTimer(0);
		 	break;	
	}
}

function setLogIn() {
	if(document.getElementById("gnbSWF")) document.getElementById("gnbSWF").setLogIn("OK");
	if(document.getElementById("sitemapSWF")) document.getElementById("sitemapSWF").setLogIn("OK");
}

function setLogOut() {
	if(document.getElementById("gnbSWF")) document.getElementById("gnbSWF").setLogIn("FAIL");
	if(document.getElementById("sitemapSWF")) document.getElementById("sitemapSWF").setLogIn("FAIL");
}

function mediaPopup(url) {
	windowOpen(url,'740','703');
}
	
	