

//<![CDATA[

<!--


function Client(){
//if not a DOM browser, hopeless
	this.min = false; if (document.getElementById){this.min = true;};

	this.ua = navigator.userAgent;
	this.name = navigator.appName;
	this.ver = navigator.appVersion;  

//Get data about the browser
	this.mac = (this.ver.indexOf('Mac') != -1);
	this.win = (this.ver.indexOf('Windows') != -1);

//Look for Gecko
	this.gecko = (this.ua.indexOf('Gecko') > 1);
	if (this.gecko){
		this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
		if (this.geckoVer < 20020000){this.min = false;}
	}
	
//Look for Firebird
	this.firebird = (this.ua.indexOf('Firebird') > 1);
	
//Look for Safari
	this.safari = (this.ua.indexOf('Safari') > 1);
	if (this.safari){
		this.gecko = false;
	}
	
//Look for IE
	this.ie = (this.ua.indexOf('MSIE') > 0);
	if (this.ie){
		this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
		if (this.ieVer < 5.5){this.min = false;}
	}
	
//Look for Opera
	this.opera = (this.ua.indexOf('Opera') > 0);
	if (this.opera){
		this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
		if (this.operaVer < 7.04){this.min = false;}
	}
	if (this.min == false){
		alert('Your browser may not be able to handle this page.');
	}
	
//Special case for the horrible ie5mac
	this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
}

var C = new Client();

//for (prop in C){
//	alert(prop + ': ' + C[prop]);
//}



//CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS

//[strNavBarJS]
function NavBtnOver(Btn){
	if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
}

function NavBtnOut(Btn){
	Btn.className = 'NavButton';
}

function NavBtnDown(Btn){
	Btn.className = 'NavButtonDown';
}
//[/strNavBarJS]

function FuncBtnOver(Btn){
	if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
}

function FuncBtnOut(Btn){
	Btn.className = 'FuncButton';
}

function FuncBtnDown(Btn){
	Btn.className = 'FuncButtonDown';
}

function FocusAButton(){
	if (document.getElementById('CheckButton1') != null){
		document.getElementById('CheckButton1').focus();
	}
	else{
		if (document.getElementById('CheckButton2') != null){
			document.getElementById('CheckButton2').focus();
		}
		else{
			document.getElementsByTagName('button')[0].focus();
		}
	}
}




//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX

var topZ = 1000;

function ShowMessage(Feedback){
	var Output = Feedback + '<br /><br />';
	document.getElementById('FeedbackContent').innerHTML = Output;
	var FDiv = document.getElementById('FeedbackDiv');
	topZ++;
	FDiv.style.zIndex = topZ;
	FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';

	FDiv.style.display = 'block';

	ShowElements(false, 'input');
	ShowElements(false, 'select');
	ShowElements(false, 'object');

//Focus the OK button
	setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
	
//
}

function ShowElements(Show, TagName){
//Special for IE bug -- hide all the form elements that will show through the popup
	if (C.ie){
		var Els = document.getElementsByTagName(TagName);
		for (var i=0; i<Els.length; i++){
			if (Show == true){
				Els[i].style.display = 'inline';
			}
			else{
				Els[i].style.display = 'none';
			}
		}
	} 
}

function HideFeedback(){
	document.getElementById('FeedbackDiv').style.display = 'none';
	ShowElements(true, 'input');
	ShowElements(true, 'select');
	ShowElements(true, 'object');
	if (Finished == true){
		Finish();
	}
}


//GENERAL UTILITY FUNCTIONS AND VARIABLES

//PAGE DIMENSION FUNCTIONS
function PageDim(){
//Get the page width and height
	this.W = 600;
	this.H = 400;
	this.W = document.getElementsByTagName('body')[0].clientWidth;
	this.H = document.getElementsByTagName('body')[0].clientHeight;
}

var pg = null;

function GetPageXY(El) {
	var XY = {x: 0, y: 0};
	while(El){
		XY.x += El.offsetLeft;
		XY.y += El.offsetTop;
		El = El.offsetParent;
	}
	return XY;
}

function GetScrollTop(){
	if (document.documentElement && document.documentElement.scrollTop){
		return document.documentElement.scrollTop;
	}
	else{
		if (document.body){
 			return document.body.scrollTop;
		}
		else{
			return window.pageYOffset;
		}
	}
}

function GetViewportHeight(){
	if (window.innerHeight){
		return window.innerHeight;
	}
	else{
		return document.getElementsByTagName('body')[0].clientHeight;
	}
}

function TopSettingWithScrollOffset(TopPercent){
	var T = Math.floor(GetViewportHeight() * (TopPercent/100));
	return GetScrollTop() + T; 
}

//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
var InTextBox = false;

function SuppressBackspace(e){ 
	if (InTextBox == true){return;}
	if (C.ie) {
		thisKey = window.event.keyCode;
	}
	else {
		thisKey = e.keyCode;
	}

	var Suppress = false;

	if (thisKey == 8) {
		Suppress = true;
	}

	if (Suppress == true){
		if (C.ie){
			window.event.returnValue = false;	
			window.event.cancelBubble = true;
		}
		else{
			e.preventDefault();
		}
	}
}

if (C.ie){
	document.attachEvent('onkeydown',SuppressBackspace);
	window.attachEvent('onkeydown',SuppressBackspace);
}
else{
	if (window.addEventListener){
		window.addEventListener('keypress',SuppressBackspace,false);
	}
}

function ReduceItems(InArray, ReduceToSize){
	var ItemToDump=0;
	var j=0;
	while (InArray.length > ReduceToSize){
		ItemToDump = Math.floor(InArray.length*Math.random());
		InArray.splice(ItemToDump, 1);
	}
}

function Shuffle(InArray){
	var Num;
	var Temp = new Array();
	var Len = InArray.length;

	var j = Len;

	for (var i=0; i<Len; i++){
		Temp[i] = InArray[i];
	}

	for (i=0; i<Len; i++){
		Num = Math.floor(j  *  Math.random());
		InArray[i] = Temp[Num];

		for (var k=Num; k < (j-1); k++) {
			Temp[k] = Temp[k+1];
		}
		j--;
	}
	return InArray;
}

function WriteToInstructions(Feedback) {
	document.getElementById('InstructionsDiv').innerHTML = Feedback;

}




function EscapeDoubleQuotes(InString){
	return InString.replace(/"/g, '&quot;')
}

function TrimString(InString){
        var x = 0;

        if (InString.length != 0) {
                while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
                        InString = InString.substring(0, InString.length - 1)
                }

                while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
                        InString = InString.substring(1, InString.length)
                }

                while (InString.indexOf('  ') != -1) {
                        x = InString.indexOf('  ')
                        InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
                 }

                return InString;
        }

        else {
                return '';
        }
}

function FindLongest(InArray){
	if (InArray.length < 1){return -1;}

	var Longest = 0;
	for (var i=1; i<InArray.length; i++){
		if (InArray[i].length > InArray[Longest].length){
			Longest = i;
		}
	}
	return Longest;
}

//UNICODE CHARACTER FUNCTIONS
function IsCombiningDiacritic(CharNum){
	var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
	Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
	return Result;
}

function IsCJK(CharNum){
	return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
}

//SETUP FUNCTIONS
//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
function ClearTextBoxes(){
	var NList = document.getElementsByTagName('input');
	for (var i=0; i<NList.length; i++){
		if ((NList[i].id.indexOf('Guess') > -1)||(NList[i].id.indexOf('Gap') > -1)){
			NList[i].value = '';
		}
		if (NList[i].id.indexOf('Chk') > -1){
			NList[i].checked = '';
		}
	}
}

//EXTENSION TO ARRAY OBJECT
function Array_IndexOf(Input){
	var Result = -1;
	for (var i=0; i<this.length; i++){
		if (this[i] == Input){
			Result = i;
		}
	}
	return Result;
}
Array.prototype.indexOf = Array_IndexOf;

//IE HAS RENDERING BUG WITH BOTTOM NAVBAR
function RemoveBottomNavBarForIE(){
	if ((C.ie)&&(document.getElementById('Reading') != null)){
		if (document.getElementById('BottomNavBar') != null){
			document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
		}
	}
}




//HOTPOTNET-RELATED CODE

var HPNStartTime = (new Date()).getTime();
var SubmissionTimeout = 30000;
var Detail = ''; //Global that is used to submit tracking data

function Finish(){
//If there's a form, fill it out and submit it
	if (document.store != null){
		Frm = document.store;
		Frm.starttime.value = HPNStartTime;
		Frm.endtime.value = (new Date()).getTime();
		Frm.mark.value = Score;
		Frm.detail.value = Detail;
		Frm.submit();
	}
}



//JQUIZ CORE JAVASCRIPT CODE

var CurrQNum = 0;
var CorrectIndicator = ':-)';
var IncorrectIndicator = 'X';
var YourScoreIs = 'Your score is ';
var ContinuousScoring = true;
var CorrectFirstTime = 'Questions answered correctly first time: ';
var ShowCorrectFirstTime = true;
var ShuffleQs = false;
var ShuffleAs = false;
var DefaultRight = '*********';
var DefaultWrong = 'Sorry! Try again.';
var QsToShow = 49;
var Score = 0;
var Finished = false;
var Qs = null;
var QArray = new Array();
var ShowingAllQuestions = false;
var ShowAllQuestionsCaption = 'Show all questions';
var ShowOneByOneCaption = 'Show questions one by one';
var State = new Array();
var Feedback = '';
var TimeOver = false;
var strInstructions = '';

//The following variable can be used to add a message explaining that
//the question is finished, so no further marking will take place.
var strQuestionFinished = '';

function CompleteEmptyFeedback(){
	var QNum, ANum;
	for (QNum=0; QNum<I.length; QNum++){
//Only do this if not multi-select
		if (I[QNum][2] != '3'){
  		for (ANum = 0; ANum<I[QNum][3].length; ANum++){
  			if (I[QNum][3][ANum][1].length < 1){
  				if (I[QNum][3][ANum][2] > 0){
  					I[QNum][3][ANum][1] = DefaultRight;
  				}
  				else{
  					I[QNum][3][ANum][1] = DefaultWrong;
  				}
  			}
  		}
		}
	}
}

function SetUpQuestions(){
	var AList = new Array(); 
	var QList = new Array();
	var i, j;
	Qs = document.getElementById('Questions');
	while (Qs.getElementsByTagName('li').length > 0){
		QList.push(Qs.removeChild(Qs.getElementsByTagName('li')[0]));
	}
	var DumpItem = 0;
	if (QsToShow > QList.length){
		QsToShow = QList.length;
	}
	while (QsToShow < QList.length){
		DumpItem = Math.floor(QList.length*Math.random());
		for (j=DumpItem; j<(QList.length-1); j++){
			QList[j] = QList[j+1];
		}
		QList.length = QList.length-1;
	}
	if (ShuffleQs == true){
		QList = Shuffle(QList);
	}
	if (ShuffleAs == true){
		var As;
		for (var i=0; i<QList.length; i++){
			As = QList[i].getElementsByTagName('ol')[0];
			if (As != null){
  			AList.length = 0;
				while (As.getElementsByTagName('li').length > 0){
					AList.push(As.removeChild(As.getElementsByTagName('li')[0]));
				}
				AList = Shuffle(AList);
				for (j=0; j<AList.length; j++){
					As.appendChild(AList[j]);
				}
			}
		}
	}
	
	for (i=0; i<QList.length; i++){
		Qs.appendChild(QList[i]);
		QArray[QArray.length] = QList[i];
	}

//Show the first item
	QArray[0].style.display = '';
	
//Now hide all except the first item
	for (i=1; i<QArray.length; i++){
		QArray[i].style.display = 'none';
	}		
	SetQNumReadout();
	
	SetFocusToTextbox();
}

function SetFocusToTextbox(){
//if there's a textbox, set the focus in it
	if (QArray[CurrQNum].getElementsByTagName('input')[0] != null){
		QArray[CurrQNum].getElementsByTagName('input')[0].focus();
//and show a keypad if there is one
		if (document.getElementById('CharacterKeypad') != null){
			document.getElementById('CharacterKeypad').style.display = 'block';
		}
	}
	else{
  	if (QArray[CurrQNum].getElementsByTagName('textarea')[0] != null){
  		QArray[CurrQNum].getElementsByTagName('textarea')[0].focus();	
//and show a keypad if there is one
			if (document.getElementById('CharacterKeypad') != null){
				document.getElementById('CharacterKeypad').style.display = 'block';
			}
		}
//This added for 6.0.4.11: hide accented character buttons if no textbox
		else{
			if (document.getElementById('CharacterKeypad') != null){
				document.getElementById('CharacterKeypad').style.display = 'none';
			}
		}
	}
}

function ChangeQ(ChangeBy){
//The following line prevents moving to another question until the current
//question is answered correctly. Uncomment it to enable this behaviour. 
//	if (State[CurrQNum][0] == -1){return;}
	if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
	QArray[CurrQNum].style.display = 'none';
	CurrQNum += ChangeBy;
	QArray[CurrQNum].style.display = '';
//Undocumented function added 10/12/2004
	ShowSpecialReadingForQuestion();
	SetQNumReadout();
	SetFocusToTextbox();
}

var HiddenReadingShown = false;
function ShowSpecialReadingForQuestion(){
//Undocumented function for showing specific reading text elements which change with each question
//Added on 10/12/2004
	if (document.getElementById('ReadingDiv') != null){
		if (HiddenReadingShown == true){
			document.getElementById('ReadingDiv').innerHTML = '';
		}
		if (QArray[CurrQNum] != null){
			var Children = QArray[CurrQNum].childNodes;
			for (var i=0; i<Children.length; i++){
			if (Children[i].className=="HiddenReading"){
					document.getElementById('ReadingDiv').innerHTML = Children[i].innerHTML;
					HiddenReadingShown = true;
//Hide the ShowAllQuestions button to avoid confusion
					if (document.getElementById('ShowMethodButton') != null){
						document.getElementById('ShowMethodButton').style.display = 'none';
					}
				}
			}	
		}
	}
}

function SetQNumReadout(){
	document.getElementById('QNumReadout').innerHTML = (CurrQNum+1) + ' / ' + QArray.length;
	if ((CurrQNum+1) >= QArray.length){
		if (document.getElementById('NextQButton') != null){
			document.getElementById('NextQButton').style.visibility = 'hidden';
		}
	}
	else{
		if (document.getElementById('NextQButton') != null){
			document.getElementById('NextQButton').style.visibility = 'visible';
		}
	}
	if (CurrQNum <= 0){
		if (document.getElementById('PrevQButton') != null){
			document.getElementById('PrevQButton').style.visibility = 'hidden';
		}
	}
	else{
		if (document.getElementById('PrevQButton') != null){
			document.getElementById('PrevQButton').style.visibility = 'visible';
		}
	}
}

I=new Array();
I[0]=new Array();I[0][0]=100;
I[0][1]='';
I[0][2]='0';
I[0][3]=new Array();
I[0][3][0]=new Array('the right lung has 10 segments','',1,0,1);
I[0][3][1]=new Array('the left lung had 9 segments','',1,0,1);
I[0][3][2]=new Array('the visceral pleura is exteremly sensitive to pain','The visceral pleura is insensitive to pain.',1,100,1);
I[0][3][3]=new Array('the parietal pleura is extremely sensitive to pain','',1,0,1);
I[0][3][4]=new Array('the left upper lobe has 4 segments','',1,0,1);
I[1]=new Array();I[1][0]=100;
I[1][1]='';
I[1][2]='0';
I[1][3]=new Array();
I[1][3][0]=new Array('myasthenia gravis','',1,0,1);
I[1][3][1]=new Array('central sleep apnea','',1,0,1);
I[1][3][2]=new Array('ankylosing spondylitis','',1,0,1);
I[1][3][3]=new Array('motor neuron disease','',1,0,1);
I[1][3][4]=new Array('acute pneumonia','Correct Answer acute pneumonia causes tachypnia and hence CO2 wash out',1,100,1);
I[2]=new Array();I[2][0]=100;
I[2][1]='';
I[2][2]='0';
I[2][3]=new Array();
I[2][3][0]=new Array('Large pulmonary arterio-venous malformation','Other causes of this type of hypoxemia that is not corrected by O2 therapy  1-Any right to left shunt (at cardiac or lung level) 2-decreased O2 carrying capacity of blood: anemia and inactivated hemoglobins',1,100,1);
I[2][3][1]=new Array('acute pneumonia','',1,0,1);
I[2][3][2]=new Array('pulmonary hemorrhage','',1,0,1);
I[2][3][3]=new Array('pulmonary thromboembolism','',1,0,1);
I[2][3][4]=new Array('acute asthma','',1,0,1);
I[3]=new Array();I[3][0]=100;
I[3][1]='';
I[3][2]='0';
I[3][3]=new Array();
I[3][3][0]=new Array('MRI is usually used for parenchymal lesions','',1,0,1);
I[3][3][1]=new Array('high resolution CT scan is less helpful in interstitial diseases','',1,0,1);
I[3][3][2]=new Array('V/Q scan is contraindicated in ASD','It is contraindicated in ASD because the macro aggregates of albumin loge in the cerebral and renal circulations with devastating effects  MRI is usually used in mediastinal lesions and CT for parenchyma lesions Bronchoscope is useful in central tumors   Ultrasound is very sensitive of the detection of small pleural effusion',1,100,1);
I[3][3][3]=new Array('bronchoscopy is useful in peripheral lung tumors','',1,0,1);
I[3][3][4]=new Array('ultrasound examination of the chest is insensitive for the small detection pleural effusions','',1,0,1);
I[4]=new Array();I[4][0]=100;
I[4][1]='';
I[4][2]='0';
I[4][3]=new Array();
I[4][3][0]=new Array('right sided pneumonectomy','',1,0,1);
I[4][3][1]=new Array('Severe ankylosing spondylitis','',1,0,1);
I[4][3][2]=new Array('myasthenia gravis','',1,0,1);
I[4][3][3]=new Array('poliomyelitis','',1,0,1);
I[4][3][4]=new Array('fibrosing alveolitis','Fibrosing alveolitis Causes reduction in both TLCO and KCO',1,100,1);
I[5]=new Array();I[5][0]=100;
I[5][1]='';
I[5][2]='0';
I[5][3]=new Array();
I[5][3][0]=new Array('single metastasis','',1,0,1);
I[5][3][1]=new Array('bronchial carcinoma','',1,0,1);
I[5][3][2]=new Array('Wegner\'s Granuloma','Wegner\'s as well as bronchogenic cysts, pulmonary sequestration, lymphoma, benigh tumors, apspergilloma and rheumatoid nodule all are uncommon causes.',1,100,1);
I[5][3][3]=new Array('tuberculoma','',1,0,1);
I[5][3][4]=new Array('lung abscess','',1,0,1);
I[6]=new Array();I[6][0]=100;
I[6][1]='';
I[6][2]='0';
I[6][3]=new Array();
I[6][3][0]=new Array('has been shown to decrease the mortality by 50%','',1,0,1);
I[6][3][1]=new Array('used for at least 15 hours / day','',1,0,1);
I[6][3][2]=new Array('the objective is to produce PaO2 of more than 8 kPa without unacceptable rise in PaCO2','',1,0,1);
I[6][3][3]=new Array('the patient should stop smoking before hand','',1,0,1);
I[6][3][4]=new Array('indicated when the PaO2 is below 8 kPa with any level of PaCO2','The indications are:  a-PaO2 is less than 7.3 kPa with nay level of PaCO2 and FEV1 less that 1.5 liters b-PaO2 between 7.3 to 8 kPa PLUS either pulmonary hypertension ,peripheral edema or nocturnal hypoxemia',1,100,1);
I[7]=new Array();I[7][0]=100;
I[7][1]='';
I[7][2]='0';
I[7][3]=new Array();
I[7][3][0]=new Array('inbcrease in the amount sputum production','',1,0,1);
I[7][3][1]=new Array('increase in the purulence of the sputum','',1,0,1);
I[7][3][2]=new Array('fluid retention','',1,0,1);
I[7][3][3]=new Array('increase in the chest tightness and wheeze','',1,0,1);
I[7][3][4]=new Array('fever','Fever is may be due to ANYTHING...so don\u2019t assume that the patient is having an exacerbation \u2026',1,100,1);
I[8]=new Array();I[8][0]=100;
I[8][1]='';
I[8][2]='0';
I[8][3]=new Array();
I[8][3][0]=new Array('previuos response to steroids','',1,0,1);
I[8][3][1]=new Array('during acute exacerbation','',1,0,1);
I[8][3][2]=new Array('early in the course to lessen progression','Steroids have no effect on the progression of the disease  Other indications:  a-if the exacerbation was the presenting feature   b-if there is strong response to bronchodilator therapy',1,100,1);
I[8][3][3]=new Array('concomitent asthma','',1,0,1);
I[8][3][4]=new Array('if the patients was already on steroids','',1,0,1);
I[9]=new Array();I[9][0]=100;
I[9][1]='';
I[9][2]='0';
I[9][3]=new Array();
I[9][3][0]=new Array('the best guide to progression of COPD is the decline in FEV1 over time','',1,0,1);
I[9][3][1]=new Array('the prognosis is inversely related to age','',1,0,1);
I[9][3][2]=new Array('the prognosis is directly related to post-bronchodilator FEV1','',1,0,1);
I[9][3][3]=new Array('atopy patients have bad prognosis','Surprisingly, atopy patients have better survival but to date, no drug treatment (aside from LTOT) has been shown to affect the disease outcome',1,100,1);
I[9][3][4]=new Array('pulmonary hypertension in COPD implies a poor prognosis','',1,0,1);
I[10]=new Array();I[10][0]=100;
I[10][1]='';
I[10][2]='0';
I[10][3]=new Array();
I[10][3][0]=new Array('prophylactive subcutaneous heparin should be considered','',1,0,1);
I[10][3][1]=new Array('the PH is less than 7.26 and the PaCO2 is rising  consider ventilatory  support','',1,0,1);
I[10][3][2]=new Array('if ventilatory support is needed but not indicated because of poor quality of life or significant co-morbidity, then doxapram should be considered','',1,0,1);
I[10][3][3]=new Array('Duiretics should be avoided','Diuretics should be strongly considered if there edema or raised JVP',1,100,1);
I[10][3][4]=new Array('when giving O2, it is better to be given at a rate of 2 liters / minutes by nasal prongs','',1,0,1);
I[11]=new Array();I[11][0]=100;
I[11][1]='';
I[11][2]='0';
I[11][3]=new Array();
I[11][3][0]=new Array('there is a risk of expansion of non-functional pulmonary bullae','',1,0,1);
I[11][3][1]=new Array('there is a risk of producing excessive abdominal gases','',1,0,1);
I[11][3][2]=new Array('high risk of dryness of the bronchial secretions','',1,0,1);
I[11][3][3]=new Array('all patients with a resting PaO2 less than 9 kPa on air require supplementary O2','',1,0,1);
I[11][3][4]=new Array('hypercapnia is an absolute contraindication to air travel','Hypercapnia is a relative   contraindication to air travel as well as PaO2 less than 6.7 kPa on air',1,100,1);
I[12]=new Array();I[12][0]=100;
I[12][1]='';
I[12][2]='0';
I[12][3]=new Array();
I[12][3][0]=new Array('central cyanosis may bee seen','',1,0,1);
I[12][3][1]=new Array('peripheral edema may indicate cor pulmonale','',1,0,1);
I[12][3][2]=new Array('wiegh loss is uncommon','Wight loss is common due to inflammatory mediators from the bronchial epithelium like TNF alpha \u2026..This  usually stimulates unnecessary investigations for weight loss',1,100,1);
I[12][3][3]=new Array('only 15 % of smokers are likely to develop clinically significant COPD','',1,0,1);
I[12][3][4]=new Array('Smoker emphysema is usually seen in the upper zones of the lung','',1,0,1);
I[13]=new Array();I[13][0]=100;
I[13][1]='';
I[13][2]='0';
I[13][3]=new Array();
I[13][3][0]=new Array('there is smooth muscles hypertrophy and hyperplasia','',1,0,1);
I[13][3][1]=new Array('desequamation of the epithelium and edema of the sub mucosa thichening of the basement membrane is rarely seen','',1,0,1);
I[13][3][2]=new Array('thichening of the basement membrane is rarely seen','Thickening of the basement membrane contributes to chronic disability and poor response in chronic asthma cases. All of the changes gradually in the long term become irreversible',1,100,1);
I[13][3][3]=new Array('mucus plugs are common especially in severe episodes','',1,0,1);
I[13][3][4]=new Array('the changes are initially reversible','',1,0,1);
I[14]=new Array();I[14][0]=100;
I[14][1]='';
I[14][2]='0';
I[14][3]=new Array();
I[14][3][0]=new Array('adequate warm up exercises','',1,0,1);
I[14][3][1]=new Array('pretretment with Beta 2 agonists','',1,0,1);
I[14][3][2]=new Array('intravenous steroids','IV steroids have no role in such a prophylaxis',1,100,1);
I[14][3][3]=new Array('nedochromil sodium','',1,0,1);
I[14][3][4]=new Array('moteleukast','',1,0,1);
I[15]=new Array();I[15][0]=100;
I[15][1]='';
I[15][2]='0';
I[15][3]=new Array();
I[15][3][0]=new Array('may be totally normal','',1,0,1);
I[15][3][1]=new Array('prximal bronchiectasis may indicate allergic bronchopulmonary aspergillosis','',1,0,1);
I[15][3][2]=new Array('fluffy transient and patchy changes may indicate Church Strauss vasculitis','',1,0,1);
I[15][3][3]=new Array('during an acute attack of asthma hyperlucency is rare','Hyperlucency is very common during an acute attack and acutally may be the only finding.',1,100,1);
I[15][3][4]=new Array('peumothorax should always be looked for in severe cases unresponding to standard treatment','',1,0,1);
I[16]=new Array();I[16][0]=100;
I[16][1]='';
I[16][2]='0';
I[16][3]=new Array();
I[16][3][0]=new Array('avoid contact with dogs, cats and horses (for animal dander)','',1,0,1);
I[16][3][1]=new Array('avoid all possible drugs that may induce asthma attack (for drug-induced asthma)','',1,0,1);
I[16][3][2]=new Array('avoid exposure to chemicals or change occupation if necessary (industrial chemicals)','',1,0,1);
I[16][3][3]=new Array('for feathers in pillows, substitute latex foam pillows (feathers in pillows)','',1,0,1);
I[16][3][4]=new Array('for food, try to identify and eliminate it from diet (for food)','1, 2, 3 and 4 are HIGHLY efficacious measures to prevent asthma attacks   5 has low efficacy and preventive measures "against mites and pollens" have LOW to uncertain efficacy   Item 5 is powerful in eczema not asthma',1,100,1);
I[17]=new Array();I[17][0]=100;
I[17][1]='';
I[17][2]='0';
I[17][3]=new Array();
I[17][3][0]=new Array('the objective is to maintain PaO2 above 8.5 to 8 kPa with O2 therapy','',1,0,1);
I[17][3][1]=new Array('High flow high concentration should be given even in the presence of hypercapnia','',1,0,1);
I[17][3][2]=new Array('Systemic steroids should be given in all acute severe asthmatic attacks','',1,0,1);
I[17][3][3]=new Array('peak expiratory flow rate has no role in the initial management','1-this should be maintained in all cases  2-you are not dealing with COPD with chronic hypercapnia!!! So give it  3-oral steroids are given. But if the patient has vomiting or unable to swallow give it IV. 4-should be done in all cases in the A&E department to assess the severity and subsequent management . 5-true \u2026',1,100,1);
I[17][3][4]=new Array('nebulized Beta 2 agonsits are preferred over the IV rout','',1,0,1);
I[18]=new Array();I[18][0]=100;
I[18][1]='';
I[18][2]='0';
I[18][3]=new Array();
I[18][3][0]=new Array('ipratropium bromide 0.5 mg should be added to the nebulized Beta 2 agonists','',1,0,1);
I[18][3][1]=new Array('magnesium infusion may be considered','',1,0,1);
I[18][3][2]=new Array('loading dose aminophyllin may be used even in those who are already on oral theophyllin','Aminophyllin should be avoided in those who are already on oral theophyllin for a high risk of toxicity is likelihood.',1,100,1);
I[18][3][3]=new Array('iv Beta 2 agonists may be used','',1,0,1);
I[18][3][4]=new Array('there is a place for mechanical ventilation','',1,0,1);
I[19]=new Array();I[19][0]=100;
I[19][1]='';
I[19][2]='0';
I[19][3]=new Array();
I[19][3][0]=new Array('exhausion, confusion and drowsiness','',1,0,1);
I[19][3][1]=new Array('coma','',1,0,1);
I[19][3][2]=new Array('sudden respiratory arrest','',1,0,1);
I[19][3][3]=new Array('PH less 7 and rising','PH less than 7 and falling  Also, PaO2 less than 8 kPa and falling .i.e.. Deteriorating blood gases despite optimal therapy',1,100,1);
I[19][3][4]=new Array('PaCO2 more than 6 kPa and rising','',1,0,1);
I[20]=new Array();I[20][0]=100;
I[20][1]='';
I[20][2]='0';
I[20][3]=new Array();
I[20][3][0]=new Array('may be caused by pulmonary sequestration','',1,0,1);
I[20][3][1]=new Array('may be caused by bronchomalacia','',1,0,1);
I[20][3][2]=new Array('hemoptysis is common and may be life threatening','',1,0,1);
I[20][3][3]=new Array('clubbing is uncommon','Clubbing and hemoptysis are both common \u2026.and absence of large amount of sputum is not against the diagnosis ( bornchiectasis sicca)',1,100,1);
I[20][3][4]=new Array('dry bronchiectasis indicates upper lobe bronchiectasis and may be caused by TB.','',1,0,1);
I[21]=new Array();I[21][0]=100;
I[21][1]='';
I[21][2]='0';
I[21][3]=new Array();
I[21][3][0]=new Array('The commonest mutation is the delta 508 in CFTR gene on chromosome 7','It is on chromosome 17',1,100,1);
I[21][3][1]=new Array('staph infections tends to occur early in the course while pseudomonas and tends to be later','',1,0,1);
I[21][3][2]=new Array('spontaneous pneumothorax should be suspected in any sudden deterioration','',1,0,1);
I[21][3][3]=new Array('nasal polypi are common','',1,0,1);
I[21][3][4]=new Array('amyloidosis may be seen','',1,0,1);
I[22]=new Array();I[22][0]=100;
I[22][1]='';
I[22][2]='0';
I[22][3]=new Array();
I[22][3][0]=new Array('treatment with recombinant human DNAase has been shown to decrease the infective exacerbation in a sub group of patients','',1,0,1);
I[22][3][1]=new Array('Treatment with recombinant human DNAase has been shown to improve the pulmonary function and the sense of wellbeing in a subgroup of patients','',1,0,1);
I[22][3][2]=new Array('Recombinant human DNAase is delivered to the bronchial tree by a nebulizer','',1,0,1);
I[22][3][3]=new Array('Treatment with recombinant human DNAase has been shown to be effective in cystic fibrosis as well as other causes of bronchiectasis','Actually treating other causes of bronchiectasis with recombinant human DNAase has been shown to produce deleterious effects \u2026so it is only used in bronchiectasis of cystic fibrosis',1,100,1);
I[22][3][4]=new Array('Treatment with recombinant human DNAase has been shown to be expensive','',1,0,1);
I[23]=new Array();I[23][0]=100;
I[23][1]='';
I[23][2]='0';
I[23][3]=new Array();
I[23][3][0]=new Array('the commonest causes is streptococcus pneumoniae','',1,0,1);
I[23][3][1]=new Array('staph aureus is a rare cause','',1,0,1);
I[23][3][2]=new Array('Many have overlapping picture','',1,0,1);
I[23][3][3]=new Array('it is easily to differentiate between typical and atypical pneumonias','Actually many are having overlapping picture and it is really difficult to differentiate between typical and atypical pneumonias in clinical practice',1,100,1);
I[23][3][4]=new Array('in any severe community acquired pneumonia; legionella infection has to be excluded','',1,0,1);
I[24]=new Array();I[24][0]=100;
I[24][1]='';
I[24][2]='0';
I[24][3]=new Array();
I[24][3][0]=new Array('obtain radiological confirmation of the diagnosis','',1,0,1);
I[24][3][1]=new Array('exclude other conditions which may mimic pneumonias','',1,0,1);
I[24][3][2]=new Array('Obtain microbiological diagnosis','',1,0,1);
I[24][3][3]=new Array('asses the severity of pneumonia','',1,0,1);
I[24][3][4]=new Array('looking for the development of complications is usually a minor thing','The development of complications may and usually adversely affect the outcome and should be looked for in all cases',1,100,1);
I[25]=new Array();I[25][0]=100;
I[25][1]='';
I[25][2]='0';
I[25][3]=new Array();
I[25][3][0]=new Array('sputum for gram stain and culture','',1,0,1);
I[25][3][1]=new Array('sputum for acid fast bacilli and culture','',1,0,1);
I[25][3][2]=new Array('pleural fluid aspirate','Pleural fluid should be aspirated ONLY when present for more than a trivial amount (more than 10 mm thickness on lateral decubitus films) and preferably under ultrasound guide',1,100,1);
I[25][3][3]=new Array('blood cultures','',1,0,1);
I[25][3][4]=new Array('seorology with acute and convalescent titers to diagnose mycoplasma, Chlamydia, legionella and viral pneumonias','',1,0,1);
I[26]=new Array();I[26][0]=100;
I[26][1]='';
I[26][2]='0';
I[26][3]=new Array();
I[26][3][0]=new Array('respiratory rate more than 30/minute','',1,0,1);
I[26][3][1]=new Array('systolic blood pressure below 90mmHg and or Diastolic blood pressure below 60 mmHg','',1,0,1);
I[26][3][2]=new Array('blood urea more than 17 mmol/L','Blood urea more than 7 mmol/L  Others :WBC below 4000 or above 20000 ,hypoxemia with PaO2 below 8 kPa , age above 60,multiple lobe involvement and the presence  of underlying disease',1,100,1);
I[26][3][3]=new Array('hypoalbuminaemia','',1,0,1);
I[26][3][4]=new Array('positive blood culture','',1,0,1);
I[27]=new Array();I[27][0]=100;
I[27][1]='';
I[27][2]='0';
I[27][3]=new Array();
I[27][3][0]=new Array('pulmonar infarction','',1,0,1);
I[27][3][1]=new Array('pleural / pulmonary TB','',1,0,1);
I[27][3][2]=new Array('certain types of pulmonary edema. Usually atypical types','',1,0,1);
I[27][3][3]=new Array('subphrenic abscess','',1,0,1);
I[27][3][4]=new Array('paracolic abscess','Remember : atypical pulmonary edema may be unilateral and / or localized and may be extremely difficult to differentiate it from pneumonias \u2026.however absence of fever and presence of underlying heart disease are in favor of pulmonary edema',1,100,1);
I[28]=new Array();I[28][0]=100;
I[28][1]='';
I[28][2]='0';
I[28][3]=new Array();
I[28][3][0]=new Array('does not include post operative pneumonia','',1,0,1);
I[28][3][1]=new Array('does not include new pneumonia while the patient is on a ventilator','',1,0,1);
I[28][3][2]=new Array('include certain types of aspiration pneumonias','It occurs in up to 2-5 % of hospital admissions and predominantly of gram negative type',1,100,1);
I[28][3][3]=new Array('occures in up to 10% of hospital admissions','',1,0,1);
I[28][3][4]=new Array('Usually gram positive organisms predominate','',1,0,1);
I[29]=new Array();I[29][0]=100;
I[29][1]='';
I[29][2]='0';
I[29][3]=new Array();
I[29][3][0]=new Array('usually occurs in old females','',1,0,1);
I[29][3][1]=new Array('chest signs are rare','',1,0,1);
I[29][3][2]=new Array('leukemoid reaction may be seen','',1,0,1);
I[29][3][3]=new Array('pancytopenia may be seen','',1,0,1);
I[29][3][4]=new Array('chest x ray usually abnormal','Chest x ray OFTEN normal in such cases and usually presents as Pyrexia of unknown origin, hepatosplenomegally weight loss and malaise .',1,100,1);
I[30]=new Array();I[30][0]=100;
I[30][1]='';
I[30][2]='0';
I[30][3]=new Array();
I[30][3][0]=new Array('miliary TB','',1,0,1);
I[30][3][1]=new Array('immune suppressive therapy','',1,0,1);
I[30][3][2]=new Array('early in the course of TB meningitis','Usually it becomes falsely negative LATELY in the course of TB meningitis in 50 % of cases only',1,100,1);
I[30][3][3]=new Array('eldery patients','',1,0,1);
I[30][3][4]=new Array('AIDS patients','',1,0,1);
I[31]=new Array();I[31][0]=100;
I[31][1]='';
I[31][2]='0';
I[31][3]=new Array();
I[31][3][0]=new Array('Thiacetazone is contraindicated in AIDS','1-true \u2026..It is static and hence contraindicated  2-ethambutol 3-rare complication  4-false...The reverse is true  5-fasle...only to high risk group\u2026e.g. HIV patients, malnutrition, chronic diarrhea, alcoholics.',1,100,1);
I[31][3][1]=new Array('optic neuritis is usually caused by pyrazinamide','',1,0,1);
I[31][3][2]=new Array('hemolytic anemia with rifampicin is common','',1,0,1);
I[31][3][3]=new Array('streptomycin mainly affects hearing rather than vestibular function','',1,0,1);
I[31][3][4]=new Array('pyridoxin should be given to all patients receiving isoniazide','',1,0,1);
I[32]=new Array();I[32][0]=100;
I[32][1]='';
I[32][2]='0';
I[32][3]=new Array();
I[32][3][0]=new Array('serum IgG precipitins is usually strongly positive','1-weakly positive 2-true \u2026.a hypersensitivity reaction   3- True  4-aspirgillus clavatus is a cause of malt worker\'s lung and cheese worker\'s lung 5-like asthma and cystic fibrosis',1,100,1);
I[32][3][1]=new Array('an immune complex disease, not invasive','',1,0,1);
I[32][3][2]=new Array('esosinphilia is very common','',1,0,1);
I[32][3][3]=new Array('is not caused by aspirgillus clavatus and the total IgE is raised','',1,0,1);
I[32][3][4]=new Array('usually there is a preexistent lung disease','',1,0,1);
I[33]=new Array();I[33][0]=100;
I[33][1]='';
I[33][2]='0';
I[33][3]=new Array();
I[33][3][0]=new Array('passive smoking is responsible for 5% of all lung cancers','',1,0,1);
I[33][3][1]=new Array('exposure to naturally occurring RADON is responsible for 5 % of all lung cancers','',1,0,1);
I[33][3][2]=new Array('may be caused by chromium and cadmium exposure','',1,0,1);
I[33][3][3]=new Array('the incidence is slightly higher in rural than urban dwellers','Item 4, the reverse is true  90% of lung cancers are associated with cigarette smoking',1,100,1);
I[33][3][4]=new Array('the incidence of adenocarcinoma is rising','',1,0,1);
I[34]=new Array();I[34][0]=100;
I[34][1]='';
I[34][2]='0';
I[34][3]=new Array();
I[34][3][0]=new Array('resposible for 25% of all cancer deaths','',1,0,1);
I[34][3][1]=new Array('8% of cancer deaths in women and 4% cancer deaths in men','4% of cancer deaths in women and 8% cancer deaths in men',1,100,1);
I[34][3][2]=new Array('the commonest cause of cancer death in men','',1,0,1);
I[34][3][3]=new Array('the most rapidly increasing cause of cancer death in women','',1,0,1);
I[34][3][4]=new Array('more than 3 folds increase in cancer deaths since 1950','',1,0,1);
I[35]=new Array();I[35][0]=100;
I[35][1]='';
I[35][2]='0';
I[35][3]=new Array();
I[35][3][0]=new Array('totally normal films virtually exclude lung cancer','Some tumors are truly endobronchial and may not produce any changes in the plain x ray films especially early in the course',1,100,1);
I[35][3][1]=new Array('pleural effusion','',1,0,1);
I[35][3][2]=new Array('lung, lobe or segmental collapse','',1,0,1);
I[35][3][3]=new Array('broadening of the mediastinum','',1,0,1);
I[35][3][4]=new Array('rib destruction','',1,0,1);
I[36]=new Array();I[36][0]=100;
I[36][1]='';
I[36][2]='0';
I[36][3]=new Array();
I[36][3][0]=new Array('Esophageal invasion','',1,0,1);
I[36][3][1]=new Array('FEV1 less than 1.8 L','In general, the contraindications are: Any T4 (item 1, 3) Any N3 (item5) FEV1 less than 0.8 L Any severe or unstable cardiac or other medical conditions',1,100,1);
I[36][3][2]=new Array('malignant pleural effusion','',1,0,1);
I[36][3][3]=new Array('severe ischemic heart disease','',1,0,1);
I[36][3][4]=new Array('contralateral mediastinal lymph node involvement','',1,0,1);
I[37]=new Array();I[37][0]=100;
I[37][1]='';
I[37][2]='0';
I[37][3]=new Array();
I[37][3][0]=new Array('paravertebral abscess','',1,0,1);
I[37][3][1]=new Array('neurogenic tumors','',1,0,1);
I[37][3][2]=new Array('foregut duplication','',1,0,1);
I[37][3][3]=new Array('Diaphragmatic hernia through foramen of Morgagni','Item 4 is an anterior mediastinal mass',1,100,1);
I[37][3][4]=new Array('Diaphragmatic hernia through foramen of Bockdaleck','',1,0,1);
I[38]=new Array();I[38][0]=100;
I[38][1]='';
I[38][2]='0';
I[38][3]=new Array();
I[38][3][0]=new Array('may be asymptomatic and discovered incidentally by x ray in up to 30 % of cases','',1,0,1);
I[38][3][1]=new Array('occular symptoms in 5-10 % of patients','',1,0,1);
I[38][3][2]=new Array('skin sarcoids in 5 % of cases','',1,0,1);
I[38][3][3]=new Array('symtoms of hypercalcemia in 20% of cases','This is a tricky question\u2026..although hypercalcemia is usually seen around 20-30 % of cases but as a presenting complaint it is 1 % or less',1,100,1);
I[38][3][4]=new Array('superficial lymph node enlargement in 5 % of cases','',1,0,1);
I[39]=new Array();I[39][0]=100;
I[39][1]='';
I[39][2]='0';
I[39][3]=new Array();
I[39][3][0]=new Array('hypercalcemia per se','',1,0,1);
I[39][3][1]=new Array('occular sarcoidosis','',1,0,1);
I[39][3][2]=new Array('CNS involvement','',1,0,1);
I[39][3][3]=new Array('stage I or II disease','Other indications: a-Rapidly worsening stage II/III with deteriorating  lung function test. b-hypercalciuria  c-lupus perinio  per se',1,100,1);
I[39][3][4]=new Array('cardiac sarcoidosis','',1,0,1);
I[40]=new Array();I[40][0]=100;
I[40][1]='';
I[40][2]='0';
I[40][3]=new Array();
I[40][3][0]=new Array('twice as common among cigarette smokers than in nonsmokers','',1,0,1);
I[40][3][1]=new Array('bronchoalveolar lavage shows predominance of neutrophils','',1,0,1);
I[40][3][2]=new Array('clubbing is seen in 60% of cases','',1,0,1);
I[40][3][3]=new Array('Query association with Epstien Barr virus','',1,0,1);
I[40][3][4]=new Array('LDH is elevated in a minority of patients','Surprisingly \u2026LDH is elevated in the MAJORITY.  There is a query association with antidepressants also  Neutrophils in bronchoalveolar lavage is also seen in pneumoconiosis (in sarcoidosis and extrinsic allergic alveolitis it is lymphocytic) ANA and RF are seen up to 50% of cases',1,100,1);
I[41]=new Array();I[41][0]=100;
I[41][1]='';
I[41][2]='0';
I[41][3]=new Array();
I[41][3][0]=new Array('Byssinosis-penicillium cassie','',1,0,1);
I[41][3][1]=new Array('Malt worker\'s lung \u2013aspirgillus fumigatus','',1,0,1);
I[41][3][2]=new Array('maple bark stripper\'s lung-cryptostroma corticale','Byssinosi-textile induxtries with cotton, flax and hemp dust  Malt worker\'s lung-aspirgillus clavatus  Cheese worker\'s lung- aspirgillus clavatus and penicillium cassie Bird\'s lung-avian serum proteins',1,100,1);
I[41][3][3]=new Array('cheese worker\'s lung \u2013thromophilic actinomycetes','',1,0,1);
I[41][3][4]=new Array('bird fancier\'s lung \u2013aspirgillus clavatus','',1,0,1);
I[42]=new Array();I[42][0]=100;
I[42][1]='';
I[42][2]='0';
I[42][3]=new Array();
I[42][3][0]=new Array('the commonest type of asbestos fibers produced world-wide is the white one (chrysotile)','',1,0,1);
I[42][3][1]=new Array('exposure mainly occurs through mining and milling of the mineral','',1,0,1);
I[42][3][2]=new Array('greatly increases the risk of lung adenocarcinomas especially in smokers','',1,0,1);
I[42][3][3]=new Array('greatly increases the risk of pleural mesotheliomas especially in smokers','1-up to 90%  2-and demolition, ship breaking, break-pads, pipe and boiler lagging  3-true...Strong association  4-smoking has no effect in asbestos-related mesotheliomas 5-multiplicative rather than additive (may reach up to 50 folds)',1,100,1);
I[42][3][4]=new Array('the overall risk of malignancy is higher in smokers than non-smokers','',1,0,1);
I[43]=new Array();I[43][0]=100;
I[43][1]='';
I[43][2]='0';
I[43][3]=new Array();
I[43][3][0]=new Array('nitufurantoin','',1,0,1);
I[43][3][1]=new Array('mansonella steptocerca','',1,0,1);
I[43][3][2]=new Array('Wuchereria Bancrofti','',1,0,1);
I[43][3][3]=new Array('phenylbutazon','',1,0,1);
I[43][3][4]=new Array('Wegner\'s granulomatosis','Church Strauss may be the cause but not Wegner\'s  Also  a-acute and chronic eosinophilic pneumonia  b-hypereosinophilic syndrome  c-fungal and parasitic infections  d-other drugs like PAS and sulphasalazine',1,100,1);
I[44]=new Array();I[44][0]=100;
I[44][1]='';
I[44][2]='0';
I[44][3]=new Array();
I[44][3][0]=new Array('sponateous remission occurs up to 30 %','',1,0,1);
I[44][3][1]=new Array('fever and hemoptysis are common','',1,0,1);
I[44][3][2]=new Array('5 % remission rate after whole lung lavage','Up to 50% remission occurs after whole lung lavage Also: cough and dyspnea are common',1,100,1);
I[44][3][3]=new Array('air bronchogram on chest x ray is common','',1,0,1);
I[44][3][4]=new Array('diffuse bilateral shadowing mainly around the hili is the usual cheat x ray finding','',1,0,1);
I[45]=new Array();I[45][0]=100;
I[45][1]='';
I[45][2]='0';
I[45][3]=new Array();
I[45][3][0]=new Array('usualy seen in females during their child bearing age','',1,0,1);
I[45][3][1]=new Array('chylous pleural effusions are common','',1,0,1);
I[45][3][2]=new Array('recurrent pneumothorces are seen','',1,0,1);
I[45][3][3]=new Array('hormonal ablation and progestins are highly effective in the treatment','Hormonal ablation and progestins are of doubtful value  The only treatment is lung transplantation',1,100,1);
I[45][3][4]=new Array('hemoptysis is seen','',1,0,1);
I[46]=new Array();I[46][0]=100;
I[46][1]='';
I[46][2]='0';
I[46][3]=new Array();
I[46][3][0]=new Array('yellow nail syndrome','',1,0,1);
I[46][3][1]=new Array('Meig\'s syndrome','',1,0,1);
I[46][3][2]=new Array('acute rheumatic fever','',1,0,1);
I[46][3][3]=new Array('subphrenic abscess','subphrenic abscess is considered to be  a common cause . other uncommon causes:  uraemia ,asbestos related effusion,Dressler\'s syndrome',1,100,1);
I[46][3][4]=new Array('myxedema','',1,0,1);
I[47]=new Array();I[47][0]=100;
I[47][1]='';
I[47][2]='0';
I[47][3]=new Array();
I[47][3][0]=new Array('Tension type per se','',1,0,1);
I[47][3][1]=new Array('More than 2-5 liters of air aspirated','',1,0,1);
I[47][3][2]=new Array('if you faced resistant during aspiration','',1,0,1);
I[47][3][3]=new Array('pneumothorx with underlying COPD','',1,0,1);
I[47][3][4]=new Array('any degree of dyspnea','Chest tightness is very common yet severe dyspnea is an indication \u2026',1,100,1);
I[48]=new Array();I[48][0]=100;
I[48][1]='';
I[48][2]='0';
I[48][3]=new Array();
I[48][3][0]=new Array('severe pleuritic pain','',1,0,1);
I[48][3][1]=new Array('subphrenic abscess','',1,0,1);
I[48][3][2]=new Array('pulmonary infarction','',1,0,1);
I[48][3][3]=new Array('eventration of the diaphragm','',1,0,1);
I[48][3][4]=new Array('intercostal nerve palsy','Phrenic nerve palsy is a cause. Other causes:  1-excess gas in the stomach or colon 2-large tumors or cysts in the liver  3- Any cause of reduction in the volume of the lung e.g. lobotomy or lung fibrosis',1,100,1);


function StartUp(){
	RemoveBottomNavBarForIE();

//If there's only one question, no need for question navigation controls
	if (QsToShow < 2){
		document.getElementById('QNav').style.display = 'none';
	}
	
//Stash the instructions so they can be redisplayed
	strInstructions = document.getElementById('InstructionsDiv').innerHTML;
	

	

	
	CompleteEmptyFeedback();

	SetUpQuestions();
	ClearTextBoxes();
	CreateStatusArray();
	

	
//Check search string for q parameter
	if (document.location.search.length > 0){
		if (ShuffleQs == false){
			var JumpTo = parseInt(document.location.search.substring(1,document.location.search.length))-1;
			if (JumpTo <= QsToShow){
				ChangeQ(JumpTo);
			}
		}
	}
//Undocumented function added 10/12/2004
	ShowSpecialReadingForQuestion();
}

function ShowHideQuestions(){
	FuncBtnOut(document.getElementById('ShowMethodButton'));
	document.getElementById('ShowMethodButton').style.display = 'none';
	if (ShowingAllQuestions == false){
		for (var i=0; i<QArray.length; i++){
				QArray[i].style.display = '';
			}
		document.getElementById('Questions').style.listStyleType = 'decimal';
		document.getElementById('OneByOneReadout').style.display = 'none';
		document.getElementById('ShowMethodButton').innerHTML = ShowOneByOneCaption;
		ShowingAllQuestions = true;
	}
	else{
		for (var i=0; i<QArray.length; i++){
				if (i != CurrQNum){
					QArray[i].style.display = 'none';
				}
			}
		document.getElementById('Questions').style.listStyleType = 'none';
		document.getElementById('OneByOneReadout').style.display = '';
		document.getElementById('ShowMethodButton').innerHTML = ShowAllQuestionsCaption;
		ShowingAllQuestions = false;	
	}
	document.getElementById('ShowMethodButton').style.display = 'inline';
}

function CreateStatusArray(){
	var QNum, ANum;
//For each item in the item array
	for (QNum=0; QNum<I.length; QNum++){
//Check if the question still exists (hasn't been nuked by showing a random selection)
		if (document.getElementById('Q_' + QNum) != null){
			State[QNum] = new Array();
			State[QNum][0] = -1; //Score for this q; -1 shows question not done yet
			State[QNum][1] = new Array(); //answers
			for (ANum = 0; ANum<I[QNum][3].length; ANum++){
				State[QNum][1][ANum] = 0; //answer not chosen yet; when chosen, will store its position in the series of choices
			}
			State[QNum][2] = 0; //tries at this q so far
			State[QNum][3] = 0; //incrementing percent-correct values of selected answers
			State[QNum][4] = 0; //penalties incurred for hints
			State[QNum][5] = ''; //Sequence of answers chosen by number
		}
		else{
			State[QNum] = null;
		}
	}
}



function CheckMCAnswer(QNum, ANum, Btn){
//if question doesn't exist, bail
	if (State[QNum].length < 1){return;}
	
//Get the feedback
	Feedback = I[QNum][3][ANum][1];
	
//Now show feedback and bail if question already complete
	if (State[QNum][0] > -1){
//Add an extra message explaining that the question
// is finished if defined by the user
		if (strQuestionFinished.length > 0){Feedback += '<br />' + strQuestionFinished;}
//Show the feedback
		ShowMessage(Feedback);
		return;
	}
	
//Hide the button while processing
	Btn.style.display = 'none';

//Increment the number of tries
	State[QNum][2]++;
	
//Add the percent-correct value of this answer
	State[QNum][3] += I[QNum][3][ANum][3];
	
//Store the try number in the answer part of the State array, for tracking purposes
	State[QNum][1][ANum] = State[QNum][2];
	State[QNum][5] += String.fromCharCode(65+ANum) + ',';
	
//Should this answer be accepted as correct?
	if (I[QNum][3][ANum][2] < 1){
//It's wrong

//Mark the answer
		Btn.innerHTML = IncorrectIndicator;
		
//Remove any previous score unless exercise is finished (6.0.3.8+)
		if (Finished == false){
			WriteToInstructions(strInstructions);
		}	
		
//Check whether this leaves just one MC answer unselected, in which case the Q is terminated
		var RemainingAnswer = FinalAnswer(QNum);
		if (RemainingAnswer > -1){
//Behave as if the last answer had been selected, but give no credit for it
//Increment the number of tries
			State[QNum][2]++;		
		
//Calculate the score for this question
			CalculateMCQuestionScore(QNum);

//Get the overall score and add it to the feedback
			CalculateOverallScore();
			if ((ContinuousScoring == true)||(Finished == true)){
				Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
			}
		}
	}
	else{
//It's right
//Mark the answer
		Btn.innerHTML = CorrectIndicator;
				
//Calculate the score for this question
		CalculateMCQuestionScore(QNum);

//Get the overall score and add it to the feedback
		if (ContinuousScoring == true){
			CalculateOverallScore();
			if ((ContinuousScoring == true)||(Finished == true)){
				Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
			}
		}
	}
	
//Show the button again
	Btn.style.display = 'inline';
	
//Finally, show the feedback	
	ShowMessage(Feedback);
	
//Check whether all questions are now done
	CheckFinished();
}

function CalculateMCQuestionScore(QNum){
	var Tries = State[QNum][2] + State[QNum][4]; //include tries and hint penalties
	var PercentCorrect = State[QNum][3];
	var TotAns = GetTotalMCAnswers(QNum);
	var HintPenalties = State[QNum][4];
	
//Make sure it's not already complete

	if (State[QNum][0] < 0){
//Allow for Hybrids
		if (HintPenalties >= 1){
			State[QNum][0] = 0;
		}
		else{
//This line calculates the score for this question
			if (TotAns == 1){
				State[QNum][0] = 1;
			}
			else{
				State[QNum][0] = ((TotAns-((Tries*100)/State[QNum][3]))/(TotAns-1));
			}
		}
//Fix for Safari bug added for version 6.0.3.42 (negative infinity problem)
		if ((State[QNum][0] < 0)||(State[QNum][0] == Number.NEGATIVE_INFINITY)){
			State[QNum][0] = 0;
		}
	}
}

function GetTotalMCAnswers(QNum){
	var Result = 0;
	for (var ANum=0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][4] == 1){ //This is an MC answer
			Result++;
		}
	}
	return Result;
}

function FinalAnswer(QNum){
	var UnchosenAnswers = 0;
	var FinalAnswer = -1;
	for (var ANum=0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][4] == 1){ //This is an MC answer
			if (State[QNum][1][ANum] < 1){ //This answer hasn't been chosen yet
				UnchosenAnswers++;
				FinalAnswer = ANum;
			}
		}
	}
	if (UnchosenAnswers == 1){
		return FinalAnswer;
	}
	else{
		return -1;
	}
}





function CalculateOverallScore(){
	var TotalWeighting = 0;
	var TotalScore = 0;
	
	for (var QNum=0; QNum<State.length; QNum++){
		if (State[QNum] != null){
			if (State[QNum][0] > -1){
				TotalWeighting += I[QNum][0];
				TotalScore += (I[QNum][0] * State[QNum][0]);
			}
		}
	}
	if (TotalWeighting > 0){
		Score = Math.floor((TotalScore/TotalWeighting)*100);
	}
	else{
//if TotalWeighting is 0, no questions so far have any value, so 
//no penalty should be shown.
		Score = 100; 
	}
}

function CheckFinished(){
	var FB = '';
	var AllDone = true;
	for (var QNum=0; QNum<State.length; QNum++){
		if (State[QNum] != null){
			if (State[QNum][0] < 0){
				AllDone = false;
			}
		}
	}
	if (AllDone == true){
	
//Report final score and submit if necessary
		CalculateOverallScore();
		FB = YourScoreIs + ' ' + Score + '%.';
		if (ShowCorrectFirstTime == true){
			var CFT = 0;
			for (QNum=0; QNum<State.length; QNum++){
				if (State[QNum] != null){
					if (State[QNum][0] >= 1){
						CFT++;
					}
				}
			}
			FB += '<br />' + CorrectFirstTime + ' ' + CFT + '/' + QsToShow;
		}
		WriteToInstructions(FB);
		
		Finished == true;

		TimeOver = true;
		Locked = true;
		


		Finished = true;
		Detail = '<?xml version="1.0"?><hpnetresult><fields>';
		for (QNum=0; QNum<State.length; QNum++){
			if (State[QNum] != null){
				if (State[QNum][5].length > 0){
					Detail += '<field><fieldname>Question #' + (QNum+1) + '</fieldname><fieldtype>question-tracking</fieldtype><fieldlabel>Q ' + (QNum+1) + '</fieldlabel><fieldlabelid>QuestionTrackingField</fieldlabelid><fielddata>' + State[QNum][5] + '</fielddata></field>';
				}
			}
		}
		Detail += '</fields></hpnetresult>';
		setTimeout('Finish()', SubmissionTimeout);
	}
}










//-->

//]]>



