var old_menu='';
var Max_MenuNum ;
function menuclick(idx)
{
		Max_MenuNum = img_arr.length;
		var submenu ;
		var cellbar ;
		eval("submenu = submenu" + idx );
		eval("cellbar = bar"+idx );
			
		// view content
		if(old_menu != ''){
			old_menu.style.display="none";
		}
		submenu.style.display="";
		old_menu=submenu;
		// switch bar
		for (i=0; i< Max_MenuNum; i++){
			if (i==idx)  eval("bar"+i+".src = 'http://image.ahnlab.com/v3webhard/user/tab"+img_arr[i]+"_on.gif'");
				else eval("bar"+i+".src = 'http://image.ahnlab.com/v3webhard/user/tab"+img_arr[i]+"_off.gif'");
		}
}

function ViewLayer(){

	if(document.getElementById("Pop1").style.display=="none")	{
	   document.getElementById("Pop1").style.display='inline'
	}else{
	   document.getElementById("Pop1").style.display='none'
	}
	//$("#Pop1").draggable();
	//$("#Pop1").draggable({ containment: 'window', scroll: false });
	$("#Pop1").draggable({ containment: 'document' });
 }

 function ViewLayer2(){

	if(document.getElementById("Pop2").style.display=="none")	{
	   document.getElementById("Pop2").style.display='inline'
	}else{
	   document.getElementById("Pop2").style.display='none'
	}
	//$("#Pop2").draggable();
	$("#Pop2").draggable({ containment: 'document' });
 }

 function ViewLayer3(){

	if(document.getElementById("Pop3").style.display=="none")	{
	   document.getElementById("Pop3").style.display='inline'
	}else{
	   document.getElementById("Pop3").style.display='none'
	}
	//$("#Pop3").draggable();
	$("#Pop3").draggable({ containment: 'document' });
 }


function clrImg(obj) {       

	obj.style.backgroundImage="";obj.onkeydown=obj.onmousedown=null;
}



function file_browse()
{
	document.all.file_1.click();
	document.all.file_1D.value=document.all.file_1.value; 
}

// PNG 파일 투명
function setPNG24(obj) {
    obj.width=obj.height=1;
    obj.className=obj.className.replace(/\bPNG24\b/i,'');
    obj.style.filter =
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    obj.src='';
    return '';
}


//문자열의 byte size를 반환한다!
function getByteLength(s){
   var len = 0;     
   if ( s == null ) return 0;
   for(var i=0;i < s.length; i++) {
      var c = escape(s.charAt(i));
      if ( c.length == 1 ) len ++;
      else if ( c.indexOf("%u") != -1 ) len += 2;
      else if ( c.indexOf("%") != -1 ) len += c.length/3;
   }            
   return len;
}


//서비스 기능 펼치기 감추기
isNS4 = (document.layers) ? true : false;
	isIE4 = (document.all && !document.getElementById) ? true : false;
	isIE5 = (document.all && document.getElementById) ? true : false;
	isNS6 = (!document.all && document.getElementById) ? true : false;
	function getObj(idname) {
		 if (isNS4){
			 elm = document.layers[idname];
		 }
		 else if (isIE4) {
			 elm = document.all[idname];
		 }
		 else if (isIE5 || isNS6) {
			elm = document.getElementById(idname);
		 }
		 return elm;
	}
	
	function toggleTab(tab_id,text_id) {
		var obj =  getObj(tab_id);
		var objText = getObj(text_id);
	
	
		if (obj.style.display == 'block') {
	
			obj.style.display = 'none';
			objText.innerHTML = '<img src="http://image.ahnlab.com/v3webhard/service/btn_useinfo_view.gif" alt="사용방법 보기" />';
		} else {
			obj.style.display = 'block';
			objText.innerHTML = '<img src="http://image.ahnlab.com/v3webhard/service/btn_useinfo_hide.gif" alt="사용방법 닫기" />';
		}
	}



	function TabClick(menuElId,e) { 
		var tabMenu = document.getElementById(menuElId).getElementsByTagName("li");
		for(var i=1;i<=tabMenu.length;i++){ 
			document.getElementById('cont_0'+i).style.display = (e==i)?"block":"none";
			document.getElementById('title_0'+i).className = (e==i)?"on":"";

			if(e==i){
				tabMenu.item(e-1).getElementsByTagName("img").item(0).src = tabMenu.item(e-1).getElementsByTagName("img").item(0).src.replace("_off.gif", "_on.gif");
			}else{
				tabMenu.item(i-1).getElementsByTagName("img").item(0).src = tabMenu.item(i-1).getElementsByTagName("img").item(0).src.replace("_on.gif", "_off.gif");
			}
		}
		if (e == 1) {
			document.getElementById("link_url").href = "http://pc.ahnlab.com/v3webhard_customer/custom_news.do";
		} else {
			document.getElementById("link_url").href = "http://erms.ahnlab.com/selfahn/B2C/FaqList.jsp?subNodeId=NODE0000000114&parentNodeId=NODE0000000002";
		}
	}

function SvcClick(menuElId2,e) { 
		var svcmenu = document.getElementById(menuElId2).getElementsByTagName("li");
		for(var i=1;i<=svcmenu.length;i++){ 
			document.getElementById('svc_cont_0'+i).style.display = (e==i)?"block":"none";
			document.getElementById('svc_title_0'+i).className = (e==i)?"on":"";

			if(e==i){
			svcmenu.item(e-1).getElementsByTagName("img").item(0).src = svcmenu.item(e-1).getElementsByTagName("img").item(0).src.replace("_off.gif", "_on.gif");
			}else{
			svcmenu.item(i-1).getElementsByTagName("img").item(0).src = svcmenu.item(i-1).getElementsByTagName("img").item(0).src.replace("_on.gif", "_off.gif");
			}
		}
	}
	

//플래시 (투명)
function flashOpenTransparent(flashSrc, flashWidth, flashHeight, flashVar){
	var stringVars = flashVar;
	document.write('<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" WIDTH="' + flashWidth + '" HEIGHT="' + flashHeight + '" id="flashObject" swLiveConnect="true"> ');
	document.write('<PARAM NAME=flashVars VALUE="'+ stringVars + '" />');
	document.write('<PARAM NAME=movie VALUE="' + flashSrc + '" />');
	document.write('<PARAM NAME=quality VALUE=high />');
	document.write('<PARAM NAME=menu VALUE=false />');
	document.write('<PARAM NAME=allowScriptAccess VALUE=always />');
	document.write('<PARAM NAME=bgcolor VALUE=#FFFFFF />');
	document.write('<PARAM NAME=wmode VALUE=transparent />');
	document.write('<EMBED src="' + flashSrc + '" flashVars="' + stringVars + '" wmode="transparent" allowScriptAccess="always" quality="high" bgcolor="#FFFFFF"  WIDTH="' + flashWidth + '" HEIGHT="' + flashHeight + '" NAME="flashObject" TYPE = "application/x-shockwave-flash" PLUGINSPAGE = "http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');
}

//도움말 팝업 어픈
function popup_help() {
	window.open('http://v3webhard.ahnlab.com/v3webhard/front/help','help','width=920,height=640');
}

//Footer 셀렉트박스 바로가기
	function go_Family(url) {
	    if(url != "") window.open(url, "", "");
	}

