// questions.js

var rQuestionVar1 = new Array (
"Pain",
"Life Style",
"Eating Habits",
"Urination",
"Digestive System",
"Sleep",
"Skin Symptoms",
"Heart and Lung",
"Other Symptoms"
);

var rQuestionVar2 = new Array (
new Array ("Does he seem to have any chest pain?", "Headache?", "Does he have abdominal or stomach pain?", "Pain in his legs?", "Pain in his hands and arms?", "Back pain?", "Feet?", "Joints?", "Muscle?", "Does physical activity cause pain?"),
new Array ("Is he under a lot of stress right now?", "Is he able to play with other children?", "How would you describe his diet?", "Does physical activity cause pain?", "Have you notice any odd changes in his mood?", "How are his energy levels?"),
new Array ("Is his appetite OK?", "Would you say he eats a balanced diet?", "Fruits and veggies?", "Pain after eating?", "Vomitting/spitting up?", "Weight gain or loss?"),
new Array ("How much fluids does he drink each day?", "How many diapers does he wet each day?", "What color is his urine?", "Does he have any difficulty urinating?", "Has he lost or gained any weight recently?", "Do you notice any swelling?"),
new Array ("Does he have any heartburn or problems swallowing?", "Does he have a history of peptic ulcer disease, gallbladder or abdominal pain?", "Does he have any nausea or vomiting?", "Is he constipated?", "Does he have diarrhea?", "Does he have large stools?", "Have you noticed anything unusual about the color about his stools?", "How is his stool consistency?", "Have you noticed any unusual odor about his stools?"),
new Array ("Does he fall asleep easily?", "How much sleep does he get?", "Does he snore?", "Does he nap during the day?", "Does he sleep well at night?"),
new Array ("Has he been experiencing any fevers?", "Has he experienced night sweats?", "Does he bruise easily?", "Has his skin started flushing or turning red anywhere?", "Have you noticed rashes or bumps in his skin?", "Have you noticed any changes in pigmentation?"),
new Array ("Has he experienced any shortness of breath?", "Has he experienced any cough?", "Do you have a family history of heart or lung disease?", "Do you have a family history of respiratory disease?", "Any history of coronary artery disease?", "Do you have a family history of allergies?", "Any history of anemia?", "Has he experienced any heart palpitations?"),
new Array ("Is he experiencing and numbness or tingling?", "Do you have a family history of diabetes?", "Do you have any history of seizures?", "Do you have any history of serious head injuries?", "Do you have any visual disturbances or other problems related to eyes, ears, nose, or throat?", "Any sores in his mouth or nose? Any hoarseness?", "Do you have a family history of stroke or neurological disorders?", "Has he had fevers or night sweats?", "Have you noticed any swollen glands?")
);

var rAnswers = new Array (
new Array ("No, but you would think so after all the coughing he does.", "I don't think so.", "Yes! A few hours after he eats, he just cries and cries.", "No.", "No.", "No.", "No.", "No.", "No.", "He tires out pretty quickly, but it doesn't seem to hurt him."),
new Array ("No.", "He plays whenever he can.", "He eats like a horse, but it just goes right through him.", "No.", "No", "He tires out quickly."),
new Array ("Oh yes. He's always hungry!", "Yes.", "Oh, yes.  We eat a lot of salads and vegetables.", "Yes. He screams a few hours after just about every meal.", "Not after eating, but sometimes he coughs so hard he throws up.", "He's always been small for his age and I think he's too skinny."),
new Array ("A lot.  He's always asking for juice and milk.", "It's hard to tell with these super-absorbent diapers.  I guess we change him 6 or so times a day.", "I haven't notice any color.  I guess it's okay.", "No.", "No, he's just as skinny as always.", "No."),
new Array ("No.", "Yes. He gets a tummy ache after he eats.", "Yes. He coughs so hard he throws up.", "He was born constipated!  And his stools are so big they must be hard to pass.", "No - but he does poop a lot.", "They're a lot larger than my first baby's.", "They're kind of pale.", "It's kind of strange and greasy-looking.", "Oh, my goodness! They smell just awful!"),
new Array ("Yes - it seems he's always tired and ready for a nap.", "Hmm.. about 12 or 14 hours, between nighttime and his naps.", "No, but I can hear this funny wheezing sound when he breathes.", "Yes - he'll go down for an hour or so in the morning and take another nap in the afternoon.", "No, he doesn't. He's always coughing and hacking himself awake."),
new Array ("Yes, he does because he's always got some kind of chest infections.", "No.", "Yes. Ever since he started walking, he's got so many bruises I'm afraid someone might think we beat him.", "Just when he's having a hard coughing fit.", "No.", "No."),
new Array ("He always seems to have trouble breathing.", "Yes! All the time.", "No.", "I don't think anyone on my side of the family does. I'll have to ask my husband about his family.", "No.", "Well, my husband is allergic to ragweed. He's had to have shots ever since we came to Ohio.", "No.", "No."),
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.")
);

function popQuestions (inForm) {
	var theSelect = inForm.questionval1;
	
	for (x = 0; x < theSelect.options.length; x++)
		theSelect.options[x] = null;
	
	for (x = 0; x < rQuestionVar1.length; x++) {
		theSelect.options [x] = new Option (rQuestionVar1 [x], x, (x == 0 ? true : false));
	}
	
	theSelect.options [0].selected = true;
	
	popQuestion2 (inForm, 0);
}

function popQuestion2 (inForm, inWhich) {

	var theArray = rQuestionVar2 [inWhich];
	var theSelect = inForm.questionval2;
	
	for (x = 0; x < theSelect.options.length; x++)
		theSelect.options[x] = null;
	
	for (x = 0; x < theArray.length; x++) {
		theSelect.options [x] = new Option (theArray [x], x, (x == 0 ? true : false));
	}
	
	theSelect.options [0].selected = true;

}

function patientAnswer (inForm) {
	
	var theAnswer = rAnswers [inForm.questionval1.selectedIndex];
	theAnswer = theAnswer [inForm.questionval2.selectedIndex];
	
	alert (theAnswer);
}

