
//globals
var intFlickerDelay = 100; //milliseconds
var colorFlicker1 = "#FFCCCC";
var colorFlicker2 = "#FFEEEE";
var colorBackground = "#FFFFFF";

//no modifications necessary below this line.
var gDivTOS = null;
// end globals

//function writes href value into anchor tag.
//enableLink(checkbox object, anchor string if box checked, anchor string if box unchecked, div element to write to)
function enableLink(cb, strAnchor_valid, strAnchor_invalid, divId) {
	if(cb.checked) document.getElementById(divId).innerHTML = strAnchor_valid;
	else document.getElementById(divId).innerHTML = strAnchor_invalid;
}

//function flickers div if checkbox is not checked.
//tosNotice(id of div to flicker, id of checkbox to test)
function tosNotice(divTos, strCbTOS) {	
	//if checkbox is checked, return without flickering.
	if(document.getElementById(strCbTOS).checked) return true;
	
	//save the name of TOS div for timeout function to access after this function has exited.
	gDivTOS = divTos;
	
	//set several timeouts to modify TOS div background color at a period determined by intFlickerDelay.
	document.getElementById(gDivTOS).style.backgroundColor=colorFlicker1;
	setTimeout("document.getElementById(gDivTOS).style.backgroundColor=colorBackground",intFlickerDelay);
	setTimeout("document.getElementById(gDivTOS).style.backgroundColor=colorFlicker2",intFlickerDelay * 2);
	setTimeout("document.getElementById(gDivTOS).style.backgroundColor=colorBackground",intFlickerDelay * 3);

}

