// popup.js 
// expects :
//			url - of the window to be called
//			Title -  for the window, each unique title spawns a new window
//			width - in pixels of the desired window
//			height - in pixels of the desired window
//	hence a legal call would look like:
// <a href="JavaScript:popWindow('myurl.htm','popupwindowname','520','615')" >click here to spawn window</a>
//

oHTMLWin = null;

function centerWindow(url, name, w, h, scroll, menu, resizable, all)
{
	if (window.screen)
	{
		var chasm = screen.availWidth;
		var mount = screen.availHeight;
		var allprops = "";

	      if(all=="1") allprops = ",directories=yes,location=yes,status=yes,toolbar=yes";

		winprops = 'width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=' + scroll + ',menubar=' + menu + ',resizable=' + resizable + allprops;
		
		oHTMLWin = window.open(url, name, winprops);
		oHTMLWin.window.focus();
	}
}

function popWindowMenus(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "yes", "yes", "1");
}

function popWindow(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "no", "no", "0");
}

function popWindowResizeable(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "no", "yes", "0");
}

function popWindowNoScroll(url,title,width,height){
		centerWindow(url, title, width, height, "no", "no", "no", "0");
}

function popWindowNoScrollResizeable(url,title,width,height){
		centerWindow(url, title, width, height, "no", "no", "yes", "0");
}


