//IntervalID
var aktiv;
//Hoehe des jeweiligen content-DIVs
var divHeight = 'x';
/*
 * Loest das Hochscrollen vom Content des Werdegangs aus
 */
function scrollUp() {
	aktiv = window.setInterval('moveContent(6)', 10);
}

/*
 * Loest das Runterscrollen vom Content des Werdegangs aus
 */
function scrollDown() {
	aktiv = window.setInterval('moveContent(-6)', 10);
}

/*
 * Stoppt jegliches Scrollen
 */
function stopScroll() {
	window.clearInterval(aktiv);
}

/*
 * Scrollt den Content des Werdegangs nach Oben
 */
function moveContent(direction) {
	if(divHeight == 'x') {
		//Braucht nur einmal ausgelesen werden
		divHeight = document.getElementById('price_list_scroll').offsetHeight;
	}
	var newScrollPos;
	var divPos = $('#price_list_scroll').css('top');
	var divScaleHeight = $('#price_list').css('height');
	divScaleHeight = parseInt(divScaleHeight.replace('px', ''));
	divPos = parseInt(divPos.replace('px', ''));
	if(direction > 0 && divPos < (divScaleHeight - divHeight)) {
		newScrollPos = divPos;
	}else if(direction < 0 && divPos == 0) {
		newScrollPos = divPos;
	}else {
		newScrollPos = divPos - direction;
	}
	$('#price_list_scroll').css({'top' : newScrollPos + 'px'});
}

function changeColorDark(id) {
	var idPart = id.split('_');
	$('#'+id).attr({'src' : 'images/basics/'+idPart[1]+'_hover.png'});
}

function changeColorBright(id) {
	var idPart = id.split('_');
	$('#'+id).attr({'src' : 'images/basics/'+idPart[1]+'.png'});
}
