function activate() {
	Nifty('div#formContainer');
	Nifty('div#header','tl,tr');
	Nifty('div#footer','bl,br');
	var elmts = document.forms['guide'].elements;
	for (var i=0; i < elmts.length; i++) {
		if(elmts[i].type == 'text' || elmts[i].type == 'password' || elmts[i].type == 'file' || elmts[i].type == 'textarea' || elmts[i].type == 'select-one' || elmts[i].type == 'select-multiple') {
			elmts[i].onfocus = spotlight;
	 		elmts[i].onblur = spotlight;
 		}
 		else if(elmts[i].type == 'radio' || elmts[i].type == 'checkbox') {
	 		elmts[i].parentNode.onmouseover = spotlight;
	 		elmts[i].parentNode.onmouseout = spotlight;
 		}
	}
	var divs = document.getElementsByTagName('div');
	for (var i=0; i < divs.length; i++) {
		if(divs[i].className=='groupHelp') {
			Nifty('div.groupHelp');
		}
	}
	var links = document.getElementsByTagName('a');
	linkState='off';
	for (var i=0; i < links.length; i++) {
		links[i].onmouseover = hover;
		links[i].onmouseout = hover;
	}
}
function hover() {
	if(this.className=='dhelp') {
		linkState = (linkState=='off') ? 'on' : 'off';
	}
}

function spotlight() {
	div = (this.nodeName == 'DIV') ? this : this.parentNode;
	div.className = (div.className == 'formElmt') ? 'formElmt elmtFocus' : 'formElmt' ;
	divContents = div.childNodes;
	for (var i=0; i < divContents.length; i++) {
		if((divContents[i].nodeName == 'DIV') && (divContents[i].className.indexOf('helpCtnr') != -1)) {
			if(linkState=='off') {
				divContents[i].className = (divContents[i].className=='helpCtnr') ? 'helpCtnr viewHelp' : 'helpCtnr' ;
			}
			else {
				d = divContents[i];
				setTimeout(timer,400);
			}
		}
	}
}
function timer() {
	d.className = 'helpCtnr';	
}

window.onload = activate;