function Change_Patient_Relationship() {

if (document.pc.Patient_Relationship.options[document.pc.Patient_Relationship.selectedIndex].value == 3) {

var el=document.getElementById('Health_Care_Providers');el.style.display='block';
}

else {

var el=document.getElementById('Health_Care_Providers');el.style.display='none';

var el=document.getElementById('Phsyician_Types');el.style.display='none';
}


//end function
}

function Change_Health_Care_Provider() {

if (document.pc.Health_Care_Provider.options[document.pc.Health_Care_Provider.selectedIndex].value == 3) {

var el=document.getElementById('Phsyician_Types');el.style.display='block';
}

else {

var el=document.getElementById('Phsyician_Types');el.style.display='none';
}

//end function
}

function PC_Demographic() {

var missing_answers = "";
var errors = "";
var errors_found = 0;


//List all simple verifcations




//Check if user selected a Gender
if (document.pc.Gender.selectedIndex == "") {

missing_answers = missing_answers + "Sex\n";

errors_found++;
}

//Check if user selected a Race
if (document.pc.Race.selectedIndex == 0) {

missing_answers = missing_answers + "Race\n";

errors_found++;
}

//Check if user selected an Diagnosis Age
if (document.pc.Diagnosis_Age.selectedIndex == 0) {

missing_answers = missing_answers + "Age at Diagnosis\n";

errors_found++;
}

//Check if user selected a Current Age
if (document.pc.Current_Age.selectedIndex == 0) {

missing_answers = missing_answers + "Current Age\n";

errors_found++;
}

//Check if user selected a Education
if (document.pc.Education.selectedIndex == 0) {

missing_answers = missing_answers + "Highest Education Level\n";

errors_found++;
}

//Check if a option is selected for managing your healthcare needs

if (document.pc.Patient_Relationship.selectedIndex == 0) {

missing_answers = missing_answers + "What is your relationship to the patient?\n";

errors_found++;
}
//Check if user selects health care provider other text for managing your healthcare needs

if (document.pc.Patient_Relationship.options[document.pc.Patient_Relationship.selectedIndex].value == 3 && document.pc.Health_Care_Provider.selectedIndex == 0) {

missing_answers = missing_answers + "Healthcare Prodiver Type\n";

errors_found++;
}

//Check if user selects physician type

if (document.pc.Health_Care_Provider.options[document.pc.Health_Care_Provider.selectedIndex].value == 3 && document.pc.Phsyician_Type.selectedIndex == 0) {

missing_answers = missing_answers + "Phsyician Type\n";

errors_found++;
}

//Check if user selected a Treatment
if (document.pc.Treatment.selectedIndex == 0) {

missing_answers = missing_answers + "Type of Treatment\n";

errors_found++;
}

//Check if a option is selected for managing your healthcare needs

if (document.pc.Managing_Healthcare.selectedIndex == 0) {

missing_answers = missing_answers + "Who is currently managing your healthcare needs?\n";

errors_found++;
}

//Check if user entered other text for managing your healthcare needs

if (document.pc.Managing_Healthcare.options[document.pc.Managing_Healthcare.selectedIndex].value == 4 && document.pc.Other_Managing_Healthcare.value == "") {

missing_answers = missing_answers + "Specify who is currently managing your healthcare needs\n";

errors_found++;
}


function Show_SubCancer_Types() {

if (document.pc.Category_ID.options[document.pc.Category_ID.selectedIndex].value == 3) {

var el=document.getElementById('SubCancer_Types');el.style.display='block';
}

else {

var el=document.getElementById('SubCancer_Types');el.style.display='none';
}

//end function
}

//Check if user selected geographical location

var Checked = 0;

for (x = 0; x<document.pc.Country.length; x++) {

if (document.pc.Country[x].checked == true) {

Checked = 1;
}

//end for loop
}


if (Checked == 0) {

missing_answers = missing_answers + "What is your geographical location?\n";

errors_found++;
}





//Make sure other geographical information is selected or inputted


//US geographical check

if (document.pc.Country[0].checked == true) {


if (document.pc.State.selectedIndex == 0) {

missing_answers = missing_answers + "Select State\n";

errors_found++;
}

}


//Canada geographical check

if (document.pc.Country[1].checked == true && document.pc.Province.selectedIndex == 0) {

missing_answers = missing_answers + "Select Province\n";

errors_found++;
}

//Other country geographical check

if (document.pc.Country[2].checked == true && document.pc.Other_Country.selectedIndex == 0) {

missing_answers = missing_answers + "Please Select Country\n";

errors_found++;
}

//Check if user selected a Where do you consider yourself living?

if (document.pc.Living[0].checked == false && document.pc.Living[1].checked == false && document.pc.Living[2].checked == false) {

missing_answers = missing_answers + "Where do you consider yourself living?\n";

errors_found++;
}

//Check if user selected a Where do you consider yourself living?

if (document.pc.Where_CancerCenter[0].checked == false && document.pc.Where_CancerCenter[1].checked == false && document.pc.Where_CancerCenter[2].checked == false) {

missing_answers = missing_answers + "Where have you received most of your cancer care?\n";

errors_found++;
}


//Check if user selected a How far do you live from the cancer center where you received most of your cancer treatment?

if (document.pc.CancerCenter[0].checked == false && document.pc.CancerCenter[1].checked == false) {

missing_answers = missing_answers + "How far do you live from the cancer center?\n";

errors_found++;
}


//Check if user selected a Have you ever had a primary care doctor?

if (document.pc.PrimaryDoctor[0].checked == false && document.pc.PrimaryDoctor[1].checked == false) {

missing_answers = missing_answers + "Have you ever had a primary care doctor?\n";

errors_found++;
}

//If user answered NO to having a primary care doctor, check to see if they selected a who do they follow up with

if (document.pc.PrimaryDoctor[0].checked == true && items_checked == 0 && document.pc.IfNo_FollowUp.value == "") {

missing_answers = missing_answers + "Who do you see for regular follow up?\n";

errors_found++;
}


//Make sure user doesn't select any chemotherapies if they answered no to having IV administered


if (document.pc.IfNo_FollowUp[1].checked == true && document.pc.IfNo_FollowUp_Specialist.selectedIndex == 0) {

missing_answers = missing_answers + "Please specifiy a Specialist.\n";

errors_found++;
}


















//Display errors if they're any

if (errors_found > 0) {

alert("Please answer the following question(s)?\n\n" + missing_answers);

return false;
}

if (errors != "" && errors_found == 0) {

alert("We found the following error(s)?\n\n" + errors);

return false;
}


//end function
}

