var faqBehaviours = {
	'dl dt' : function(el){
		el.setAttribute('title','Click to show answer');
		el.onclick = function(){
			// build defintion term and defintion collections
			var aDT = el.parentNode.getElementsByTagName("dt");
			var aDD = el.parentNode.getElementsByTagName("dd");

			// loop through defintion term collection
			for (var i = 0; i < aDT.length; i++) {

				// if definition term is the current element and definition is closed, open definition
				if (el == aDT[i] && aDD[i].style.display == "none") {
					aDT[i].className = 'selected';
					new Effect.BlindDown(aDD[i], {duration:0.2});
					new Effect.Highlight(aDD[i], {duration:0.9, startcolor:'#fff5e5', endcolor:'#FFFFFF'});

				// otherwise close definition
				} else if (aDD[i].style.display != "none") {
					aDT[i].className = '';
					aDT[i].style.backgroundColor = '#fff';
					new Effect.BlindUp(aDD[i], {duration:0.5});
				}
			}
		}

		el.onmouseover = function(){
			//el.style.color = '#f90';
			if(el.className != 'selected') {
				el.style.backgroundColor = '#fff5e5';
			}else{
				el.style.backgroundColor = '';
			}
		}

		el.onmouseout = function(){
			//el.style.color = '#0060aa';
			el.style.backgroundColor = '';
		}

	},

	// hide all definitions on start
	'dl dd' : function(el){
		el.style.display = "none";		
	}
	
};

if (readCookie("style") != "textonly") Behaviour.register(faqBehaviours);

