

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 popup_window (url_name, name, pop_width, pop_height, pop_cookie, pop_scroll,  pop_resize, pop_toolbar)
 {

// ################## ÆË¾÷¸Þ´º ¿­±â #######################
 if ( getCookie( pop_cookie ) != "done" )
    {
    var paraWin = 'width =' + pop_width + ',height =' + pop_height + ',scrollbars =' + pop_scroll+ ',resizable =' + pop_resize + ',toolbar =' + pop_toolbar + ',location=no,directories=no,status=no,menubar=no';

    noticeWindow = window.open(url_name ,name, paraWin);

    noticeWindow.opener = self;
   
    }

 }

function setCookie( name, value, expiredays )
{
        var todayDate = new Date();

        todayDate.setDate( todayDate.getDate() + expiredays );

        document.cookie = name + "=" + escape( value ) + "; path=/; domain=hanoltech.com; expires=" + todayDate.toGMTString() +";" 

}


// ####################### ÆË¾÷ Ã¢ ´Ý±â #####################
function closeWin(pop_cookie,check)

{
        document.write(check);
    if ( check )

        setCookie( pop_cookie, "done" ,30 );
    self.close();
}


function maxWin()
{
          top.window.moveTo(0,0);
          if (document.all) {
          top.window.resizeTo(screen.availWidth,screen.availHeight);
          }
          else if (document.layers||document.getElementById) {
          if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
          top.window.outerHeight = screen.availHeight;
          top.window.outerWidth = screen.availWidth;
          }
          }
}
