// questions.js

var rQuestionVar1 = new Array (
"Pain",
"Life Style",
"Eating Habits",
"Urination",
"Bowel Habits/Stool",
"Sleep",
"Sexual Activity/Reproductive Years",
"Skin Symptoms",
"Other Symptoms"
);

var rQuestionVar2 = new Array (
new Array ("Chest", "Head", "Abdomen", "Gastric", "Lower extremity", "Upper extremity", "Back", "Feet", "Joints", "Muscle", "Does physical activity cause pain?"),
new Array ("Are you under a lot of stress right now?", "Do you exercise regularly?", "How would you describe your diet?", "Does physical activity cause pain?", "How much alcohol do you consume each week?", "Do you smoke?", "Have you noticed any odd changes in your mood?", "How are your energy levels?"),
new Array ("Is your appetite OK?", "Would you say you eat a balanced diet?", "Fruits and veggies?", "Pain after eating?", "Vomiting/spitting up?", "Weight gain or loss?"),
new Array ("How much fluids do you drink each day?", "Do you need to urinate frequently?", "What color is your urine?", "Do you have any difficulty urinating?", "Have you lost or gained any weight recently?", "Do you notice any swelling?"),
new Array ("Constipation", "Diarrhea", "Rectal bleeding", "Stool consistency", "Stool color", "Odor"),
new Array ("Do you fall asleep easily?", "How much sleep do you get?", "Do you snore?", "Do you nap during the day?", "Do you fall asleep reading or watching TV?"),
new Array ("Are you pregnant?", "Are your periods regular?", "Are you taking birth control pills?", "How many times have you been pregnant?", "How many partners have you been with in the past 15 years?"),
new Array ("Have you been experiencing any fevers or hot flashes?", "Do you have night sweats", "Do you bruise easily?", "Have you been having any trouble with acne?", "Are you experiencing any unusual hair growth?", " Has your skill started flushing or turning red anywhere?", "Have you noticed other lumps or bumps in your skin?", "Have you noticed any changes in pigmentation?"),
new Array ("Nausea", "Vomiting", "Numbness or tingling?", "Cough", "SOB", "Palpitations", "Fever", "Night sweats", "Swollen glands")
);

var rAnswers = new Array (
new Array ("No.", "Sometimes.", "No.", "No.", "No.","No.", "Yes, in my lower back.", "No.", "No.", "No.", "Not really. I've been walking to lose weight, but it's not helping."),
new Array ("No, and I can't figure out why I go kind of crazy now and them.", "We walk our dog for 45 minutes after supper.", "I've been trying to cut down. Y'know, eat more fruits and veggies, but I just can't lose weight!", "No.", "Just some wine at special occasions. I'm really not much of a drinker.", "I quit 13 years ago!", "My kids tell me I've been a real grouch lately. One time I went completely wacko and my husband took me to the hospital. But lately, I've just been feeling down in the dumps.", "It seems like I'm tired all the time."),
new Array ("Oh, yes. I'm always hungry!", "I'm trying to watch what I eat.", "Oh, yes. We eat a lot of salads and vegetables.", "No.", "No.", "Oh, yes! I wasn't nearly this heavy four years ago! And I just can't lose weight!"),
new Array ("A lot. I keep water at my desk because I'm always thirsty.", "Every couple of hours, I guess.", "Pale yellow.", "No.", "Yes, that's why I came in today.", "No."),
new Array ("No.", "No.", "No.", "Normal.", "Normal.", "Normal."),
new Array ("Yes, as soon as I hit the pillow.", "I try to get my 8 hours a night.", "No.", "No.", "Sometimes."),
new Array ("No.", "They have been getting lighter and coming less often. Do you think I'm going through the change?", "No, just vitamins.", "I have four children.", "Just my husband. We've been married 22 years."),
new Array ("No.", "No.", "Yes.", "Yes, I have all of these tiny pimples on my chin and more on my back.", "Now that you ask, I am getting a moustache. And the hair on my legs and stomach is growing faster.", "Yes, my face hasn't always been this pink.", "Just these funny stretch marks. They're showing up everywhere.", "I'm getting these funny stretch marks. You'd think I was pregnant!"),
new Array ("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);
}

