
function top_menu(menu) 
{
	var link = "http://paxnet.moneta.co.kr/stock/intro/bbs.jsp,http://paxnet.moneta.co.kr/stock/intro/invest.jsp,http://paxnet.moneta.co.kr/stock/intro/analysis.jsp,http://foreign.moneta.co.kr/WorldStock/worldintro.html,http://news.moneta.co.kr/Service/stock/,http://paxnet.moneta.co.kr/stock/intro/futures.jsp,http://paxnet.moneta.co.kr/stock/elw/intro.jsp,http://bnb.moneta.co.kr/today_recom/intro.php,http://procafe.moneta.co.kr/cafe/intro/intro.php,http://paxnet.moneta.co.kr/WWW/html/stockClub/intro.html,http://paxnet.moneta.co.kr/stock/stockLoan/loan_intro.jsp";
	var link_table = link.split(",");
	var alt = "Åä·Ð½Ç,ÅõÀÚÀü·«,½Ã¼¼,¼¼°èÁõ½Ã,´º½º,¼±¹°¿É¼Ç,ELW,¿À´ÃÀÇÃßÃµ,Àü¹®°¡Ä«Æä,Áõ±Ç»çÅ¬·´,½ºÅ¹·Ð";
	var alt_table = alt.split(",");

	document.write("<script language=\"JavaScript\" src=\"http://image.moneta.co.kr/comm/include/stock/prototype.js\"></script>\n");
	document.write("<script language=\"JavaScript\" src=\"http://image.moneta.co.kr/comm/include/stock/scriptaculous.js\"></script>\n");
	document.write("<script language=\"JavaScript\" src=\"http://image.moneta.co.kr/comm/include/stock/jquery-1.3.2.js\"></script>\n");
	//jquery
	document.write("<script language=\"JavaScript\" src=\"http://paxnet.moneta.co.kr/WWW/inc/autocomplete/codelist.js\" charset='euc-kr'></script>\n");
	document.write("<script language=\"JavaScript\" src=\"http://paxnet.moneta.co.kr/WWW/inc/autocomplete/cross_searchutil.js\" charset='euc-kr'></script>\n");
	document.write("<script language=\"JavaScript\" src=\"http://image.moneta.co.kr/comm/include/stock/paxnet_gnb.js\"></script>\n");

	document.write("<center>");
	
	//-----------------------------Ãß°¡ S-----------------------------//
	document.write("<div style=\"background:#FFF; \">");
	//-----------------------------Ãß°¡ E-----------------------------//
	
	document.write("<div style=\"position:relative; width:980px; top:-1px; z-index:2\">");
	document.write("<!-- ÁÖ¹®¼¾ÅÍ begin--> ");
	document.write("<div style=\"width:69px; height:28px; position:absolute; left:902px; top:0px\"> ");
	document.write("<script type=\"text/javascript\">getFlashObject2(\"http://image.moneta.co.kr/stock/mystock/mini/mini_center.swf\", 69, 28,'')</script>"); 
	document.write("</div>");
	document.write("<!-- ÁÖ¹®¼¾ÅÍ end-->");
	document.write("<div style=\"position:relative;z-index:-1\" id=\"paxFts\">\n");
	document.write("<iframe src=\"#\" id=\"div_Flash\" name=\"div_Flash\" width=\"980\" height=\"0\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>\n"); 
	document.write("</div>\n");
	document.write("<iframe src=\"http://interest.moneta.co.kr/wm/mini/miniMyStockSlide.jsp\" width=\"980\" height=\"55\"  id=\"stockIframe\" frameborder=\"0\"  marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"></iframe>\n");
	document.write("</div>");

	document.write("<div style=\"display:none\">");
	document.write("<input id='spanState' style=\"display:none;\" type=hidden value='preload'>");
	document.write("</div>");
	
	//-----------------------------Ãß°¡ S-----------------------------//
	document.write("</div>");	
	document.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\"><td align=\"center\">");
	//-----------------------------Ãß°¡ E-----------------------------//
	
	document.write("<div class=height></div>");
	
	document.write("<table width=\"980\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
	document.write("<tr>");
	document.write("<td align=center valign=center>");
	document.write("	<!-- ·Î°í, °Ë»ö Start-->");
	document.write("	<h2><a href=\"http://paxnet.moneta.co.kr/\"><img src=\"http://image.moneta.co.kr/stock/comm/sub_logo.gif\" alt=\"PAXNET\"></a></h2>");
	document.write("	<form name=\"searchCodeForm\" id=\"searchCodeForm\" method=\"POST\" onSubmit=\"return checkValue();\" style=\"padding:0; margin:0\">\n");
	document.write("	<input type=\"hidden\" name=\"code\" value=\"\">");
	document.write("	<div id=\"search2009\">");
	document.write("		<ul>");
	document.write("		<li><span class=\"window\"><input name=\"pxcode\" id=\"pxcode\" type=\"text\" value=\"\" onFocus=\"\" onKeyDown=\"\" onMouseDown=\"px.checkInput();this.style.backgroundImage='url(http://image.moneta.co.kr/stock/gnb/search_whitebg.gif)'\" onkeypress=\"this.style.backgroundImage='url(http://image.moneta.co.kr/stock/gnb/search_whitebg.gif)'\" onKeyUp=\"this.style.fontSize='19px';this.style.paddingTop='4px';px.inputstr(event.keyCode);this.style.backgroundImage='url(http://image.moneta.co.kr/stock/gnb/search_whitebg.gif)'\" OnClick=\"this.style.backgroundImage='url(http://image.moneta.co.kr/stock/gnb/search_whitebg.gif)'\" size=\"55\" tabindex=1 class=\"input_text\"  autocomplete=\"off\" >");
	//document.write("          <input name=\"pxcode\" id=\"pxcode\" type=\"text\" class=\"input_text\" onFocus=\"\" onKeyDown=\"\" onMouseDown=\"px.checkInput();this.style.backgroundImage='url(http://image.moneta.co.kr/stock/gnb/search_whitebg.gif)'\" onkeypress=\"this.style.backgroundImage='url(http://image.moneta.co.kr/stock/gnb/search_whitebg.gif)'\" onKeyUp=\"px.inputstr(event.keyCode);this.style.backgroundImage='url(http://image.moneta.co.kr/stock/gnb/search_whitebg.gif)'\" OnClick=\"this.style.backgroundImage='url(http://image.moneta.co.kr/stock/gnb/search_whitebg.gif)'\" autocomplete=\"off\">");
	document.write("          <input type=\"image\" alt=\"°Ë»ö\" src=\"http://image.moneta.co.kr/stock/comm/searchbtn.gif\" class=\"btn\" >");
	document.write("          </span></li>");
	document.write("          <li style=\"padding:0px 0 0 7;\"><a href=\"http://paxnet.moneta.co.kr/stock/searchStock/searchStock.jsp?section=0\"><img src=\"http://image.moneta.co.kr/stock/comm/searchbtn_all.gif\" alt=\"Á¾¸ñÃ£±â\"></a></li>");
	document.write("		<DIV id=\"stockListBox\" style=\"display:none;background:#FFFFFF;border:0px;position:relative;left:-576px;top:-40px;z-index:10\" ></DIV>\n");
	document.write("		</ul>");
	document.write("	</div>");
	document.write("	</form>\n");
	document.write("	<div align=\"right\"><iframe src='http://interest.moneta.co.kr/wm/mini/miniloginasub.jsp' width='350' height='22' frameborder='0'  marginwidth='0' marginheight='0' scrolling='no' ></iframe></div>");
	document.write("	<!-- ·Î°í, °Ë»ö End-->");
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
	
	//-----------------------------Ãß°¡ S-----------------------------//
	document.write("</td></table>");	
	//-----------------------------Ãß°¡ E-----------------------------//

	document.write("<!--@@@@@@@@ÅÇ¸Þ´º  ½ÃÀÛ 2009@@@@@@@-->");

	document.write("<div id=\"gnbMenu\" style=\"width:100%;background-color:#153960;\">");

	document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:980px; height: 30px; background-color:#153960;\">");
	document.write("<tr>");
	document.write("<td>");

	for(var  i = 1; i <= link_table.length; i++)
	{
		var num, menuCh;
		if (i < 10) num = "0" + i;
		else num = i;

		if (menu == 3) //ÅõÀÚÀü·«
			menuCh = 2;
		else if (menu == 4) //½Ã¼¼Á¤º¸
			menuCh = 3;
		else if (menu == 5) //¼±¹°¿É¼Ç
			menuCh = 6;
		else if (menu == 6) //¼¼°èÁõ½Ã
			menuCh = 4;
		else if (menu == 7) //´º½º
			menuCh = 5;
		else if (menu == 8)
			menuCh = 9;
		else if (menu == 9)
			menuCh = 10;
		else if (menu == 10)
			menuCh = 11;
		else if (menu == 11) //ELW
			menuCh = 7;
		else if (menu == 12) //¿À´ÃÀÇÃßÃµÁÖ
			menuCh = 8;
		else menuCh = menu;

		//(menu == 8)menu = 8 //ÇÁ¸®¹Ì¾ö¼­ºñ½º
		//(menu == 9)menu = 9 //Áõ±Ç»çÅ¬·´
		//(menu == 10)menu = 10 //½ºÅ¹·Ð
		//(menu == 11)menu = 7 //ELW

		if(menuCh == i) //¼±ÅÃµÈ ¸Þ´º
		{
				document.write("<a href=\""+ link_table[i-1] +"\"><img src=\"http://image.moneta.co.kr/stock/gnb/m"+ i +"on.gif\" border=\"0\" alt=\""+alt_table[i-1]+"\"></a>");
		}
		else //ÀÏ¹Ý ¸Þ´º
		{
				document.write("<a href=\""+ link_table[i-1] +"\"><img src=\"http://image.moneta.co.kr/stock/gnb/m"+ i +".gif\" border=\"0\" alt=\""+alt_table[i-1]+"\"></a>");
		}
	}

	document.write("<a href=\"http://cafe.moneta.co.kr/paxtv/paxtv_live.jsp\"><img src=\"http://image.moneta.co.kr/stock/gnb/m12.gif\" border=\"0\" alt=\"ÆÅ½ºTV\"></a></td>");
	document.write("</tr>");
	document.write("</table>");

	document.write("</div>");

	document.write("<!--@@@@@@@@ÅÇ¸Þ´º  ³¡ 2009@@@@@@@-->");

	var randomNum = Math.floor(Math.random()*7);
	var adSLink,adSSrc = '';

	var curDate = new Date();
	var gmonth = curDate.getMonth() + 1;
	var gdate = curDate.getDate();
	var ghours = curDate.getHours();

	if(randomNum < 1){// event B1
		adSSrc = 'http://image.moneta.co.kr/stock/ad/gnbtop/subgnbtop_091230_02.gif';
		adSLink = 'http://paxnet.moneta.co.kr/WWW/html/searchsmt/promo.html';
	}else if(randomNum < 2){
		adSSrc = 'http://image.moneta.co.kr/stock/ad/gnbtop/subgnbtop_091231_01.gif';
		adSLink = 'http://bnb.moneta.co.kr/today_recom/bbs/view.php?bc_id=ipclub_notice&page=1&bd_no=70';
	}else if(randomNum < 3){
		adSSrc = 'http://image.moneta.co.kr/stock/ad/gnbtop/subgnbtop_100115_01.gif';
		adSLink = 'http://cafe.moneta.co.kr/paxtv/paxtv_live.jsp';
	}else if(randomNum < 4){
		adSSrc = 'http://image.moneta.co.kr/stock/ad/gnbtop/subgnbtop_100119_01.gif';
		adSLink = 'http://paxnet.moneta.co.kr/stock/paxbanner/countBanner.jsp?http://paxnet.moneta.co.kr/WWW/html/loan/giftEvent2010Jan.html&paxbanner=SCHMENU|R1|jagum';
	}else if(randomNum < 5){
		adSSrc = 'http://image.moneta.co.kr/stock/ad/gnbtop/subgnbtop_100304_01.gif';
		adSLink = 'http://procafe.moneta.co.kr/cafe/intro/bbs/view.php?bd_no=895&bc_id=notice';
	}else if(randomNum < 6){
		adSSrc = 'http://image.moneta.co.kr/stock/ad/gnbtop/subgnbtop_100201_02.gif';
		adSLink = 'http://procafe.moneta.co.kr/cafe/intro/lott_main.php';
	}else{
		adSSrc = 'http://image.moneta.co.kr/stock/ad/gnbtop/subgnbtop_100112_01.gif';
		adSLink = 'http://paxnet.moneta.co.kr/WWW/html/event/promoteMpax.html';
	}

	document.write("<!------ subGNB PROMOTION --------->");
	document.write("<div style=\"position:relative; width:980px;\">");
	document.write("<div style=\"position:absolute; left:780px; top:-56px;\"><a href='"+adSLink+"' target=\"_blank\" onfocus='this.blur()'><img src=\""+adSSrc+"\" alt=\"\" width=\"197\" height=\"56\" border=\"0\"></a></div>");
	document.write("</div>");
	document.write("<!------ //subGNB PROMOTION --------->");


	var px;//ÀÚµ¿¿Ï¼º
	var plus_ie = document.all ? true : false;
	if (!plus_ie) document.captureEvents(Event.MOUSEMOVE)

	
	

if(window.addEventListener) window.addEventListener("load", pxInit, false);
else if(window.attachEvent) window.attachEvent("onload", pxInit);
else window.onload=pxInit;

}//end of topmenu..


function pxInit()
{
	px = new autosearch('stockListBox','searchCodeForm','pxcode','code','','','','','','326');
	frm = document.searchCodeForm;
	//frm.pxcode.focus();
	// BanKIS Ad Start
	var promokey = "";
	adbackgrdsrc = "http://image.moneta.co.kr/stock/gnb/search_whitebg.gif";
	goadurl = "http://paxnet.moneta.co.kr/stock/paxbanner/countBanner.jsp?http://blue.crossmedia.co.kr/rac?cd=0235&ad=AD0000257C&curd=01B18&cus=1&paxbanner=MAIN|SEARCH|bankis";
	adNum = Math.floor(Math.random()*3);
	frm.pxcode.value = '';
	
	if(adNum < 1){
		adbackgrdsrc = "http://image.moneta.co.kr/stock/gnb/search_whitebg.gif";
		frm.code.value = "";
	}else if (adNum < 2){
		adbackgrdsrc = "http://image.moneta.co.kr/RealMedia/ads/Creatives/OasDefault/00_loadmovie/search_bgBankis5.gif";
		goadurl = "http://paxnet.moneta.co.kr/stock/paxbanner/countBanner.jsp?http://green.crossmedia.co.kr/rac?cd=02AE&ad=AD00002E97&curd=02032&cus=1&paxbanner=MAIN|SEARCH|bankis";
		frm.pxcode.value = "";
		frm.code.value = "";
	}else{
		adbackgrdsrc = "http://image.moneta.co.kr/RealMedia/ads/Creatives/OasDefault/00_loadmovie/search_bgBankis6.gif";
		goadurl = "http://paxnet.moneta.co.kr/stock/paxbanner/countBanner.jsp?http://green.crossmedia.co.kr/rac?cd=02AE&ad=AD00002E97&curd=02032&cus=1&paxbanner=MAIN|SEARCH|bankis";
		frm.pxcode.value = "";
		frm.code.value = "";
	}
	// BanKIS Ad End

	 if(frm.pxcode.value == ""){
        document.getElementById('pxcode').style.background='url("'+adbackgrdsrc+'")';
    }
}

function checkValue()
{
	frm = document.searchCodeForm;
	//goadurl = "http://paxnet.moneta.co.kr/stock/paxbanner/countBanner.jsp?http://blue.crossmedia.co.kr/rac?cd=0235&ad=AD0000257C&curd=01B18&cus=1&paxbanner=MAIN|SEARCH|bankis";
	goadurl = "http://paxnet.moneta.co.kr/stock/paxbanner/countBanner.jsp?http://green.crossmedia.co.kr/rac?cd=02AE&ad=AD00002E97&curd=02032&cus=1&paxbanner=MAIN|SEARCH|bankis";

	if(frm.pxcode.value == ""){
        var checkImg = document.getElementById('pxcode').style.background;
		if(checkImg.indexOf("search_bgBankis") != -1){
            frm.action = goadurl;
            frm.target = "_blank";
            frm.submit();
        }else{
			frm.action = 'http://qrobo.paxsearch.moneta.co.kr/index.php?mode=SH';
			frm.submit();
        }
		return false;
	}else{
		if (frm.code.value != "qrobo") {
			if(frm.code.value == "") frm.code.value = frm.pxcode.value;
			//frm.code.value = Url.encode(frm.code.value);
			goURL = getSearchUrl();
			frm.action = 'http://paxnet.moneta.co.kr/stock/searchStock/crosssearchStockResult.jsp?crtn='+encodeURIComponent(goURL);
			frm.submit();
		} else {
			var q = document.getElementById('pxcode').value;
			goURL = getSearchUrl();
			if (q) document.location = goURL + "&q="+Url.encode(q);
			else window.location = "http://qrobo.paxsearch.moneta.co.kr/index.php?mode=SH";
		}
		return false;
	}
}

function getSearchUrl(){
	var szUrl = document.location.href;
	var szRtnUrl = "http://qrobo.paxsearch.moneta.co.kr/index.php?";


	if(szUrl.indexOf("mode=") == -1){
		szUrl = "http://qrobo.paxsearch.moneta.co.kr/index.php?mode=US";
	}else{
		var szIndx = szUrl.indexOf("mode=");
		var tmpUrl = szUrl.substring(szIndx, szUrl.length);
		if(tmpUrl.indexOf("&") == -1){
			szRtnUrl +=tmpUrl;
		}else{
			szRtnUrl += tmpUrl.substring(0, tmpUrl.indexOf("&"));
			tmpUrl = tmpUrl.substring(tmpUrl.indexOf("&")+1, tmpUrl.length);

			//submode °¡Á®¿À±â
			if(tmpUrl.length > 0){
				if(tmpUrl.indexOf("submode=") != -1){
					if(tmpUrl.indexOf("&") != -1){
						szRtnUrl +="&"+tmpUrl.substring( tmpUrl.indexOf("submode="), tmpUrl.indexOf("&"));
					}else{
						szRtnUrl +="&"+tmpUrl;				
					}
				}
			}//end of  submode
		}
	}

	return szRtnUrl;

}
function doSubmit(q) {
	if (navigator.userAgent.indexOf("MSIE")>=0 ) { ///--> ÀÌºÎºÐÀº  IE ¸¸..
	}
	goURL = getSearchUrl();
	window.location =  goURL + "&q="+q;
}
