


/* ÆË¾÷Ã¢¶ç¿ì±â */
function winOpen(file,wid,hei){ 
	window.open(file, 'add', 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizeable=no, scrolling=no, width='+wid+', height='+hei+',top=100,left=400');	 
}
/*select box ¼±ÅÃ½Ã ÀÌµ¿*/
function urlChange(sel){
	 
	var moveUrl = sel.options[sel.selectedIndex].value;
	if(moveUrl=="")
		return false;	
	window.open(moveUrl,"move","status=yes,menubar=yes,toolbar=yes,left=10,top=10" );
}
// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}
//ÀÌ¹ÌÁö ·Ñ¿À¹ö.
function initRollovers(temp) 
	{
	 if (!document.getElementById) {return}

	 var ele=document.getElementById(temp);
	 
	 var TempSrc;  
	 var aImages = ele.getElementsByTagName("img");  // "menu" div ¿µ¿ª³»¿¡¼­¸¸ ÀÌ¹ÌÁöµé 
	 
	 for (var i = 0; i < aImages.length; i++) 
	 {  
		if (aImages[i].className == 'imgover')  //Å¬·¡½º ³×ÀÓÀÌ imgover ÀÎ°Í¸¸ º¯È­
		{
		 var src = aImages[i].getAttribute('src'); // src ¼Ó¼º °¡Áö°í ¿À±â
		 var ftype = src.substring(src.lastIndexOf('.'), src.length); //È®ÀåÀÚ µû·Î »©¿À±â..  =>."gif"
		 var hsrc = src.replace(ftype, '_on'+ftype); // ¿À¹öÀÌ¹ÌÁö ÀÌ¸§ xxx_over.gif

		 aImages[i].setAttribute('hsrc', hsrc); 

		 // ÀÌ¹ÌÁö ÀÓÀÇÀÇ ¼Ó¼º hrc (¾Æ¹«ÀÌ¸§ÀÌ³ª »ó°ü¾øÀ½ src alt(x) aaa,bbb (o) )   ¼Ó¼º¿¡ ¿À¹ö ÀÌ¹ÌÁö ÀúÀå; 

		 aImages[i].onmouseover = function() 
		 {
			TempSrc = this.getAttribute('src');
			this.setAttribute('src', this.getAttribute('hsrc')); // ¿À¹ö ÀÌ¹ÌÁö »ðÀÔ
		 } 
		 
		 aImages[i].onmouseout = function() 
		 {
			if (!TempSrc) TempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
			this.setAttribute('src', TempSrc); //¾Æ¿ô ÀÌ¹ÌÁö »ðÀÔ
		 }

		// ±âÁ¸ ÅÂ±×¿¡ ÀÌº¥Æ®(onmouseover,onmouseout) ¸¦ ¿Ã·Á³õ½À´Ï´Ù. ¼Ò½º»ó¿¡´Â ¾Èº¸ÀÓ..

	 // ex) <img src="aa.gif" onmouseover ="ÀÌº¥Æ®È¿°ú" onmouseout="ÀÌº¥Æ®È¿°ú"  /> 
		}
	 }
	 
	}	
function positionMessage(){   
	//dvSidebar menu id
	var elem=document.getElementById("side");   
	// ÃÊ±â top À§Ä¡ 
	elem.style.top=document.documentElement.scrollTop + 130 + "px"; 				
	setTimeout("moveElement()", 10); 
}
 

function moveElement(){
	var elem = document.getElementById("side"); 
	start = parseInt (elem.style.top);  
	end = document.documentElement.scrollTop + 130; // limit Á¤ÇÏ±â
	 
	//start ¿Í end °°À¸¸é ¸ØÃá´Ù.
	if ( start != end ) {
		scale =   Math.ceil( Math.abs( end - start ) / 10 );
		
		
		//½ºÅ©·ÑÀÌ »ó´ÜÀ¸·Î ÀÌµ¿ÀÌ½Ã ¸¶ÀÌ³Ê½º°ª...
		if ( end < start )	{
			scale = -scale; // alert("end = "+end+" start = "+start);
		}
			elem.style.top = parseInt (elem.style.top)+ scale + "px"; 
	 
	}		

	setTimeout("moveElement()", 10);
}

function topMove(){
	 
	 document.documentElement.scrollTop = 0 +"px";
}

function winPrint(){
	if(confirm("ÀÎ¼â½Ã¿¡´Â ¿ÞÂÊ¿©¹é : 4.5, ¿À¸¥ÂÊ¿©¹é : 4.5·Î ¼³Á¤ÇØ ÁÖ¼¼¿ä.")){
		print();	
	}
}
 
function addLoadEvent(func){
	
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
	 
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
 
}

//°æ°í ÈÄ ·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿
function AlertGoLogin()
{
	//if(confirm("È¸¿ø¸¸ÀÌ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
	//	location.href="/webapp/mypage/login.jsp?goUrl="  + escape(location.href);
	//}
	location.href="/webapp/mypage/login.jsp?goUrl="  + escape(location.href);
}

//°æ°í ÈÄ »óÀ§ ÇÁ·¹ÀÓ ·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿
function AlertTargetLogin()
{
	//if(confirm("È¸¿ø¸¸ÀÌ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
	//	parent.location.href="/webapp/mypage/login.jsp?goUrl="  + escape(window.parent.location);
	//}
	parent.location.href="/webapp/mypage/login.jsp?goUrl="  + escape(window.parent.location);
}


//°ü½ÉÆÝµå µî·ÏÇÏ±â
function myFundReg(sFundCd, mode)
{
	NewWindow('/webapp/mypage/my_fund.jsp?sFundCd='+sFundCd+'&mode='+mode, 'myFund', '457', '243', 'no');
}
