var lsfViewJson = null; 

this.checkShowCondition = function() {
	var date = new Date();
	if(date.getHours()%2 == 1 && date.getMinutes() > 44){
		return 120;
	} else {
		return 0; //Skip Panel
	}
}

this.show = function() {
	//SomeSortOfTimingStuff
}

this.hide = function() {
	//CleanDat
}

this.loaded = function(panel, config) {
	function lsfDataUpdate() {
		$.getJSON("tmp/lsfView.json?"+( new Date().getTime()) ).done(function(json) {
			lsfViewJson = json;
			fillTable(lsfViewJson);
		}).fail(function(jqxhr, textStatus, error) {
			var err = textStatus + ", " + error;
			console.log("Request Failed: " + err);
		});
	}

	function toNextRound(i){
		if(i%2 == 1){
			return i+1;
		}
		return i;
	}
	
	function fillTable(json) {
		var date = new Date();
		document.getElementById("lsfViewTitleBar").innerHTML = "Vorlesungen zwischen " + toNextRound(date.getHours()) + " und " + (toNextRound(date.getHours())+2);
	}
	
	lsfDataUpdate();
}