/** SAL2 JAvascript functions */
//module 1 activity
function highlightthis(whichelement, type) {
		if (type == '1') {
		var theclass = 'highlighted1';
		} else if (type == '2') {
		var theclass = 'highlighted2';
		} else {
		var theclass = 'none';
		}

		var link= document.getElementById(whichelement);
		link.className = theclass;
}



function toggleSwitch(whichelement) {
	var link= document.getElementById(whichelement);
	if (link.className == 'off') {
		link.className = 'on';
		link.src = 'images/checkbox-on.gif';
	} else {
		link.className = 'off';
		link.src = 'images/checkbox-off.gif';
	}
}


function checkAnswers() {
	var link= document.getElementById('checkprompt');
	link.className = 'hidden';
	var link= document.getElementById('qmarkbgd');
	link.className = 'hidden';
	var link= document.getElementById('answers');
	link.className = 'shown';
}


var tiptrack = 'off';
var strattrack = 'off';
var litfocustrack = 'off';
var strategytrack = 'off';
var keytermpopuptrack = 'off';
var litdynpopuptrack = 'off';
var quiztrack = '';
var tradscenariotrack = '';
var transcriptpopuptrack = 'off';

var transcriptpopup= '';
var tradscenariopopup1= '';
var strategypopup1= '';
var tippopup1= '';
var strategypopup2= '';
var litfocuspopup1= '';
var keytermpopup1= '';
var litdynpopup1 = '';
var quizpopup1 = '';

function ecdfpopup(whichpopup) {

if (whichpopup =='keytermpopup') {
		if (keytermpopuptrack == 'on') {
			keytermpopup1.show();
		} else { 
			keytermpopup1 = new YAHOO.widget.Panel("keytermpopup", {constraintoviewport:true, underlay:"shadow", width:"462px" });
			keytermpopup1.cfg.setProperty("x", 100);
			keytermpopup1.cfg.setProperty("y", 10);
			keytermpopup1.render();
			keytermpopuptrack ='on';
		}
	//not currently used:
	} else if (whichpopup =='keytermpopupwide') {
		if (keytermpopuptrack == 'on') {
			keytermpopup1.show();
		} else { 
			keytermpopup1 = new YAHOO.widget.Panel("keytermpopupwide", {constraintoviewport:true, underlay:"shadow", width:"671px" });
			keytermpopup1.cfg.setProperty("x", 200);
			keytermpopup1.cfg.setProperty("y", 100);
			keytermpopup1.render();
			keytermpopuptrack ='on';
		}
	
	} else if (whichpopup =='keytermpopuptall') {
		if (keytermpopuptrack == 'on') {
			keytermpopup1.show();
		} else { 
			keytermpopup1 = new YAHOO.widget.Panel("keytermpopup", {constraintoviewport:true, underlay:"shadow", width:"462px" });
			keytermpopup1.cfg.setProperty("x", 100);
			keytermpopup1.cfg.setProperty("y", 20);
			keytermpopup1.render();
			keytermpopuptrack ='on';
		}
	
	} else if (whichpopup =='litdynpopup') {
		if (litdynpopuptrack == 'on') {
			litdynpopup1.show();
		} else { 
			litdynpopup1 = new YAHOO.widget.Panel("litdynamicpopup", {constraintoviewport:false, underlay:"shadow", width:"671px" });
			litdynpopup1.cfg.setProperty("x", 100);
			litdynpopup1.cfg.setProperty("y", 10);
			litdynpopup1.render();
			litdynpopuptrack ='on';
		}

	} else if (whichpopup =='strategy') {
		if (strattrack == 'on') {
			stratpopup1.show();
		} else { 
			stratpopup1 = new YAHOO.widget.Panel("strategypopup", {constraintoviewport:true, underlay:"shadow", width:"462px" });
			stratpopup1.cfg.setProperty("x", 300);
			stratpopup1.cfg.setProperty("y", 100);
			stratpopup1.render();
			strattrack ='on';
		}		
		
		
	//standard tip	
	} else if (whichpopup =='tip') {
		if (tiptrack == 'on') {
			tippopup1.show();
		} else { 
 			tippopup1 = new YAHOO.widget.Panel("tippopup", {constraintoviewport:true, underlay:"shadow", width:"462px" });
 			tippopup1.cfg.setProperty("x", 323);
			tippopup1.cfg.setProperty("y", 123);
			tippopup1.render();
			tiptrack ='on';
		}
	// here are the new ones	
	} else if (whichpopup =='literacyfocus') {
		if (litfocustrack == 'on') {
			litfocuspopup1.show();
			highlightthis('minilitfocusspan', '1');
		} else { 
 			litfocuspopup1 = new YAHOO.widget.Panel("litfocus", {constraintoviewport:true, underlay:"shadow", width:"252px" });
 			litfocuspopup1.cfg.setProperty("x", 100);
			litfocuspopup1.cfg.setProperty("y", 200);
			litfocuspopup1.render();
			litfocustrack ='on';
			highlightthis('minilitfocusspan', '1');
			litfocuspopup1.hideEvent.subscribe(alertliteracyfocus);
		}
	
	}else if (whichpopup =='teachingstrategy') {
		if (strategytrack == 'on') {
			strategypopup2.show();
			highlightthis('ministrategyspan', '2');
		} else { 
 			strategypopup2 = new YAHOO.widget.Panel("strategy", {constraintoviewport:true, underlay:"shadow", width:"252px" });
 			strategypopup2.cfg.setProperty("x", 200);
			strategypopup2.cfg.setProperty("y", 70);
			strategypopup2.render();
			strategytrack ='on';
			highlightthis('ministrategyspan', '2');
			strategypopup2.hideEvent.subscribe(alertteachingstrategy);

		}
	
	} else if (whichpopup =='teachingstrategymulti') {
		if (strategytrack == 'on') {
			strategypopup2.show();
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
 			highlightthis('ministrategyspan3', '2');
		} else { 
 			strategypopup2 = new YAHOO.widget.Panel("strategy", {constraintoviewport:true, underlay:"shadow", width:"252px" });
 			strategypopup2.cfg.setProperty("x", 200);
			strategypopup2.cfg.setProperty("y", 70);
			strategypopup2.render();
			strategytrack ='on';
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
 			highlightthis('ministrategyspan3', '2');
			strategypopup2.hideEvent.subscribe(alertteachingstrategymulti);
		}
	
	} else if (whichpopup =='teachingstrategymulti2') {
		if (strategytrack == 'on') {
			strategypopup2.show();
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
		} else { 
 			strategypopup2 = new YAHOO.widget.Panel("strategy", {constraintoviewport:true, underlay:"shadow", width:"252px" });
 			strategypopup2.cfg.setProperty("x", 200);
			strategypopup2.cfg.setProperty("y", 70);
			strategypopup2.render();
			strategytrack ='on';
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');;
			strategypopup2.hideEvent.subscribe(alertteachingstrategymulti2);
		}
	
	} else if (whichpopup =='literacyfocusmulti2') {
		if (litfocustrack == 'on') {
			litfocuspopup1.show();
			highlightthis('minilitfocusspan', '1');
		} else { 
 			litfocuspopup1 = new YAHOO.widget.Panel("litfocus", {constraintoviewport:true, underlay:"shadow", width:"252px" });
 			litfocuspopup1.cfg.setProperty("x", 100);
			litfocuspopup1.cfg.setProperty("y", 200);
			litfocuspopup1.render();
			litfocustrack ='on';
			highlightthis('minilitfocusspan1', '1');
			highlightthis('minilitfocusspan2', '1');
			litfocuspopup1.hideEvent.subscribe(alertliteracyfocusmulti2);
		}
	
	} else if (whichpopup =='teachingstrategymulti5') {
		if (strategytrack == 'on') {
			strategypopup2.show();
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
 			highlightthis('ministrategyspan3', '2');
 			highlightthis('ministrategyspan4', '2');
 			highlightthis('ministrategyspan5', '2');
		} else { 
 			strategypopup2 = new YAHOO.widget.Panel("strategy", {constraintoviewport:true, underlay:"shadow", width:"252px" });
 			strategypopup2.cfg.setProperty("x", 200);
			strategypopup2.cfg.setProperty("y", 70);
			strategypopup2.render();
			strategytrack ='on';
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
 			highlightthis('ministrategyspan3', '2');
 			highlightthis('ministrategyspan4', '2');
 			highlightthis('ministrategyspan5', '2');
			strategypopup2.hideEvent.subscribe(alertteachingstrategymulti5);
		}
	
	} else if (whichpopup =='teachingstrategymulti6') {
		if (strategytrack == 'on') {
			strategypopup2.show();
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
 			highlightthis('ministrategyspan3', '2');
 			highlightthis('ministrategyspan4', '2');
 			highlightthis('ministrategyspan5', '2');
 			highlightthis('ministrategyspan6', '2');
		} else { 
 			strategypopup2 = new YAHOO.widget.Panel("strategy", {constraintoviewport:true, underlay:"shadow", width:"252px" });
 			strategypopup2.cfg.setProperty("x", 200);
			strategypopup2.cfg.setProperty("y", 70);
			strategypopup2.render();
			strategytrack ='on';
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
 			highlightthis('ministrategyspan3', '2');
 			highlightthis('ministrategyspan4', '2');
 			highlightthis('ministrategyspan5', '2');
 			highlightthis('ministrategyspan6', '2');
			strategypopup2.hideEvent.subscribe(alertteachingstrategymulti6);
		}
	
	} else if (whichpopup =='teachingstrategymulti9') {
		if (strategytrack == 'on') {
			strategypopup2.show();
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
 			highlightthis('ministrategyspan3', '2');
 			highlightthis('ministrategyspan4', '2');
 			highlightthis('ministrategyspan5', '2');
 			highlightthis('ministrategyspan6', '2');
 			highlightthis('ministrategyspan7', '2');
 			highlightthis('ministrategyspan8', '2');
 			highlightthis('ministrategyspan9', '2');
		} else { 
 			strategypopup2 = new YAHOO.widget.Panel("strategy", {constraintoviewport:true, underlay:"shadow", width:"252px" });
 			strategypopup2.cfg.setProperty("x", 200);
			strategypopup2.cfg.setProperty("y", 70);
			strategypopup2.render();
			strategytrack ='on';
			highlightthis('ministrategyspan1', '2');
 			highlightthis('ministrategyspan2', '2');
 			highlightthis('ministrategyspan3', '2');
 			highlightthis('ministrategyspan4', '2');
 			highlightthis('ministrategyspan5', '2');
 			highlightthis('ministrategyspan6', '2');
 			highlightthis('ministrategyspan7', '2');
 			highlightthis('ministrategyspan8', '2');
 			highlightthis('ministrategyspan9', '2');
			strategypopup2.hideEvent.subscribe(alertteachingstrategymulti9);
		}
	
	} else if (whichpopup =='tradscenario') {
		if (tradscenariotrack == 'on') {
			tradscenariopopup1.show();
		} else { 
 			tradscenariopopup1 = new YAHOO.widget.Panel("tradscenariopopup", {constraintoviewport:true, underlay:"shadow", width:"671px" });
 			tradscenariopopup1.cfg.setProperty("x", 70);
			tradscenariopopup1.cfg.setProperty("y", 4);
			tradscenariopopup1.render();
			tradscenariotrack ='on';
		}
	
	} else if (whichpopup =='transcriptpopup1') {
		if (transcriptpopuptrack == 'on') {
			transcriptpopup.show();
		} else { 
			transcriptpopup = new YAHOO.widget.Panel("transcript", {constraintoviewport:false, underlay:"shadow", width:"671px" });
			transcriptpopup.cfg.setProperty("x", 200);
			transcriptpopup.cfg.setProperty("y", 100);
			transcriptpopup.render();
			transcriptpopuptrack ='on';
		}
	
	} else if (whichpopup =='quiz') {
		if (quiztrack == 'on') {
			quizpopup1.show();
		} else { 
 			quizpopup1 = new YAHOO.widget.Panel("quizpopup", {constraintoviewport:true, underlay:"shadow", width:"671px" });
 			quizpopup1.cfg.setProperty("x", 70);
			quizpopup1.cfg.setProperty("y", 70);
			quizpopup1.render();
			quiztrack ='on';
		}
	
	}

//end of popups	
}	
	
	
function alertliteracyfocus () { 
highlightthis('minilitfocusspan', '10');
} 

function alertliteracyfocusmulti2 () { 
highlightthis('minilitfocusspan1', '10');
highlightthis('minilitfocusspan2', '10');
} 
	
function alertteachingstrategy () { 
highlightthis('ministrategyspan', '10');
}

function alertteachingstrategymulti () { 
highlightthis('ministrategyspan1', '10');
highlightthis('ministrategyspan2', '10');
highlightthis('ministrategyspan3', '10');
}

function alertteachingstrategymulti2 () { 
highlightthis('ministrategyspan1', '10');
highlightthis('ministrategyspan2', '10');
}	

function alertteachingstrategymulti5 () { 
highlightthis('ministrategyspan1', '10');
highlightthis('ministrategyspan2', '10');
highlightthis('ministrategyspan3', '10');
highlightthis('ministrategyspan4', '10');
highlightthis('ministrategyspan5', '10');
}

function alertteachingstrategymulti6 () { 
highlightthis('ministrategyspan1', '10');
highlightthis('ministrategyspan2', '10');
highlightthis('ministrategyspan3', '10');
highlightthis('ministrategyspan4', '10');
highlightthis('ministrategyspan5', '10');
highlightthis('ministrategyspan6', '10');
}

function alertteachingstrategymulti9 () { 
highlightthis('ministrategyspan1', '10');
highlightthis('ministrategyspan2', '10');
highlightthis('ministrategyspan3', '10');
highlightthis('ministrategyspan4', '10');
highlightthis('ministrategyspan5', '10');
highlightthis('ministrategyspan6', '10');
highlightthis('ministrategyspan7', '10');
highlightthis('ministrategyspan8', '10');
highlightthis('ministrategyspan9', '10');
}