var stmnLEFT = 920; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
var stmnGAP1 = 171 ; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
var stmnGAP2 = 200; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î ¼¼ÆÃ
var stmnBASE = 55; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡ (¾Æ¹«·¸°Ô³ª ÇØµµ »ó°üÀº ¾øÁö¸¸ stmnGAP1°ú ¾à°£ Â÷ÀÌ¸¦ ÁÖ´Â°Ô º¸±â ÁÁÀ½)
var stmnActivateSpeed = 200; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
var stmnScrollSpeed = 10; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)

var stmnTimer;

function ReadCookie(name) {
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;

while (i < cLen) {
        var j = i + labelLen;

        if (document.cookie.substring(i, j) == label) {
                var cEnd = document.cookie.indexOf(";", j);
                if (cEnd == -1) cEnd = document.cookie.length;
		return unescape(document.cookie.substring(j, cEnd));
        }
		i++;
    }
  return "";
}

function SaveCookie(name, value, expire) {
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
}

function RefreshStaticMenu() {
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

stmnStartPoint = parseInt(STATICMENU.style.top, 10);
stmnEndPoint = document.body.scrollTop + stmnGAP2;
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

stmnRefreshTimer = stmnActivateSpeed;

if ( stmnStartPoint != stmnEndPoint ) {
        stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
        STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
        stmnRefreshTimer = stmnScrollSpeed;
        }
        stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

function ToggleAnimate() {
	if (!ANIMATE.checked) {
		RefreshStaticMenu();
                SaveCookie("ANIMATE", "true", 300);
                } else {
                clearTimeout(stmnTimer);
                STATICMENU.style.top = stmnGAP1;
                SaveCookie("ANIMATE", "false", 300);
        }
}

function InitializeStaticMenu() {
STATICMENU.style.left = stmnLEFT;
	if (ReadCookie("ANIMATE") == "false") {
                ANIMATE.checked = true;
                STATICMENU.style.top = document.body.scrollTop + stmnGAP1;
                } else {
                ANIMATE.checked = false;
                STATICMENU.style.top = document.body.scrollTop + stmnBASE;
                RefreshStaticMenu();
        }
}//·Î±×ÀÎ ´Ü¼ø °æ°íÃ¢
function LoginAlert()
{
	alert("È¸¿øÀü¿ë¼­ºñ½º ÀÔ´Ï´Ù. ·Î±×ÀÎÇÏ¼¼¿ä");
}


// Àü¿ª º¯¼ö
var ErrMsg = "";
var ErrFld;

// ÇÃ·¡½¬¿¢Æ¼ºê¿¢½ºÆÐÄ¡

function writeFlash(url_root, width, height, bgcolor,version, name){
   document.write("<object name='"+name+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \n"
      +" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version+"' \n"
      +" width='"+width+"' height='"+height+"'> \n"
      +"<param name='movie' value='"+url_root+"'>\n"
      +"<param name='quality' value='high'>\n"
      +"<param name='bgcolor' value='"+bgcolor+"'>\n"
      +"<param name='wmode' value='transparent'>\n"
      +"<embed src='"+url_root+"' "
      +" wmode='transparent' quality='high' bgcolor='"+bgcolor+"'  width='"+width+"' height='"+height+"' "
      +" type='application/x-shockwave-flash' "
      +" pluginspage='http://www.macromedia.com/shockwav/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>\n"
      +"</embed></object>\n");
}

//·Î±×ÀÎ °æ°íÃ¢
function GoLogin(url){
	window.alert('·Î±×ÀÎ ÈÄ »ç¿ëÇÏ¼¼¿ä');
	location.href='/Member/Login/Login.php?url='+url;
}

// ÇÊµå °Ë»ç
function FieldCheck(fld, msg){
    if ((fld.value = Trim(fld.value)) == "") 			   
        FieldError(fld, msg);
    else
        FieldClear(fld);
    return;
}

// ÇÊµå ¿À·ù Ç¥½Ã


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function FieldError(fld, msg) {
    if (msg != "")
        ErrMsg += msg + "\n";
    if (!ErrFld) ErrFld = fld;
    fld.style.background = "#BDDEF7";
}

// ÇÊµå¸¦ ±ú²ýÇÏ°Ô
function FieldClear(fld) {
    fld.style.background = "#FFFFFF";
}

//°ø¹é¾ø¾Ö±â
function Trim(s){
	s = s.replace(/^\s*/,'').replace(/\s*$/, '');
	return s;
}

// E-Mail °Ë»ç
function CheckEmail(email) {
    if (email.search(/(\S+)@(\S+)\.(\S+)/) == -1)
        return false;
    else
        return true;
}

// ÁÖ¹Îµî·Ï¹øÈ£ °Ë»ç
function CheckSecurity(j1, j2) {
    if (j1.value.length<6 || j2.value.length<7)
        return false;

    var sum_1 = 0;
    var sum_2 = 0;
    var at=0;
    var juminno= j1.value + j2.value;
    sum_1 = (juminno.charAt(0)*2)+
            (juminno.charAt(1)*3)+
            (juminno.charAt(2)*4)+
            (juminno.charAt(3)*5)+
            (juminno.charAt(4)*6)+
            (juminno.charAt(5)*7)+
            (juminno.charAt(6)*8)+
            (juminno.charAt(7)*9)+
            (juminno.charAt(8)*2)+
            (juminno.charAt(9)*3)+
            (juminno.charAt(10)*4)+
            (juminno.charAt(11)*5);
    sum_2=sum_1%11;

    if (sum_2 == 0)	{ 
		at = 10;
    } 
	else {
        if (sum_2 == 1)
			at = 11;
		else 
            at = sum_2;
    }
    att = 11 - at;
    if (juminno.charAt(12) != att){
        return false;
    }
    return true;
 }

// »õ Ã¢
function WindowPopup(url, winname, opt){
    window.open(url, winname, opt);
}

//°øÁö»çÇ×
function NoticePopup(sort,id){
	var top		=	10;
	var left	=	10;
	var width	=	517;
	var height	=	517;
	var winname	=	'Notice';
	url = "../../Etc/notice/view.php?sort="+sort+"&id=" + id;
	opt = 'scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left;
	WindowPopup(url, winname, opt);	
}

//¿ìÆí¹øÈ£
function ZipPopup(url){
	var top		=	10;
	var left	=	10;
	var width	=	398;
	var height	=	420;
	var winname	=	'ZipCode';
	var opt = 'toolbar=no, location=no, directory=no, status=no, menuber=no, resizable=no, copyhistory=no,scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left;
	WindowPopup(url, winname, opt);	
}

// ¾ÆÀÌµðÆÐ½º¿öµå Ã£±â Ã¢
function IdSearchPopup(){
	var top = 10;
	var left = 10;
	var width = 500;
	var height = 500;
	var url = '/Member/Srch/SearchId.php';
	var winname = 'idpass';
	var opt = 'scrollbars=no,width='+width+',height='+height+',top='+top+',left='+left;
	WindowPopup(url, winname, opt);	
}

// ¸ÞÀÏ »õÃ¢
function FormMailPopup(url, width, height, winname){
	var top		=	10;
	var left	=	10;
	width		=	width+50;
	height		=	height+50;
	var winname	=	'FormMail';
	opt = 'scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left;
	WindowPopup(url, winname, opt);	
}

// Å«ÀÌ¹ÌÁö Ã¢
function LargeImagePopup(url, width, height, winname){
	var top = 10;
	var left = 10;
	width = width + 50;
	height = height + 50;
	opt = 'scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left;
	WindowPopup(url, winname, opt);	
}

// µµ¿ì¹Ì ´äº¯ Ã¢
function HelpPopup(no){
	var top = 10;
	var left = 10;
	var width = 500;
	var height = 500;
	var url = '/Help/Faq/View.php?no='.no;
	var winname = 'help';
	var opt = 'scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left;
	WindowPopup(url, winname, opt);	
}

//°¡³ª¸Ó´Ï ÃæÀü
function GanaMoneyPopup(){
	var top = 10;
	var left = 50;
	var width = 470;
	var height = 500;
	var url = '/MyPage/MyMoney/PayFilling.php';
	var winname = 'moneyCharge';
	var opt = 'scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left;
	WindowPopup(url, winname, opt);	
}

//¸ÞÀÏ¸µ¼­ºñ½º º¯°æ
function MailingPopup(){
	var top = 10;
	var left = 10;
	var width = 500;
	var height = 500;
	var url = '/MyPage/MyInfo/MemMailing.php';
	var winname = 'mailing';
	opt = 'scrollbars=no,width='+width+',height='+height+',top='+top+',left='+left+'toolbar=no, location=no, directory=no, status=no, menuber=no, resizable=no, copyhistory=no';
	WindowPopup(url, winname, opt);	
}

//Å°Áî¸ÞÀÏ ½ÅÃ»
function KidsMailPopup(){
	var top = 10;
	var left = 10;
	var width = 500;
	var height = 500;
	var url = '/MyPage/MyInfo/MemKidsMail.php';
	var winname = 'kidsmail';
	opt = 'scrollbars=no,width='+width+',height='+height+',top='+top+',left='+left+'toolbar=no, location=no, directory=no, status=no, menuber=no, resizable=no, copyhistory=no';
	WindowPopup(url, winname, opt);	
}

//È¸¿øºñ¹Ð¹øÈ£ º¯°æ
function ChangePwPopup(){
	var top = 10;
	var left = 10;
	var width = 500;
	var height = 500;
	var url = '/MyPage/MyInfo/PwAdjust.php';
	var winname = 'changepassword';
	opt = 'scrollbars=no,width='+width+',height='+height+',top='+top+',left='+left+'toolbar=no, location=no, directory=no, status=no, menuber=no, resizable=no, copyhistory=no';
	WindowPopup(url, winname, opt);	
}

// ±âÅ¸
function EtcPopup(url, width, height, winname, scroll){
	var top = 10;
	var left = 10;
	width = width;
	height = height;
	opt = 'scrollbars='+scroll+',width='+width+',height='+height+',top='+top+',left='+left+'toolbar=no, location=no, directory=no, status=no, menuber=no, resizable=no, copyhistory=no';
	WindowPopup(url, winname, opt);	
}


// »èÁ¦ °Ë»ç È®ÀÎ
function del(href) {
    if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) 
        document.location.href = href;
}

//´Ù³¯-ÇÚÆù°áÁ¦
function BillDanal(iType, goChannel,chargeMethod,Amount){
	var url;
	if(chargeMethod == 'DA')		url = '/Teledit/object/Readyars.php3';
	else if(chargeMethod == 'DH')	url = '/Teledit/object/Ready.php3';
	else if(chargeMethod == 'DK' || chargeMethod == 'DS')	url = '/Teledit/object/Ready_KT.php3';

	url = url+'?iType='+iType+'&goChannel='+goChannel+'&chargeMethod='+chargeMethod+'&Amount='+Amount;
	location.href=url;
}

//ÆË¾÷Ã¢ Á¦¾î
function openWin(theURL, lngWidth, lngHeight) { 
  window.open(theURL,"","width=" + lngWidth + ",height=" + lngHeight + ",directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no");
}

//½ÅÈ­ ÇÃ·¡½Ã Ç®Ã¢
function fullscreen(theURL) {
	window.open(theURL,"","fullscreen=yes,type=fullwindow,scrollbars=no");
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

//µ¥ÀÌÄÞ ACTIVE-X·ÐÃÄ¿¡ ÇÊ¿äÇÑ ½ºÅ©¸³Æ®
function launch_game(type)
{
	LETS.initialize();
	LETS.plain_parameters=type;
	LETS.launch();
}
function launch_game_ex(type,reg_path,reg_key,reg_value)
{
	LETS.initialize();
	LETS.write_registry(reg_path,reg_key,reg_value);
	LETS.plain_parameters=type;
	LETS.launch();
}

//ÀÌ¹ÌÁöº¯È¯ Start
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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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 MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
//ÀÌ¹ÌÁöº¯È¯ Start
