var changePage = function(page) {
    if ($('#group').val() == undefined) {
        window.location= '?showOverview=1&page=' + page;
    } else {
        window.location= '?showOverview=1&id=' + $('#group').val() + '&page=' + page + '&returnPage=' + $('#returnPage').val();
    }
}

var bto = function() {
    $('#backToOverview').submit();
}

$(document).ready(function() {
	
	$('#scheduledForm').submit(function () {
		setTimeout(function() {
			$('#submitDelete').parent().html($('#scheduledForm div.bottomProgressBar').html());
		}, 3000);
		return true;
	});
	
	$('#periodicForm').submit(function () {
		setTimeout(function() {
			$('#submitDelete').parent().html($('#periodicForm div.bottomProgressBar').html());
		}, 3000);
		return true;
	});
	
	$('#deletePeriodic').submit(function () {
		setTimeout(function() {
			$('a.deletePeriodic').parent().append($('#periodicForm div.topProgressBar').html());
		}, 3000);
		return true;
	});
	
	$('a.editPeriodic').click(function () {
		setTimeout(function() {
			$('a.editPeriodic').parent().append($('#periodicForm div.topProgressBar').html());
		}, 3000);
		return true;
	});

	
	$('table.scheduleTableLayout a.editScheduled').each(function() {
		var elem = this;
		$(this).click(function() {
			setTimeout(function() {
				$(elem).parent().html($('div.cellProgressBar').html());
			}, 3000);
			return true;
		})
	});
}); // document.ready