묻고답하기

자신의 홈페이지를 방문한 방문자가 인터넷창을 닫을때 새로뜨는 사이트를 랜덤으로 할려고 하면 어떻게 해야 되는지 궁금 합니다. 소스 맨밑쪽에 보면 사이트주소란에 주소를 적을때 여러개의 사이트를 랜덤으로 출력 하게 할려면 어떠한 방식으로 해야 되는지요? 현재 쿠키를 사용하여서 한개의 사이트로만 적용시키고 있습니다.
<!-- saved from url=(0022)http://internet.e-mail -->
<html>
<head>

<script language="javascript">
function getCookie(name) {
        var from_idx = document.cookie.indexOf(name+'=');
        if (from_idx != -1) {
                from_idx += name.length + 1
                to_idx = document.cookie.indexOf(';', from_idx)

                if (to_idx == -1) {
                        to_idx = document.cookie.length
                }
                        return unescape(document.cookie.substring(from_idx, to_idx))
                }
}

function notice_setCookie( name, value, expiredays ){
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function openwin(){
        var blnCookie = getCookie("blnEvent");
        if ( !blnCookie ) {
                window.open("사이트주소");
                notice_setCookie( "blnEvent", "done" , 1);
        }
}
</script>
</head>
<body onunload="openwin()">
</body>
</html>