  var IE = false ;

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 open_window(url, name, width, height, feature)
  {
    var oWnd;

    if (IE && width < window.screen.width && height < window.screen.height) 
    {
        var windowX = Math.ceil( (window.screen.width  - width) / 2 );
        var windowY = Math.ceil( (window.screen.height - height) / 2 );

        oWnd = window.open(url, name, feature+",width=" + width +",height=" + height+",left="+windowX+",top="+windowY + ",resizable=yes");
    }
    else 
    {
        oWnd = window.open(url, name, feature+",width=" + width +",height=" + height + ",resizable=yes");
    }

    return oWnd;
  }

  // window resize 여부
  // 초기값 : 0, resize 시도 : 1
  var windowResized = 0;
  function resizepopup(wid, minH){
	if (windowResized == 0) {
		windowResized = 1;
		var nWidth = wid;
		var nHeight = minH;
		if (IE) {
			var nCWidth = document.body.offsetWidth;
			var nCHeight = document.body.offsetHeight;
			window.resizeTo(nWidth, nHeight);
			
			var nTmpWidth = nWidth - (document.body.offsetWidth - nCWidth);
			var nTmpHeight = nHeight - (document.body.offsetHeight - nCHeight);
			window.resizeTo(nTmpWidth, nTmpHeight);
			
			var nDiffWidth = nTmpWidth - nCWidth;
			var nDiffHeight = nTmpHeight - nCHeight;
				
			nWidth += document.body.offsetWidth + nDiffWidth - document.body.clientWidth;
			nHeight += document.body.offsetHeight + nDiffHeight - document.body.clientHeight;
		} else {
			window.resizeTo(nWidth, nHeight);
			nWidth += window.outerWidth - window.innerWidth;
			nHeight += window.outerHeight - window.innerHeight
		}
		
		var nWindowX = Math.ceil((window.screen.width  - nWidth) / 2);
		var nWindowY = Math.ceil((window.screen.height - nHeight) / 2);
		
		window.moveTo(nWindowX, nWindowY);
		window.resizeTo(nWidth, nHeight);
	}
  }


function PopOpen(CName,url, name, width, height, feature) {
	if ( getCookie( CName ) != "done" )
	{	
		open_window(url, name, width, height, feature);
	}
}