// JavaScript Document
//this javascript is used to stretched the image background of the document for briefreports

function changeDivHeight() {
	var myA = document.getElementsByTagName('a');
	for (i=0; i<myA.length; i++) {
		myText = myA[i].innerHTML
		if (myText.match('Continue reading this activity')) {
			myA[i].innerHTML = ('<span style="font-size:16px;">&gt;&gt;To continue reading this activity for free, click here.</span>');
		}
	}
    startHeight = 2000;
	document.getElementById('middle-background-image').style.height= startHeight + 'px';
	divHeight=document.getElementById('middle-content').offsetHeight;
	backHeight=divHeight + 10;
	document.getElementById('middle-background-image').style.height=backHeight + 'px';
}
function openCME() {
	myCMEURL = document.URL;
	marker = myCMEURL.lastIndexOf('/') + 1;
	markerend = marker + 11;
	myFile = myCMEURL.substring(marker,markerend);
	if (myFile == 'comment.asp') {
		myFrameURL = document.getElementById('iframetoc').src;
		marker2 = myFrameURL.lastIndexOf('=') + 1;
		myFrameID = myFrameURL.substring(marker2);
		window.open('http://www.cmeinstitute.com/casencomment/cmebackground.asp?QID=' + myFrameID, 'cmebackground');
		return false;
	} else {
		
		document.getElementById('cme_psychlopedia').className='show'; 
		return false;
	}
}
