

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.aboutstroke.checked = false;
chapters.effectsofastroke.checked = false;
chapters.warningsigns.checked = false;
chapters.riskfactors.checked = false;
chapters.preventionanddiagnosis.checked = false;
chapters.medications.checked = false;
chapters.surgeryandvascularinterventions.checked = false;
chapters.rehabilitation.checked = false;
chapters.latestresearch.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.aboutstroke.checked = false;
chapters.effectsofastroke.checked = false;
chapters.warningsigns.checked = false;
chapters.riskfactors.checked = false;
chapters.preventionanddiagnosis.checked = false;
chapters.medications.checked = false;
chapters.surgeryandvascularinterventions.checked = false;
chapters.rehabilitation.checked = false;
chapters.latestresearch.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.aboutstroke.checked = true;
chapters.effectsofastroke.checked = true;
chapters.warningsigns.checked = true;
chapters.riskfactors.checked = true;
chapters.preventionanddiagnosis.checked = true;
chapters.medications.checked = true;
chapters.surgeryandvascularinterventions.checked = true;
chapters.rehabilitation.checked = true;
chapters.latestresearch.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.aboutstroke.checked
&& !document.printForm.effectsofastroke.checked
&& !document.printForm.warningsigns.checked
&& !document.printForm.riskfactors.checked
&& !document.printForm.preventionanddiagnosis.checked
&& !document.printForm.medications.checked
&& !document.printForm.surgeryandvascularinterventions.checked
&& !document.printForm.rehabilitation.checked
&& !document.printForm.latestresearch.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.aboutstroke.checked = false;
document.printForm.effectsofastroke.checked = false;
document.printForm.warningsigns.checked = false;
document.printForm.riskfactors.checked = false;
document.printForm.preventionanddiagnosis.checked = false;
document.printForm.medications.checked = false;
document.printForm.surgeryandvascularinterventions.checked = false;
document.printForm.rehabilitation.checked = false;
document.printForm.latestresearch.checked = false;
 var imageindex = querystring.indexOf('/aboutstroke');
 if(imageindex != -1) {
document.printForm.aboutstroke.checked = true; }
 var imageindex = querystring.indexOf('/effectsofastroke');
 if(imageindex != -1) {
document.printForm.effectsofastroke.checked = true; }
 var imageindex = querystring.indexOf('/warningsigns');
 if(imageindex != -1) {
document.printForm.warningsigns.checked = true; }
 var imageindex = querystring.indexOf('/riskfactors');
 if(imageindex != -1) {
document.printForm.riskfactors.checked = true; }
 var imageindex = querystring.indexOf('/preventionanddiagnosis');
 if(imageindex != -1) {
document.printForm.preventionanddiagnosis.checked = true; }
 var imageindex = querystring.indexOf('/medications');
 if(imageindex != -1) {
document.printForm.medications.checked = true; }
 var imageindex = querystring.indexOf('/surgeryandvascularinterventions');
 if(imageindex != -1) {
document.printForm.surgeryandvascularinterventions.checked = true; }
 var imageindex = querystring.indexOf('/rehabilitation');
 if(imageindex != -1) {
document.printForm.rehabilitation.checked = true; }
 var imageindex = querystring.indexOf('/latestresearch');
 if(imageindex != -1) {
document.printForm.latestresearch.checked = true; }


 

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


