﻿//<![CDATA[

/*
Popup function
*/
function popWin(url,wname,w,h,ptype,t,l) {
	var pWin, tVal, lVal;
	if (t == "c") {
		lVal = (screen.Width - w) / 2;
		tVal = (screen.Height - h) / 2;
	}
	else {
		tVal = (t!=null)?t:0;
		lVal = (l!=null)?l:0;
	}

	var popOpt = "width="+w+"px,height="+h+"px, top="+tVal+", left="+lVal;
	if(ptype == 0)
		popOpt += ",scrollbars=no";

	if(ptype == 1)
		popOpt += ",scrollbars=yes";

	if(ptype == 2)
		popOpt += ",scrollbars=yes,resizable=yes";

	pWin = window.open(url,wname,popOpt);
	return pWin;
}
/** 
Values Byte Cut
**/
function checkByte(element,lens,Yn) { 
  var oldStr, oldCnt; 
  var onechar; 
  var tcount = 0; 

  for (k=0;k<element.value.length;k++) { 
    onechar = element.value.charAt(k); 

    if (escape(onechar).length > 4) {
      tcount += 2; 
    }
    else if (onechar!='\r') {
      tcount++;
    }
  } 

  if(tcount>lens) { 
    if(Yn == "Y") {
      document.form1.cbyte.value = tcount;
    }
    alert(lens + " byte가 초과되었습니다.\r\n초과된 부분은 자동으로 삭제됩니다."); 
    element.value = oldStr; 
    tcount = oldCnt; 
  }
  
  oldStr = element.value; 
  oldCnt = tcount; 
  
  if(Yn == "Y") {
    document.form1.cbyte.value = tcount;
  }
}
/*
Values Byte Length Viewer
*/ 
function ChkLen() { 
  var msgtext, msglen; 
            
  msgtext = document.form1.txtHeadline.value;
  
  var i=0,l=0; 
  var temp,lastl; 
  
  //length count
  while(i < msgtext.length) { 
    temp = msgtext.charAt(i); 
    
    if (escape(temp).length > 4) {
      l+=2; 
    }
    else if (temp!='\r') {
      l++;
    }
    
    lastl = l;
    i++; 
  } 
  document.form1.cbyte.value=l; 
}
/* call swf*/
function swfView(id, swfPath, width, height, wmode, accessMode, subConId) {
  if (!wmode) wmode = 'transparent';
  if (!accessMode) accessMode = 'always';
  var swfStr = "";
  swfStr = "<object id=\"" + id + "\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"" + location.protocol + "//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.0.42.34\" width=\"" + width + "\" height=\"" + height + "\">";
  swfStr += "<param name=\"movie\" value=\"" + swfPath + "\" />";
  swfStr += "<param name=\"wmode\" value=\"" + wmode + "\" />";
  swfStr += "<param name=\"allowscriptAccess\" value=\"" + accessMode + "\" />";
  swfStr += "<!--[if !IE]> <-->";
  swfStr += "<object type=\"application/x-shockwave-flash\" id=\"" + id + "NIE\" data=\"" + swfPath + "\" width=\"" + width + "\" height=\"" + height + "\">";
  swfStr += "<param name=\"wmode\" value=\"" + wmode + "\" />";
  swfStr += "<param name=\"allowscriptAccess\" value=\"" + accessMode + "\" />";
  if (subConId != "" && document.getElementById(subConId) != null) {
    swfStr += document.getElementById(subConId).innerHTML;
    document.getElementById(subConId).innerHTML = "";
  }
  swfStr += "</object>";
  swfStr += "<!--> <![endif]-->";
  swfStr += "</object>";
  document.write(swfStr);
}

//Network Print map script: only div '#printarea' print
var win = null;
function print(printThis) {
  win = window.open("", "PrintWindow", "width=480,height=241,left=10,top=10,scrollbars=no,resizable=no");
  self.focus();
  win.document.open();
  win.document.write("<html><head>");
  win.document.write("<link href='/Eng/css/common.css'  rel='stylesheet' type='text/css'>");
  win.document.write("</head><body style='margin:0;padding:0;'>");
  win.document.write(printThis);
  win.document.write("</body></html>");
  win.document.close(); win.print(); win.close();
}

/* GNB Link */
function pageURL(a,b){
		var z_1_0 = "/Eng/Company/Company.aspx";							// Company
			var z_1_1 = "/Eng/company/company/profile/overview.aspx";							// Company
			var z_1_2 = "/Eng/Company/Network/Domestic/HeadOffice.aspx";					// Network
			var z_1_3 = "/Eng/Company/Business/Module/Chassis.aspx";				// Business
			var z_1_4 = "/Eng/Company/Investor/Corporate/Overview.aspx";				// IR
			var z_1_5 = "/Eng/Company/Rnd/Vision/Vision.aspx";				// R&D
		var z_2_0 = "/Eng/PR/PR.aspx";						// PR
			var z_2_1 = "/Eng/PR/News/List.aspx";						// NEWS
			var z_2_2 = "/Eng/PR/ad/tv.aspx";					// AD
			var z_2_3 = "/Eng/PR/Sports/Sports.aspx";								// Sports
			var z_2_4 = "/Eng/pr/social/overview.aspx";								// Social Responsibility
		var z_3_0 = "/Eng/support/Inquires/write.aspx";							// Support
			var z_3_1 = "/Eng/support/Inquires/write.aspx";								// Inquires
			//var z_4_3 = "javascript:rtnReady()";							//
			//var z_4_4 = "javascript:alert('');";							//

	 	var goUrl = eval("z_"+ a + "_" + b);
		if(goUrl != "#") {location.href = goUrl;return;}
	}

	function go_home(){
		location.href="/Eng/Main.aspx";
	}

	function Fb_01(){													//Sitemap
		location.href="/eng/footer/sitemap.aspx";
	}
	function Fb_05(){													//CyberAuidt
		window.open("/Eng/CyberAudit/CyberAudit.aspx", "_blank", "width=917,height=605,scrollbars=yes");
	}
/* family site */
function F_01(){													//HYUNDAI
	window.open("http://worldwide.hyundai.com/");
}
function F_02(){													//KIA MOTORS
	window.open("http://www.kiamotors.com/");
}
function F_03(){													//HYUNDAI STEEL
	window.open("http://www.hyundai-steel.com/info/eng/main.jsp");
}
function F_04(){													//HYUNDAI HYSCO
	window.open("http://www.hysco.com/eng/main/main.aspx");
}
function F_05(){													//HYUNDAI  Rotem
	window.open("http://www.hyundai-rotem.co.kr/eng/");
}
function F_06(){													//amco
	window.open("http://www.amco.co.kr/en/main.aspx");
}
function F_07(){													//IHL
	window.open("http://www.ihl.co.kr/english/main.asp");
}
function F_08(){													//AutoEverSystems
	window.open("http://www.autoeversystems.com/Eng/");
}
function F_09(){													//Hyundai Capital
	window.open("http://www.hyundaicapital.com/ir_en.jsp");
}
function F_10(){													//HyundaiCard
	window.open("http://www.hyundaicard.com/ir/en_new/index.jsp");
}
function F_11(){													//NGV
	window.open("http://www.ngvtek.com/new/eng/");
}
function F_12(){													//Glovis
	window.open("http://www.glovis.net/Eng/index_eng.asp");
}
function F_13(){													//Kefico
	window.open("http://www.kefico.co.kr/english/index.asp");
}
function F_14(){													//DYMOS
	window.open("http://www.dymos.co.kr/english/main/index.asp");
}
function F_15(){													//HYUNDAI POWERTECH
	window.open("http://www.powertech.co.kr/Eng/");
}
function F_16(){													//HYUNDAI  WIA
	window.open("http://en.hyundai-wia.com/index.asp");
}
function F_17(){													//WISCO
	window.open("http://www.wisco.co.kr/eng/");
}
function F_18(){													//BNG STEEL
	window.open("http://www.bngsteel.com:8080/scx_menu/menu.scx?cmd=menu-view&menu_code=114");
}
function F_19(){													//METIA
	window.open("http://www.metia.co.kr/");
}
function F_20(){													//Hyundai Commercial
	window.open("http://www.hyundaicommercial.com/ir/en/index.jsp");
}
function F_21(){													//INNOCEAN
	window.open("http://www.innocean.com/EngMain.asp");
}
/* GNB ON/Off */
function naviOn(){
	var IEflash = document.getElementById("tNavi");
	var noIEflash = document.getElementById("tNaviNIE");
	if(IEflash){IEflash.height = "220px";}
	if(noIEflash){noIEflash.height = "220px";}
	document.getElementById("GNBinContents").style.height = "220px";
}
function naviOff(){
	var IEflash = document.getElementById("tNavi");
	var noIEflash = document.getElementById("tNaviNIE");
	if(IEflash){IEflash.height = "74px";}
	if(noIEflash){noIEflash.height = "74px";}
	document.getElementById("GNBinContents").style.height = "74px";
}

/* footer ON/Off */
function F_naviOn(){
	var IEflash = document.getElementById("Footer");
	var noIEflash = document.getElementById("FooterNIE");
	if(IEflash){IEflash.height = "180px";}
	if(noIEflash){noIEflash.height = "180px";}
	document.getElementById("finCopyright2").style.height = "180px";
}
function F_naviOff(){
	var IEflash = document.getElementById("Footer");
	var noIEflash = document.getElementById("FooterNIE");
	if(IEflash){IEflash.height = "60px";}
	if(noIEflash){noIEflash.height = "60px";}
	document.getElementById("finCopyright2").style.height = "60px";
}
/* image over out */
function imgOverOut(obj) {
 if ( obj != null && obj.getAttribute('nover') != 'set' )
 {
  obj.src = (obj.src.indexOf("on.gif") > -1) ? obj.src.replace("on.gif", ".gif") : obj.src.replace(".gif", "on.gif");
 }
}

function disCurMenu(id) {
	imgOverOut(document.getElementById(id));
	document.getElementById(id).setAttribute('nover', 'set');
}
//]]>
