// JavaScript Document
// This file contains custom javascript for use on www.emerson.edu

// shows tabs for step-by-step
// this function predicated on the link name being the same as the tab name + _link
function showDivTab(divName, thisDivName) {
	// loop from 1-20
	for (var i = 1; i <= 20; i++) {
		//get the corresponding name of the link container
		var linkP = divName + i + '_link';
		// if there is a matching tab hide it and set its corresponding link bgcolor to white; otherwise break
		if (document.getElementById(divName+i)) { 
			document.getElementById(divName+i).className = 'tabHide';
			document.getElementById(linkP).style.backgroundColor = '#FFFFFF';
			document.getElementById(linkP).style.borderBottom = "thin solid #808080";
			document.getElementById(linkP).style.borderTop = "none";
			document.getElementById(linkP).style.borderLeft = "none";
			document.getElementById(linkP).style.borderRight = "none";
		}	else {
			break;
		}
	}
	//show selected tab and set bgcolor and borders of active tab
	document.getElementById(thisDivName).className = 'tabView';
	document.getElementById(thisDivName + '_link').style.backgroundColor = '#EAEAEA';
	document.getElementById(thisDivName + '_link').style.borderTop = "thin solid #808080";
	document.getElementById(thisDivName + '_link').style.borderLeft = "thin solid #808080";
	document.getElementById(thisDivName + '_link').style.borderRight = "thin solid #808080";
	document.getElementById(thisDivName + '_link').style.borderBottom = "none";
	
}


// shows/hides a simple block of text ~ used in course displays
function showBlock(id) {
	if (document.getElementById) {
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';	
		} else {
			document.getElementById(id).style.display = 'none';		
		}
	}
}