function narrow_page_controls(type, value) {
	xajax_narrow_page_controls(type, value);	
}

function add_control(type) {
	var narrow = document.getElementById("narrow").value;
	var control_id = document.getElementById("standalones").value;
	xajax_add_control(type, control_id, narrow);
}

function remove_control(type, control_id) {
	if (confirm("Are you sure you this control?")) {
		var narrow = document.getElementById("narrow").value;
		xajax_remove_control(type, control_id, narrow);
	}
}

function attachSingleControlDocumentUpload(ob, doc_type) {
	document.getElementById("uploadDocMsg"+doc_type).innerHTML = '';
	xajax_attachSingleControlDocumentUpload(ob, doc_type, document.getElementById('new_doc_upload'+doc_type).value);
}

function deleteSingleControlDocument(ob, doc_type, p) {
	if (confirm("Are you sure you wish to remove this document?")) {
		document.getElementById("deleteDocCtrl-"+p).innerHTML = small_progress();
		xajax_deleteSingleControlDocument(ob, doc_type, p);
	}
}

function orderDocuments(p, selected, type, doc_type) {
	document.getElementById("sortCtrl-"+p).innerHTML = small_progress();
	xajax_orderDocuments(type, doc_type, p, selected);
}
