var iaccessF = "closed";
var administrationF = "closed";
var agentF = "closed";
var feesF = "closed";
var notificationF = "closed";
var otherF = "closed";
var processingF = "closed";
var tipsF = "closed";
var glossaryF = "closed";

function switchState(thisClass, state) {
	switch (thisClass) {
			case "iaccess" : 
				iaccessF = state;
				break;
			case "administration" : 
				administrationF = state;
				break;
			case "agent" : 
				agentF = state;
				break;
			case "fees" : 
				feesF = state;
				break;
			case "notification" : 
				notificationF = state;
				break;
			case "other" : 
				otherF = state;
				break;
			case "processing" : 
				processingF = state;
				break;
			case "tips" : 
				tipsF = state;
				break;
			case "glossary" : 
				glossaryF = state;
				break;
		}
}

function openCloseFaq(thisClass, state) {
	if (state == "closed") {
		$$("#content h2." + thisClass + " a")[0].setStyle({
			backgroundImage: "url(../images/bullet_slider_open.gif)",
			color: "#0d6db9"
		});
		Effect.BlindDown(thisClass + "Div", {
			duration: 0.7
		});
		state = "open";
		switchState(thisClass, state);
	} else if (state == "open") {
		$$("#content h2." + thisClass + " a")[0].setStyle({
			backgroundImage: "url(../images/bullet_slider_closed.gif)",
			color: "#042349"
		});
		Effect.BlindUp(thisClass + "Div", {
			duration: 0.7
		});
		state = "closed";
		switchState(thisClass, state);
	}
}

function faqOpenClose() {
	$$("#content div").each(function(d) {
		d.setStyle({
			overflow: "hidden"
		}).hide();
	});
	$$("#content h2 a").each(function(h2) {
		h2.setStyle("background-image: url(../images/bullet_slider_closed.gif);");
		var thisClass = h2.up().readAttribute("class");
		var state = null;
		h2.observe("mouseover", function() {
			this.setStyle({
				cursor: "pointer"
			});
		});
		h2.observe("mouseout", function() {
			this.setStyle({
				cursor: "default"
			});
		});
		h2.observe("click", function() {
			switch (thisClass) {
				case "iaccess" : 
					state = iaccessF;
					break;
				case "administration" : 
					state = administrationF;
					break;
				case "agent" : 
					state = agentF;
					break;
				case "fees" : 
					state = feesF;
					break;
				case "notification" : 
					state = notificationF;
					break;
				case "other" : 
					state = otherF;
					break;
				case "processing" : 
					state = processingF;
					break;
				case "tips" : 
					state = tipsF;
					break;
				case "glossary" : 
					state = glossaryF;
					break;
			}
			openCloseFaq(thisClass, state);
		});
	});
	$$("#anchors li a").each(function(a) {
		var aClass = a.up().readAttribute("class");
		a.observe("click", function(a) {
			switch (aClass) {
				case "iaccess" : 
					state = iaccessF;
					break;
				case "administration" : 
					state = administrationF;
					break;
				case "agent" : 
					state = agentF;
					break;
				case "fees" : 
					state = feesF;
					break;
				case "notification" : 
					state = notificationF;
					break;
				case "other" : 
					state = otherF;
					break;
				case "processing" : 
					state = processingF;
					break;
				case "tips" : 
					state = tipsF;
					break;
				case "glossary" : 
					state = glossaryF;
					break;
			}
			openCloseFaq(aClass, state);
			a.stop();
		});
	});
}