//쿠기 얻기

function notice_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 "";

}



//자동팝업

var posx=50;

var posy=50;



function pop(id,w,h) {

	var popWin;

	var str="/popup/popup.jsp?idx="+id;

	var width=600;

	var height=714;



	var position="width="+width+",height="+height+",top="+posy+",left="+posx+",scrollbars=0,location=0,menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,screeny=0";

	if (notice_getCookie("popupset"+id)!= "nopopup"){

		popWin = window.open(str,id,position);

		posx += parseInt(w)+10;

		popWin.focus();

	}

}



//팝업미리보기

function previewpop(id,w,h) {

	var str="/popup/popup.jsp?idx="+id;

	var width=w;

	var height=h;



	var position="width="+width+",height="+height+",top=0,left=0,scrollbars=0,location=0,menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,screeny=0";

	var popWin = window.open(str,id,position);

	popWin.focus();

}

