// 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 ("Are you experiencing any chest pain?", "How about your head?","Abdomen?", "Do you have a stomach ache?", "Do your legs hurt?", "How do your hands and arms feel?", "Does your back hurt?", "Do you feel any pain in your feet?", "Do you have any joint pain?", "Muscle aches?", "Does physical activity cause pain?" ),
new Array ("How stressful is your lifestyle?", "Do you exercise regularly?", "What kinds of food do you eat?", "Does physical activity cause pain?", "Do you use alcohol?", "Do you smoke?", "How do you feel emotionally?", "How are your energy levels?"),
new Array ("How's your appetite?", "Do 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 ("Do you have difficulty urinating?", "Do you have any trouble achieving or maintaining an erection?", "How many partners have you been with in the past 15 years?", "Have you ever had intercourse with another man?"),
new Array ("Fever/Warmth", "Night sweats", "Bruising", "Acne", "Hirsuitism", "Redness (Erythema)", "Have you noticed other lumps or bumps in your skin?", "Changes in pigmentation?", "Dry mouth?"),
new Array ("Nausea", "Vomiting", "Numbness or tingling?", "Cough", "SOB", "Palpitations", "Fever", "Night sweats", "Swollen glands", "Dizziness?")
);

var rAnswers = new Array (
new Array ("No, I feel OK.", "I gotta headache.", "My gut aches.", "Yeah.", "Just a little sore. No big deal.","OK, but look how swollen my fingers are!", "No - just my butt from the bike.", "No, but they swelled up so much the medic had to take off my cleats.", "No.", "Nah... well, a coupla leg cramps.", "Are you kidding? I just did over 120 miles on a bike! Of course it causes pain."),
new Array ("My job's pretty high stress.", "I don't have time to get around to it.", "Mostly Wendy's at lunch, but my wife makes me eat vegetables at dinner.", "Not until today.", "Just a couple of beers a week.", "No.", "I don't pay much attention to that kind of stuff.", "I'm tired a lot."),
new Array ("OK.", "Yeah.", "My wife makes me eat them at dinner.", "No.", "No.", "No. I've weighed pretty much the same since college."),
new Array ("On this trip, I've been drinking a LOT of water. I did about three bottles before I got in trouble, then drank another 4 or 5 from the guys.", "Nah, I hardly have to pee at all. Maybe a little since I drank all that water.", "Clear.", "No.", "No.", "Yeah - in my hands and feet."),
new Array ("No.", "No.", "No.", "OK.", "Brown.", "Normal."),
new Array ("Yes.", "About 7 hours.", "Sometimes, according to my wife.", "No.", "No."),
new Array ("No.", "No.", "Just my wife.", "Heck, no!"),
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "Yeah, on the road. But it's going away."),
new Array ("Yeah.", "Not yet.", "No.", "No.", "No.", "My heart was going pretty hard out there.", "No.", "No.", "No.", "Just when I get up.")
);

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);
}

