/********************************************************************
//	±â           ´É     :	°øÅë ½ºÅ©¸³Æ® ÆÄÀÏ
//	ÆÄÀÏÀ§Ä¡ ÆÄÀÏ¸í     :	/common/js/Common.js
//	ÀÛ     ¼º    ÀÏ     : 	2005. 11. 28.
//********************************************************************/ 

// ÆäÀÌÁö ÀÌµ¿
function MovePage(pageName, url, mainName, subName){
	location.href="/main/MovePage.aspx?pageName= " +pageName + "&url=" + url +"&mainName="+mainName+"&subName="+subName;
}

// ÆäÀÌÁö ÀÌµ¿ (°Ô½ÃÆÇ)
function MovePage2(pageName, url, mainName, subName, tbcode){
	location.href="/main/MovePage.aspx?pageName= " +pageName + "&url=" + url +"&mainName="+mainName+"&subName="+subName+"&tbcode="+tbcode;
}

// ÆäÀÌÁö ÀÌµ¿ (³ªÀÇ Q/A)
function MovePage3(pageName, url, mainName, subName, gugun){
	location.href="/main/MovePage.aspx?pageName= " +pageName + "&url=" + url +"&mainName="+mainName+"&subName="+subName+"&gubun="+gugun;
}


// »õÃ¢ ¿­±â
function fncCallIWindow(url, width, height){
	x = (screen.availWidth - 800) / 2;
	y = (screen.availHeight - 600) / 2;
	opt = "width="+width+",height="+height+",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0," + "left=" + x + ",top=" + y;
	window.open(url,"OpenWin",opt);
}


//Å×ÀÌºí TR ·¹ÀÌ¾î È¿°ú
function showTrContents(tblName, rowNum) {
	var tbl = document.all[tblName]; 
	for( var i = 0; i < tbl.rows.length; i++ ) {
			if( i == (rowNum-1) ) {
					tbl.rows[i].style.display = "";
			} else { 
					tbl.rows[i].style.display = "none";
			}
	}
}


// ·Î±×ÀÎ ¸Þ½ÃÁö
function Error(url, msg){
	alert(msg);
	fncCallIWindow(url,'350','320');
}



/*
      select ¹Ú½ºÀÇ ¼±ÅÃµÈ Ç×¸ñÀ» ¾Æ·¡·Î ¿Ã¸°´Ù.    
*/

function select_down(){    

	var length = Form1.lbList.length;              
    var se_index = Form1.lbList.selectedIndex; 
	if(length == 0 || se_index == -1){ //¿¡·¯Ã¼Å©
		alert("¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø°Å³ª ÀÚ·á°¡ ¾ø½À´Ï´Ù.!");
		return;
	}else{
	    if(se_index <  length-1){
			var k;//¼±ÅÃµÈ°ÍÀÇ ´ÙÀ½°ª
			var l;//¼±ÅÃµÈ°ÍÀÇ ´ÙÀ½ÅØ½ºÆ®
            k = Form1.lbList.options[se_index+1].value;
			l = Form1.lbList.options[se_index+1].text;
            Form1.lbList.options[se_index+1].value = Form1.lbList.options[se_index].value;
			Form1.lbList.options[se_index+1].text = Form1.lbList.options[se_index].text;
			Form1.lbList.options[se_index].value = k;
			Form1.lbList.options[se_index].text = l;
            Form1.lbList.options[se_index+1].selected = true;
		}
	}    
   return;
}


/*=====================================
// °ü½ÉÆÝµå Ãß°¡ / »èÁ¦ / ÀúÀå °ü·Ã
//=====================================*/

// °ü½ÉÆÝµå Ãß°¡
function fncSelAdd(){
	var length = Form1.lst_funlist.length;
	var se_index = Form1.lst_funlist.selectedIndex;
	var length_f = Form1.lst_fundfavorite.length;
	var strvalue = "";
	var str_id = "";
	var lastLength = length_f;
	
	if(length == 0 || se_index == -1){ //¿¡·¯Ã¼Å©
		alert("¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø°Å³ª ÀÚ·á°¡ ¾ø½À´Ï´Ù.!");
		return;
	}else{
		
		if(length_f !=0)
			Form1.lst_fundfavorite.options[lastLength-1].selected = false;
		
		// °ü½ÉÆÝµå¿¡ Ãß°¡
		for (i = 0; i <= length-1; i++){
            if (Form1.lst_funlist.options[i].selected == true){
            
				strvalue = Form1.lst_funlist.options[i].value;
				str_id = Form1.lst_funlist.options[i].text;
				
				if(length == 0){     	    
					Form1.lst_fundfavorite.options[0] = new Option(str_id, strvalue);      
				}else{
					Form1.lst_fundfavorite.options[lastLength] = new Option(str_id, strvalue);      
				}

				lastLength += 1;				
			}
		}
		
		// °Ë»öÆÝµå ¸®½ºÆ®¿¡¼­ ÆÝµå »èÁ¦
		for (i = length-1; i >= 0; i--){
            if (Form1.lst_funlist.options[i].selected == true)				
				Form1.lst_funlist.options[i] = null;
			
		}
		
		Form1.lst_fundfavorite.options[lastLength-1].selected = true;
	}
}


// °ü½ÉÆÝµå »èÁ¦
function fncSelDel(){
	var length = Form1.lst_fundfavorite.length;
	var se_index = Form1.lst_fundfavorite.selectedIndex;
	var length_f = Form1.lst_funlist.length;
	var strvalue = "";
	var str_id = "";
	var lastLength = length_f;
	
	if(length == 0 || se_index == -1){ //¿¡·¯Ã¼Å©
		alert("¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø°Å³ª ÀÚ·á°¡ ¾ø½À´Ï´Ù.!");
		return;
	}else{
		
		// °Ë»öÆÝµå ¸®½ºÆ®¿¡ Ãß°¡
		for (i = 0; i <= length-1; i++){
            if (Form1.lst_fundfavorite.options[i].selected == true){
            
				strvalue = Form1.lst_fundfavorite.options[i].value;
				str_id = Form1.lst_fundfavorite.options[i].text;
				
				if(length == 0){     	    
					Form1.lst_funlist.options[0] = new Option(str_id, strvalue);      
				}else{
					Form1.lst_funlist.options[lastLength] = new Option(str_id, strvalue);      
				}

				lastLength += 1;				
			}
		}
		
		// °ü½ÉÆÝÆ® ¸®½ºÆ®¿¡¼­ ÆÝµå »èÁ¦
		for (i = length-1; i >= 0; i--){
            if (Form1.lst_fundfavorite.options[i].selected == true)				
				Form1.lst_fundfavorite.options[i] = null;
			
		}
		
	}
}



// ÀúÀåÇÒ °ü½ÉÆÝµå ¸®½ºÆ®¸¦ »ý¼ºÇÏÀÚ.
// fund_code;fund_code; .. Çü½ÄÀ» ¸¸µé¾î È÷µç°ªÀ» ¸¸µë
function fncSaveMake(){

	var length = Form1.lst_fundfavorite.length;
	var hdvalue = "";
	
	
	for(i= 0 ; i < length; i++){
		if (i == 0){
			hdvalue = Form1.lst_fundfavorite.options[i].value;
		}else{
			hdvalue += ";" + Form1.lst_fundfavorite.options[i].value;
		}
			
	}
	
	Form1.hdInterFund.value = hdvalue;
	
	return true;
}


// ¸¶¿ì½º ¿À¸¥ÂÊ »ç¿ëÇÏÁö ¸øÇÏµµ·Ï ¼³Á¤
//document.onkeydown = fncDocumentKeyDown;
//document.oncontextmenu = keypressed;

function keypressed() 
{ 
   return false;
}

function fncDocumentKeyDown() {
	// F5¸¦ Á¦¿ÜÇÑ Æ¯Á¤Å° ¸·À½.
	 if( (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) || 
			(event.keyCode >= 112 && event.keyCode <= 115) || (event.keyCode >= 117 && event.keyCode <= 123)) 
	{ 
		event.keyCode = 0; 
		event.cancelBubble = true; 
		event.returnValue = false; 
	}

}


window.status="»êÀºÀÚ»ê¿î¿ë";

// ÇÃ·¡½Ã Å×µÎ¸® ¾ø¾Ö±â
function flash(url, widthx, heighty){
        var url;
        var widthx;
        var heighty;

        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+widthx+'" height="'+heighty+'">');
        document.write('<param name=movie value="'+url+'">');
        document.write('<param name=quality value=high>');
        document.write('<param name=wmode value=transparent>');
        document.write('<embed src="'+url+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+widthx+'" height="'+heighty+'"></embed>');
        document.write('</object>');
}  

/* RolloverImage */
function menuOn(imgEl) {
	imgEl.src = imgEl.src.replace("x.gif", "o.gif");
}

function menuOut(imgEl) {
	imgEl.src = imgEl.src.replace("o.gif", "x.gif");
}


/* Layer show/hide */
function layV(id) {
	document.getElementById(id).style.visibility = 'visible' ;
}

function layH(id) {
	document.getElementById(id).style.visibility = 'hidden' ;
}



/* Key Press Event */
function clickKey(e, func){
	if (!e) e = window.event;
	if (e.keyCode == "13") func;
	return false;
}




