function ShowPage (url)
{
    opener.parent.location=url
    self.close();
}

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 ShowPopup(cookie, url, target, option)
{
    var ck = ReadCookie(cookie);

    if ( ck == '1' )
        return;

    window.open(url,target,option);
}

function setCookie(cookie)
{
    var expire = new Date();
    expire.setDate(expire.getDate() + 1 );
    document.cookie = cookie+"=1; expires=" + expire.toGMTString()+ "; path=/";
}

function setPopupStatus (pop_cookie,check,closeflag)
{
    if (check)     setCookie(pop_cookie);
    if (closeflag) self.close();
}


