// questions.js

var rQuestionVar1 = new Array (
"Pain",
"Life Style",
"Eating Habits",
"Urination",
"Digestive System",
"Sleep",
"Sexual Activity/Reproductive Years",
"Skin Symptoms",
"Heart and Lung",
"Other Symptoms"
);

var rQuestionVar2 = new Array (
new Array ("Where does it hurt?", "How long has he been having this pain?", "Abdominal pain?", "Does the pain begin suddenly and severely or does it develop more slowing?", "Is the pain constant or does it come and go?", "What makes the pain worse?", "Does physical activity cause pain?", "Does resting make the pain worse?", "Does applying heat help?", "Do medications help?"),
new Array ("How is his stress level?", "Does he exercise regularly?", "How would you describe his diet?", "Does physical activity cause pain?", "Does he consume alcohol?  If yes, how much?", "Are you a smoker? If yes, how much?", "Does he consume caffeine?  If yes, how much?", "Does he have any history of depression or anxiety?", "How are his energy levels?"),
new Array ("How is his appetite?", "Does he eat a balanced diet?", "Does he eat fruits and veggies?", "Does he have any pain after eating?", "Any vomitting/spitting up?", "Weight gain or loss?"),
new Array ("How much fluids does he drink each day?", "Does he need to urinate frequently?", "What color is his urine?", "Does he have any difficulty urinating?", "Has he lost or gained any weight recently?", "Do you notice any swelling?", "Have you noticed any change in urinary pattern or blood in urine?", "Does he have any history of kidney stones?"),
new Array ("Does he have any heartburn or problems swallowing?", "Any history of peptic ulcer disease, gallbladder or abdominal pain?", "Does he have any nausea or vomiting?", "Has he noticed any change in bowel habits?", "Any rectal bleeding?", "Changes in stool consistency, color, or odor?"),
new Array ("How would you describe his sleep habits?", "Does he fall asleep easily?", "How much sleep does he get?", "Does he snore?", "Does he nap during the day?", "Does he fall asleep reading or watching TV?"),
new Array ("Does he have any changes in urinary patterns such as hesitancy?", "Has he noticed any changes in frequency of urination?", "Does he have any prostate problems?", "Does he have any trouble achieving or maintaining an erection?", "How many partners has he been with in the past 15 years?", "Has he ever had intercourse with another man?"),
new Array ("Has he experienced any fevers or warmth?", "Has he experienced night sweats?", "Does he bruise easily?", "Any changes in body or facial hair?", "Any history of skin lesions or rashes?", "Have you noticed other lumps or bumps in his skin?", "Any changes in pigmentation? Skin moles?"),
new Array ("Has he experienced any shortness of breath?", "Has he experienced any cough?", "Does he have a family history of heart or lung disease?", "Does he have a family history of asthma?", "Any history of emphysema?", "Any history of coronary artery disease?", "Any history of anemia?", "Has he experienced any heart palpitations?"),
new Array ("Numbness or tingling?", "Does he have a family history of diabetes?", "Any history of convulsions or serious head injuries?", "Any problems related to eyes, ears, nose or throat?", "Any sores in his mouth or nose? Any hoarseness?", "Does he have a family history of stroke or neurological disorders?", "Fevers or night sweats?", "Swollen glands?")
);

var rAnswers = new Array (
new Array ("It seems to hurt him everywhere: stomach, legs, and joints.", "I guess it started soon after he came to us.", "Yes, sometimes." , "It seems to take about 15 minutes before he's really hurting.", "It comes and goes.", "It seems to get worse after he's been crying awhile or if he doesn't get enough to drink.", "I don't know.  He's just started to walk, but it gets worse when he cries a lot.", "No, it makes it better!", "Yes.", "The only thing I give him is Tylenol and it doesn't help much."),
new Array ("I don't know what it was like with his mother, but he seems to be doing well at our house.", "Does crawling count as exercise?", "He eats table food and really puts it away!", "I don't know.  He's just started to walk.", "Of course not! He's just a baby.", "I don't smoke.  How will this affect him?", "No. We don't even let our kids drink Coke.", "I don't know.", "He seems to tire out easily."),
new Array ("It's really good.", "I see that he does!", "Oh, yes.  He loves carrots and bananas.", "No", "No", "He seems to be gaining weight nicely."),
new Array ("He gets about 3 glasses of milk. Some juice and water too.  He's a thirsty little guy.", "He wets about 6 or 8 diapers a day.", "It's real light and clear.", "Nope.", "He's growing like any other kid.", "No.", "No.", "I don't know."),
new Array ("No.", "No.", "No.", "No.", "No.", "No."),
new Array ("He sleeps through the night and takes an afternoon nap.", "Yes.", "About 12 hours.", "No.", "Yes, he goes down for about an hour and a half in the afternoons.", "Well, I'll read to him or let him watch TV if it'll get him to nap!"),
new Array ("No.", "No.", "What? No!", "What? No!", "None!  He's just a baby!", "Heck, no! He's just a baby!"),
new Array ("Sometimes he feels hot and has a fever.", "No.", "No.", "No.", "Not since he's been with us.", "No.", "No."),
new Array ("Yes, sometimes he seems to be gasping for breath.", "No.", "I don't know.", "I don't know.", "I don't know.", "I don't know.", "I don't know.", "Sometimes his heart seems to beat really fast."),
new Array ("No.", "I don't know.", "No.", "No.", "No.", "I don't know.", "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);
}

