//variables for buttons

//variables for differential diagnosis
//further history
var hxDif="<b><ul><li>No history of recurrent infections apart from respiratory. One episode of otitis media but no recurrences.</li><li> No history to suggest reflux.</li><li> The cough has not been paroxysmal.</li><li> Between viral illnesses is completely normal with normal growth and development.</li></ul></b>";
var hxDif1 = "<p>The Canadian Pediatric Consensus Guidelines suggest that in young preschool children, a differential diagnosis needs to be considered especially if there is a poor response to asthma therapy.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S15#SEC1' target='_blank'>Go to Recommendations</a>";
var hxDif2 = "<br /><br />The differential diagnosis of wheezing from the Guidelines&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S15/T13' target='_blank'>Go to Differential</a>&nbsp;in the guidelines.";


//variables for family history
var hxFam = "<b>There is a strong family history of allergy and asthma with both parents being allergic and mother having asthma.</b>";
var hxFam1 = "<p>The Canadian Guideline recommendations on the diagnosis of preschool asthma stresses the importance of the family history in the diagnosis.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S15#SEC1'target='_blank'>Go to Recommendations</a>.";
var hxFam2 = "&nbsp;The importance is based on the algorithm for distinguishing preschool non-atopic wheeze from atopic asthma published by Castro-Rodriguez et al.(<a href = 'http://ajrccm.atsjournals.org/cgi/content/abstract/162/4/1403?ijkey=53414c0be170053e9fc097d53a08e9243752d793&keytype2=tf_ipsecsha' target = '_blank'>2000</a>).";
var hxFam3 = "<br /><br />Family history of asthma and allergy is considered a major risk for expressing atopic asthma.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S15/T23' target='_blank'>Go to Algorithm</a>.";

//variables for allergy history
var hxAll = "<b>There is no history to suggest that the child is allergic, with no history of:</b>";
var hxAll1 = "<b><ul><li> atopic dermatitis,</li><li> allergy to a food,</li><li> allergic symptoms around animals,</li><li>allergic rhinitis.</li></ul></b>";
var hxAll2 = "&nbsp;<b>She constantly has rhinorrhea from frequent viral illnesses in daycare but no history to suggest that the rhinorrhea is allergic in nature.</b>";
var hxAll3 = "<br /><br />The Canadian Pediatric Consensus Guidelines stresses the importance of history in this age group since there is a significant difference in the outcome of allergic and non-allergic asthma.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S15#SEC3' target = '_blank'>Go to Guidelines</a>.";

//variables for environmental history
var hxEnv = "<br />An Environmental history should always be obtained when a child has recurrent wheezing including\:";
var hxEnv1 = "<ul><li>Smoking in the home \:<b> No-one smokes in this home.</b></li><li>Pets in the home\:<b> There are no pets.</b></li><li>Mite Control\:<b> Dust mite control is not being done in the bedroom.</b></li><li>Sources of Mould\:<b> There are no wet areas in the home.</b></li><li>Contact with mice and cockroach\:<b>&nbsp;There have been mice in the home but no cockroaches.</b></li></ul>";

//variables for physical exam
var exPhys = "<b>Physical examination was normal with a normal chest examination despite some coughing.</b>";

//variables for skin tests
var testSkt = "<b>Skin testing with a battery of aeroallergens and a few foods was all negative with a positive histamine control and negative saline control.</b>";
var testSkt1 = "<br /><br />At the present time she does not seem to be atopic despite the high risk family history.";
var testSkt2 = "&nbsp;In the absence of allergy, she is unlikely to have eosinophilic inflammation in her airways.&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=8187030&query_hl=4' target = '_blank'>Reference</a>"
		+"&nbsp;&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=9678834&query_hl=6' target = '_blank'>Reference</a>";

//variables for spirometry
var testSpiro = "<b>She is too young to perform spirometry or even peak flow measurements.</b>";

//variables for Dr.Z's message.

var drz="<p><font color=red>APPROACH TO PEDIATRIC ASTHMA ACCORDING TO THE CANADIAN CONSENSUS GUIDELINES (BLACK TEXT).</font></p>";

var diag="<p><b>DIAGNOSIS:</b>"
	+"<br /><br />Most of the differential diagnosis suggested by the Canadian Pediatric Consensus Guidelines"
	+"&nbsp;can by ruled out by the negative history.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S15/T13' target='_blank'>Go to Differential</a>&nbsp;"
	+"&nbsp;A chest x-ray should be done to help rule out other diagnoses in view of the degree she has been coughing. This would be especially true if there were findings on"
	+"&nbsp;auscultation of the chest. Because she clears completely between colds, has no history to suggest a co-morbid condition and"
	+"&nbsp;because auscultation was unremarkable, it is unlikely that there is anything"
	+"&nbsp;sinister in the chest and the chest xray did prove to be normal. The Canadian Consensus Guidelines provides a symptom guide to facilitate the diagnosis of"
	+"&nbsp;preschool asthma.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S3/T41' target = '_blank'>Go to Guidelines</a>&nbsp;"
	
	+"&nbsp;If this child remains non-atopic as she ages, she has a good chance of outgrowing the wheezing problem."
	+"&nbsp;<a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=7800004&dopt=Abstract' target = '_blank'>Martinez 1995.</a>"
	+"&nbsp; <a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=9699776&dopt=Abstract'target = '_blank'>Martinez 1998.</a>"
	+"&nbsp;The recent Canadian Pediatric Guidelines on the Management of Asthma has stressed the importance of the"
	+"&nbsp;patient history and family history in distinguishing preschool viral-induced wheeze that is likely to be outgrown"
	+"&nbsp;from atopic wheeze that is likely to persist.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S15' target = '_blank'>Go to Guidelines</a>"
	
	+"&nbsp; Allergy skin testing of preschool wheezing children as has been done in this case is useful since a negative result suggests viral induced asthma while a positive result"
	+"&nbsp;raises the possibility of true atopic asthma with eosinophilic inflammation in the airways."
	+"&nbsp;The Tucson algorithm for predicting atopic asthma in preschool wheezing children&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=11029352&query_hl=11' target = '_blank'>Castro-Rodriguez 2000</a>"
	+"&nbsp;has been recommended in the Canadian Pediatric Guidelines for predicting the outcome of wheezing in the preschool child."
	+"&nbsp;&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S15/T23' target = '_blank'>Go to Algorithm</a>"
	+"&nbsp;The algorithm has recently been modified to include positive skin test to an aeroallergen as a major criterion and positive skin test to a food as a minor criterion."
	+"&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15157730&query_hl=13' target = '_blank'>Guilbert 2004</a>"
	+"<p><b>IN THIS CASE:<ul><li> frequent episodes of cough and wheeze.</li><li> strong family history of allergy while mother has asthma.</li><li> The algorithm suggests a high"
	+"&nbsp;risk for persisting asthma.</li><li> But at present skin test negative and therefore not atopic.</li></ul></b></p>"
	
	+"<p><b><center><table border='2' cellpadding='12'><tr><td><font size ='+1'>WORKING DIAGNOSIS: Non-atopic preschool wheezing with a high risk for becoming Atopic Asthma</font>"
	+"<br /><br /><font size ='+1'>KEY POINTS:&nbsp;<table border='0'><tr><td><ul><li>Consider Differential and Co-Morbidity (History was negative for alternative diagnosis and co-morbidity).</li>"
	+"<li>Consider Allergy (Nonatopic on skin testing).</li><li>Consider Algorithm (Strong family history of allergy and asthma).</li>"
	+"</ul></td></tr></table></font></td></tr></table></center></b></p>";


var allerg="<p><b>TREATMENT AT FIRST VISIT:<br /><br /> 1. Environmental Control.</b>&nbsp;This child is non-allergic and no-one smokes in the home."
	+"&nbsp;Since the episodes of cough and wheeze occur with viral infections, there is very little that can be done"
	+"&nbsp;to prevent them. Children in day-care develop frequent viral respiratory tract infections, virtually"
	+"&nbsp;every three weeks in winter. Those children who develop cough and wheeze are usually just finishing one"
	+"&nbsp;viral infection when they develop another, leading to snowballing of the symptoms."
	//+"&nbsp;There must be no smoking in the home or car. Second hand cigarette smoke has been consistently associated"
	//+"&nbsp;with severity and frequency of asthma symptoms especially if the person who is the primary caregiver smokes."
	//+"&nbsp;<a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=3958385&dopt=Abstract' target = '_blank'>Murray 1986</a>"
	//+"&nbsp;<a href = 'http://thorax.bmjjournals.com/cgi/content/abstract/54/4/357?ijkey=5c307d46654457483f1324e76422faf3c04ceb67&keytype2=tf_ipsecsha' target = '_blank'>Cook 1999</a>"
	+"&nbsp;The Canadian Pediatric Guidelines continues to recommend the avoidance of"
	+"&nbsp;environmental tobacco smoke in the secondary prevention strategies for asthma"
	+"&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S20#SEC1' target = '_blank'>Go to Recommendations</a>"
	+"&nbsp;In the present case there is a strong family history of allergy, and I usually recommend allergy control should be done in the home."
	+"&nbsp;However it is not clear from the literature that this will prevent the child from becoming allergic to the"
	+"&nbsp;the specific allergens.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S25#SEC4' target = '_blank'>Go to Recommendations</a>"
	+"&nbsp;Dust mite control should be done in the bedroom. The home should be checked for sources of mould. Unfortunately those measures will not help this child at the present time."
	+"<p><b>2. Education</b>&nbsp;The outcome of preschool wheezing should be discussed with the parents especially the"
	+"&nbsp;difference in outcome of nonatopic versus atopic wheezing i.e. preschool wheezing versus atopic asthma. The"
	+"&nbsp;risk suggested by the family history in light of the Tucson algorithm should be discussed. The spacer device"
	+"&nbsp;and puffer techniques should be taught along with the role of inhaled steroid.</p>";





var meds="<p><b> 3. Medication.</b>&nbsp;The literature on the management of intermittent viral-induced wheezing in preschool children"
	+"&nbsp;is still controversial and that is because studies to date in this group of very young patients have been difficult to perform with"
	+"&nbsp;small numbers of subjects enrolled, with a lack of objective measures of asthma and a failure to separate the subjects"
	+"&nbsp;into non-atopic and atopic groups. Certainly if the asthma symptoms are chronic then the Canadian Pediatric Guidelines"
	+"&nbsp;recommend the same treatment as for older children i.e. maintenance with low dose inhaled corticosteroid"
	+"&nbsp;as first-line therapy.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S28#SEC1' target = '_blank'>Go to Recommendations</a>"
	+"&nbsp;The controversy surrounds treatment of preschool non-atopic children with intermittent viral induced symptoms and"
	+"&nbsp;the guidelines recommend against treatment with intermittent inhaled steroid."
	+"&nbsp;The controversy is well captured in the discussion of intermittent asthma in the Guideline document.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S33#SEC3' target = _'blank'>Go to Discussion</a>"
	+"&nbsp;Part of the problem can be traced to the fact that preschool children with atopic asthma or children with"
	+"&nbsp;criteria suggesting high risk for persisting, chronic, atopic asthma according to the Tucson algorithm cited,"
	+"&nbsp;commonly present with intermittent viral-induced symptoms the same as non-atopic wheezers who are likely to outgrow the wheezing."
	+"&nbsp;These latter children who represent the majority of wheezing toddlers in the community.&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=9988452&query_hl=1' target = '_blank'>Reference</a> &nbsp;<a href ='http://www.cmaj.ca/cgi/content/full/173/6_suppl/S33' target = '_blank'>Go to Guidelines</a> are overtreated with maintenance inhaled steroid"
	+"&nbsp;and, in fact, may not respond to maintenance inhaled steroid.&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=10796596&query_hl=2' target = '_blank'>McKean 2000</a>"
	+"&nbsp;In contrast the issue of management of atopic preschool asthmatics (which is likely to persist) is extremely important since there is evidence that"
	+"&nbsp;significant airway remodelling occurs in the preschool age in the atopic asthma group.&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15157730&query_hl=10' target = '_blank'>Guilbert 2004</a>"
	+"&nbsp;A study is underway to determine if these changes in lung function can be prevented by treating preschool"
	+"&nbsp;children at high risk for persisting asthma with maintenance inhaled steroid even when they have only intermittent symptoms."
	+"&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15577824&query_hl=16' target = '_blank'>Guilbert 2005</a>"
	+"&nbsp;There has been a recent large multicenter double-blind, placebo-controlled trial of Montelukast in the treatment"
	+"&nbsp;of preschool intermittent viral-induced wheezing (Previa study). The study was not reviewed in the recent Canadian Pediatric Consensus Guidelines"
	+"&nbsp;but it showed that the number of exacerbations could be reduced by a third compared to placebo.&nbsp;<a href = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15542792' target = '_blank'>Reference</a>"
	+"<p><b>IN THIS CASE:<ul><li> the child is coughing with a cold and it is important to clear her sympoms before she develops"
	+"&nbsp;her next cold.</li><li> Treatment should be initiated with inhaled steroid in order to clear her cough.</li>"
	+"<li>At age three, she is unlikely to be able to use the dry powder devices but the use of a mask-spacer device"
	+"&nbsp;can be taught.</li><li> Treatment can be started with the equivalent of beclomethasone 400 mcg per day, fluticasone"
	+"&nbsp;200 mcg per day or CFC-free beclomethasone 200 mcg per day by a metered-dose inhaler.&nbsp;<a href = 'http://www.cmaj.ca/cgi/content/full/173/6_suppl/S39#SEC1' target = '_blank'>Go to Guidelines</a>&nbsp;</li>"
	+"<li>If there are technical difficulties with the devices then a high dose inhaler"
	+"&nbsp;could be tried.</li><li> Bronchodilator can be used as"
	+"&nbsp;needed for symptom relief.</li><li> The parent should be given written instructions on management.</li><li> The goal is to clear all symptoms,"
	+"&nbsp;so that she has no cough night or morning and no symptoms with activity.</li>"
	+"<li>If she develops a cold before achieving the goals, the inhaled steroid could be increased and bronchodilator added as needed for symptom relief.</li>"
	+"<li>Generally bronchodilator should only be rarely needed.</li></ul></b></p>"
	
	+"<p><b><center><table border='2' cellpadding='12'><tr><td><font size ='+1'>INITIAL MANAGEMENT: Fluticasone 50 mcg, 2 puffs bid.</font>"
	+"<br /><br /><font size ='+1'>KEY POINTS:&nbsp;<table border='0'><tr><td><ul><li>Nonatopic on skin testing but strong family history therefore environmental control.</li>"
	+"<li>Too young for objective measures.</li><li>Teach mask-spacer device.</li><li>Symptomatic therefore treat with inhaled steroid.</li>"
	+"</ul></td></tr></table></font></td></tr></table></center></b></p>";


var prog="<p><b>MANAGEMENT AT FOLLOW-UP: </b><br /><br /><font size ='+1'>With recent onset, non-atopic, preschool wheezing, it should"
	+"&nbsp;be possible to achieve full control of symptoms, that is, no symptoms night or morning, no symptoms with exercise and no requirement for bronchodilator.</font>"
	+"<br /><br /><b>The response to the treatment plan should be evaluated carefully and"
	+"&nbsp;she should be monitored regularly over the next year. Initially she should return in 1 month.</b>"
	+"<br /><br /><b><font size = '+1'>If full control has been achieved:</b></font>"
	+"<ul><li>"
	+"&nbsp;The dose of inhaled steroid can be reduced to a minimum which might be no regular inhaled steroid since she seems to be non-atopic on skin testing.</li><li> The presence or absence of symptoms"
	+"&nbsp;when the inhaled steroid has been reduced or stopped can be determined but at the first sign of a cold,"
	+"&nbsp;even before she begins coughing, the inhaled steroid should be restarted in full doses or doubled from the maintenance dose as an action plan.</li></ul>"
	+"<br /><br /><font size = '+1'><b>If the goals have not been achieved:</b></font><ul><li>Then the management should be reviewed.</li>"
	+"<li> The child's use of the inhalational devices should be assesssed at each visit.</li>"
	//+"&nbsp;proves to be problematic or the symptoms drag on despite treatment, management should be reviewed.</li>"
	+"&nbsp;<li>The commonest reason for medication failure in this age group is technical, i.e. problems inhaling the medication.</li>"
	+"&nbsp;<li>Nevertheless other reasons should be considered i.e. the diagnosis is wrong or the dose of inhaled steroid was insufficient.</li>"
	+"&nbsp;<li>If it seems to require a lot of inhaled steroid to manage the child, the possibility of atopic asthma should"
	+"&nbsp;be considered and maintenance inhaled steroid should be introduced.</li><li> This child has a strong family history of both allergy and asthma so that the risk for developing atopic asthma is high.</li></ul>"

	+"<p><b><center><table border='2' cellpadding='12'><tr><td>"
	+"<font size ='+1'>KEY POINTS:&nbsp;<table border='0'><tr><td><ul><li>Continuum of management: Achieve control and reduce inhaled steroid to a minimum.</li>"
	+"<li>Establish an Action Plan.</li><li>Continuum of management: First sign of a cold or symptoms, immediately increase inhaled steroid.</li><li>Review management outcome, inhaler technique on return visits.</li>"
	+"</ul></td></tr></table></font></td></tr></table></center></b></p>";


//************************
//FUNCTIONS
//******************************
//functions for buttons

//history for differential
function diffHist(){
	var _w =window.open("","","width=350,height=350");
		_w.document.write(hxDif+hxDif1+hxDif2);
		}//close

//history of allergy
function allHist(){
	var _w =window.open("","","width=350,height=350");
			_w.document.write(hxAll+hxAll1+hxAll2+hxAll3);
		}//close

//family history
function famHist(){//open function

	var _w =window.open("","","width=350,height=350");
	_w.document.write(hxFam+hxFam1+hxFam2+hxFam3);
		}//close
		
//environmental history
function envHist(){//open function

	var _w =window.open("","","width=350,height=350");
	_w.document.write(hxEnv+hxEnv1);
		}//close
		
//physical exam
function physEx(){//open function

	var _w =window.open("","","width=250,height=250");
	_w.document.write(exPhys);
		}//close
		
//variables for skin test 
function skTest(){//open function

	var _w =window.open("","","width=250,height=250");
	_w.document.write(testSkt+testSkt1+testSkt2);
		}//close
		
//variables for spirometry
function spiroTest(){//open function

	var _w =window.open("","","width=250,height=250");
	_w.document.write(testSpiro);
		}//close


//submit form and alerts

//function to create else alert
function createAlert(){

var mess = document.getElementById('message').value;
var mess1 = document.getElementById('message1').value;
var mess2 = document.getElementById('message2').value;
var warning = "Please fill in: ";

	if (mess==""){
			warning = warning+"Diagnosis, "}
		

		if (mess1==""){
			warning =warning+"Management, "}
		


			if (mess2==""){
				warning = warning +"Followup,"}
		

 alert(warning + "\n\n then click Submit, thank you.");

		}



//function to control conditional page
function managCas(){
	
	var mess = document.getElementById('message').value;
	var mess1 = document.getElementById('message1').value;
	var mess2 = document.getElementById('message2').value;
	var messEmpty;
	var messEmpty1;
	var messEmpty2;
	var messEmpty3 = "";
	
	if (mess!=""&&mess1!=""&&mess2!=""){//open conditional
		document.write('<center><p><img src=../images/kids.jpg width=200 height=130 alt = kids></center>'
		+'<font size=+1 color=blue><p>'+drz+'Your Diagnosis:&nbsp;&nbsp;'+document.getElementById('message').value +'</font>'
		+diag+'<font size=+1 color=blue><p>Your Treatment:&nbsp;&nbsp;'+document.getElementById('message1').value+'</font><br />'
		+allerg+meds+'<font size=+1 color=blue><p>Your Follow-up:&nbsp;&nbsp;'+document.getElementById('message2').value+'</font>'+prog+'</center>');
		}//close conditional
	
	else{
	createAlert();
		}//close else
	
			}//close function


		
		
