// JavaScript Document
function next(el) {
	do {
		el = el.nextSibling;
	} while (el && (1 != el.nodeType));
	return el;
}
function previous(el) {
	do {
		el = el.previousSibling;
	} while (el && (1 != el.nodeType));
	return el;
}
function first(el) {
	el = el.firstChild;
	return (el && (1 !== el.nodeType)) ? next(el) : el;
};
function last(el) {
	el = el.lastChild;
	return (el && (1 !== el.nodeType)) ? previous(el) : el;
};
function children(el) {
	for (var i = 0, result = [], c = el.childNodes, l = c.length; i < l; i++) {
		if (1 === c[i].nodeType) {
			result.push(c[i]);
		}
	}
	return result;
};
var toggle = {
	hide : 'bigArrow',
	show : 'bigArrowSelected',
	init : function (id) {
		id = document.getElementById(id);
		if (id) {
			var ul = id.getElementsByTagName('ul'), l = ul.length, i, li, a;
			while (l--) {
				i = ul[l];
				if ('ul' === i.nodeName.toLowerCase()) {
					li = i.parentNode;
					a = first(li);
					a.onclick = toggle.toggle;
					if (toggle.show !== li.className) {
						i.style.display = 'none';
						li.className = toggle.hide;
					}
				}
			}
		}
	},
	toggle : function (e) {
		var p = this.parentNode, t = p.getElementsByTagName('UL')[0];
		if (toggle.hide === p.className) {
			p.className = toggle.show;
			t.style.display = '';
		} else {
			p.className = toggle.hide;
			t.style.display = 'none';
 		}
		if (e) {
			e.stopPropagation();
		} else if (window.event) {
			window.event.cancelBubble = true;
		}
		return false;
	}
};
