//
// Include file to handle online help system.
//
// Function:
//		online_help processed forms array and calls online
//			help cgi in a new window.
// Parameters:
//		top.form <- form array with length and elements
//              +
// Return Value:
//		True if successful
//		False if failed
//
function help_menu(frames) {
	var i
	var active_frame = 2;
	var temps;
	var frame_location;
	
	temps = String(top.frames[active_frame].location);

	// Remove the CGI parameter string

	if (temps.indexOf("?") > 0) {
		temps = temps.slice(0, temps.indexOf("?", 0));
	}

	// Remove URL protocol and hostname
	
	if ((temps.indexOf("http:") >= 0) || (temps.indexOf("https:"))) {
		temp_array = temps.split("/");
		temps = "";
		for (i=4 ; i < temp_array.length ; i++) {
			if (i > 4)
				temps = temps + "/" + temp_array[i];
			else
				temps = temps + temp_array[i];
		}
	}
	
//    alert(temps);
//	alert(top.frames[active_frame].location);
	frame_location = temps;

	window.open("/cgi-bin/help/index.pl?active_frame=" +
			active_frame +
			"&frame_location=" +
			frame_location, "help_menu","resizable=yes,toolbar=yes,width=400,height=400,menubar=no,status=no,scrollbars=yes,dependent=yes");

	return(true);
}

// temp function by kevin on 9/19/00 to get crude help for launch
function temp_help(mod) {
	var frame_location = "html/help/temp/home/home.html";
	var mname = "Portal";
	if (mod == 1 || mod == 8 || mod == 6 || mod == 7 ) {
		frame_location = "/html/help/temp/home/home.html";
		var mname = "Portal";	
	}
	if (mod == 2) {
		frame_location = "/html/help/temp/office/office.html";
		var mname = "Office";	
	}
	if (mod == 3) {
		frame_location = "/html/help/temp/class/class.html";
		var mname = "Class";	
	}
	if (mod == 5) {
		frame_location = "/cgi-bin/support/soon.pl";
		var mname = "Support";	
	}
	if (mod == 98 || mod == 99) {
		frame_location = "/html/help/temp/wizard/wizard.html";
		var mname = "Wizard";	
	}
	
	var linkto = "/cgi-bin/help/index.pl?load=" +	frame_location + "&mname=" + mname;
	pop_window(linkto);
	return(true);
}


