// 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 ("What area of your head hurts?", "How long have you been having these headaches?", "How often do you experience your headaches?", "Can you describe the pain?", "Does the pain begin suddenly and severely or does it develop more slowly?", "Is there a pressure or band-like sensation?", "Does anything seem to make the pain worse?", "Does physical activity trigger your headaches?", "Are the headaches associated with your menstrual periods?", "How long do your headaches last?", "Do medications help?", "Have you had episodes of headaches before?"),
new Array ("How would you rate your stress level?", "Do you exercise regularly?", "How would you describe your diet?", "Does physical activity make your headaches worse?", "Does you consume alcohol?  If yes, how much?", "Are you a smoker? If yes, how much?", "Does you consume caffeine?  If yes, how much?", "Does you have any history of depression or anxiety?", "How are your energy levels?"),
new Array ("How is your appetite?", "Do you eat a balanced diet?", "How many servings of fruits and vegetables do you eat each day?", "Do you have any pain after eating?", "Do you have any nausea or vomiting?", "Have you experienced any 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?", "Have you noticed any change in urinary pattern or blood in urine?", "Do you have any history of kidney stones?"),
new Array ("Do you have any heartburn or problems swallowing?", "Any history of peptic ulcer disease, gallbladder or abdominal pain?", "Do you have any nausea or vomiting?", "Have you noticed any change in bowel habits?", "Any rectal bleeding?", "Changes in stool consistency, color, or odor?"),
new Array ("How would you describe your sleep habits?", "Do you fall asleep easily?", "How much sleep do you get?", "Do you snore?", "Do you nap during the day?", "Do the headaches wake you up at night?"),
new Array ("Are you pregnant?", "Are you having regular menstrual periods?", "When was your last menstrual period?", "Do you have any premenstrual symptoms?","Are you using birth control? What type?", "Are you having any unusual vaginal bleeding or discharge?", "Have you noticed any breast lumps or do you have a history of breast cancer?", "How many times have you been pregnant?", "How many sexual partners have you been with in the past 15 years?", "When was your last pap test? Was it normal?", "When was your last breast exam? Was it normal?"),
new Array ("Have you experienced any fevers or warmth?", "Have you experienced night sweats?", "Do you bruise easily?", "Any changes in body or facial hair?", "Any history of skin lesions or rashes?", "Have you noticed other lumps or bumps in your skin?", "Any changes in pigmentation? Skin moles?"),
new Array ("Have you experienced any shortness of breath?", "Have you experienced any cough?", "Do you have a family history of heart or lung disease?", "Do you have a family history of asthma?", "Do you have emphysema?", "Any history of coronary artery disease?", "Any history of anemia?", "Have you experienced any heart palpitations?"),
new Array ("Are you experiencing any 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 your mouth or nose? Any hoarseness?", "Do you have a family history of stroke or neurological disorders?", "Do you have a family history of cancer?", "Have you had fevers or night sweats?", "Have you noticed any swollen glands?")
);

var rAnswers = new Array (
new Array ("Right here. (She indicates the right parietal and temporal areas.)", "It's hard to say.  I've always had some migraines that come around my periods.    Then this headache started in about 5 months ago.  It won't go away and lately it's  been getting worse.", "It seems like I've always got a headache to some degree.  Sometimes I just know it's there, but other times it really knocks me out.", "It's usually a dull ache, but sometimes it can start throbbing and get pretty bad.", "I wake up with it, and it feels better after I take 3 Extra Strength Advil.", "No.", "Bending over, coughing, and having a B.M.", "It's hard to say.  I mean, I'm OK during mild exercise, but doing something hard makes it hurt worse.", "Y'know, they do seem to get worse right before my period starts.", "It seems like  I always have some kind of headache.", "A little bit, but we're going through a lot of bottles of Tylenol and Advil!  I take about 3 or 4 tablets every morning.", "Just the migraines, but Midrin used to take care of them.  That's what makes this so frustrating for me."),
new Array ("I guess it's OK.", "Yes.  I go to an aerobics class twice a week.", "It's OK, but I don't think I get enough vegetables because no one else will eat them.", "Y'know, they do seem to get worse when I cough or bend over to pick something up.", "Not often.  I might have a margarita every couple of months.", "I quit smoking just about 8 years ago.", "Yes - a couple of cups of coffee in the morning, and maybe a Diet Coke later on in the day.", "Nothing that doesn't go away by the next morning.", "They're OK."),
new Array ("It's good.", "I think so.", "Hmm... three or four, I guess.", "No.", "Yes!  Whenever I get one of these headaches!  And sometimes I throw up before breakfast - quite violently.", "(Chuckles).  I've been trying to lose the same 10 pounds after my kids were born."),
new Array ("About 6 to 8 glasses of water a day, plus whatever I drink at meals.", "I don't think so.", "It's pale yellow.", "No.", "Not really.  I've been trying to lose the same 10 pounds for years!", "No.", "No.", "No."),
new Array ("No.", "No.", "Yes - whenever I have these headaches.  Between the pain and the throwing up, I'm pretty miserable.", "No.", "No.", "No."),
new Array ("They're pretty regular.  I go to bed around 10:30 and get up around 6:00.", "Oh, yes!", "About 8 hours a night.", "Not that I know of!", "No.", "No."),
new Array ("No.", "Yes.", "Last week.", "Just these headaches!  They seem to get worse around then.", "I've been taking birth control pills ever since my son was born last year.", "No.", "No.", "Three times.", "Just my husband.  We've been married 14 years!", "Last year, and it was normal.", "I had a normal exam at the doctor's office last year."),
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No."),
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No.", "No."),
new Array ("No.", "No.", "It's funny you should ask.  I had a funny spell around Christmas-time last year. I didn't thrash around or anything.  I just stared into space for a couple of minutes.", "No.", "Sometimes my vision gets kind of blurry and I see halos around lights, but it usually goes away.", "No.", "No one's had any strokes, but my mother had bad headaches, too.", "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);
}

