function selectActiveLink(id) {
	$$('.links ul li a').each(function(allSelectors) {
		if (allSelectors.rel == "clip_" + id) {
			allSelectors.addClassName('active');
		} else {
			allSelectors.removeClassName('active');
		}
	});
}

function targetLink(id) {

	var leftScroll = $('leftScroll');
	var rightScroll = $('rightScroll');

	if (id == 0) {
		leftScroll.rel = "clip_" + 15;
	} else {
		leftScroll.rel = "clip_" + id;
	}
	
	if (id == 14) {
		rightScroll.rel = "clip_" + 1;
	} else {
		rightScroll.rel = "clip_" + (id + 2);
	}

}

function startGallery() {
	$$('ul#thumbnails li img').each(function(thumbnail) {
		Event.observe(thumbnail, 'mouseover', function() {
			$$('.galleryBox').each(function(images) {
				images.hide();
			});
			$(thumbnail.alt).show();
		});
	});
}

function jumpTo(clip) {
	layer.close();
	clip = clip - 1;
	glideTo(-(clip * 150), clip);
	}
	
var clips = new Array('adressbuch', 'gruppen', 'termine', 'events', 'marketplace', 'mobile', 'bestoffers', 'vernetzen', 'profil', 'persstartseite', 'suche', 'powersuche', 'nachrichten');

Event.observe(window, 'load', function() {

	$$('.links ul li a').each(function(selector) {
		Event.observe(selector, 'click', function() {
			var clip = selector.rel.split('_')[1] - 1;
			glideTo(-(clip * 150), clip);
		});
	});
		
	$$('#scrollbar a').each(function(arrow) {
		Event.observe(arrow, 'click', function() {
			var clip = arrow.rel.split('_')[1] - 1;
			glideTo(-(clip * 150), clip);
		});
	});
	
});