/**
 * 팝업창 띄우기
 */
function popup(id, width, height, param, m_top, m_left) {
    if (m_top != null) {
        var top_margin = ', top = ' + m_top;
    }
    if (m_left != null) {
        var left_margin = ', left = ' + m_left;
    }
    if (!readCookie(id)) {
        window.open(WEBROOT + '/popup/index/id/' + id + '/param/' + param, 'popup_' + id, 'width=' + width + ', height=' + height + top_margin + left_margin);
    }
}

/**
 * 그만보기 셋팅하기
 */
function check_repeat(obj, id) {
    if (obj.checked == true) {
        createCookie(id, 'y', 1);
    } else {
        eraseCookie(id);
    }
}

/**
 * Javascript 쿠키 관련 함수
 * http://www.quirksmode.org/js/cookies.html 에서 가져옴
 * by 07/10/29 KDH
 */
function createCookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    } else {
        var expires = "";
    }
    document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}
function eraseCookie(name) {
    createCookie(name,"",-1);
}

//부모창으로 이동
function popLink(url) {
    opener.location.href = url;
    self.close();
}


//레이어일경우 레이어 숨기기
function hidden_layer(name) {
   $(name).style.display = "none"; 
}

