// title
//document.title="";
var OBJ_LANG = "";

//domain
var dom = document.domain;

//wiselog º¯¼ö
var val = "obj_kor";	
if(dom.indexOf("with") > -1) { //ÅØ½ºÆ®¸ðµå¿¡¼­ ¿Ô´ÂÁö
	val = "obj_kortext";
} else{					  //±×·¡ÇÈ¸ðµå¿¡¼­ ¿Ô´ÂÁö	
	val = "obj_kor";
} 
 
// focus
function allblur() {
  for (i = 0; i < document.links.length; i++)
	document.links[i].onfocus = document.links[i].blur;
}

function goLogin() {
	//var f = document.frmGlobal[0];
	var f = document.frmGlobal;
	f.action = '/lgstory/event/member_login.jsp';
	f.submit();
}

function goJoin() {
	//var f = document.frmGlobal[0];
	var f = document.frmGlobal;
	f.action = '/lgstory/event/consent.jsp';
	f.submit();
}

/*
function goJoin() {
	//var f = document.frmGlobal[0];
	var f = document.frmGlobal;
	f.action = '/lgstory/event/pre_sign.jsp';
	f.submit();
}
*/
function goLogout() {
	//var f = document.frmGlobal[0];
	var f = document.frmGlobal;
	f.action = '/lgstory/event/member_logout.jsp';
	f.submit();
}
 
function goInfoModify() {
	//var f = document.frmGlobal[0];
	var f = document.frmGlobal;
	f.action = '/lgstory/event/member_update.jsp';
	f.submit();
}

function main_goLogin() {
	var f = document.frmGlobal;
	f.action = '/lgstory/event/member_login.jsp';
	f.submit();
}

function main_goJoin() {
	var f = document.frmGlobal;
	f.action = '/lgstory/event/consent.jsp';
	f.submit();
}
 
function main_goLogout() {
	var f = document.frmGlobal;
	f.action = '/lgstory/event/member_logout.jsp';
	f.submit();
}
 
function main_goInfoModify() {
	var f = document.frmGlobal;
	f.action = '/lgstory/event/member_update.jsp';
	f.submit();
}

// openwindow
function openwindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

// swapImg
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function pop(url,intWidth,intHeight) { 
      window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",resizable=0,scrollbars=0") ;
}

function pop_scroll(url,intWidth,intHeight) { 
	 
      window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",resizable=0,scrollbars=1") ;
}

/*OBJECTÇ¥ÁØ½ºÅ©¸³Æ® - 
function flash(url,id,width,height){
document.write('<object type="application/x-shockwave-flash" data="'+url+'" width="'+width+'" height="'+height+'" id="'+id+'">'
+'<param name="movie" value="'+url+'">'
+'<param name="quality" value="high">'
+'<param name="wmode" value="transparent">'
+'<param name="menu" value="false">'
+'<param name="allowScriptAccess" value="always">'
+'<param name="FlashVars" value="playMode=embeded">'
//+'<embed src="'+url+'" quality="high" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash"></embed>'
+'</object>');
}
*/

function flash(url,id,width,height){
document.write('<object width="'+width+'" height="'+height+'" id="'+id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" type="application/x-shockwave-flash">'
+'<param name="movie" value="'+url+'">'
+'<param name="quality" value="high">'
+'<param name="wmode" value="transparent">'
+'<param name="allowScriptAccess" value="always">'
+'<param name="allowFullScreen" value="true">'
+'<param name="FlashVars" value="playMode=embeded">'
+'<param name="swliveconnect" value="true" />'
+'<embed src="'+url+'" quality="high" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" ></embed>'
+'</object>');
}

function flash1(url,id,width,height,paramName, paramValue){
document.write('<object type="application/x-shockwave-flash" data="'+url+'" width="'+width+'" height="'+height+'" id="'+id+'">'
+'<param name="movie" value="'+url+'">'
+'<param name="quality" value="high">'
+'<param name="wmode" value="transparent">'
+'<param name="menu" value="false">'
+'<param name="allowScriptAccess" value="always">'
+'<param name="FlashVars" value="'+paramName+'='+paramValue+'">'
+'</object>');
}

function movie(url,id,width,height){
	document.write('<object type="video/x-ms-wmv" data="http://www.sarahsnotecards.com/catalunyalive/fishstore.wmv" width="'+width+'" height="'+height+'">'
	+'<param name="AutoSize" value="0">'
	+'<param name="AutoStart" value="1">'
	+'<param name="AutoRewind" value="1">'
	+'<param name="ClickToPlay" value="1">'
	+'<param name="Enabled" value="1">'
	+'<param name="ShowTracker" value="1">'
	+'<param name="EnableTracker" value="0">'
	+'<param name="EnableContextMenu" value="0">'
	+'<param name="ShowStatusBar" value="0">'
	+'<param name="ShowControls" value="0">'
	+'<param name="ShowAudioControls" value="0">'
	+'<param name="ShowCaptioning" value="0">'
	+'<param name="Mute" value="0">'
	+'<param name="ShowDisplay" value="0">'
	+'<param name="BufferingTime" value="3">'
	+'<param name="PlayCount" value="1">'
	+'<param name="FileName" value='+url+'>'
	+'</object>');
}

function f_balance(paramName, paramValue){  //  Àç¹«Á¤º¸ > ´ëÂ÷´ëÁ¶Ç¥
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="605" height="181">');
	document.write('  <param name="movie" value="/image/kor/investor/dacha.swf">');
	document.write('  <param name="quality" value="high">');
	document.write('  <param name="FlashVars" value="'+paramName+'='+paramValue+'">');
	document.write('  <embed src="/flash/investor/dacha.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="605" height="181"></embed>');
	document.write('</object>');
}

function f_income(paramName, paramValue){  //  Àç¹«Á¤º¸ > ¼ÕÀÍ°è»ê¼­
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="605" height="226">');
	document.write('  <param name="movie" value="/image/kor/investor/soninc.swf">');
	document.write('  <param name="quality" value="high">');
	document.write('  <param name="FlashVars" value="'+paramName+'='+paramValue+'">');
	document.write('  <embed src="/flash/investor/soninc.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="605" height="226"></embed>');
	document.write('</object>');
}

function resizeIframe(fr) { 
                fr.setExpression('height',resize_frame.document.body.scrollHeight); 
                fr.setExpression('width',resize_frame.document.body.scrollWidth); 
} 
function goURLbySelect(url,target) {
	if (url) {
		target.document.location.href = url ;
	}
}

/************** iframeÀÇ ¸µÅ© ÀÌµ¿ ************/
function changeAdress(_url)
{
	iframe1.location.href=_url;
}

/************* ÅØ½ºÆ®¸ðµå º¸±â ±â´É ******************/
/************* ÅØ½ºÆ®¸ðµå º¸±â ±â´É ******************/
function ConvertVersion(ver)
{
	var lnk = document.URL;
	var param = "util";
	var val = "obj_kor";
//alert(lnk);
	if(ver.indexOf("kortext") > -1) { //±×·¡ÇÈ¸ðµå º¸±â
		val = "obj_kor";
		lnk = lnk.replace("with","www");	
		lnk = lnk.replace(/\'/g, "%27");
		
		if(lnk.indexOf("lgstory")>-1 || lnk.indexOf("friend") > -1 ||  lnk.indexOf("advice") > -1 ||  lnk.indexOf("inlg") > -1 ||  lnk.indexOf("recruit/guide/company") > -1 ) {
			lnk = lnk.replace("view", "list") ;			
		}

		///°³¹ß¼­¹ö¿¡¼­¸¸ 
		//lnk = lnk.replace("5025","5020");	
	} else{					  //ÅØ½ºÆ®¸ðµå º¸±â		
		val = "obj_kortext";
		
		// www¸¦ Ä¡Áö¾Ê°í µé¾î¿Ã°æ¿ì 
		// ¾Æ·¡´Â °³¹ß¼­¹ö¿Í Æ²¸®¹Ç·Î ÁÖÀÇ ÇØ¾ß ÇÔ 
		if(lnk.indexOf("www") == -1 ) {
			lnk = lnk.replace("lg.co.kr","www.lg.co.kr");
		}		
		lnk = lnk.replace("www","with");
		
		
		if(lnk.indexOf("lgstory")>-1 || lnk.indexOf("friend") > -1 ||  lnk.indexOf("advice") > -1 ||  lnk.indexOf("inlg") > -1 ||  lnk.indexOf("recruit/guide/company") > -1 ) {

			lnk = lnk.replace("list", "view") ;
		}	

		///°³¹ß¼­¹ö¿¡¼­¸¸ 
		//lnk = lnk.replace("5020","5025");	
     }
     
 	var Chars = checkSpecialChar(lnk);
 	
	if(Chars == true){ // ÆÄ¶ó¹ÌÅÍ °ªÀÌ ÀÖÀ¸¸é 
		//section&from ÆÄ¶ó¹ÌÅÍÀÇ °ªÀº ÇÏ³ª¸¸ ¼ÂÆÃÇØ¾ß ÇÑ´Ù.
		//ÀÌÀü¿¡ ´Ù¸¥ °æ·Î·Î µé¾î¿ÔÀ»¶§ ¸ðµå º¯°æ½Ã ÆÄ¶ó¹ÌÅÍ ÃÊ±âÈ­
		if(lnk.indexOf("section") > -1) { 
			lnk = lnk.substring(0,lnk.indexOf("section") -1);
		}
		
		if( checkSpecialChar(lnk)) { // Ãß°¡ ÆÄ¶ó¹ÌÅÍ°¡ ÀÖÀ» °æ¿ì
			lnk=lnk+"&from="+param+"&section="+val;	
		} else {	
			lnk=lnk+"?from="+param+"&section="+val;
		}  
	} else {    // ÆÄ¶ó¹ÌÅÍ °ªÀÌ ¾øÀ¸¸é 
	    lnk=lnk+"?from="+param+"&section="+val;
	}
	
     openwindow(lnk, '','' );
}  
   
   
//¸ÞÀÎ ¹Ù·Î°¡±â
function goMain(){
 location.href="/index.jsp";
}
    
/********************************************************************
*  Function Name : js_open()+
*  Description   : »õÃ¢¿­±â
*  Input Data    : window.open()¿Í °°À½
*  Output Data   : none
*  »ç¿ëµÇ´Â Function : None
* onClick="js_open(this.href,'newwin','width=400,height=300,status=yes,menubar=yes');return false"
********************************************************************/
function js_open(url, wname, wopt) {
	var newopt = "", wHeight = 0, wWidth = 0;
	if (wopt != undefined) {
		var woptlist = wopt.replace(/ /g, "").split(",");
		for (var i in woptlist) {
			if (woptlist[i].match(/^height=/i)) {
				wHeight = parseInt(woptlist[i].substr(7),10);
				if (!isNaN(wHeight)) newopt += "top=" + Math.floor((screen.availHeight - wHeight) / 2) + ",";
			}
			if (woptlist[i].match(/^width=/i)) {
				wWidth = parseInt(woptlist[i].substr(6),10);
				if (!isNaN(wWidth)) newopt += "left=" + Math.floor((screen.availWidth - wWidth) / 2) + ",";
			}
		}
	}
	return window.open(url, wname, newopt + wopt);
}
function MM_openBrWindow(url,name,size){

		open(url,name,size);
}

/************* ÁÖ¼Ò ÆÛ°¡±â ±â´É ******************/
function addToClipBoardData(data, end_day, validate)
{
	var data;	
	
	if (window.clipboardData)
	{ 
		clipboardData.setData('Text', data);
		//	alert(data + "ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.");
		if(end_day == '')
		{
			alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.");
		}
		else
		{
			if(validate == 0)
			{
				alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\n\nº» ÄÁÅÙÃ÷´Â Á¤º¸ÀÇ ÃÖ½Å¼ºÀ» º¸ÀåÇÏ±â À§ÇÑ \nÀ¯È¿±â°£ÀÌ ¼³Á¤µÇ¾î ÀÖÀ¸¸ç,  \n¸¸·áÀÏÀº " +  end_day + " ÀÔ´Ï´Ù");	
			}
			else
			{
				alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\n\nº» ÄÁÅÙÃ÷´Â Á¤º¸ÀÇ ÃÖ½Å¼ºÀ» º¸ÀåÇÏ±â À§ÇÑ \nÀ¯È¿±â°£("+ validate +"ÀÏ)ÀÌ ¼³Á¤µÇ¾î ÀÖÀ¸¸ç,  \n¸¸·áÀÏÀº " +  end_day + " ÀÔ´Ï´Ù");	
			}

		}	
	}
	else if(window.netscape)
	{		
		// dit is belangrijk maar staat nergens duidelijk vermeld:
		// you have to sign the code to enable this, or see notes below
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

		// maak een interface naar het clipboard
		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) return;

		// maak een transferable
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return;

		// specificeer wat voor soort data we op willen halen; text in dit geval
		trans.addDataFlavor('text/unicode');

		// om de data uit de transferable te halen hebben we 2 nieuwe objecten nodig om het in op te slaan
		var str = new Object();
		var len = new Object();

		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);

		var copytext=data;
		
		str.data=copytext;

		trans.setTransferData("text/unicode",str,copytext.length*2);

		var clipid=Components.interfaces.nsIClipboard;

		if (!clip) return false;

		clip.setData(trans,null,clipid.kGlobalClipboard);

		if(end_day == '')
		{
			alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.");
		}
		else
		{
			if(validate == 0)
			{
				alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\n\nº» ÄÁÅÙÃ÷´Â Á¤º¸ÀÇ ÃÖ½Å¼ºÀ» º¸ÀåÇÏ±â À§ÇÑ \nÀ¯È¿±â°£ÀÌ ¼³Á¤µÇ¾î ÀÖÀ¸¸ç,  \n¸¸·áÀÏÀº " +  end_day + " ÀÔ´Ï´Ù");	
			}
			else
			{
				alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\n\nº» ÄÁÅÙÃ÷´Â Á¤º¸ÀÇ ÃÖ½Å¼ºÀ» º¸ÀåÇÏ±â À§ÇÑ \nÀ¯È¿±â°£("+ validate +"ÀÏ)ÀÌ ¼³Á¤µÇ¾î ÀÖÀ¸¸ç,  \n¸¸·áÀÏÀº " +  end_day + " ÀÔ´Ï´Ù");	
			}

		}
	}
}



/************* µ¿¿µ»ó ÆÛ°¡±â ±â´É ******************/
function addToClipBoardVod(data, width, height)
{
	var data;	
	var _obj = "<embed src='"+data+"' width='"+width+"' height='"+height+"' autoplay=true type=video/x-ms-asf-plugin></embed>";
	
	if (window.clipboardData)
	{ 
		clipboardData.setData('Text', _obj);
		//	alert(data + "ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.");
		
		
		alert("µ¿¿µ»óÀÌ º¹»çµÇ¾ú½À´Ï´Ù.");	
	}
	else if(window.netscape)
	{		
		// dit is belangrijk maar staat nergens duidelijk vermeld:
		// you have to sign the code to enable this, or see notes below
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

		// maak een interface naar het clipboard
		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) return;

		// maak een transferable
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return;

		// specificeer wat voor soort data we op willen halen; text in dit geval
		trans.addDataFlavor('text/unicode');

		// om de data uit de transferable te halen hebben we 2 nieuwe objecten nodig om het in op te slaan
		var str = new Object();
		var len = new Object();

		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);

		var copytext=_obj;
		
		str.data=copytext;

		trans.setTransferData("text/unicode",str,copytext.length*2);

		var clipid=Components.interfaces.nsIClipboard;

		if (!clip) return false;

		clip.setData(trans,null,clipid.kGlobalClipboard);

		
		alert("µ¿¿µ»óÀÌ º¹»çµÇ¾ú½À´Ï´Ù.");
			
	}
}


/************* ÇÁ¸°Æ® ÇÏ±â ±â´É  ******************/
function printContentHTML()
{
	var obj = document.getElementById("printbox_kor");
	if(obj)
	{			
		var form = document.content_print_form;	
		form.content.value = obj.innerHTML;		
		
		var screen_width	= screen.availWidth;
		var screen_height	= screen.availHeight;
		var pop_width			= 684;
		var pop_height		= 600;
		var top					= (screen_height - pop_height) / 2;	
		var left					= (screen_width - pop_width) / 2;	
		var param = "scrollbars=yes, width=" + pop_width + ", height=" + pop_height + ", top=" + top + ", left=" + left;	
		
		window.open("about:blank", "_pchtml_", param);	
		
		
		form.target = "_pchtml_";
		form.submit();			
	}
	else
	{
		alert("ÄÁÅÙÃ÷ ¿µ¿ªÀÌ ¾ø½À´Ï´Ù.");
	}	
}

function viewCompany(code)
{
	
	if(code != ""){
		document.form1.action = "/about/company/company_view.jsp";
		if(typeof(mailForm) != 'undefined') 
		document.form1.print.value = "";
		document.form1.cmd.value = "companyView";
		document.form1.com_code.value = code;
		document.form1.submit();
		return true;
	}
	else {
		alert("ÁØºñÁßÀÔ´Ï´Ù.");
		return;
	}
}



/********************************************************************
*  Function Name		: resizeFrame
*  Description			: ¾ÆÀÌÇÁ·¹ÀÓ ÀÚµ¿ »çÀÌ
*  Input Data			: tagURL
*  Output Data			: None
*  »ç¿ëµÇ´Â Function 		: None
/********************************************************************/

function resizeFrame(){
		var oBody = iframe_event.document.body;
		var oFrame = document.all("iframe_event");
		oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
		oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
}



/* --------------------------------------------- 
 * ÇÔ¼ö¸í : checkSpecialChar 
 * ¼³  ¸í : Æ¯¼ö¹®ÀÚ Ã¼Å©  URI·ÎÄÉÀÌ¼Ç ÆÄ¶ó¹ÌÅÍ °ª Ã¼Å© 
 * ¿¹) if(!checkSpecialChar()) return; 
 ---------------------------------------------*/ 
function checkSpecialChar(Chk){ 

    if(Chk.search(/[?]/) >= 0) { 
//      alert("¹®ÀÚ¿­¿¡ Æ¯¼ö¹®ÀÚ( \",  ',  <,  > )°¡ ÀÖ½À´Ï´Ù.\nÆ¯¼ö¹®ÀÚ¸¦ Á¦°ÅÇÏ¿© ÁÖ½Ê½Ã¿À!");         
      return true;
      } else { return false; }
} 


/********************************************************************
*  Function Name		: LocationSetting
*  Description			: uri ·ÎÄÉÀÌ¼Ç ¼ÂÆÃ 
*  Input Data			: tagURL
*  Output Data			: None
*  »ç¿ëµÇ´Â Function 		: None
/********************************************************************/

function LocationSetting(uri,param,val){

 	var Chars = checkSpecialChar(uri);   	
	  if(Chars == true){ // ÆÄ¶ó¹ÌÅÍ °ªÀÌ ÀÖÀ¸¸é 
	  	uri= replaceAll(uri,"~@~","&");	  
		//location.href=uri.replace(" ","")+"&section="+param+"&from="+val;
		location.href=uri +"&section="+param+"&from="+val;
	  } else {    // ÆÄ¶ó¹ÌÅÍ °ªÀÌ ¾øÀ¸¸é 
		//location.href=uri.replace(" ","")+"?section="+param+"&from="+val;
		location.href= uri +"?section="+param+"&from="+val;
	 }
}

/* --------------------------------------------- 
 * ÇÔ¼ö¸í : replaceAll 
 * ¼³  ¸í : strTemp ¹®ÀÚ¿­ ¿øº», strValue1 :Ã£À» ¹®ÀÚ , strValue2: ¹Ù²Ü ¹®ÀÚ
 * »ç¿ë¿¹) replaceAll(uri,"~@~","&");
 ---------------------------------------------*/ 
function replaceAll(strTemp, strValue1, strValue2) {

    strTemp = strTemp.replace(new RegExp(strValue1, "g"), strValue2);

    return strTemp;

}


/********************************************************************
*  Function Name		: FontSetting
*  Description			: ±ÛÀÚÅ©±â,»ö»ó, ¹è°æ»ö Á¶Àý  
*  Input Data			: 
*  Output Data			: None
*  »ç¿ëµÇ´Â Function 		: None
/********************************************************************/

    function FontSetting(opt,val) {
      var mystyle=document.all.TextMain.style;
      var mystyle01=document.all.left.style;
      var mystyle02=document.all.wrapperAll.style;
	  var mystyle03=document.all.className;

      switch(opt) {
        case 1:
          mystyle.fontSize=val;
          mystyle01.fontSize=val;     
          mystyle02.fontSize=val;
		  break;
        case 2:
          
		  mystyle03="AllFont_"+val;
          break;
        case 3:
          mystyle02.backgroundColor=val;     
          mystyle01.backgroundColor=val;
          mystyle.backgroundColor=val;
          break;
      }
    }

/********************************************************************
*  Function Name		: FontSetting
*  Description			: ±ÛÀÚÅ©±â,»ö»ó, ¹è°æ»ö Á¶Àý  
*  Input Data			: 
*  Output Data			: None
*  »ç¿ëµÇ´Â Function 		: None
/********************************************************************/


  function printPopUp(oneDepthName) {
  	window.open("/common/inc/print.jsp?oneDepthName="+oneDepthName,"Print_Pop","width=800,height=600,status=no,menubarno,scrollbars=yes,resize=1,resizable=1,top=0,left=0");
  }


/********************************************************************
*  Function Name		: goMenu
*  Description			: ¸Þ´ºÀÌµ¿ ½ºÅ©¸³Æ®
*  Input Data			: 
*  Output Data			: None
*  »ç¿ëµÇ´Â Function 		: None
/********************************************************************/

function goMenu( PageCode, param, value ) {	
	
	if (PageCode=="S08020000") LocationSetting ('/util/sitemap.jsp', param , value);																//»çÀÌÆ®¸Ê
	
	/* ¸ÂÃã¸Þ´º  ¹Ù·Î°¡±â */
	else 	if (PageCode=="S03010100") LocationSetting ('/recruit/notice/notice_list.jsp', param , value );										//Ãë¾÷ÁØºñ > Ã¤¿ë°ø°í 
	else 	if (PageCode=="S03030400") LocationSetting ('/recruit/guide/company/company_list.jsp', param , value ); 							//Ãë¾÷ÁØºñ > Áö¿øÈ¸»ç ¹Ù·Î¾Ë±â 
	else 	if (PageCode=="S03030300") LocationSetting ('/recruit/guide/job/job_list.jsp', param , value); 										//Ãë¾÷ÁØºñ > Á÷¹«¼Ò°³ 
	else 	if (PageCode=="S07060000") LocationSetting ('/lgstory/advice/advice_list.jsp', param , value); 										//Ãë¾÷ÁØºñ > ÀÔ»ç Advice 

	else 	if (PageCode=="S04010100") LocationSetting ('/press/lgnews/news/news_list.jsp', param, value); 									//LG¼Ò°³ > º¸µµÀÚ·á 
	else 	if (PageCode=="S04010300") LocationSetting ('/press/lgnews/media/media_list.jsp', param , value); 								//LG¼Ò°³ > µ¿¿µ»ó ´º½º
	
	else 	if (PageCode=="S07010000") LocationSetting ('/lgstory/with/with_list.jsp', param , value);  										//LG½ºÅä¸® > LG¿Í ÇÔ²²ÇÏ´Â ÀÌ¾ß±â
	else 	if (PageCode=="S07020000") LocationSetting ('/lgstory/product/product_list.jsp', param , value);  									//LG½ºÅä¸® > Á¦Ç°µéÀÇ ÀÌ¾ß±â
	else 	if (PageCode=="S07030000") LocationSetting ('/lgstory/people/people_list.jsp', param , value);  									//LG½ºÅä¸® > LGÀÎÀÇ ÀÌ¾ß±â
	else 	if (PageCode=="S07040000") LocationSetting ('/lgstory/picture/picture_list.jsp', param , value);  									//LG½ºÅä¸® > ±×¸²ÀÌ ÀÖ´Â ÀÌ¾ß±â	
	else 	if (PageCode=="S05040100") LocationSetting ('/social/news/news_list.jsp', param , value); 										//»çÈ¸°øÇå > ³ª´®´º½º

	else 	if (PageCode=="S02080000")  LocationSetting ('/about/history/history01.jsp', param , value); 										//LG¿ª»ç > ¿ª»ç 
 	
	/* À¯Æ¿¸®Æ¼ */	
	else 	if (PageCode=="S08060100")  LocationSetting ('/util/newsletter/newsletter01.jsp', param , value); 									//´º½º·¹ÅÍ ½ÅÃ» 	
	else 	if (PageCode=="S08070000")  LocationSetting ('/util/legal.jsp', param , value);  													//¹ýÀû°íÁö
	else 	if (PageCode=="S08080000")  LocationSetting ('/util/privacy.jsp', param , value);  												//°³ÀÎÁ¤º¸º¸È£Á¤Ã¥ 
	else 	if (PageCode=="S08090000")  LocationSetting ('/util/email.jsp', param , value); 													//ÀÌ¸ÞÀÏÁÖ¼Ò ¹«´Ü¼öÁý°ÅºÎ	
	
	/* °í°´ Áö¿ø */
	else 	if (PageCode=="S08010202")  LocationSetting ('/util/widget/customer/webmaster.jsp', param ,value); 										//À¥ ¿î¿µÀÚ¿¡°Ô ¹®ÀÇÇÏ±â 
	else 	if (PageCode=="S06060000")  LocationSetting ('/investor/contact/contact.jsp', param, value); 											//IR ¹®ÀÇÇÏ±â  	
	else 	if (PageCode=="S08010203")  LocationSetting ('/util/widget/customer/faq.jsp', param , value ); 											//FAQ º¸±â 	

	/* °è¿­»ç */
	else 	if (PageCode=="S02070100")  LocationSetting ('/about/company/company_list.jsp', param ,value); 										//°è¿­»ç
	
}

//¿µ¹®»çÀÌÆ® ¹Ù·Î°¡±â
function goEng(){
	
	if(dom.indexOf("with") > -1) { //ÅØ½ºÆ®¸ðµå¿¡¼­ ¿Ô´ÂÁö
		val = "obj_eng_kortext";
	} else{					  //±×·¡ÇÈ¸ðµå¿¡¼­ ¿Ô´ÂÁö	
		val = "obj_eng_kor";
     }
	var link="http://www.lg.net/?from=util&section="+ val ;	
	
	openwindow(link, 'winEnglish','' );
	
}


//Å¸ÀÌÆ² ¸ÞÅ¸ÅÂ±× º¯°æ
function SetMetaTag(menu) {

	if(menu=="01") document.title="LG Always on your side";
	if(menu=="02") document.title="LG>LG¼Ò°³";
	if(menu=="03") document.title="LG>ÀÎÀçÃ¤¿ë";
	if(menu=="04") document.title="LG>´º½º.±¤°í";
	if(menu=="05") document.title="LG>»çÈ¸°øÇå";
	if(menu=="06") document.title="LG>ÅõÀÚÁ¤º¸";
	if(menu=="07") document.title="LG>LGÀÌ¾ß±â";
	if(menu=="08") document.title="LG>±âÅ¸";

}

//LGÀÌ¾ß±â ¸Þ´º
function goStoryMenu( PageCode, param, value ) {
	if (PageCode=="S07010000") LocationSetting ('/lgstory/with/with_list.jsp', param , value);  						//LG½ºÅä¸® > LG¿Í ÇÔ²²ÇÏ´Â ÀÌ¾ß±â
	else if (PageCode=="S07020000") LocationSetting ('/lgstory/product/product_list.jsp', param , value);  		//LG½ºÅä¸® > Á¦Ç°µéÀÇ ÀÌ¾ß±â
	else	if (PageCode=="S07030000") LocationSetting ('/lgstory/people/people_list.jsp', param , value);  		//LG½ºÅä¸® > LGÀÎÀÇ ÀÌ¾ß±â
	else	if (PageCode=="S07040000") LocationSetting ('/lgstory/picture/picture_list.jsp', param , value);  		//LG½ºÅä¸® > ±×¸²ÀÌ ÀÖ´Â ÀÌ¾ß±â
	else	if (PageCode=="S07050000") LocationSetting ('/lgstory/friend/friend_list.jsp', param , value);  			//LG½ºÅä¸® > ÁÁÀºÄ£±¸
	else 	if (PageCode=="S07060000") LocationSetting ('/lgstory/advice/advice_list.jsp', param , value); 			//LG½ºÅä¸® > ÀÔ»ç¾îµå¹ÙÀÌ½º
}
	
//¸ÞÀÎº¸µµÀÚ·á
function goNews(link, param, value ){
	LocationSetting (link, param , value);	
}

//¸ÞÀÎ ÅÂ±× ¹Ù·Î°¡±â
function goTag(link, param, value) {
	
	LocationSetting (link, param, value);
}

//LG½ºÅä¸® ¹Ù·Î°¡±â
function goStory(link, param, value ){
	LocationSetting (link, param , value);	
}

//°ü·Ã¸µÅ© ¹Ù·Î°¡±â
function goRelation(link, param, value, target ){
	if (target=='1')	 openwindow(link, 'winRelation','' );
	else LocationSetting (link, param , value);
}

//ºÎ°¡¼­ºñ½º ¹Ù·Î°¡±â(»õÃ¢)
function goService(link){
	if (link=="" || link==null) {
	} else {		
		if(link.indexOf("http://") < 0) {
			link = "http://" + link;
		}	
		openwindow(link, 'winService','' );
	}
}

//°í°´Áö¿ø ¹Ù·Î°¡±â(»õÃ¢)
function goCustomer(link){
	if (link=="" || link==null) {
	} else {		
		if(link.indexOf("http://") < 0) {
			link = "http://" + link;
		}	
		openwindow(link, 'winCustomer','' );
	}
}

//»çÀÌÆ®¸Ê ¹Ù·Î°¡±â
function goSitemap() {	
	LocationSetting ("/util/sitemap.jsp", 'obj_sitemap', 'util');
}

//°è¿­»ç ¹Ù·Î°¡±â(»õÃ¢)
function goCompany(link){	
	
	if (link=="" || link==null) {
	} else {		
		if(link.indexOf("http://") < 0) {
			link = "http://" + link;
		}	
		openwindow(link, 'winCompany','' );
	}
}

//Á¦Ç°Ã£±â ¹Ù·Î°¡±â(»õÃ¢)
function goProduct(link){
	if (link=="" || link==null) {
	} else {		
		if(link.indexOf("http://") < 0) {
			link = "http://" + link;
		}	
		openwindow(link, 'winProduct','' );
	}
}

//ÇÖÀÌ½´ ¹Ù·Î°¡±â
//target °ªÀÌ 1ÀÏ¶§´Â »õÃ¢À¸·Î ¶ç¿ì°í 0ÀÏ¶§´Â ÆäÀÌÁö·Î ¸µÅ© °Ç´Ù
function goImageLink(link, param, value, target, props){	
	if (target==1)	 openwindow(link, 'winIssue',props);
	else LocationSetting (link, param , value);
}

//RSS ±¸µ¶ (ÆË¾÷)
function goRss(param, value){	
	pop_scroll('/util/rss.jsp?section='+param+'&from='+ value ,570,500);
}

//½ºÅ©¸°¼¼ÀÌ¹ö ¹× ¿ùÆäÀÌÆÛ (ÆË¾÷)
function goWallpaper(param, value){	
	pop('/util/screensaver/download.jsp?section='+param+'&from='+ value ,722,740)
}

//ÀÌ¸ÞÀÏ ¹«´Ü¼öÁý °ÅºÎ (ÆË¾÷)
function goEmail(param, value){	
	//openwindow('/util/email.jsp?section='+param+'&from='+ value , 'winEmail', 'width=416, hight=250')	;
	openwindow('/util/email.jsp?section=obj_email&from=util','email','width=416,height=250')
}

//LG¿ª»ç > »çÀÌ¹ö¿ª»ç°ü (»õÃ¢)
function goHistory(){
	openwindow('http://www.lghistory.com/?section=obj_history&from=util', 'winHistory','' );	
}
//LG¿ª»ç > LG60³â»ç e-book (»õÃ¢)
function goEbook(){
	 openwindow('http://www.lghistory.com/LG_60_0405/autorun.html?section=obj_ebook&from=util', 'winEbook','' );											
}

//LG¿ª»ç > Virtual Museum(»õÃ¢)
function goMuseum(){
	openwindow('http://www.lghistory.com/jsp/virtual/virtual_museum.jsp?section=obj_museum&from=util', 'winMuseum', 'width=760, height=559') ;
}
	
/********************************************************************************/
/**
 * ¹®ÀÚ¿­ÀÇ leftÂÊ trim()
 * @return trimµÈ ¹®ÀÚ¿­
 */
function ltrim(str)
{
    var i;
    var ch;
    var retStr = '';
    if (str.length == 0)
        return str;
    for (i = 0; i < str.length; i++)
    {
        ch = str.charAt(i);
        if (retStr.length == 0 && (ch == ' ' || ch == '\r' || ch == '\n'))
            continue;
        retStr += ch;
    }
    return retStr;
}

/**
 * ¹®ÀÚ¿­ÀÇ rightÂÊ trim()
 * @return trimµÈ ¹®ÀÚ¿­
 */
function rtrim(str)
{
    var i;
    var ch;
    var retStr = '';
    if (str.length == 0)
        return str;
    for (i = str.length - 1; i >= 0; i--)
    {
        ch = str.charAt(i);
        if (ch != ' ' && ch != '\r' && ch != '\n')
        {
            break;
        }
    }
    retStr = str.substring(0, i + 1);
    return retStr;
}

/**
 * ¹®ÀÚ¿­ÀÇ ¾çÂÊ trim()
 * @return trimµÈ ¹®ÀÚ¿­
 */
function trim(str)
{
    var retStr;
    retStr = ltrim(str);
    retStr = rtrim(retStr);
    return retStr;
}

/**
 * ¹®ÀÚ¿­Ä¡È¯
 * @return trimµÈ ¹®ÀÚ¿­
 */
function replaceStr(str, oldstr, newstr)
{
    var index = 1;
    var temp = String(str);

    if (newstr == null)
        newstr = "";

    while (index > 0)
    {
        temp = temp.replace(oldstr, newstr);
        index = temp.indexOf(oldstr);
    }

    return temp;
}


/****************************************/
function checkEmail( emailbox ) {
    emailbox.value = alltrim(emailbox.value);

    if (emailbox.value.length == 0) {
        alert("ÀüÀÚ¿ìÆíÀ» ÀÔ·ÂÇÏÁö ¾Ê¾Ò½À´Ï´Ù.");
        //emailbox.focus();
        return false;
    }

    if (isAllowStr(emailbox.value, "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@.-_") == false) {
        alert("ÀüÀÚ¿ìÆí¿¡´Â ¿µ¹®°ú ¼ýÀÚ - _ . @¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
        return false;
    }

    var atCnt = 0;
    var dotCnt = 0;
    for (i = 0; i < emailbox.value.length ; i++) {
        ch = emailbox.value.charAt(i);
        if (ch == "@")
            atCnt++;
        if (ch == ".") {
            dotCnt++;
        }
    }

    if (atCnt != 1 || dotCnt < 1 || ((/(\w+)@(\w+)\.(\w+)/).test(emailbox.value) == false)) {
        alert ("À¯È¿ÇÏÁö ¾ÊÀº ÀüÀÚ¿ìÆíÀÔ´Ï´Ù.  ¿¹) aaa@bbb.com");
        //emailbox.focus();
        return false;
    }

    var atIndex = 0;
    atIndex = emailbox.value.indexOf("@");

    if (atIndex <= 0 || ((/(\w+)@(\w+)\.(\w+)/).test(emailbox.value) == false)) {
        alert ("À¯È¿ÇÏÁö ¾ÊÀº ÀüÀÚ¿ìÆíÀÔ´Ï´Ù.  ¿¹) aaa@bbb.com");
        //emailbox.focus();
        return false;
    }

    return true;
}

function isAllowStr(str, allowStr) {
    var i;
    var ch;
    for (i=0;i<str.length;i++) {
        ch = str.charAt(i);
        if (allowStr.indexOf(ch) < 0) {
            return false;
        }
    }
    return true;
}

function alltrim(str) {
    var i;
    var ch;
    var retStr = '';
    var retStr1 = '';
    if (str.length == 0)
        return str;
    for (i=0;i<str.length;i++) {
        ch = str.charAt(i);
        if (ch == ' ' || ch == '\r' || ch == '\n')
            continue;
         retStr += ch;
    }
    return retStr;
}

	
/*** ±ÛÀÚÅ©±â, ±ÛÀÚ»ö»ó, ¹è°æ»ö ÄíÅ° »èÁ¦ ***/
function move_exit () 
{
	if ( self.screenTop > 9000 ) 
	{
		deleteCookie('LGTextKey');
		// ºê¶ó¿ìÀú ´ÝÈû
	}
	else
	{
		if ( document.readyState == 'complete' ) 
		{
			// »õ·Î°íÄ§
		} 
		else if ( document.readyState == 'loading' )
		{
			// ´Ü¼ø·Îµù     
		} 
		else 
		{
			// ´Ù¸¥»çÀÌÆ®·Î ÀÌµ¿
			try 
			{
			logOff ( 'move' );
			}
			catch ( e ) {}
		}
	}
}

/*** À§Á¬ ¿­¾îº» ÆäÀÌÁö ¸ñ·Ï ÄíÅ° »èÁ¦ ***/
function flash_move_exit()
{
	if ( self.screenTop > 9000 ) 
	{
		deleteCookie('flash_link_list');
		// ºê¶ó¿ìÀú ´ÝÈû
	}
	else 
	{
		if ( document.readyState == 'complete' ) 
		{
			// »õ·Î°íÄ§
		} 
		else if ( document.readyState == 'loading' )
		{
			// ´Ü¼ø·Îµù     
		}
		else
		{
			// ´Ù¸¥»çÀÌÆ®·Î ÀÌµ¿
			try
			{			
				logOff ( 'move' );
			}
			catch ( e ) 
			{

			}
		}
	}
}


/*** ÄíÅ° »èÁ¦ ***/
function deleteCookie( cookieName )
{
	var expireDate = new Date();

	//¾îÁ¦ ³¯Â¥¸¦ ÄíÅ° ¼Ò¸ê ³¯Â¥·Î ¼³Á¤ÇÑ´Ù.
	expireDate.setDate( expireDate.getDate() - 1 );
	document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
}



function popMail(tid, type) 
{
	window.open('/util/email_check.jsp?cmd=noSpam&tid='+tid+'&type='+type,'noSpam','width=457,height=311');
}

/** XSS º¸¾ÈÃ³¸® **/
function removeTag(obj)
{ 	
	var description = obj.value;
	var re = /\r\n/g;	
	description = description.replace(re, "@@@");	
	re = /<\s*script.+?<\/\s*script\s*>/gi;	
 	description = description.replace(re, "");  	       
   	re = /eval\((.*)\)/gi;   
    	description = description.replace(re, "");      
 	re = /</g;
 	description = description.replace(re, "&lt;");
 	re = />/g;
 	description = description.replace(re, "&gt;"); 	
 //	re = /'/g;
// 	description = description.replace(re, "''"); 	 	
	re = /@@@/g;
 	description = description.replace(re, "\r\n"); 	 	      
  
  	obj.value = description;  	
}

/** À§Á¬ °ü·Ã ½ºÅ©¸³Æ® **/

/* À§Á¬ ÄÁÆ®·Ñ */
/*document.getElementById function*/
function dEI(idString){
	return document.getElementById(idString);
}

function doChangeFlashDivHeight(gnbHeight){
	dEI("gnbArea").style.height =gnbHeight+"px";
}

function widgetArea(Height_size){
	var Fh=new Number(Height_size);
	dEI("widgetBox").style.height =Fh+"px";
}

function doBrowerIsTop(){
	window.scrollTo(0,0);
}

/* À§Á¬ ÄÁÆ®·Ñ·¯ */
function widget_control(num){
	document.body.onclick="";
	widgetEI.obj().browerToFlashControll(num);	
	document.getElementById("hidForm").src="/util/widget/widget_hit.jsp?section="+ getObjectName(num) +"&from=widget" ;
}

/* À§Á¬ Å¬¸¯ ÆÄ¶ó¹ÌÅÍ - ¿ÍÀÌÁî·Î±× ¿¬µ¿¿ë */
function getObjectName(num) {	
	var objname;
	switch(num) {
        case "10" :
          objname="obj_product";
		  break;
        case "15" :
          objname="obj_customer";
          break;
        case "20" :
          objname="obj_company";
          break;
       case "25" :
          objname="obj_added";
          break;
       case "30" :
          objname="obj_issue";
          break;
       case "35" :
          objname="obj_issue";
          break;
      }
      return objname;
}

function doWidgetClose(){
	document.body.onclick=function(){
		if(window.navigator.appName == "Netscape"){
		dEI("widgetBox").onblur=function(){
			widgetEI.obj().browerToFlashControll();
			}
		}else{
			widgetEI.obj().browerToFlashControll();
		}
	}
}

function doFirstChild(useID, tagName, itemNum){
	liEl = document.getElementById(useID).getElementsByTagName(tagName);
	if (liEl.item(itemNum)) {
		liEl.item(itemNum).className += " first-child";
	}
}

// ÀÌ¹ÌÁö ·Ñ¿À¹ö
function imgRollover(imgBoxID){
	var MenuCounts = document.getElementById(imgBoxID).getElementsByTagName("img");
	for (i=0;i<MenuCounts.length;i++) {
		var numImg=MenuCounts.item(i);
		var ImgCheck = numImg.src.substring(numImg.src.length-6,numImg.src.length);
		if (ImgCheck!="on.gif") {
				numImg.onmouseover = function () {
					this.src = this.src.replace(".gif", "on.gif");
				}
				numImg.onmouseout = function () {
					this.src = this.src.replace("on.gif", ".gif");
				}
			}
	}
}