function toggleCheckbox(id,element) {
	input = document.getElementById(id);
	inputnr = input.value.substring(0,input.value.indexOf('_'));
	if (element.checked) { inputstatus = 1; } else { inputstatus = 0; }
	input.value = inputnr + '_' + inputstatus;
}

function toggleCheckboxSimple(id,element) {
	input = document.getElementById(id);
	if (element.checked) { inputstatus = 1; } else { inputstatus = 0; }
	input.value = inputstatus;
}

function setFormAction(prefix,action,id) {
	modeel = document.getElementById(prefix+'_action');
	modeel.value = action;
	
	idel = document.getElementById(prefix+'_action_id');
	idel.value = id;
}

function currentDate() {
	var monthNames = new Array("Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December");
	today = new Date();
	return (today.getDate() + ' ' + monthNames [today.getMonth()] + ' ' + today.getFullYear());
}

function openUrl(url) {
	if(url != null && url != "") {
		window.location = url;
	}
}

function getQueryVariable(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
	var pair = vars[i].split("=");
	if (pair[0] == variable) {
		return pair[1];
	}
	}
}

function jumpToAnchor () {
	jumpto = getQueryVariable("anchor");
	if (jumpto != undefined && jumpto != "") {	
		jumptoelement = document.getElementById(jumpto);
		if (jumptoelement != undefined && jumptoelement != null) { 
			var thepoint = jumptoelement.offsetTop;
			window.scrollTo(0,thepoint);
		}
	}
}
