﻿// JScript 파일

// 쿠키 저장
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 ""; 
} 

// 배송지 공지사항 닫기
function closeDeliWin() { 
    /*if(document.all["chkDeli"].checked == true) { 
        setCookie("pDeli", "done" ,1); 
    } */
    
    MM_showHideLayers('pop_lyaa','','hide'); 
} 

// 배송지 공지사항 열기
//  1. 로그인하지 않은 경우
//  2. 배송지가 설정되지 않은 경우(로그인 후)
function openDeliWin(abs) {
    var lpath = location.pathname;
    var viewChk = false;
    
    if ((lpath.toLowerCase() == '/' || lpath.toLowerCase() == '/default.aspx'|| lpath.toLowerCase() == '/default_20090811.aspx') && abs == 'login') {
        viewChk = true;
    }
    
    //if(viewChk && getCookie("pDeli") != "done" || abs == "login")
    if(viewChk || abs == "login")
    {
        MM_showHideLayers('pop_lyaa','','show'); 
    }
}

// page on_load 함수에 추가해 주세요!!
 //openDeliWin("login");
 