// Function that simulates PHP addslashes

function addSlashes(textString){

	return textString.replace(/('|")/g,"\\$1");	
	
}

// Function to delete a row from a list

function deleteRow(rowId, rowDescription){

	ask = confirm('RIJ VERWIJDEREN ! BENT U ZEKER ?\n\n' + rowDescription + ' verwijderen ?' + '\n\nDruk \"OK\" om de rij te verwijderen of \"Cancel\" om te annuleren.');
	
	if (ask == true){
		frm = document.forms.action_form;
		frm.action_id.value = rowId;
		frm.action_record_description.value = rowDescription;
		frm.action_type.value = 'do_delete';
		frm.submit();
	}

}

// Function to copy a row from a list

function copyRow(rowId, rowDescription){

	ask = confirm('RIJ KOPIEREN ! BENT U ZEKER ?\n\n' + rowDescription + ' kopiëren ?' + '\n\nDruk \"OK\" om de rij te kopiëren of \"Cancel\" om te annuleren.');
	
	if (ask == true){
		frm = document.forms.action_form;
		frm.action_id.value = rowId;
		frm.action_record_description.value = rowDescription;
		frm.action_type.value = 'do_copy';
		frm.submit();
	}

}

// Function to delete a picture from a user

function deletePicture(rowId, rowDescription){

	ask = confirm('FOTO VERWIJDEREN ! BENT U ZEKER ?\n\n' + rowDescription + ' kopiëren ?' + '\n\nDruk \"OK\" om de foto te verwijderen of \"Cancel\" om te annuleren.');
	
	if (ask == true){
		frm = document.forms.action_form;
		frm.action_id.value = rowId;
		frm.action_record_description.value = rowDescription;
		frm.action_type.value = 'do_delete_picture';
		frm.submit();
	}

}

// Function to set the default picture from a user

function setDefaultPicture(rowId, rowDescription){

	ask = confirm('STANDAARDFOTO INSTELLEN ! BENT U ZEKER ?\n\n' + rowDescription + ' als standaard foto instellen ?' + '\n\nDruk \"OK\" om de foto als standaard in te stellen of \"Cancel\" om te annuleren.');
	
	if (ask == true){
		frm = document.forms.action_form;
		frm.action_id.value = rowId;
		frm.action_record_description.value = rowDescription;
		frm.action_type.value = 'do_set_default_picture';
		frm.submit();
	}

}


