// 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 ("Do you have any chest pains?", "Do you have any headaches?", "Are you experiencing any abdominal pain?", "Gastric?", "Any leg pains?", "Do you have pain in your arms or upper extremities?", "Do your feet hurt?", "Are you experiencing any backache?", "Do you have any history of joint problems?", "Do you have any history of bone problems?", "Do you have any muscle pains?", "Does physical activity cause pain?"),
new Array ("How is your stress level?", "Do you exercise regularly?", "How would you describe your diet?", "Does physical activity make your symptoms worse?", "Do you consume alcohol? If yes, how much?", "Are you a smoker? If yes, how much?", "Do you consume caffeine? If yes, how much?", "Do 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?", "Do you eat fruits and veggies?", "Do you have any pain after eating?", "Any 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?", "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 you fall asleep reading or watching TV?"),
new Array ("Are you pregnant?", "Are you having regular menstrual periods?", "When was your last menstrual period?", "Are you using birth control? What type?", "Are you having any unusual vaginal bleeding or discharge?", "Have you noticed any breast lumps or history of breast cancer?", "How many times have you been pregnant?", "How many sexual partners have you had 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 any history of heart or lung disease?", "Do you have any history of asthma?", "Any history of emphysema?", "Any history of coronary artery disease?", "Have you experiences any heart palpitations?"),
new Array ("Numbness or tingling?", "Do you have any history of diabetes?", "Any history of convulsions or serious head injuries?", "Any problems relating to eyes, ears, nose, or throat?", "Any sores in your mouth or nose? Any hoarseness?", "Any history of stroke or neurological disorders?", "Fevers or night sweats?", "Swollen glands")
);

var rAnswers = new Array (
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "No.", "No."),
new Array ("It's pretty rough right now at work.  We're very short-staffed and, since I've been putting in about 70 hour weeks, I haven't had time to take care of myself.", "No, I don't. Exercise has become almost impossible because I run out of breath so fast.", "It's terrible! I've been living on cereal and fast food.", "Absolutely! Just walking up stairs or carrying groceries puts me completely out of breath.", "Not much.  Just a glass of wine on special occasions.", "I've been smoking a pack or two a day for about 25 years.", "Yes. I drink two or three big (20 oz.) bottles of Diet Pepsi a day and I like a pot of tea while I'm working in the evenings.", "I'm afraid I have some trouble with depression.  I've been taking about 25 mg. of Paxil for three years now and it really helps.", "I'm exhausted all the time.  It's just been getting worse and worse."),
new Array ("It's OK. I just eat what I can find.", "No, I pretty much just do yogurt at my desk and a drive-through for supper.", "Not enought of them.  I try to get a couple of big salads at Wendy's a week.", "No.", "No.", "I've lost a few pounds this year from all the stress and no time to shop for food."),
new Array ("That's easy: three big bottles of Diet Pepsi during the day and about six cups of tea at night.", "No.", "It's pale yellow.", "No.", "I've lost a few pounds this year from all the stress.", "No.", "No.", "No."),
new Array ("No.", "No.", "No.", "No.", "No.", "No."),
new Array ("I get to bed around midnight and get up at six a.m.", "Yes, I'm so tired I fall asleep as soon as my head hits the pillow.", "About six hours.", "No.", "No.", "No."),
new Array ("No.", "Yes.", "Three weeks ago.", "No, I don't have a social life!", "No.", "No.", "Never.", "Just my husband, but we divorced ten years ago.", "Umm... about two years ago? It was OK.", "Umm... about two years ago? It was OK."),
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No."),
new Array ("Oh, all the time!  I can't even walk from my car to my office without getting winded.", "Yes, I've been coughing for the last 6 months.  Sometimes it wakes me up, and it's usually worse in the morning.", "No.", "No.", "No.", "No.", "No.", "No."),
new Array ("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);
}

