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();

}
