	function winClose(){
		window.close();
	}
function Change (target,type){  
       if ( target.value == target.defaultValue && type==0) target.value = ''; 
       if ( !target.value && type==1) target.value = target.defaultValue; 
}
function tab_history(){
	obj = $('tab_temp').getElementsByTagName('img'); 
	 
	for(var i=0;i<obj.length;i++){
		
		if( obj[i].className!="not_over"){  
		
			obj[i].onmouseover= function(){
				change_src = this.src.replace("_off","_on");
				this.src = change_src;
				 
			}
			obj[i].onmouseout= function(){
				change_src = this.src.replace("_on","_off");
				this.src = change_src;
			} 									
												
		}else{
			obj[i].onmouseover= function(){	}
			obj[i].onmouseout= function(){	} 
		} 
		 
	}	
}	 												
 
 
function contentChange(str){
	var imgTemp = document.getElementById("tab_temp");
	var imgTag = imgTemp.getElementsByTagName('img');
	for(var i=1;i<=imgTag.length;i++){
		if(i==str){
			document.getElementById("temp_"+str).style.display='block';
			imgTag[i-1].className="not_over";									
			var change_src = imgTag[i-1].src.replace("_off","_on"); 
			imgTag[i-1].src = change_src 

		}else{
			document.getElementById("temp_"+(i)).style.display='none';
			imgTag[i-1].className="";
			var change_src = imgTag[i-1].src.replace("_on","_off");									 	
			imgTag[i-1].src = change_src 
		}

	}
	 tab_history()
 }

function change_word(obj){
	obj = $(obj).getElementsByTagName('img'); 
		
	for(var i=0;i<obj.length;i++){
		if(obj[i].src.indexOf("_on") == "-1"){ 
			obj[i].onmouseover= function(){
				var change_src = this.src.replace("_off","_on");
				this.src = change_src
			}
			obj[i].onmouseout= function(){
				var change_src = this.src.replace("_on","_off");
				this.src = change_src
			}									
		}
	}		 												
}
function change_tab(){
	obj = $("tab").getElementsByTagName('img');
	
		
	for(var i=0;i<obj.length;i++){
		if(obj[i].src.indexOf("_on") == "-1"){ 

			obj[i].onmouseover= function(){
				var change_src = this.src.replace("_off","_on");
				this.src = change_src
			}
			obj[i].onmouseout= function(){
				var change_src = this.src.replace("_on","_off");
				this.src = change_src
			}									
		}
	}		 												
}

function addLoadEvent(func){
 
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }

}
function $(element) {
  return document.getElementById(element);
}

function NewWindow(mypage, myname, w, h, scroll)
{
 
	var win = null;
 
	LeftPosition=(screen.width) ? (screen.width-w)/2 : 0;
	TopPosition=(screen.height) ? (screen.height-h)/2 : 0;				
	settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',resizable=no, scrollbars=' + scroll;
	win=window.open(mypage,myname,settings);
	return win;
	 
}
function ieVersion7() {
 
  var ver = navigator.userAgent.toLowerCase().indexOf("7.0");
  return ver;
}

function viewFlash(source,id,width,height,wmode) {
  var swfHtml = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width='"+width+"' height='"+height+"' id='"+id+"_swf'>"
  swfHtml +="<param name=\"allowScriptAccess\" value=\"sameDomain\"><param name=wmode value='"+wmode+"' />";
  swfHtml +="<param name=\"movie\" value='"+source+"' />";
  swfHtml +="<param name=\"quality\" value=\"high\" />";
  swfHtml +="<embed src="+source+" quality=\"high\" type=\"application/x-shockwave-flash\" pluginspage=\"https://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width='"+width+"' height='"+height+"' wmode='"+wmode+"' showmenu=false></embed></object>"; 
    document.getElementById(id).innerHTML = swfHtml;
}

 
 
 
	
	function fundOpen(args){ 	  
		bgMake("pop_bg",'0.3');  
		infoMake('fundOpen',args); 
	}
	
	function fundClose(){ 
	
		if($("pop_bg")){
			
			var del_bg = document.getElementById("pop_bg");
			var del_swf = document.getElementById("fundOpen");
			document.body.removeChild(del_bg);
			document.body.removeChild(del_swf);
		}else{
			alert("°ü·ÃµÈ ¾ÆÀÌµð°ªÀÌ ¾ø½À´Ï´Ù.")
		}
				
	}
	function bgMake(ele,opa){		
	
		var pop_temp= document.createElement("div");			
		pop_temp.setAttribute("id",ele); //layout.css
		pop_temp.onclick = function (){
			//fundClose()
		}
		document.body.appendChild(pop_temp); 
		var _height = document.documentElement.scrollHeight;  
		$(ele).style.position = "absolute";
		$(ele).style.top = 0;
		$(ele).style.left = 0;
		$(ele).style.width = "100%";  
		$(ele).style.height = _height+"px";
		$(ele).style.backgroundColor = "#000";  
		$(ele).style.zIndex = "9000";
		$(ele).style.display="";
		$(ele).style.cursor="pointer";
		setDiv(ele,opa); 								
		
	}
	function infoMake(ele,args){
		var pop_temp= document.createElement("div");			
		pop_temp.setAttribute("id",ele); //layout.css 
		document.body.appendChild(pop_temp); 		
		var _top =  document.documentElement.scrollTop+30;
		 
		$(ele).style.position = "absolute";
		$(ele).style.top = _top+"px";
		$(ele).style.left = "0px";
		$(ele).style.backgroundColor = ""; 
		$(ele).style.zIndex ="10000"; 
		$(ele).style.display="";
 		
		viewFlash('/kor/swf/viewFundInfo.swf?fundCd='+args, ele, '1013', '546', 'transparent');
		
	}
	
	function setDiv(obj,obj2){
		 
		if(document.all){ 
			$(obj).style.filter="alpha(opacity="+obj2*100+")"; 
		}else{ 
			$(obj).style.opacity = obj2;
		}
	}

function topMove(){
	 document.documentElement.scrollTop = 0 +"px";
}

function quickMenu(str) {
	 this.top = 366;														// default top 
	 this.right = 0;														// default left 
	 this.ele = document.getElementById(str);		//¾×¼Ç element

	 this.footlimit = 150;	
	 
	 this.timer = null;

	 this.yHeight =  parseInt(document.documentElement.scrollHeight); 
	 this.ele.limit = this.yHeight- this.footlimit; //
	 // element  position, left, top value setup
	 this.ele.style.position	=	"absolute";
	 this.ele.style.top = this.top+"px";
	 this.ele.style.right =	this.right+"px";
	 this.moveY = this.top;

	}
	quickMenu.prototype.pos = function(){this.ele.style.top=this.moveY+"px";}
	quickMenu.prototype.move = function(){

		this.end = document.documentElement.scrollTop+this.top; 
		this.moveY +=   Math.floor((this.end - this.moveY ) / 10 );
		
		if(this.moveY>this.ele.limit){
				this.moveY =  this.ele.limit;
		}
		this.pos();// À§Ä¡°ª ÀÔ·Â
	 	//$("quick_menu").innerHTML = "yÀ§Ä¡ "+this.moveY+" limit"+this.ele.limit +" ÀüÃ¼³ôÀÌ"+this.yHeight;
		this.timer = setTimeout(this.name+".move()",10);
	}

	quickMenu.prototype.start = function(){
		this.start = parseInt (this.ele.style.top);
		this.timer = setTimeout(this.name+".move()",10);
	}

/* Äü¸Þ´º*/
 
function quickAreaChange(mode) {
  if(mode == "over") { 
		if(!$("quick").style.width){
			 $("quick").style.width="430px"
		}
    $("quick").style.width="430px";
  }else if(mode == "out") {
	 	if(!$("quick").style.width){
			 $("quick").style.width="28px"
		}
    $("quick").style.width="28px";
  }
}

var ssl = "http://localhost/jnmzzx";
var ssl_url = "";
//°æ°í ÈÄ ·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿
function alertGoLogin()
{
	if(confirm("·Î±×ÀÎÈÄ ÀÌ¿ëÇÏ½Ç¼ö ÀÖ½À´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
		location.href=ssl_url+"kor/member/login.jsp?goUrl="  + escape(location.href);
	}
}

//°æ°í ÈÄ ºÎ¸ðÃ¢¿¡¼­ ·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿
function openerAlertGoLogin()
{
	if(confirm("·Î±×ÀÎÈÄ ÀÌ¿ëÇÏ½Ç¼ö ÀÖ½À´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
		opener.location.href=ssl_url+"kor/member/login.jsp?goUrl="  + escape(opener.location.href);
	}
}

//ÀüÃ¼°Ë»ö
function FlashFundSearch(searchWord) {
	location.href=ssl+"/search.asp?sWord="+searchWord;
}

//»óÇ°½ºÅ©·¦
function productScrap(fundCd) {	
	NewWindow(ssl+'kor/popup/good_scrap.jsp?fundCd='+fundCd, 'product_scrap', '460', '674', 'no');
}

//E-mail Àü¼Û
function productEmail(fundCd) {	
	NewWindow(ssl_url+'kor/popup/good_email.jsp?fundCd='+fundCd, 'email_send', '460', '311', 'no');
}

//ÆÄÀÏ´Ù¿î·Îµå
function getDownload(ctg, fileNm) {
	self.location.href=ssl+"common/filedown.jsp?ctg="+ctg+"&fileName="+fileNm;
}

//ÀÏÀÚº°±âÁØ°¡¿¢¼¿´Ù¿î·Îµå
function getFundPriceExcel(fundCd, sDate, eDate){
	self.location.href=ssl+"kor/fund_info/fund_day_price_excel.jsp?sFundCd="+fundCd+"&sSdate="+sDate+"&sEdate="+eDate;
}

//¹Ù·Î°¡±â¸µÅ©
function goLink(obj){
	 
	if(obj.options[0].selected != true){ 
		window.open(obj.options[obj.selectedIndex].value,'_blank');
	}
}

//¸®ÇÃ·¿ º¸±â
function leafletPopup(fname){

	if (fname != "" && fname != null)
	{
		var m = fname.split(".");
	    var filename = m[0];
		var extname  = m[1];
		extname = extname.toLowerCase();
		
		if (extname == "pdf") {			
			self.location.href=ssl+"common/filedown.jsp?ctg=fund&fileName="+fname;
		} else {
			var elmForm = document.view_imgNMovie; 
			elmForm.fName.value = fname;
			
			ow = window.open('', 'AD_IMG', 'status=no, toolbar=no, resizeable=no, scrollbars=yes, top=100, left=100, width=795, height=520');

			elmForm.action = 'kor/popup/fund_image.jsp';	
			elmForm.target = 'AD_IMG';
			elmForm.submit();
		}
	}
}
