// questions.js

var rQuestionVar1 = new Array (
"Pain",
"Life Style",
"Eating Habits",
"Urination",
"Gastrointestinal",
"Sleep",
"Sexual Activity/Reproductive Years",
"Dermatological/Oral/Musculoskeletal",
"Cardiovascular",
"Respiratory",
"Hematologic",
"Neurologic",
"Other Symptoms"
);

var rQuestionVar2 = new Array (
new Array ("Do you have any chest pains?", "Do you have any headaches?", "Abdomen?", "Gastric?", "Lower extremity?", "Upper extremity?", "Back?", "Feet?", "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 do you describe your diet?","Does physical activity cause pain?", "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 vomitting/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?", "Persistent diarrhea?"),
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 ("Do you have any changes in urinary patterns such as hesitancy?", "Do you urinate more than six times a day?", "Do you have any prostate problems?", "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 ("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 rash or hives?", "Have you noticed other lumps or bumps in your skin?", "Any changes in pigmentation? Skin moles?", "Arthritis, rheumatism or gout?", "Dentures?"),
new Array ("Any history of coronary artery disease?", "Any history of anemia?", "Have you experienced any heart palpitations?", "High blood pressure?", "Heart murmur?", "Heart pacemaker or defibrillator?", "Arrythmia?", "Rheumatic heart disease?", "Other heart problems?"),
new Array ("Have you experienced any shortness of breath?", "Have you experienced a persistent 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 bronchitis?", "Any other respiratory problems?"),
new Array ("Have you had any blood transfusions?", "Have you had anemia?", "Bleeding tendency?", "Hemophilia?", "Leukemia?"),
new Array ("Numbness or tingling?", "Any history of convulsions or serious head injuries?", "Any history of stroke or transient ischemic attack?", "Vision problems?", "Earaches, ringing in the ears?", "Hearing loss.", "Severe headaches.", "Fainting or dizzy spells?"),
new Array ("Are you allergic to any medications?", "Are you allergic to any foods, preservatives, clothing, animals, etc?", "Any problems related to eyes, ears, nose or throat?", "Any sores in your mouth or nose? Any hoarseness?", "Swollen glands?", "Have you ever had an operation or surgery?", "Have you ever been hospitalized?", "Are you taking any medication?")
);

var rAnswers = new Array (
new Array ("No.", "Yes, sometimes.", "No.", "No.", "No.", "No.", "No.", "No.", "I've got a little artha-ritis.", "No.", "No.", "Henry: No.<BR>Virginia:  Daddy's really not very active."),
new Array ("Henry:  Umm.... <BR>Virginia:  Nothing phases him.", "No.", "Henry:  I like plain food. <BR>Virginia:  Daddy does all right when we eat out, but at home he just has baked sweet potatoes and baked apples.  Sometimes he'll have a baked pear for variety.", "Henry: I think... <BR>Virginia:  He's too inactive for me to answer that question.", "Never.", "Never.", "Henry: No, I don't. <BR>Virginia:  Daddy drinks milk.", "Virginia:  I don't know.  He's always been this way - kind of quiet, y'know.", "Henry: All right. <BR>Virginia:  Daddy doesn't seem to have much energy."),
new Array ("Virginia:  He barely nibbles.", "Henry: I think so.... <BR>Virginia: Daddy, your diet is a little old. He eats just baked sweet potatoes, baked apples, and pears with milk.", "Virginia:  Lots of sweet potatoes, apples, and pears!", "No.", "No.", "Henry: No... <BR>Virginia:  I think he's lost a few pounds over the past 15 years or so."),
new Array ("Henry: Ummm.... <BR>Virginia:  He drinks about half a glass of milk with his meals.", "No.", "Henry:  (Looks puzzled) <BR>Virginia: I haven't seen it.", "No.", "Henry:  No. -- Virginia:  I haven't seen any major weight loss.", "No.", "No.", "No."),
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No."),
new Array ("Henry:  I sleep pretty good. <BR>Virginia:  He sleeps all night and dozes off a lot during the day.", "Yes.", "Virginia:  He gets about 8 hours at night, plus whatever naps he takes during the day. -- Henry:  I guess I'm making up for all the sleep I lost during the War.", "Virginia:  Oh, yes.", "Henry: Yes. <BR>Virginia:  He doesn't lie down for a nap, but he gets all kinds of little naps in his chair.", "Henry: Reading sometimes.  I don't like television. <BR>Virginia: He dozes off all the time - in church or whenever he's sitting quietly."),
new Array ("Henry:  (chuckles)  Um.. <br>Virginia: No.", "Henry:  (chuckles)  Um.. <br>Virginia: I don't think so.", "Henry:  (chuckles)  Um.. <br>Virginia: No.", "Henry:  (looks embarrassed) <BR>Virginia: What does that have to do with anything?", "Henry: (looks surprised) -- Virginia:  Mother died three months ago.  Before that they were married for over 40 years.", "Henry:  (chuckles)  Um.. -- Virginia: No"),
new Array ("No.", "Henry:  No. <BR>Virginia: Now, Daddy, I think you do have some night sweats.  Remember how your pajamas are so wet we have to wash them?", "No.", "No.", "No.", "No.", "No.", "Henry: My hands... -- Virginia: Daddy's got a little arthritis in his hands and back.", "Henry: I've got all my own teeth. <BR>Virginia: Daddy's very proud of his teeth. He's always brushing them."),
new Array ("No.", "No.", "No.", "Henry: Not anymore… -- Virginia: Daddy takes DynaCirc for his blood pressure.  It seems to be working well for him.", "No.", "No.", "No.", "Henry: I had that years ago, but I'm all right now. -- Virginia:  Mother told me that Daddy has a weak valve from that.", "No."),
new Array ("No.", "No.", "No.", "No.", "No.", "No.", "No."),
new Array ("No.", "No.", "No.", "No.", "No."),
new Array ("No.", "No.", "Henry: Yes, a few years... <br>Virginia: Daddy definitely had a stroke a few years ago.  He woke up and one side of his mouth was paralyzed.  But he recovered just fine.", "Yes, I wear glasses.", "No.", "No.", "Henry: No. -- Virginia:  Daddy gets headaches, but I don't know how bad they are.", "Henry: Yes. <BR>Virginia:  Daddy fainted on the bus about three years ago.  The bus people brought him home."),
new Array ("No.", "No.", "No.", "Henry:  No. <BR>Virginia:  His mouth is in great condition.  He brushes his teeth like it's an obsession.", "No.", "No.", "Henry: No. <BR>Virginia:  Daddy hates going to doctors.  I don't think he's been to the hospital since he hurt his hands around 1988.", "Just my blood pressure pills.")
);

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);
}

