/**
 * ÄíÅ° °ü·Ã
 */
function get_cookie(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 set_cookie( name, value, expiredays ) {
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}




/**
 * Layer ÆË¾÷ °ü·Ã
 */
var cWins = new Array();

function createWindow(win_id, className, title, url, top, left, width, height, isResize, isMiniIcon, isMaxIcon, isModal) {
	var win = new Window(win_id, {
								  className: className,
								  title: title, 
							      url: url,
								  top: top, left: left, width: width, height: height, 
								  resizable: isResize, minimizable: isMiniIcon, maximizable: isMaxIcon, showEffectOptions: {duration:1}});
	win.setDestroyOnClose();
	//win.show();
	//win.show(isModal, top, left);

	cWins[win_id] = win;
	
	return win;
}

function windowClose(win_id) {
	if(cWins[win_id])
		cWins[win_id].hide();
}

function self_close(obj) {
    if(obj.checked)
        set_cookie(obj.value, "done" , 1);

	parent.windowClose(obj.value);
}

function self_close2(obj) {
	if(obj.checked)
        set_cookie(obj.value, "done" , 1);
        
    self.close();
}
