/* any error can be reported to shahmeet.singh@morningstar.com  */
var speedTime = 5;		// lesser is faster
var splide = 10;		// lesser is faster but quality of motion gets worse(should be more than 1 and should not be more that half of height of block)
var opened = '';		// please set any number within the quote or set false without quote
var toggling = true;	// Do you need toggle
var blkClassN = 'profileBoxTxt';
var titClassN = 'textOnOff bgOff';
var blockEle = 'div';
var titleEle = 'p';
var blockPad = 0;
var titlePad = 0;

// Don't edit below this line;
var blkObj = new Array();
var blockObj = new Array();
var blockObjH = new Array();
var titObj = new Array();
var titleObj = new Array();
var titleObjH = new Array();
var hideIntvl, showIntvl, openBlk, iHide, iShow, toggleBlockObj;
var  j = 0; 
function domReady() {
	toggleBlockObj = document.getElementById('director-bios');
	blkObj = toggleBlockObj.getElementsByTagName(blockEle);
	titObj = toggleBlockObj.getElementsByTagName(titleEle);	
	for(var k = 0; k < titObj.length; ++k) {
		if(titObj[k].className == titClassN) {
			titleObj[j] = titObj[k];
			++j;
		}
	}
	j = 0;
	for(var m = 0; m < blkObj.length; ++m) {
		if(blkObj[m].className == blkClassN) {
			blockObj[j] = blkObj[m];
			++j;
		}
	}
	j = 0;
	for(var n = 0; n < blockObj.length; ++n) {
		blockObj[n].style.overflow = 'hidden';
		blockObjH[n] = (blockObj[n].offsetHeight + blockPad);
		blockObj[n].style.height = (0 + 'px');
		// blockObj[n].className = 'off';
	}
	if(opened) {
		toggle(opened);
	}
}
function toggle(i) {
	i = parseInt(i);
	if(parseInt(blockObj[i].style.height) < blockObjH[i] && iHide != i && iShow != i && !showIntvl && !hideIntvl) {
		show(i);
		
	} else if (iHide != i && iShow != i && !hideIntvl && !showIntvl) {
		blockObj[i].style.height = ((blockObj[i].offsetHeight) + 'px');
		hide(i);
	}
	if(openBlk && (openBlk - 1) != i && toggling && !hideIntvl) {
		hide(openBlk -1);
		openBlk = 0;
	}
}
function hide(i) {
	if(parseInt(blockObj[i].style.height) > 0) {
	 	blockObj[i].style.height = ((parseInt(blockObj[i].style.height) - (parseInt(blockObj[i].style.height)/splide)) + 'px');
		if(hideIntvl) {
		} else {
			hideIntvl = setInterval("hide("+i+")", speedTime);
			iHide = i;
		}
	} else {
		clearInterval(hideIntvl);
		hideIntvl = 0;
		iHide = 10000;
		titleObj[i].className = 'textOnOff bgOff';
	}
}
function show(i) {
	if(parseInt(blockObj[i].style.height) < blockObjH[i]) {
	 	blockObj[i].style.height = (parseInt(blockObj[i].style.height) + (splide) + 'px');
		if(showIntvl) {
		} else {
			showIntvl = setInterval("show("+i+")", speedTime);
			iShow = i;
		}
	} else {
		clearInterval(showIntvl);
		showIntvl = 0;
		openBlk = i + 1;
		iShow = 10000;
		titleObj[i].className = 'textOnOff bgOn';
	}
}