function makeAjaxCall(pType, pUrl, pSuccess, pData, pComplete) { $.ajax({ type: pType, url: pUrl, data: pData, success: pSuccess, error: showAjaxError, complete: pComplete }); } function removeElementFromArray(pArray, pKey) { var newArray = {}; for(var key in pArray) { var keyAsNumber = Number(key); if(keyAsNumber !== pKey) { newArray[keyAsNumber] = pArray[keyAsNumber]; } } return newArray; } function toggleLabel(inputId) { var label = $('label[for="' + inputId + '"]'); var topValue; if($('#' + inputId).is(":focus")) { $(label).animate({ top: "-6px" }, 100); return; } topValue = "12px"; if($('#' + inputId).val()) { topValue = "-6px"; } $(label).animate({ top: topValue }, 75); } function adjustLabel(inputId) { var label = $('label[for="' + inputId + '"]'); var topValue; topValue = "12px"; if($('#' + inputId).val()) { topValue = "-6px"; } $(label).animate({ top: topValue }, 75); } function isInEditingMode() { return $("#isInEditModeIndicator").val() == "true"; } function isElementInArray(array, element) { try { var contains = false; array.forEach(function (e, index) { if (e === element) { contains = true; } }); return contains; } catch (error) { console.log(error.message); return false; } } function isEmptyOrSpaces(str) { return str === null || str === undefined || str.match(/^ *$/) !== null; }