
function isTagFoundInPage(tag) {
	return (document.getElementById(tag) 
			&& document.getElementById(tag).style);
}

	
function show(content) {
	if(isTagFoundInPage(content)){ 
		var style2 = document.getElementById(content).style;
		style2.display = "block";
	}
}


function hide(content) {
	if(isTagFoundInPage(content)) {
		var style2 = document.getElementById(content).style;
		style2.display = "none";
	}
}

function switchDisplayState(tag){
	if(isTagFoundInPage(tag)){
		var style2 = document.getElementById(tag).style;
		style2.display = (style2.display=="block") ? "none" : "block";
	}
}	

function showHideDESC(tag){
	if(isTagFoundInPage(tag)) {
	var style2 = document.getElementById(tag).style;
	style2.display = (style2.display == "block") ? "none": "block";
	}
}

function toggleMore(tag, moreTag){
	showHideDESC(tag);
	shoeHideDESC(moreTag);
}

/* show the first tag, turn off the rest ... of 3 buttons */
function radioButtonShow3(on,off1,off2){
	hide(off1);
	hide(off2);
	show(on);
}	



/* **** OPEN IN NEW WINDOW **** */

var aNewWindow;

function openArticleWindow(absPath){
		window.open(absPath,'name','height=520,width=420,left=20, top=40,resizable=no,scrollbars=yes,toolbar=no,status=yes');
	}
/*
function openSpeakerWindow(speaker){
	var speakerPage = 'Content/speakers/'+speaker+'.html';
		aNewWindow=window.open(speakerPage,'name','height=400,width=600,left=0, top=40,resizable=no,scrollbars=yes,toolbar=no,status=yes');
	}
	*/
function openSpeakerWindow(speaker){
	var speakerPage = speaker;
		aNewWindow=window.open(speakerPage,'name','height=400,width=600,left=0, top=40,resizable=no,scrollbars=yes,toolbar=no,status=yes');
	}


function openKeynoteWindow(speaker_link){
	var speakerPage = speaker_link;
		aNewWindow=window.open(speakerPage,'name','height=580,width=600,left=32, top=20,resizable=no,scrollbars=yes,toolbar=no,status=yes');
		}




/* ***** Planning Worksheet ******** */









function toggleSection(sectionId, chboxId){
	if(isTagFoundInPage(chboxId)){
		var chbox = document.getElementById(chboxId);
		if(chbox.checked) {
			show(sectionId);
		}else {
			hide(sectionId);
		}
	}
}		

/* ***** Handle Overview Page's Toggling of sections ***** */
/* *** this code is left over from a previoius project *** */

function reduceLinkStyle(tag){
	if(isTagFoundInPage(tag)) {
		document.getElementById(tag).className="reducedLink";

	}
}

function makeProminentStyle(tag){
	if(isTagFoundInPage(tag)) {
		var style4 = document.getElementById(tag).className="prominentLink";
	}

}

function showFirstTimers(){
	hide('returning'); reduceLinkStyle('returningLink');
	hide('letter'); reduceLinkStyle('letterLink');
	show('firstTimers'); makeProminentStyle('firstTimersLink');
}

function showReturning(){
	hide('firstTimers'); reduceLinkStyle('firstTimersLink');
	hide('letter'); reduceLinkStyle('letterLink');
	show('returning'); makeProminentStyle('returningLink');
}

function showLetter(){
	hide('firstTimers'); reduceLinkStyle('firstTimersLink');
	hide('returning'); reduceLinkStyle('returningLink');
	show('letter'); makeProminentStyle('letterLink');
}
