/**
 * @author susanhartig
 */


// Initialisieren
$(function() {
	$('#myselectbox').selectbox();
	if ($('#mycarousel').length) {
		$('#mycarousel').jcarousel({
			start:startIndex,
			scroll:1,
			itemFirstInCallback: toolLoader.loadLater
		});
	}
})


var toolLoader = {
	timeOut: null,

	clearTimeout: function () {
		if (this.timeOut != null) {
			window.clearTimeout(this.timeOut);
		}
	},

	load: function (data) {
		[id, text] = data.split('#');
		document.location.href = HOME_LINK + id + '/' + text + '.html';
	},

	loadLater: function (carousel, item, idx, state) {
		this.clearTimeout();
		if (state != 'init') {
			this.timeOut = window.setTimeout("toolLoader.load('" + $(item).attr('id') + "')", 1000);
		}
	}
}


// collapse bzw. show/hide
function toggleBox(id) {			
	$('#'+id).toggleClass("infobox_expanded");
}
