function launchWS(winName) {
  
  //window height and width
  myHeight = screen.height*.80;
  myWidth = 784;
  
  //widow height bounds
  if ( myHeight < 556 ) {
  myHeight = 556;
  } else if (myHeight>700) {
  myHeight = 700;
  }
  
  //get screen size, and cacl center screen positioning
  var height = screen.height;
  var width = screen.width;
  var leftpos = width / 2 - myWidth / 2;
  var toppos = (height / 2 - myHeight / 2) - 40;
  
  //open window
  msgWindow=window.open(winName,"ws_window","toolbar=no,location=no,directories=no,resizable=yes,menubar=no,scrollbars=no,status=yes,width=" + myWidth + ",height="+ myHeight + ", left=" + leftpos + ",top=" + toppos);
  
  //focus window
  setTimeout('msgWindow.focus()',1);
  
}

function menu_show(id) {
	// First, hide all of our menu divs (there are 6)
	for (var i=0;i<pageIndexSize;i++) {
		//alert('getting ' + i);
		eval("var actual = document.getElementById('menu_' + i)");
		if (actual) { actual.style.display = 'none'; } 

		//submenus, too
		for (var ix=0;ix<5;ix++) {
			eval("var actual = document.getElementById('submenu_' + i + '_' + ix)");
			if (actual) { actual.style.display = 'none'; }	
		}
	}
//	if (id > 0) {
		// This part shows the menu div
		eval("var show = document.getElementById('menu_' + id)");
		if (show) { show.style.display = 'block'; }

		// This code will move our invisible bar that makes the menu disappear to RIGHT under the menu.
		// It requires the height to be set on the table in the menu div, though.
		id += "_table";
		var tablecheck = document.getElementById(id);
//		var setbar = document.getElementById('turnoff');
//		var newsetting = tablecheck.style.height;
//		setbar.style.marginTop = newsetting;
//	}

}
function submenu_show(mainmenu,id,size) {
	for (var i=0;i<size;i++) {
		//alert('getting ' + i);
		eval("var actual = document.getElementById('submenu_' + mainmenu + '_' + i)");
		if (actual) { actual.style.display = 'none'; }
	}
//	alert('submenu_' + mainmenu + '_' + id);
	eval("var show = document.getElementById('submenu_' + mainmenu + '_' + id)");
	if (show) {  show.style.display = 'block'; }

}

function check_length(formName) {
	var fields = new Array;
	eval("fields = document."+formName+".toVerify.value.split(\"\;\")");
	var field_names = new Array;
	eval("field_names = document."+formName+".fields.value.split(\"\,\")");
	for (var i=0;i<fields.length;i++) {
		var nvp = fields[i].split(",");
		var o = nvp[0].split("_");
		var l = eval("document."+formName+"."+ nvp[0]+".value.length");
		if (l < nvp[1]) {
			alert('Please fill out the '+field_names[o[1]]+ ' field to be equal to or greater than ' + nvp[1] + ' characters!');
			//error;
			return false;
		}
	}
} 

