var parent_1 = new Array("ANIMATION","FASHION-DESIGN","FASHION-MERCHANDISING","FINE-ART-CRAFT","GAME-DESIGN","GRAPHIC-DESIGN","INTERIOR-DESIGN","MULTIMEDIA-WEB-DESIGN","MUSIC","PHOTOGRAPHY","THEATER-ARTS"); var parent_2 = new Array("ACCOUNTING","BUSINESS-ADMINISTRATION","CUSTOMER-SERVICE","E-COMMERCE","ENTREPRENEURSHIP","FINANCE","FINANCIAL-PLANNING","FORENSIC-ACCOUNTING","HUMAN-RESOURCES","INSURANCE-RISK-MANAGEMENT","INTERNATIONAL-BUSINESS","MANAGEMENT-LEADERSHIP","MARKETING-ADVERTISING","OFFICE-ADMINISTRATION","OPERATIONS-MANAGEMENT","ORGANIZATIONAL-PSYCHOLOGY","PROJECT-MANAGEMENT","PUBLIC-RELATIONS","REAL-ESTATE","RETAIL-SALES","SPORTS-MANAGEMENT","TAXATION"); var parent_3 = new Array("ADULT-EDUCATION","ASSESSMENT-EVALUATION","CHILD-CARE","CHILD-DEVELOPMENT","CORPORATE-TRAINING","CURRICULUM-DESIGN","DISTANCE-EDUCATION","ESL","EARLY-CHILDHOOD-EDUCATION","EDUCATION-GENERAL","EDUCATIONAL-ADMINISTRATION","EDUCATIONAL-TECHNOLOGY","HIGHER-EDUCATION","K-12-EDUCATION","LITERACY-READING","PHYSICAL-HEALTH-EDUCATION","SPECIAL-EDUCATION","TEACHER-AIDE","TEACHER-LICENSE"); var parent_4 = new Array("ARCHITECTURE-LANDSCAPE-DESIGN","CIVIL-ENGINEERING","COMPUTER-SOFTWARE-ENGINEERING_CON","CONSTRUCTION","ELECTRICAL-ENGINEERING","ENGINEERING-GENERAL","ENGINEERING-MANAGEMENT","ENVIRONMENTAL-ENGINEERING","INDUSTRIAL-ENGINEERING","MATERIAL-ENGINEERING","MECHANICAL-ENGINEERING","QUALITY-CONTROL-SAFETY","SYSTEMS-ENGINEERING"); var parent_6 = new Array("ALTERNATIVE-MEDICINE","DENTAL-HYGIENIST","EMS-PARAMEDIC","GERONTOLOGY","HIPAA-HEALTH-INSURANCE-PORTABILITY-AND-ACCOUNTABILITY-ACT","HEALTH-MEDICAL-SCIENCES","HEALTH-CARE-ADMINISTRATION","HEALTH-EDUCATION","LABORATORY-TECHNICIAN","MASSAGE-THERAPY","MEDICAL-DENTAL-ASSISTANT","MEDICAL-BILLING","MEDICAL-TECHNOLOGY","MEDICAL-TRANSCRIPTION","NURSING","NUTRITION","OCCUPATIONAL-THERAPY","PHARMACY-TECHNICIAN","PHYSICAL-THERAPY","PHYSICIAN-ASSISTANT","PSYCHOLOGY","PUBLIC-HEALTH","RESPIRATORY-THERAPY","SPORTS-FITNESS","X-RAY-TECH-RADIOLOGY"); var parent_7 = new Array("BAKING-PASTRY","CATERING","CHEF-TRAINING","CULINARY-ARTS","EVENT-PLANNING","HOSPITALITY-MANAGEMENT","HOTEL-MANAGEMENT","LE-CORDON-BLEU","RESTAURANT-MANAGEMENT","TRAVEL-TOURISM"); var parent_8 = new Array("CORRECTIONS","COURT-REPORTING","CRIME-SCENE-FORENSICS","CRIMINAL-JUSTICE","FORENSIC-PSYCHOLOGY","FORENSIC-SCIENCE","HOMELAND-SECURITY","INTELLIGENCE-STUDIES","INVESTIGATION","LAW","LAW-ENFORCEMENT","PARALEGAL-LEGAL-SERVICES","PUBLIC-SAFETY","SECURITY-LOSS-PREVENTION"); var parent_9 = new Array("ART-HISTORY","COMMUNICATIONS-MEDIA","ENGLISH","GENERAL-STUDIES","LANGUAGE","LIBERAL-ARTS","RELIGIOUS-STUDIES","WRITING"); var parent_10 = new Array("AVIATION-SCIENCE","BIOLOGY","BIOTECHNOLOGY","CHEMISTRY","ENVIRONMENTAL-SCIENCE","FIRE-SCIENCE","MATHEMATICS-STATISTICS","PHYSICS","VETERINARY-SCIENCE-ANIMAL-CARE","WILDLIFE-FORESTRY"); var parent_11 = new Array("ANTHROPOLOGY","BEHAVIORAL-SCIENCE","CONFLICT-RESOLUTION-MEDIATION","COUNSELING","ECONOMICS","EMERGENCY-MANAGEMENT","GEOGRAPHY","HISTORY","INTERNATIONAL-RELATIONS","POLITICAL-SCIENCE","PSYCHOLOGY_SOC","PUBLIC-POLICY-ADMINISTRATION","SCHOOL-COUNSELING","SOCIAL-SCIENCES","SOCIAL-WORK","SOCIOLOGY"); var parent_12 = new Array("CISCO-CERTIFICATION","COMPUTER-SOFTWARE-ENGINEERING","COMPUTER-NETWORKING","COMPUTER-PROGRAMMING","COMPUTER-SCIENCE","DATABASE-MANAGEMENT-DBA","GRAPHICS-MULTIMEDIA","INFORMATION-SYSTEMS","INFORMATION-SYSTEMS-SECURITY","INFORMATION-TECHNOLOGY","MICROSOFT-CERTIFICATION","NETWORK-ADMINISTRATION","SECURITY","TECHNICAL-MANAGEMENT","TECHNICAL-SUPPORT-REPAIR","TECHNICAL-WRITING","TELECOMMUNICATIONS","VENDOR-CERTIFICATIONS","VIDEO-GAME-DEVELOPMENT","WEB-DESIGN","WEB-DEVELOPMENT"); var parent_13 = new Array("APPLIED-TECHNOLOGY","AUTOMOTIVE-VEHICLE","AVIATION","BEAUTY-COSMETOLOGY","COMPUTER-APPLIANCE-REPAIR","ELECTRICIAN","HVAC","PLUMBING","TELECOMMUNICATIONS_VOC","TRANSPORTATION","WELDING");  function loadProgram(version) { 	// function to toggle the program box
			if (version == "long") {	// for long version search form

				var subject = document.searchboxform.subject.value;	// grab the subject value
				var programs = document.searchboxform.program;	// grab the program select box
				var concentrations = document.searchboxform.concentration;	// grab the concentration select box
			}
			else if (version == "short") {	// for short version serch form
				var subject = document.searchboxform_short.subject.value;	// grab the subject value
				var programs = document.searchboxform_short.program;	// grab the program select box
				var concentrations = document.searchboxform_short.concentration;	// grab the concentration select box
			}
			programs.options.length = 0;	// truncate the program select box (remove all options)
			if (subject == "All") {	// no particular subject was selected - add default option to program box
				var newoption = document.createElement("OPTION");
				newoption.text = "--- Select a Subject ---";
				newoption.value = 0;
				programs.options.add(newoption, 0);
				programs.disabled = true;

			}
			else {
				var newprograms;

				switch(subject) {
					case "ART-DESIGN": newprograms = parent_1; break; case "BUSINESS": newprograms = parent_2; break; case "EDUCATION": newprograms = parent_3; break; case "ENGINEERING-CONSTRUCTION": newprograms = parent_4; break; case "HS-DIPLOMA-GED": newprograms = parent_5; break; case "HEALTH": newprograms = parent_6; break; case "HOSPITALITY-CULINARY": newprograms = parent_7; break; case "LAW-CRIMINAL-JUSTICE": newprograms = parent_8; break; case "LIBERAL-ARTS-HUMANITIES": newprograms = parent_9; break; case "SCIENCE": newprograms = parent_10; break; case "SOCIAL-SCIENCE": newprograms = parent_11; break; case "TECHNOLOGY-IT": newprograms = parent_12; break; case "VOCATIONAL": newprograms = parent_13; break;  	/*	create the switch statements	*/
					default: break;
				}
				if (newprograms != null) {	// populate the program list
					var newoption = document.createElement("OPTION");
					newoption.text = "--- All Programs ---";
					newoption.value = "All";
					programs.options.add(newoption,0);
					for (var i=0; i<newprograms.length; i++) {
						var newoption = document.createElement("OPTION");
						newoption.value = newprograms[i];

						var tmp_text = newprograms[i].replace('-',' ');
						newoption.text = ucwords(tmp_text);
						programs.options.add(newoption,i+1);
						programs.disabled = false;
					}
				}
			}
			concentrations.options.length = 0;	// truncate the concentration select box (remove all options)
			var newoption = document.createElement("OPTION");	// add default option to conentration box
			newoption.text = "--- Select a Program ---";
			newoption.value = 0;
			concentrations.options.add(newoption,0);
			concentrations.disabled = true;
		}

		function loadConcentration() {	// function to toggle the concentration values
			var subject = document.searchboxform.subject.value;	// grab the subject value
			var program = document.searchboxform.program.value;	// grab the program value
			var concentrations = document.searchboxform.concentration;	// grab the concentration select box
			concentrations.options.length = 0;	// truncate the concentration select box (remove all options)
			if (program == "All") {	// no particular program was selected - add default option to concentration box
				var newoption = document.createElement("OPTION");
				newoption.text = "--- Select a Program ---";
				newoption.value = 0;
				concentrations.options.add(newoption,0);
				concentrations.disabled = true;
			}
			else {
				var newconcentrations;
				switch(subject) {
					case "ART-DESIGN": switch(program) { default: break; } break; case "BUSINESS": switch(program) { default: break; } break; case "EDUCATION": switch(program) { default: break; } break; case "ENGINEERING-CONSTRUCTION": switch(program) { default: break; } break; case "HS-DIPLOMA-GED": switch(program) { default: break; } break; case "HEALTH": switch(program) { default: break; } break; case "HOSPITALITY-CULINARY": switch(program) { default: break; } break; case "LAW-CRIMINAL-JUSTICE": switch(program) { default: break; } break; case "LIBERAL-ARTS-HUMANITIES": switch(program) { default: break; } break; case "SCIENCE": switch(program) { default: break; } break; case "SOCIAL-SCIENCE": switch(program) { default: break; } break; case "TECHNOLOGY-IT": switch(program) { default: break; } break; case "VOCATIONAL": switch(program) { default: break; } break; 	//	create the switch statements
					default: break;
				}
				if (newconcentrations != null) {	// populate the concentration list
					var newoption = document.createElement("OPTION");
					newoption.text = "--- All Concentrations ---";
					newoption.value = "All";
					concentrations.options.add(newoption,0);
					for (var i=0; i<newconcentrations.length; i++) {
						var newoption = document.createElement("OPTION");
						newoption.text = newconcentrations[i];
						newoption.value = newconcentrations[i];
						concentrations.options.add(newoption,i+1);
						concentrations.disabled = false;
					}
				}
				else {
					concentrations.disabled = true;
				}
			}
		}

		function loadCity() { 	// function to toggle city box
			var selected = document.searchboxform.location.value; 	//grab the state/location value
			var city = document.searchboxform.city; 	// grab the city select box
			city.options.length = 0; 	// truncate the city select box (remove all options)
			if (selected == "All") { 	// no particular location/state was selected - add default option to city box
				var newoption = document.createElement("OPTION");
				newoption.text = "--- Select a State ---";
				newoption.value = 0;
				city.options.add(newoption,0);
				city.disabled = true;
				document.getElementById("citybox").style.display = "none"; 	// hide the city box
			}
			else {
				var newcities;

				if (window.XMLHttpRequest)
				{// code for IE7+, Firefox, Chrome, Opera, Safari
			  		xmlhttp=new XMLHttpRequest();
			  	}
				else
			  	{// code for IE6, IE5
				  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  	}
				var newoption = document.createElement("OPTION");
				newoption.text =  "--- Loading ---";
				newoption.value = "Load";
				city.options.add(newoption,0);
				xmlhttp.onreadystatechange=function()
				{
			  		if (xmlhttp.readyState==4 && xmlhttp.status==200)
			    	{

			    		newcities=xmlhttp.responseText;
						newcities = newcities.split('","');
						if (newcities != null) { 	// populate the city list
							//clear out the loading text
							city.options.length = 0;
							var newoption = document.createElement("OPTION");
							newoption.text = "--- All Cities ---";
							newoption.value = "All";
							city.options.add(newoption,0);
							for (var i=0; i<newcities.length; i++) {
								var newoption = document.createElement("OPTION");
								newoption.text = newcities[i];
								newoption.value = newcities[i];
								city.options.add(newoption,i+1);
								city.disabled = false;
							}
							document.getElementById("citybox").style.display = "block"; 	// display the city box
						}
						else {
							document.getElementById("citybox").style.display = "none"; 	// hide the city box
						}
			    	}
			  	}
				xmlhttp.open("POST","/search_box_cities",true);
				var city_params = "state="+selected;
				//Send the proper header information along with the request
				xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				xmlhttp.setRequestHeader("Content-length", city_params.length);
				xmlhttp.setRequestHeader("Connection", "close");
				xmlhttp.send(city_params);


			}
		} 

