// this function launches a pop up window with the paramters passed to it
// url - the url of the document to be loaded into the window
// name - the name of the window, for reference by other JS
// w - width
// h - height
// switches for the window's toolbar, location bar, scrollbars
// switches for the window's centering vertically and/or horizontally

function openWindow(url, name, w, h, Wtoolbar, Wlocation, Wscrollbars, Wstatus, Wresizable, VAlign, HAlign) {

	//popUpWin=window.close(name);
	//alert("test: " + name[name]);

	//url="http://"+url;
	if (Wtoolbar) {
	Wtoolbar="yes"} else {Wtoolbar="no"}
	if (Wlocation) {
	Wlocation="yes"} else {Wlocation="no"}
	if (Wscrollbars) {
	Wscrollbars="yes"} else {Wscrollbars="no"}
	if (Wstatus) {
	Wstatus="yes"} else {Wstatus="no"}
	if (Wresizable) {
	Wresizable="yes"} else {Wresizable="no"}
	scrwidth=screen.width;scrheight=screen.height;

	if (HAlign == "C") {
	leftmargin = (scrwidth - w)/2}
	if (HAlign == "L") {
	leftmargin = 0}
	if (HAlign == "R") {
	leftmargin = (scrwidth - w) - 10}

	if (VAlign == "T") {
	topmargin = 0}
	if (VAlign == "C") {
	topmargin = (scrheight - h)/2}
	if (VAlign == "B") {
	topmargin = (scrheight - h)}

	
	props = "left=" + leftmargin + ",";props = props + "top=" + topmargin + ",";props = props + "width=" + w+ ",";props = props + "height=" + h+ ",";
	var windowprops= "left=" + leftmargin +",top=" + topmargin +",width="+w+",height="+h+",resizable="+Wresizable+ ",location="+Wlocation+",toolbar="+Wtoolbar+",status="+Wstatus+"scrollbars=" + Wscrollbars;
	popUpWin=window.open(url, name,windowprops);
        popUpWin.focus();
}