function submit(id) {
	document.getElementById(id).submit();
}

function loader() {
	output = document.getElementById("image"),
	nodes = output.getElementsByTagName("a"),
	bottom = nodes.length-1,
	node = bottom,
	direction = -1;
}

function switches() {
	switch (node) {
		//at the top
		case 0:
			//down
			if (direction == 1) {
				nodes[node].style.visibility = "visible", node += 1;
			}
			//up
			else {
				nodes[node].style.visibility = "hidden", direction *= -1;
			}
			break;
		//at the bottom
		case bottom:
			if (direction == 1) {
				nodes[node].style.visibility = "visible", direction *= -1;
			}
			else {
				nodes[node].style.visibility = "hidden", node -= 1;
			}
			break;
		//in the middle
		default:
			if (direction == 1) {
				nodes[node].style.visibility = "visible", node += 1;
			}
			else {
				nodes[node].style.visibility = "hidden", node -= 1;
			}
	}
}
