function dps_confirm_del(url_val, all_rec){
	var msg_extra = all_rec == 'Y' ? '\nAll data connected with this record will also be deleted. ' : '';
	if(all_rec == 'Y')
		url_val +'&del_all=Y';

	if(confirm('Are you sure you want to delete this record?'+msg_extra)){
		location.href=encodeURI(url_val);
	}
}

function dps_mark_selected(field_obj, value_selected, mark_type){
	for(var d=0; d < field_obj.length; d++){
		if(mark_type != 'radio'){
			if(field_obj.options[d].value == value_selected){
				field_obj.options[d].selected = true;
				break;
			}
		}else{
			if(field_obj[d].value == value_selected){
				field_obj[d].checked = true;
				break;
			}
		}
	}
}

function dps_mouse_over(obj, color){
	oldColor = obj.style.backgroundColor;
	obj.style.backgroundColor = color;

}

function dps_mouse_out(obj){
	obj.style.backgroundColor = oldColor;
}

var media_click = false;
function dps_media_form(form_id, name_file){
  // this functions needs the dom-funcs.js to be included
	if(!media_click){
		var tbody = document.getElementById(form_id);
		var tr = createElement('tr');
		tbody.appendChild(tr);

		var td = createElement('td');
		td.appendChild(createElement('input', 'type', 'file',  'name', name_file));
		tr.appendChild(td);

		tr = createElement('tr');
		tbody.appendChild(tr);
		td = createElement('td');
		td.appendChild(createElement('input', 'type', 'submit', 'value', 'save'));
		tr.appendChild(td);
		media_click = true;
	}
}
