var g_pGB = "0"
var g_gicode = "A005930"
var g_ResearchYN = "N"
var g_ReportGbButton = ""


//4:¹Ì·¡¿¡¼Â, 5:µ¿¾çÁ¾±ÝÁõ±Ç, 6:KRX, 7:ÀÌÆ®·¹ÀÌµå, 9:Çª¸£µ§¼È, 17:Çö´ëÁõ±Ç
function LoadSubMenu(){
	var reg = /pGB=(\d)?/gi
	var url = window.location.href
	var rslt = reg.exec(url);
	//Á¦°øÃ³ ±¸ºÐ Ã£±â
	if (rslt != null){
		g_pGB= rslt[1];
	}

	//±â¾÷ÄÚµå Ã£±â
	reg = /A(\d{6})/gi;
	rslt = reg.exec(url);
	if (rslt != null)
		g_gicode= rslt[0];
	

	//°æ¿ì¿¡ µû¸¥ Ã³¸®
	if (g_pGB == "5" || g_pGB == "4" || g_pGB == "7" || g_pGB == "9" || g_pGB == "17"){
		window.tblSubMenuBar.style.display = "inline"
	}

	//ÇïÇÁ¹öÆ° ¼û±â±â
	if (g_pGB == "4"){ 
		window.HelpImg.style.display="none";
	}
}

//Ã¢ Á¶Àý ¾ÈµÇ°Ô.
function NoResize(){
	window.resizeTo(800, 800);
	return false;
}

//µµ¿ò¸» È®ÀÎ
function GoHelp_HTML(file, menuID){
	var help_file
	if (file== "" || file == null){
		help_file = "SVD_Help10.asp"
	}
	else {
		help_file = file
	}
	if (menuID=="" || menuID==null)
	{
		menuID ="52"
	}
	itsme = parseInt(help_file.substring(help_file.length-5,help_file.length-4)) -1;
	help_file = help_file + "?pGB=" + g_pGB + "&MenuID=" + menuID + "&itsme="+itsme
	window.open("/svo/handbook_New/xml/" + help_file, "HELP", "width=800, height=700, scrollbars=yes, resizable=yes")
}

function GoMenu_HTML_Button(menuID, ReportGb){
	g_ReportGbButton = ReportGb
	GoMenu_HTML(menuID)
}


//¸Þ´º ÀÌµ¿
function GoMenu_HTML(menuID){
	var url
	var report_gb

	if (g_ReportGbButton== "")
	{

		if (document.getElementById("ReportGB")!=null)
		{
			report_gb = window.document.all.ReportGB.options[window.document.all.ReportGB.selectedIndex].value
		} else {
			report_gb = ""
		}

	} else {
		report_gb = g_ReportGbButton
	}
	
	if (menuID == 11)
		url = "SVD_Main.asp?pGB="+ g_pGB + "&gicode=" + g_gicode + "&menuID=" + menuID + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 12)
		url = "SVD_Corp.asp?pGB="+ g_pGB+ "&gicode=" + g_gicode + "&menuID=" + menuID + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 13)
		url = "SVD_Finance.asp?pGB="+ g_pGB+ "&gicode=" + g_gicode + "&menuID=" + menuID + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb 
	else if (menuID == 14)
		url = "SVD_FinanceRatio.asp?pGB="+ g_pGB+ "&gicode=" + g_gicode + "&menuID=" + menuID + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 15)
		url = "SVD_Invest.asp?pGB="+ g_pGB+ "&gicode=" + g_gicode + "&menuID=" + menuID + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 16)
		url = "SVD_Comparison.asp?pGB="+ g_pGB+ "&gicode=" + g_gicode + "&menuID=" + menuID + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 17)
		url = "SVD_Disclosure.asp?pGB="+ g_pGB+ "&gicode=" + g_gicode + "&menuID=" + menuID + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 21)
		url = "html/SVD_SortByPotential.htm?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb 
	else if (menuID == 22)
		url = "html/SVD_SortByEpsUpDown.htm?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 31)
		url = "SVD_UJRank.asp?sort=7&u_cd=I.101&pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 32)
		url = "SVD_IdxRank.asp?u_cd=I.101&sort=9&pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 41)
		url = "SVD_CreditScore.asp?mkt_Gb=1&gb=1&pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 42)
		url = "SVD_CorpList.asp?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 43)
		url = "SVD_ProResultCorp.asp?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 51)
		url = "SVD_Help10.asp?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 52)
		url = "SVD_Help11.asp?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 53)
		url = "SVD_Help21.asp?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 54)
		url = "SVD_Help31.asp?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else if (menuID == 55)
		url = "SVD_Help41.asp?pGB="+ g_pGB + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	else
		url = "SVD_Main.asp?pGB="+ g_pGB+ "&gicode=" + g_gicode + "&menuID=" + menuID + "&strResearchYN=" + g_ResearchYN + "&ReportGB=" + report_gb
	

	window.location.href= "/svo/handbook_New/xml/" + url;
}

//ÆäÀÌÁö ÇÁ¸°Æ®
function PrintPage(){
	window.print();
}

//Ç³¼±¸» º¸ÀÌ±â
function showToolTip(e,text){ 
	alert(document.all.ToolTip);
      document.all.ToolTip.innerHTML="<table border=0 cellspacing=1 cellpadding=1 style='border-right: #ccd2d5 1px double; BORDER-TOP: #ccd2d5 1px double; BORDER-LEFT: #ccd2d5 1px double; BORDER-BOTTOM: #ccd2d5 1px double; background:#FFFFFF;'><tr bgcolor='#F1F1F1'><td width=170 align=center height=20><B>ÁÖÁÖ¸í</B></td><td width=80 align=center><B>ÁöºÐÀ²(%)</B></td></tr>"+text+"</table>"; 
      ToolTip.style.pixelLeft=(e.x+15+document.body.scrollLeft); 
      ToolTip.style.pixelTop=(e.y+document.body.scrollTop); 
      ToolTip.style.visibility="visible"; 
} 

//Ç³¼±¸» ¼û±â±â
function hideToolTip(){ 
      ToolTip.style.visibility="hidden"; 
} 

//Á¾¼ÓÈ¸»ç Á¶È¸ ÆË¾÷ ¿ÀÇÂ
function OpenSubOrdComp(itemnm){ 
	var strParam;
	var hwin;
	strParam = "statusbar=yes,scrollbars=yes,resizable=yes,width=700,height=900,top=5,left=" + (window.screen.width - 705);
	hwin = window.open("/svo/handbook_New/xml/SVD_SubordComp.asp?pGB=" + g_pGB + "&gicode="  + g_gicode + "&itemnm=" + escape(itemnm),"subwin",strParam);
	hwin.focus();
} 

// IFRS ¼±ÅÃ½Ã Á¾¼ÓÈ¸»ç Á¶È¸ ÆË¾÷ ¿ÀÇÂ BY KDW 2010-06-14
function OpenSubOrdComp4IFRS(itemnm){ 
	var strParam;
	var hwin;
	strParam = "statusbar=yes,scrollbars=yes,resizable=yes,width=900,height=900,top=5,left=" + (window.screen.width - 705);
	hwin = window.open("/svo/handbook_New/xml/SVD_SubordComp4IFRS.asp?pGB=" + g_pGB + "&gicode="  + g_gicode + "&itemnm=" + escape(itemnm),"ifrssubwin",strParam);
	hwin.focus();
}

// PDF µµ¿ò¸» ÆÄÀÏ ¿¬°á
function ShowPDF(URL, PNAME){
	window.open(URL, PNAME, "width=900,height=600,resizable=yes,scrollbars=yes")
}



// select boxÀÇ ¼±ÅÃµÈ option Ç¥½Ã( sleect box ¼±ÅÃ ÈÄ ÆäÀÌÁö ¸®·Îµù ÇÏ´Â °æ¿ì)
// sSel : object, sVal : Data

function selectbox_selected(sSel,sVal){
	var i ;
	for(i=1; i< sSel.options.length  ; i++){
		if (sSel.options[i].value == sVal) {
			sSel.selectedIndex = i ;
			break;
		}
	
	}
}	


// **** ±¸±Û ºÐ¼® Åø ½ºÅ©¸³Æ® »ðÀÔ ******* //

   var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24475106-1']);
  _gaq.push(['_setDomainName', '.fnguide.com']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
