function deleteItem(subject, nextloc) {
	var input1=confirm("Weet u zeker dat u '" + subject + "' wilt verwijderen?");
	if (input1 == true) {
		window.location=nextloc;
		return;
	}
}
function popupWindowCentered(url, nWidth, nHeight) {
	var x=(screen.width-nWidth)/2;
	var y=(screen.height-nHeight)/2;
	var pos='left='+x+',top='+y;
	var w=window.open(url,"my_new_window",pos+"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width="+nWidth+", height="+nHeight);
	w.focus();
	return w;
}
function setSorting(obj) {
	document.forms['sortform'].submit();
}
function getDate() {
	var begin_day_select 	= document.forms['frm'].elements['tip_date_day'];
	var begin_month_select 	= document.forms['frm'].elements['tip_date_month'];
	var begin_year_select 	= document.forms['frm'].elements['tip_date_year'];

	begin_day 		= begin_day_select[begin_day_select.selectedIndex].value;
	begin_month 	= begin_month_select[begin_month_select.selectedIndex].value;
	begin_year 		= begin_year_select[begin_year_select.selectedIndex].value;

	datewindow = "cms/software/datepick.php?yearID="+begin_year+"&monthID="+begin_month+"&dayID="+begin_day+"&function=setBeginDate";

	popupWindowCentered(datewindow, '190', '220');
}
function setDateField(value, field) {
	var field_select = document.forms['frm'].elements[field];

	for (i=0; i<field_select.options.length; i++ ) {
		if ( field_select.options[i].value==value ) {
	    	field_select.selectedIndex = i;
	    	break;
	  	}
	}
}
function setBeginDate(year, month, day) {
	setDateField(day, 	'tip_date_day');
	setDateField(month, 'tip_date_month');
	setDateField(year, 	'tip_date_year');
}
function checkOthers(curr_name) {
	var check_array 	= document.forms['frm'].elements['theme[]'];
	
	for (var i=0; i<check_array.length; i++) {
		if (check_array[i].id != curr_name) {
			check_array[i].checked = false;
		}
	}
}
function removeSpecial(special_theme) {
	var check_array 	= document.forms['frm'].elements['theme[]'];

	if (special_theme != '') {
		for (var i=0; i<check_array.length; i++) {
			if (check_array[i].id == special_theme) {
				check_array[i].checked = false;
			}
		}
	}
}
function removeCurrFile() {
	var fld 			= document.forms['frm'].elements['file_delete'];
	var curr_file 		= document.getElementById('current_file');
	var curr_file_btn 	= document.getElementById('current_file_btn');		

	curr_file.innerHTML = 'Huidig bestand wordt verwijderd';

	curr_file_btn.style.display = 'none';
	fld.value = 1;
}
function setContentHeight() {
	
	if (self.innerWidth)
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}
	
	var content_div	= document.getElementById('content');
	
	if (frameHeight != undefined)  {
		content_div.style.height 	= (frameHeight - 220) + "px";
		document.body.style.height 	= (frameHeight - 220) + "px";
	}
}

//window.onload 		= setContentHeight();
//window.onresize		= setContentHeight();