
// for Window
function openPopupWin(src,name,width,height,top,left){
	void(window.open(src,name,'width='+width+',height='+height+',top='+top+',left='+left+',status=no,resizable=yes'));
}


// for Layer
function openPopupLayer(){



}

function setCookie( name, value, expiredays ){ 
	var todayDate = new Date(); 
	todayDate.setDate(todayDate.getDate() + expiredays); 
	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 


function closePopup(check_id,cookie_name){
	if(document.getElementById(check_id).checked)	setCookie( cookie_name, 1 , 1);
	window.close(); 
} 


function resizePopup(width, height, left, top){
	if(width==0 || height==0){

		var obj = document.body;
		var bodyWidth	=	obj.scrollWidth + (obj.offsetWidth - obj.clientWidth)+6;
		var bodyHeight	=	obj.scrollHeight + (obj.offsetHeight - obj.clientHeight)+50;

		var maxHeight	=	screen.height;

		if(bodyHeight>maxHeight){	
			bodyHeight	= maxHeight;
			bodyWidth	+= 18;
			obj.scroll = 'yes';
		}
		window.resizeTo(bodyWidth,bodyHeight);
	} else {
		window.resizeTo(width, height);
	}

	window.moveTo(left, top);
}