//À§·Î °¡´Â ½ºÅ©·Ñ ¸Þ´º Àû¿ë =---------------->
var wndUserREQ;
var delay = 50;

var orgX = 0;
var orgY = 0;

var theTableObj  = null;

var offSetX = "";
var offSetY = "";

var tableHspace = 400;
var tableVspace = 830;

var minSize = 1;
var curSize = 5;
var optCnt  = 10;

function Layerinit()
{
	if (window.document.layers) {
		theTableObj  = window.document.GoTopMenu;
		
		offSetX = "window.pageXOffset";
		offSetY = "window.pageYOffset";

	} else if (window.document.all) {
		theTableObj  = window.document.all.GoTopMenu;

		offSetX = "window.document.body.scrollLeft";
		offSetY = "window.document.body.scrollTop";
	}

	setPosition();
}

function setPosition()
{
	var curX = eval(offSetX)+tableVspace;
	var curY = eval(offSetY)+tableHspace;

	if ((curX==orgX) && (curY==orgY)) {
		window.setTimeout("setPosition()",delay);
		return;
	}

	if (window.document.all) {
		theTableObj.style.pixelLeft = curX;
		theTableObj.style.pixelTop  = curY;
	} else if (window.document.layers) {
		theTableObj.left = curX;
		theTableObj.top  = curY;
	}

	orgX = curX;
	orgY = curY;
	
	window.setTimeout("setPosition()",delay);
}

//0000000000000000000000000000000000000000000000

//--------------------------------------------->


//--Æ®¸® ±¸Á¶-->
ok=0; old_what="non";

function show(what){
  if((old_what != "non") && (what != old_what)){
 ok=1;

 old_what.style.display="none";
 what.style.display="";
  }else
  {
 if(ok){
  ok=0;
  what.style.display="none";
 }else
 {
  ok=1;
  what.style.display="";
 }
  }
  old_what=what;
}
//Æ®¸® ±¸Á¶-->

//ÅÇ ±¸Á¶ -->
meok =0; old_me = "non";

function showtap(meme) {
 
 if((old_me != "non") && (meme != old_me)) {
		meok = 1;
		old_me.style.display = "none";
		meme.style.display = "";
	}
	else {
		meok = 1;
		meme.style.display = "";
		}
		old_me = meme;	
}
// ÅÇ ±¸Á¶-->
// Æû ¸®¼Â ------------------------>
function fnc_reset(frm) {
	frm.reset();
}
// Æû ¸®¼Â ³¡---------------------->
// ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ°Ô ÇÏ±â ---------->
function OnlyNumber()
{
	if ((event.keyCode<48)||(event.keyCode>57)) event.returnValue=false;
}
//¼ýÀÚ¸¸ ÀÔ·Â ³¡ ----------------->

//»ç¾÷ÀÚ µî·Ï¹øÈ£ Ã¼Å© ----------->

function check_busino(vencod) { 
       var sum = 0; 
       var getlist =new Array(10); 
       var chkvalue =new Array("1","3","7","1","3","7","1","3","5"); 
       for(var i=0; i<10; i++) { getlist[i] = vencod.substring(i, i+1); } 
       for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; } 
       sum = sum + parseInt((getlist[8]*5)/10); 
       sidliy = sum % 10; 
       sidchk = 0; 
       if(sidliy != 0) { sidchk = 10 - sidliy; } 
       else { sidchk = 0; } 
       if(sidchk != getlist[9]) { return false; } 
       return true; 
}
//»ç¾÷ÀÚ µî·Ï¹øÈ£ ³¡ -------------->

//popup ¶ç¿ì±â -------------------->
function wopen(url, t, w, h) {
var sw;
var sh;

sw = (screen.Width - w) / 2;
sh = (screen.Height - h) / 2;

window.open(url, t, 'Width='+w+'px, Height='+h+'px, Left='+sw+', Top='+sh);
}
//popup ¶ç¿ì±â ³¡ ----------------->

//ÄíÅ° °ü·Ã ----------------------->
/*
function ClearCookie(name) {
		expireDate = new Date
		expireDate.setDate(expireDate.getDate() -1)
		
		document.cookie  = "ssl=;expires="+expireDate.toGMTString()
	}
	
function setCookie( name, value, expiredays ) { 
		var todayDate = new Date(); 
        todayDate.setDate( todayDate.getDate() + expiredays ); 
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
	} 
	
	
function getCookie( name ) { 
    var nameOfCookie = name + "="; 
    var x = 0; 
    while ( x <= document.cookie.length ) { 
		var y = (x+nameOfCookie.length); 
            if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
                if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                    endOfCookie = document.cookie.length; 
					return unescape( document.cookie.substring( y, endOfCookie ) ); 
                } 
                x = document.cookie.indexOf( " ", x ) + 1; 
            if ( x == 0 ) 
                break;
    } 
    return ""; 
} 
*/

// ÀÚµ¿ tab Ã³¸®
var isNN = (navigator.appName.indexOf("Netscape")!=-1);

function autoTab(input,len, e) {
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode)) {
	input.value = input.value.slice(0, len);
	input.form[(getIndex(input)+1) % input.form.length].focus();
	}
function containsElement(arr, ele) {
	var found = false, index = 0;
	while(!found && index < arr.length)
	if(arr[index] == ele)
		found = true;
	else
		index++;
	return found;
}

function getIndex(input) {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
	if (input.form[i] == input)index = i;
	else i++;
	return index;
}
return true;
}

function MsgOut()
{
	alert("ÁØºñÁßÀÔ´Ï´Ù.");
}

function PopMap(sParameter)
{
	//var sParameter = '<%=GetEncode%>'
	//var URL = "http://mapasp.almap.co.kr/UpdateReq/pop_mapmodi.asp?sVal="+ sParameter;
	//window.showModalDialog(URL, 'UserREQ', 'dialogHeight:580px; dialogWidth:1010px');	
	var URL;	
	document.getElementById("layerPopup").style.display = "block";
//	URL = "http://mapasp.almap.co.kr/UpdateReq/pop_mapmodi_v3.asp?sVal="+ sParameter;
//	window.open(URL, 'UserREQ', 'scrollbars=no, location=no, directories=no, width=1010, height=600, menubar=no, toolbar=no,status=no,left=0,top=0');
//	wndUserREQ.focus();
}

function PopMap_v2(sParameter)
{
	//var sParameter = '<%=GetEncode%>'
	//var URL = "http://mapasp.almap.co.kr/UpdateReq/pop_mapmodi.asp?sVal="+ sParameter;
	//window.showModalDialog(URL, 'UserREQ', 'dialogHeight:580px; dialogWidth:1010px');	
	var URL;	
	URL = "http://mapasp.almap.co.kr/UpdateReq/pop_mapmodi_v3.asp?sVal="+ sParameter;
	alert("¾÷µ¥ÀÌÆ® ÁØºñÁßÀÔ´Ï´Ù.");
//	window.open(URL, 'UserREQ', 'scrollbars=no, location=no, directories=no, width=1010, height=600, menubar=no, toolbar=no,status=no,left=0,top=0');
//	wndUserREQ.focus();
}


function fnc_Check2( sGubnCode, sLogin, sRegister, sFile) 
{

	if (sLogin == "") 
	{
		alert('·Î±×ÀÎÀ» ÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		location.href='../../Main/Main/Login.aspx?rurl=../../Update/Product/PDA.aspx';
	}
	else if (sRegister == "0") 
	{
		alert('¾Ë¸ÊÈ¸¿øÀÌÁö¸¸ Á¦Ç°ÀÎÁõÀÌ µÇ¾îÀÖÁö ¾Ê½À´Ï´Ù');
		location.href='../../My/UpdateInfo/Serial_Add.aspx';
	}	
	else if (sRegister == "1")
	{
		if( sGubnCode == '256MB' )
		{
			location.href='http://down.altools.co.kr/P_256Map_'+sFile+'.exe';
		}
		else if( sGubnCode == '512MB' )
		{
			location.href='http://down.altools.co.kr/P_512Map_'+sFile+'.exe';
		}
	}	
	else if (sRegister == "2") 
	{
		alert("Æ÷ÄÏ¾Ë¸ÊNavi Á¤½Ä¹öÀüÀ» À§ÇÑ µ¥ÀÌÅÍ ¾÷µ¥ÀÌÆ®ÀÔ´Ï´Ù.\n\n HV-KH1000 Àü¿ë Æ÷ÄÏ¾Ë¸ÊNavi ¾÷µ¥ÀÌÆ®´Â 1¿ù 25ÀÏ¿¡ Á¦°øµÉ ¿¹Á¤ÀÔ´Ï´Ù!!");				
		
	}	
	else if (sRegister == "3") 
	{
		alert("Æ÷ÄÏ¾Ë¸ÊNavi Á¤½Ä¹öÀüÀ» À§ÇÑ µ¥ÀÌÅÍ ¾÷µ¥ÀÌÆ®ÀÔ´Ï´Ù.\n\n HV-KH1000 Àü¿ë Æ÷ÄÏ¾Ë¸ÊNavi ¾÷µ¥ÀÌÆ®´Â 1¿ù 25ÀÏ¿¡ Á¦°øµÉ ¿¹Á¤ÀÔ´Ï´Ù!!");				
		
		if( sGubnCode == '256MB' )
		{
			location.href='http://down.altools.co.kr/P_256Map_'+sFile+'.exe';
		}
		else if( sGubnCode == '512MB' )
		{
			location.href='http://down.altools.co.kr/P_512Map_'+sFile+'.exe';
		}
	}	
	else
	{
		alert("°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇØ ÁÖ¼¼¿ä.");
	}
}


function fnc_MaxCheck(sGubnCode, sLogin, sRegister, sFile)
{
	if (sLogin == "") 
	{
		alert('·Î±×ÀÎÀ» ÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		location.href='../../Main/Main/Login.aspx?rurl=../../Update/Product/PDA.aspx';
	}
	else if (sRegister == "0") 
	{
		alert('¾Ë¸ÊÈ¸¿øÀÌÁö¸¸ Á¦Ç°ÀÎÁõÀÌ µÇ¾îÀÖÁö ¾Ê½À´Ï´Ù');
		location.href='../../My/UpdateInfo/Serial_Add.aspx';
	}
	else if (sRegister == "1") 
	{
		if( sGubnCode == 'max' )
		{
			location.href='http://down.altools.co.kr/MaxMap_'+sFile+'.exe';
		}				
	}
	else
	{
		alert("°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇØ ÁÖ¼¼¿ä.");
	}
}
//---------------------------------->