

querystring = window.location.search;
if (! document.getElementById)
{
window.location = "printerFriendly.html?images=images";
}

function checkEntire(chapters)
{
 chapters.allTopics.checked = true;
 chapters.selectedTopics.checked = false;
 

chapters.planningyourdoctorvisit.checked = false;
chapters.yourvisittothedoctor.checked = false;
chapters.askingquestions.checked = false;
chapters.conversationsafterdiagnosis.checked = false;


 chapters.faqs.checked = false;
 chapters.images.checked = true;
 chapters.images2.checked = false;
}

function checkImages(chapters)
{
 chapters.allTopics.checked = true;
 chapters.selectedTopics.checked = false;

chapters.planningyourdoctorvisit.checked = false;
chapters.yourvisittothedoctor.checked = false;
chapters.askingquestions.checked = false;
chapters.conversationsafterdiagnosis.checked = false;


 chapters.faqs.checked = false;
 chapters.images2.checked = false;
}

function checkSelected(chapters)
{
 chapters.allTopics.checked = false;
 chapters.images.checked = false;
 chapters.selectedTopics.checked = true;
}

function checkAll(chapters)
{
 chapters.allTopics.checked = false;
 chapters.selectedTopics.checked = true;

chapters.planningyourdoctorvisit.checked = true;
chapters.yourvisittothedoctor.checked = true;
chapters.askingquestions.checked = true;
chapters.conversationsafterdiagnosis.checked = true;


 chapters.faqs.checked = true;
 chapters.images.checked = false;
 chapters.images2.checked = true;
}
function submitted(theForm)
{

 if (!document.printForm.allTopics.checked
     && !document.printForm.faqs.checked

&& !document.printForm.planningyourdoctorvisit.checked
&& !document.printForm.yourvisittothedoctor.checked
&& !document.printForm.askingquestions.checked
&& !document.printForm.conversationsafterdiagnosis.checked


     )
 {
  alert("Please select the chapters you want to print.");
  return false;
 }

}

function selectChapter()
{

document.printForm.images.checked = false;
document.printForm.images2.checked = false;
document.printForm.allTopics.checked = false;
document.printForm.faqs.checked = false;
document.printForm.selectedTopics.checked = true;
document.printForm.planningyourdoctorvisit.checked = false;
document.printForm.yourvisittothedoctor.checked = false;
document.printForm.askingquestions.checked = false;
document.printForm.conversationsafterdiagnosis.checked = false;
 var imageindex = querystring.indexOf('/planningyourdoctorvisit');
 if(imageindex != -1) {
document.printForm.planningyourdoctorvisit.checked = true; }
 var imageindex = querystring.indexOf('/listingyoursymptoms');
 if(imageindex != -1) {
document.printForm.planningyourdoctorvisit.checked = true; }
 var imageindex = querystring.indexOf('/listingyourmedications');
 if(imageindex != -1) {
document.printForm.planningyourdoctorvisit.checked = true; }
 var imageindex = querystring.indexOf('/habitsandlifechanges');
 if(imageindex != -1) {
document.printForm.planningyourdoctorvisit.checked = true; }
 var imageindex = querystring.indexOf('/yourvisittothedoctor');
 if(imageindex != -1) {
document.printForm.yourvisittothedoctor.checked = true; }
 var imageindex = querystring.indexOf('/whattobring');
 if(imageindex != -1) {
document.printForm.yourvisittothedoctor.checked = true; }
 var imageindex = querystring.indexOf('/bestuseofyourtime');
 if(imageindex != -1) {
document.printForm.yourvisittothedoctor.checked = true; }
 var imageindex = querystring.indexOf('/discussingsensitivetopics');
 if(imageindex != -1) {
document.printForm.yourvisittothedoctor.checked = true; }
 var imageindex = querystring.indexOf('/hospitalstaysandervisits');
 if(imageindex != -1) {
document.printForm.yourvisittothedoctor.checked = true; }
 var imageindex = querystring.indexOf('/askingquestions');
 if(imageindex != -1) {
document.printForm.askingquestions.checked = true; }
 var imageindex = querystring.indexOf('/askingaboutyourdiagnosis');
 if(imageindex != -1) {
document.printForm.askingquestions.checked = true; }
 var imageindex = querystring.indexOf('/askingaboutyourmedications');
 if(imageindex != -1) {
document.printForm.askingquestions.checked = true; }
 var imageindex = querystring.indexOf('/askingaboutmedicaltests');
 if(imageindex != -1) {
document.printForm.askingquestions.checked = true; }
 var imageindex = querystring.indexOf('/rememberingtheanswers');
 if(imageindex != -1) {
document.printForm.askingquestions.checked = true; }
 var imageindex = querystring.indexOf('/conversationsafterdiagnosis');
 if(imageindex != -1) {
document.printForm.conversationsafterdiagnosis.checked = true; }
 var imageindex = querystring.indexOf('/treatmentsandsurgery');
 if(imageindex != -1) {
document.printForm.conversationsafterdiagnosis.checked = true; }
 var imageindex = querystring.indexOf('/prevention');
 if(imageindex != -1) {
document.printForm.conversationsafterdiagnosis.checked = true; }
 var imageindex = querystring.indexOf('/talkingwithaspecialist');
 if(imageindex != -1) {
document.printForm.conversationsafterdiagnosis.checked = true; }
 var imageindex = querystring.indexOf('/incaseofaseriousillness');
 if(imageindex != -1) {
document.printForm.conversationsafterdiagnosis.checked = true; }


 

 var imageindex = querystring.indexOf('/faq');
 if(imageindex != -1)
 {
  document.printForm.faqs.checked = true;
 }
}

