var scroller  = null;
var scrollbar = null;

function scrollbarEvent (o, type) {
	/*if (type == "mousedown") {
		if (o.className == "Scrollbar-Track") o.style.backgroundColor = "#6a511f";
		else o.style.backgroundColor = "#6a511f";
	} else {
		if (o.className == "Scrollbar-Track") o.style.backgroundColor = "#6a511f";
		else o.style.backgroundColor = "#6a511f";
	}*/
}

function swapIt(o) {
	o.blur();
	if (o.className == "current") return false;
  
	var list = document.getElementById("Navigation").getElementsByTagName("a");
	for (var i = 0; i < list.length; i++) {
		if (list[i].className == "current") {
			list[i].className = "";
			document.getElementById(list[i].title).y = -scroller._y;
		}
		if (list[i].title == o.title) o.className = "current";
	}
  
	list = document.getElementById("Container").childNodes;
	for (var i = 0; i < list.length; i++) {
		if (list[i].tagName == "DIV") list[i].style.display = "none";
	}
  
	var top = document.getElementById(o.title);
	top.style.display = "block";
	scrollbar.swapContent(top);
	if (top.y) scrollbar.scrollTo(0, top.y);
  
	return false;
}

function startScroller() {
	scroller  = new jsScroller(document.getElementById("toScroll"), 620, 230);
	scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container"), scroller, true, scrollbarEvent);
}

function startScrollerMenu() {
	scroller  = new jsScroller(document.getElementById("toScrollMenu"), 620, 390);
	scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container"), scroller, true, scrollbarEvent);
}

function startScrollerNews() {
	scroller  = new jsScroller(document.getElementById("toScrollNews"), 300, 460);
	scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container-News"), scroller, true, scrollbarEvent);
}

function startScrollerEvents() {
	scroller  = new jsScroller(document.getElementById("toScrollEvents"), 300, 460);
	scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container-Events"), scroller, true, scrollbarEvent);
}
function startScrollerArticles() {
	scroller  = new jsScroller(document.getElementById("toScrollArticles"), 620, 200);
	scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container-Articles"), scroller, true, scrollbarEvent);
}
function startScrollerGallery() {
	scroller  = new jsScroller(document.getElementById("toScrollGallery"), 620, 420);
	scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container-Gallery"), scroller, true, scrollbarEvent);
}