// 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", "Abdomin", "Gastric", "Lower extremity", "Upper extremity", "Back", "Feet", "Joints", "Muscle", "Does physical activity cause pain?" ),
new Array ("Stress", "Exercise", "Diet", "Does physical activity cause pain?", "Alcohol use", "Tobacco use", "Mood", "Energy levels"),
new Array ("Appetite", "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 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?"),
new Array ("Nausea", "Vomiting", "Numbness or tingling?", "Cough", "SOB", "Palpitations", "Fever", "Night sweats", "Swollen glands")
);

var rAnswers = new Array (
new Array ("Yes, right in the middle of my chest whenever I get excited or overdo it.", "Sort of - it travels up to my neck and jaw, but it'll go away if I can just relax.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "Yes."),
new Array ("It hurts when I get upset, but it'll go away if I can just relax.", "I know I oughta be more active, but that's when this chest pain starts.", "I'm a meat and potatoes man, myself.", "Sure does!", "A few beers on weekends", "I quit 7 years ago.", "Pretty good.", "I felt pretty good until about four months ago, when this chest pain started up."),
new Array ("No problem - I love to cook.", "I guess so...", "Nah, I'm really not into rabbit food.", "No.", "No.", "I've just put on a few pounds over the years."),
new Array ("Hmm, a couple cups of coffee, Coke with lunch, not a whole lot, I guess.", "Nah...", "Medium yellow.", "Nope.", "Not really.", "No."),
new Array ("No, I'm pretty regular.", "No.", "No.", "Ok - medium firm, I guess.", "Brown.", "Nothing unusual."),
new Array ("Yes.", "About 7 hours.", "Sometimes, according to my wife.", "No.", "No."),
new Array ("No.", "No.", "Just my wife. What does this have to do with my chest pain?", "Heck, no!"),
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No.", "No."),
new Array ("No.", "No.", "No.", "No.", "No.", "Yes.", "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);
}

