// 
// Project  Name: fitpregnancy.com
// File / Folder: /docs/2007/askTheExperts/js//questions.js
// File Language: javascript
// Copyright (C): 2007 The Richard Group, Inc.
// First  Author: Liam Bryan
// First Created: 2007.07.25 11:00:44
// Last Modifier: Liam Bryan
// Last Modified: 2007.07.25 11:01:30

function switchSubcategory(id) {
	var subcategory = document.getElementById('subcategory');
	subcategory.length = 0;
	subcategory.disabled = false;
	subcategory.options[0] = new Option('-Select One-','');
	if(id == 'any') {
		for(var subid in structure[860]) {
			subcategory.options[subcategory.length] = new Option(structure[860][subid], subid);
		}
		for(var subid in structure[861]) {
			subcategory.options[subcategory.length] = new Option(structure[861][subid], subid);
		}
		for(var subid in structure[862]) {
			subcategory.options[subcategory.length] = new Option(structure[862][subid], subid);
		}
		return;
	}
	for(var subid in structure[id]) {
		subcategory.options[subcategory.length] = new Option(structure[id][subid], subid);
	}
	switchQuestions(subcategory.options[0].value);
}

function switchQuestions(id) {
	var questions = document.getElementById('questions');
	questions.length = 0;
	questions.disabled = false;
	if(id == '')
		return;
	questions.options[0] = new Option('-Select One-','');
	for(var subid in structure[id]) {
		questions.options[questions.length] = new Option(structure[id][subid], subid);
	}
}


function fillQuestions() {
	var fertility = document.getElementById('fertility');
	fertility.length = 0;
	fertility.disabled = false;		
	fertility.options[0] = new Option('-Select One-','');
	
	var all_questions = new Array();
	
	for (sub_cat in structure[860])
	{
		for(var subid in structure[sub_cat]) {
			fertility.options[fertility.length] = new Option(structure[sub_cat][subid], subid);
		}		
	}
	
	var prenatal = document.getElementById('prenatal');
	prenatal.length = 0;
	prenatal.disabled = false;		
	prenatal.options[0] = new Option('-Select One-','');
	
	var all_questions = new Array();
	
	for (sub_cat in structure[861])
	{
		for(var subid in structure[sub_cat]) {
			prenatal.options[prenatal.length] = new Option(structure[sub_cat][subid], subid);
		}		
	}
	
	var postnatal = document.getElementById('postnatal');
	postnatal.length = 0;
	postnatal.disabled = false;		
	postnatal.options[0] = new Option('-Select One-','');
	
	var all_questions = new Array();
	
	for (sub_cat in structure[862])
	{
		for(var subid in structure[sub_cat]) {
			postnatal.options[postnatal.length] = new Option(structure[sub_cat][subid], subid);
		}		
	}
}