/**
 *
 *   SAIL CMS FUNCTIES
 *
 */
// Edit menu pagina's/users
function ShowEditMenu(ID) {
	$('form[name="Edits"]').hide()
	$('#'+ID).show()
}

// Weghalen ALLE spaties
function RemoveWhitespace(inp) {
	inp.value = inp.value.replace(/\s+/g,'-');
}

// Test upload
function doUpload() {
	// Checken of wel iets ingevoerd		
	if($('#fileToUpload').val() != '') {
		 $.ajaxFileUpload({
			url:'/ajaxUpload.php', 
			secureuri:false,
			fileElementId:'fileToUpload',
			dataType: 'html',
			success: function (data, status){
				$('.LogoBox').html(data)
			},
			error: function (data, status, e) {alert(e);}
		})
	}
}

// Check start en einde 
function checkStartEind() {
	// Kijken of aangeklikt
	if($("input[name='TerugkerendeActiviteit']").attr("checked")) {
		// Kijken of zelfde maand en jaar
		if( ($("select[name='e_maand']").val() == $("select[name='s_maand']").val()) &&
		    ($("select[name='e_jaar']").val() == $("select[name='s_jaar']").val())) {
		    	alert("Uw activiteit begint en eindigt in dezelfde maand!\nDeze optie aanvinken heeft alleen zin als er tussen de start en eind datum meerdere maanden zitten..")
		    }
		
	}
}

// Function voor toevoegen informatie aan activiteit
function insertInfo(strOrg, strAdres, strPostcode, strPlaats, strNummer, strEmail, strWebsite) {
	// Updaten velden
	$("input[name='aLocatie']").val(strOrg)
	$("input[name='aAdres']").val(strAdres)
	$("input[name='aPostcode']").val(strPostcode)
	$("input[name='aWoonplaats']").val(strPlaats)
	$("input[name='aTelefoonLocatie']").val(strNummer)
	$("input[name='aAanmeldenBij']").val(strEmail)
	$("input[name='aWebsite']").val(strWebsite)
}

// Open file list
function showFileList(intAds) {
	$.openPopupLayer({
		name: "FilesList",
		width: 450,
		target: "FilesLists_"+intAds
	});
}
