function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=500,height=500,screenX=150,screenY=150,top=150,left=150')
}
function PopWindow(mypage, myname, w, h, scroll) {
	boxw = w + 65
	boxh = h + 60
	if (boxh >= screen.availHeight-30) {
   	boxh = screen.availHeight-30;
   	scroll = "yes";
   }
	if(boxw >= screen.width ) {
		boxw = screen.width-15;
		scroll = "yes";
	}
	if (screen.width == boxw) {
		var winl = 0;
    } else {
		var winl = (screen.width - (boxw+10)) / 2;
	}
	if (screen.availHeight == boxh) {
		wint = 0;
	} else {
		var wint = (screen.availHeight - (boxh+30)) / 2;
	}
	w = boxw - 60
	h = boxh - 60
	
	url = "/catalog/pop_box.php?url="+mypage+"&title="+myname+"&width="+w+"&height="+h+"&scroll="+scroll;

	winprops = 'height='+boxh+',width='+boxw+',top='+wint+',left='+winl+',scrollbars=no,resizable=yes,menubar=no,status=no,toolbar=no,location=no,directories=no'
	win = window.open(url, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
