

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,left=10,top=10';

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

    noticeWindow.opener = self;
   
    }

 }

 function popup_window_pos (url_name, name, pop_width, pop_height,pop_left, pop_top, 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,left=' + pop_left + ',top=' + pop_top;

    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=/; expires=" + todayDate.toGMTString() +";" 
}


// ####################### ÆË¾÷ Ã¢ ´Ý±â #####################
function closeWin(pop_cookie, check)
{
  	//document.write(check);

    if ( check )
      setCookie( pop_cookie, "done" ,1 );

    self.close();
}


// ####################### ÆË¾÷ Ã¢2 #####################
function getCookie2( name2 )
{
	var nameOfCookie = name2 + "=";
	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_window2(url_name, name2, pop_width, pop_height, pop_cookie2, pop_scroll,  pop_resize, pop_toolbar)
 {

// ################## ÆË¾÷¸Þ´º ¿­±â #######################
 if ( getCookie2( pop_cookie2 ) != "done2" )
    {
    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,left=420,top=10';

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

    noticeWindow.opener = self;
   
    }

 }



