function openPopupWindow(htmlPath, popupName, windowWidth, windowHeight, x, y) {

	if (getCookie("popup_" + popupName) != "no") {
		windowOption  = 'width='+ windowWidth + ', height=' + windowHeight + ', resizable=no';
		windowOption += ',left=' + x + ',top=' + y;
		window.open(htmlPath, popupName, windowOption);	
	}

}

function closePopupWindow(popupName, expiredays) {

   if (document.form.closePopup.checked) {

		var todayDate = new Date(); 
		var cookieValue = "no";

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

		document.cookie = "popup_" + popupName + "=" + escape( cookieValue ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 

	}

   window.close();

}

function boardOpenWindow(url, name, width, height, align, valign, option) {
	var x,y;
	var window_option = "width="+width+",height="+height;
	
	if (option!=null) window_option+=","+option;
	if (align==null) align="center";
	if (valign==null) valign="center";
	
	if (align=="left") x=0;
	else if (align=="right") x=(screen.width-width);
	else if (align=="center") x=(screen.width-width)/2
		
	if (valign=="top") y=0;
	else if (valign=="bottom") y=(screen.height-height);
	else if (valign=="center") y=(screen.height-height)/2
	
	window_option+=",left="+x+",top="+y;
	var win = window.open(url,name,window_option);
	
	focus();
	win.focus();
	return win;
}