`
var container = $("#page1")
container.after(HTMLtoAdd)
$(".popup").hide();
}
function hideElems(...fieldids) {
for (const fieldid of fieldids) {
elem(fieldid).parent().hide()
elem(fieldid).hide()
}
}
function showElems(...fieldids) {
for (const fieldid of fieldids) {
elem(fieldid).parent().show()
elem(fieldid).show()
}
}
function elem(fieldid) {
if (fieldid.includes('modal'))
return ($("[fieldid^='"+fieldid+"']"))
else
return ($("[fieldid='"+fieldid+"']"))
}
});
// Babysitter logics - 11/02/2025
// Define the target value as a variable for easy modification
$(document).ready(function () {
const SHOW_TABLE_FOR_VALUE = 'BabySitter';
// Remove entry function
function removeEntry(index) {
entries.splice(index, 1);
updateEntriesList();
// Update textarea after removing entry
const table = document.querySelector('table');
const rows = table.querySelectorAll('tbody tr');
var paragraph = '\n-----\n';
// Loop through each row and convert it to text
rows.forEach(row => {
const cells = row.querySelectorAll('td');
const year = cells[0].textContent.trim();
const month = cells[1].textContent.trim();
const amount = cells[2].textContent.trim();
paragraph += `${month} ${year}: ${amount} \n`;
});
paragraph +='------'
// Output the paragraph
$('textArea[fieldid=fld_babysitter_sum]').val(paragraph);
// Hide summary row if table is empty
if (entries.length === 0) {
$('.summary-row').hide();
}
}
// Function to toggle form visibility
// Modified toggle form visibility function
function toggleFormVisibility() {
console.log("toggle form visibility oved")
const selectedValue = $('select[fieldid=fld_Subject]').val();
const shouldShow = selectedValue === SHOW_TABLE_FOR_VALUE;
// Elements to toggle
const formElements = [
'.entry-form',
'.entries-list',
'#tableErrorMsg',
'.summary-row' // Add summary row to elements to toggle
];
// Toggle visibility of all elements
formElements.forEach(selector => {
$(selector)[shouldShow ? 'show' : 'hide']();
});
// If hiding the form, clear the entries
if (!shouldShow) {
entries = [];
updateEntriesList();
$('textArea[fieldid=fld_babysitter_sum]').val('');
}
// Return the selected value for potential use
return selectedValue;
}
// Store entries
let entries = [];
$(document).ready(function () {
const button = document.getElementsByClassName('add-btn');
button.onclick = null; // Clears any inline `onclick` event
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = currentDate.getMonth() + 1;
// Create and append the form
const formHtml = `
שנה
חודש
סכום
התחרטת?
`;
$('div[fieldid=Babysitter_records]').parent().after(formHtml);
// Generate year options from 2023 to current year
function generateYearOptions() {
let options = '';
for (let year = 2023; year <= currentYear; year++) {
options += ``;
}
return options;
}
// Generate month options
function generateMonthOptions() {
const months = [
'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני',
'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
];
let options = '';
months.forEach((month, index) => {
options += ``;
});
return options;
}
$('#yearSelect').val(currentYear).trigger('change');
$('#monthSelect').val(currentMonth).trigger('change');
// Update month options based on selected year
$('#yearSelect').change(function () {
const selectedYear = parseInt($(this).val());
const monthSelect = $('#monthSelect');
$('#monthSelect').children().each(function () {
$(this).prop('disabled', false); // Enables each option
});
if (selectedYear === currentYear) {
if (parseInt(monthSelect.val()) > currentMonth) {
monthSelect.val(currentMonth);
}
monthSelect.find('option').each(function () {
const monthVal = parseInt($(this).val());
$(this).prop('disabled', monthVal > currentMonth);
});
} else {
monthSelect.val(1).trigger('change')
monthSelect.find('option').prop('disabled', false);
}
if (selectedYear === 2023) {
monthSelect.find('option').each(function () {
const monthVal = parseInt($(this).val());
$(this).prop('disabled', monthVal != 10 && monthVal != 11 && monthVal != 12)
});
$('#monthSelect').val(10).trigger('change');
};
});
console.log("registering handler for field subject")
// Add change event listener to the select
$('select[fieldid=fld_Subject]').on('change', function () {
console.log("trigger field subject oved")
toggleFormVisibility();
// Execute the original onchange events after our custom logic
const originalOnchange = this[0].getAttribute('onchange');
if (originalOnchange) {
// Execute each function in the original onchange
originalOnchange.split(';').forEach(func => {
if (func.trim()) {
try {
new Function(func)();
} catch (e) {
console.error('Error executing original onchange:', e);
}
}
});
}
});
// Initialize month restrictions and form visibility
$('#yearSelect').trigger('change');
toggleFormVisibility();
});
// Add entry function
// Function to add entry with fixed validation
function addEntry() {
const year = parseInt($('#yearSelect').val());
const month = parseInt($('#monthSelect').val());
const rawValue = $('#numberInput').val().trim();
const number = parseFloat(rawValue);
const errorMsg = $('#errorMsg');
// Clear any existing error message first
errorMsg.hide().text('');
// Validation checks
if (rawValue === '') {
errorMsg.text('יש להכניס מספר').show();
return false;
}
if (isNaN(number) || number < 0) {
errorMsg.text('יש להכניס מספר גדול מ ₪0').show();
return false;
}
// Check for duplicate month and year combination
const isDuplicate = entries.some(entry =>
entry.year === year && entry.month === month
);
if (isDuplicate) {
errorMsg.text('רשומה עבור חודש ושנה זו כבר קיימת').show();
// Hide the error message after 5 seconds
/*setTimeout(() => {
errorMsg.fadeOut(() => errorMsg.text(''));
}, 5000);*/
return false;
}
// Add new entry
entries.push({ year, month, number });
// Sort entries
entries.sort((a, b) => {
if (a.year !== b.year) return a.year - b.year;
return a.month - b.month;
});
updateEntriesList();
$('#numberInput').val('');
return true;
}
// Modified click handler for add button
$(document).on('click', '.add-btn', function (event) {
event.preventDefault();
addEntry();
});
// Modified click handler for add button
$(document).on('click', '.remove-btn', function (event) {
event.preventDefault();
});
// Modified select change event handler
$('select[fieldid=fld_Subject]').on('change', function (event) {
// First run our visibility toggle
toggleFormVisibility();
// Don't try to execute original handlers directly
// Instead, let them run through event bubbling
// Safely check and call required functions
try {
if (typeof toggleField === 'function') {
toggleField(this, window.select_subject);
}
} catch (e) {
console.warn('Error in toggleField:', e);
}
try {
if (typeof setMandatory === 'function' && this.value) {
setMandatory(this, 1);
}
} catch (e) {
console.warn('Error in setMandatory:', e);
}
try {
if (typeof saveChanges === 'function') {
saveChanges(this);
}
} catch (e) {
console.warn('Error in saveChanges:', e);
}
try {
if (typeof AlertMandatoryField === 'function' && this.id) {
AlertMandatoryField(this.id, $(this));
}
} catch (e) {
console.warn('Error in AlertMandatoryField:', e);
}
});
// Update entries list
// Update entries list with summary
function updateEntriesList() {
const months = [
'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני',
'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
];
// Create number formatter
const numberFormatter = new Intl.NumberFormat('he-IL', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
const entriesHtml = entries.map((entry, index) => `
${entry.year}
${months[entry.month - 1]}
₪${numberFormatter.format(entry.number)}
`).join('');
// Calculate total sum
const totalSum = entries.reduce((sum, entry) => sum + entry.number, 0);
$('[fieldid=fld_SchoomMevookash]').val(totalSum)
// Format the sum using the same formatter
const formattedSum = numberFormatter.format(totalSum);
// Create summary row HTML
const summaryHtml = `
סה"כ: ₪${formattedSum}
`;
// Update table and append summary
$('#entriesList').html(entriesHtml);
// Remove existing summary if it exists
$('.summary-row').remove();
// Add new summary after the table
$('.entries-list').after(summaryHtml);
}
// Update textarea when adding entry
$(document).on('click', '.add-btn', function () {
const table = document.querySelector('table'); // Select the table
const rows = table.querySelectorAll('tbody tr'); // Get all rows in tbody
var paragraph = '\n-----\n';
// Loop through each row and convert it to text
rows.forEach(row => {
const cells = row.querySelectorAll('td'); // Get cells in the row
const year = cells[0].textContent.trim();
const month = cells[1].textContent.trim();
const amount = cells[2].textContent.trim();
paragraph += `${month} ${year}: ${amount} \n`;
});
paragraph += '------'
// Output the paragraph
$('textArea[fieldid=fld_babysitter_sum]').val(paragraph);
});
// Remove entry from the table
$(document).on('click', '.remove-btn', function () {
index = $(this).attr('id').split("_")[1]
removeEntry(index)
});
// Create a function to check table entries that returns a promise
function validateTableEntries() {
return new Promise((resolve) => {
// Remove any existing error message first
$('#tableErrorMsg').remove();
// Check if there are any entries
if (entries.length === 0 && $('[fieldid=fld_Subject]').val() == 'BabySitter') {
// Create error message element
const errorHtml = `
יש להזין לפחות רשומה אחת לפני שליחה
`;
// Add error message below the table
$('.entries-list').after(errorHtml);
$('#tableErrorMsg').show();
// Scroll to error message with smooth animation
const errorElement = document.getElementById('tableErrorMsg');
// Hide the error message after 5 seconds
/*setTimeout(() => {
$('#tableErrorMsg').fadeOut(() => {
if (document.getElementById('tableErrorMsg')) {
document.getElementById('tableErrorMsg').textContent = '';
}
});
}, 5000);*/
resolve(false);
} else {
resolve(true);
}
});
}
// Create a wrapper for the original validator that returns a promise
function originalValidatorWrapper(param1, param2) {
return new Promise((resolve) => {
const result = window.validator(param1, param2);
resolve(result);
});
};
// Add change event listener to the select
$('select[fieldid=fld_Subject]').on('change', function (event) {
// First run our visibility toggle
toggleFormVisibility();
// Let the original onchange events proceed naturally
// Instead of trying to execute them manually
event.stopPropagation(); // Prevent double execution
// If you still need to ensure specific functions run, check if they exist first
if (typeof toggleField === 'function') {
toggleField(this, window.select_subject);
}
if (typeof setMandatory === 'function') {
setMandatory(this, 1);
}
if (typeof saveChanges === 'function') {
saveChanges(this);
}
if (typeof AlertMandatoryField === 'function') {
AlertMandatoryField(this.id, $(this));
}
});
// Push total Babysitter amount to the Total Required Field, and lock the field.
window.selectedSubject = "";
$(document).on('change', function () {
var selectedSubject = $(`select[fieldid=fld_Subject]`).val()
var fldSum = $(`input[fieldid=fld_SchoomMevookash]`)
if ((selectedSubject === "BabySitter" && (window.selectedSubject != "BabySitter"))) {
$('#paymentErrorMsg').show()
$('[fieldid=Babysitter_afternoon]').parent().show()
fldSum.attr('disabled', true);
fldSum.val('');
window.selectedSubject = "BabySitter";
$('#finishForm').attr('onclick','fixTextAreas()');
}
else if ((selectedSubject != "BabySitter") && (window.selectedSubject == "BabySitter")) {
$('#paymentErrorMsg').hide()
fldSum.attr('disabled', false)
$('[fieldid=Babysitter_afternoon]').parent().hide()
fldSum.val('');
window.selectedSubject = selectedSubject;
$('#finishForm').attr('onclick',`fixTextAreas();validator('1','')`);
}
});
$(document).on('click', '.add-btn', function () {
var BabysitterSum = parseFloat($('.summary-row > strong').text().split(" ")[1].split('₪')[1].replace(/,/g, ""))
var fldSum = $(`input[fieldid=fld_SchoomMevookash]`)
if (BabysitterSum > 0) {
fldSum.val(BabysitterSum)
}
else {
fldSum.val('')
}
})
// Wrapper Bugfixes - 16/02/2025
function pushBabySitterCheckboxes() {
var htmltopush = `
`;
var titleParent = $('div[fieldid=Payment_method]').parent();
$(titleParent).after(htmltopush);
$('.wrapper').hide()
}
function validatePaymentMethod() {
return new Promise((resolve) => {
// Remove any existing error message first
$('#paymentErrorMsg').remove();
var SelectedSubject = $('[fieldid=fld_Subject]').val() == "BabySitter"
// Check if at least one checkbox is selected
const isChecked = $('#option-1').is(':checked') || $('#option-2').is(':checked');
if (SelectedSubject && !isChecked) {
// Create error message element
const errorHtml = `
אנא בחר שיטת תשלום לפני ההגשה
`;
// Add error message below the wrapper
$('.wrapper').after(errorHtml);
$('#paymentErrorMsg').show();
// Scroll to error message with smooth animation
const errorElement = document.getElementById('paymentErrorMsg');
// Hide the error message after 5 seconds
/*setTimeout(() => {
$('#paymentErrorMsg').fadeOut(() => {
if (document.getElementById('paymentErrorMsg')) {
document.getElementById('paymentErrorMsg').textContent = '';
}
});
}, 5000);*/
resolve(false);
} else {
resolve(true);
}
});
};
function validatePaymentSum() {
if ($('#paymentErrorMsgMaanakHalad').length >= 1) {
$('#paymentErrorMsgMaanakHalad').remove()
} else if ($('#paymentErrorMsgMaanakHadap').length >= 1) {
$('#paymentErrorMsgMaanakHadap').remove()
}
return new Promise((resolve) => {
// Remove any existing error message first
$('#paymentErrorMsg').remove();
var SelectedSubject = $('[fieldid=fld_Subject]').val()
const SumInputs = +$('[fieldid=fld_SchoomMevookash]').val()
if (SelectedSubject === "MaanakHalad" && SumInputs > 10700) {
// Create error message element
const errorHtml = `
יש להזין סכום עד לגובה ₪10,700
`;
// Add error message below the wrapper
$('[fieldid=fld_SchoomMevookash]').after(errorHtml);
$('#paymentErrorMsg').show();
// Scroll to error message with smooth animation
const errorElement = document.getElementById('paymentErrorMsg');
resolve(false);
} else if (SelectedSubject === "MaanakHadap" && SumInputs > 4500) {
// Create error message element
const errorHtml = `
יש להזין סכום עד לגובה ₪4,500
`;
// Add error message below the wrapper
$('[fieldid=fld_SchoomMevookash]').after(errorHtml);
$('#paymentErrorMsg').show();
// Scroll to error message with smooth animation
const errorElement = document.getElementById('paymentErrorMsg');
resolve(false);
} else {
resolve(true);
}
});
};
function PaymentMethodLogics() {
// Attach the change event to the checkboxes
$('input[type="checkbox"]').on('change', function () {
var Paybox = $('#option-1').prop('checked');
var Physical = $('#option-2').prop('checked');
// Get the parent elements for Paybox and Physical multi-upload
var PayboxMultUpload = $('input[fieldid=fld_uploadFiles2]').parent().parent().parent().parent();
var PhysicalMultUpload = $('input[fieldid=fld_uploadFiles3]').parent().parent().parent().parent();
$(PayboxMultUpload).hide()
$(PhysicalMultUpload).hide()
// Show/hide based on the checkbox state
if (Physical) {
$(PhysicalMultUpload).show();
} else {
$(PhysicalMultUpload).hide();
}
if (Paybox) {
$(PayboxMultUpload).show();
} else {
$(PayboxMultUpload).hide();
}
});
}
$(document).ready(function () {
$('input[fieldid=fld_uploadFiles2]').parent().parent().parent().parent().hide()
$('input[fieldid=fld_uploadFiles3]').parent().parent().parent().parent().hide()
pushBabySitterCheckboxes(); // Create the checkboxes
PaymentMethodLogics(); // Bind event handlers to the checkboxes
$("select[fieldid=fld_Subject]").on('change', function () {
$('[fieldid=fld_SchoomMevookash]').val('')
$('[fieldid=fld_SchoomMevookash]').prop("disabled", false)
if ($("select[fieldid=fld_Subject]").val() === "BabySitter") {
$('[fieldid=fld_SchoomMevookash]').prop("disabled", true)
$('.wrapper').show()
} else {
$('.wrapper').hide();
$('input[fieldid=fld_uploadFiles2]').parent().parent().parent().parent().hide()
$('input[fieldid=fld_uploadFiles3]').parent().parent().parent().parent().hide()
}
const SumInputs = +$('[fieldid=fld_SchoomMevookash]').val()
if ($("select[fieldid=fld_Subject]").val() === "MaanakHalad") {
$('[fieldid=fld_SchoomMevookash]').val(10700)
$('[fieldid=fld_SchoomMevookash]').prop("disabled", true)
}
else if ($("select[fieldid=fld_Subject]").val() === "MaanakNoBenZoog") {
$('[fieldid=fld_SchoomMevookash]').val(3000)
$('[fieldid=fld_SchoomMevookash]').prop("disabled", true)
}
else if ($("select[fieldid=fld_Subject]").val() === "MaanakHadap") {
$('[fieldid=fld_SchoomMevookash]').val(4500)
$('[fieldid=fld_SchoomMevookash]').prop("disabled", true)
}
})
});
// Check Upload for Payment Method Documents
function createErrorPlaceHolders() {
var physicalmessageExists = $('#paymentErrorMsg2').length == 0;
const physicalerrorHtml = `
`;
// Add error message below the wrapper
if (physicalmessageExists) {
$(`[fieldid=uploadFiles3]`).after(physicalerrorHtml);
}
var bitmessageExists = $('#paymentErrorMsg1').length == 0;
const biterrorHtml = `
`;
// Add error message below the wrapper
if (bitmessageExists) {
$(`[fieldid=uploadFiles2]`).after(biterrorHtml);
}
}
createErrorPlaceHolders();
function validateBitDocumentsMethod() {
return new Promise((resolve) => {
// Remove any existing error message first
$('#paymentErrorMsg1').text('');
// Check what option should be shown (bit/physical)
var SelectedSubject = $('[fieldid=fld_Subject]').val() == "BabySitter"
var BitPayment = $('#option-1').is(':checked')
var PhysicalPayment = $('#option-2').is(':checked');
var mult_upload_bit = $(`[fieldid=uploadFiles2] .mu_attachedfile`).length
var mult_upload_physical = $(`[fieldid=uploadFiles3] .mu_attachedfile`).length
if (SelectedSubject && BitPayment && mult_upload_bit == 0) {
$('#paymentErrorMsg1').text('יש לצרף אסמכתא בגין ביצוע תשלום באמצעות העברה בנקאית או אפליקציית תשלום')
$('#paymentErrorMsg1').show();
// Scroll to error message with smooth animation
const errorElement = document.getElementById('paymentErrorMsg1');
/* Hide the error message after 5 seconds
setTimeout(() => {
$('#paymentErrorMsg1').fadeOut(() => {
if (document.getElementById('paymentErrorMsg1')) {
document.getElementById('paymentErrorMsg1').textContent = '';
}
});
}, 5000);*/
resolve(false);
}
else {
resolve(true);
}
});
}
function validatePhysicalDocumentsMethod() {
return new Promise((resolve) => {
// Remove any existing error message first
$('#paymentErrorMsg2').text('')
// Check what option should be shown (bit/physical)
var SelectedSubject = $('[fieldid=fld_Subject]').val() == "BabySitter"
var BitPayment = $('#option-1').is(':checked')
var PhysicalPayment = $('#option-2').is(':checked');
var mult_upload_bit = $(`[fieldid=uploadFiles2] .mu_attachedfile`).length
var mult_upload_physical = $(`[fieldid=uploadFiles3] .mu_attachedfile`).length
if (SelectedSubject && PhysicalPayment && mult_upload_physical == 0) {
// Create error message element
$('#paymentErrorMsg2').text('יש לצרף אסמכתא לתשלום במזומן')
// Scroll to error message with smooth animation
const errorElement = document.getElementById('paymentErrorMsg2');
// Hide the error message after 5 seconds
/*setTimeout(() => {
$('#paymentErrorMsg2').fadeOut(() => {
if (document.getElementById('paymentErrorMsg2')) {
document.getElementById('paymentErrorMsg2').textContent = '';
}
});
}, 5000);*/
resolve(false);
}
else {
resolve(true);
}
});
}
// bug fix Atzmaim - 16/02/2025
window.field_id_list_SingleParent = ['KnownAsSadir', 'GotInjured', 'SubmitNotice', 'UserAgreement', 'FilesAreChecked', 'EverythingIsCorrect', 'Signature']
window.field_id_list_DoubleParent = ['fld_reservistEmail']
$('[fieldid="fld_Subject"]').on('change', function () {
if ($('[fieldid="fld_Subject"]').val() == 'keren13') {
for (var i = 0; i < window.field_id_list_SingleParent.length; i++) {
$(`[fieldid=${window.field_id_list_SingleParent[i]}]`).parent().hide()
}
for (var i = 0; i < field_id_list_DoubleParent.length; i++) {
$(`[fieldid=${window.field_id_list_DoubleParent[i]}]`).parent().parent().hide()
}
}
else {
for (var i = 0; i < window.field_id_list_SingleParent.length; i++) {
$(`[fieldid=${window.field_id_list_SingleParent[i]}]`).parent().show()
}
for (var i = 0; i < field_id_list_DoubleParent.length; i++) {
$(`[fieldid=${window.field_id_list_DoubleParent[i]}]`).parent().parent().show()
}
}
})
/*// Bug fix - remove the original on click event as validator on the finishform button
function removeOnClick() {
$('#finishForm').attr('onclick','fixTextAreas()')
}
removeOnClick();*/
// Bug fix - scroll up when error message occures
const originalAnimate = $.fn.animate;
$.fn.animate = function (properties) {
this.stop(true, false)
if (properties && 'scrollTop' in properties) {
// Find the first Error message that has content
const firstError = $('.validError').filter(function () {
return $(this).text().trim().length > 0;
}).first();
// If we found an error with content
if (firstError.length > 0) {
const errorPosition = firstError.offset().top;
const scrollPosition = errorPosition - 300;
properties.scrollTop = scrollPosition;
}
}
return originalAnimate.apply(this, arguments);
};
// Bug fix - correct checkbox positioning in the code
var problematic_checkboxes = ['UserAgreement', 'FilesAreChecked', 'EverythingIsCorrect','Babysitter_afternoon']
for (var i = 0; i < problematic_checkboxes.length; i++) {
$(`[fieldid=${problematic_checkboxes[i]}]`).css({ 'display': 'flex', 'gap': '5px', 'align-items': 'center' });
$(`[fieldid=${problematic_checkboxes[i]}]`).after($(`[fieldid=${problematic_checkboxes[i]}] > .validError`))
var parent = $(`[fieldid=${problematic_checkboxes[i]}]`).parent();
var corrected_valid_error = $(parent).children().filter('.validError');
$(parent).css({ 'display': 'flex', 'flex-direction': 'column', 'align-items': 'flex-start' });
$(corrected_valid_error).css({ 'margin-right': '21px', 'margin-bottom': '20px' });
if (problematic_checkboxes[i] == "Babysitter_afternoon"){
$(parent).hide()
}
};
// Reset onClick Event for custom logics:
$('#finishForm').attr('onclick','fixTextAreas()')
$(document).on('click', '.sendBTN', async function (event) {
event.preventDefault();
try {
// Run all validations in parallel
const [tableValid, paymentValid, bitValid, physicalValid] = await Promise.all([
validateTableEntries(),
validatePaymentMethod(),
validatePaymentSum(),
validateBitDocumentsMethod(),
validatePhysicalDocumentsMethod()
]);
// If all validations pass, call validator ONCE
if (tableValid && paymentValid && bitValid && physicalValid) {
if (typeof fixTextAreas === 'function') {
fixTextAreas();
validator('1', '');
}
// Execute any additional onclick logic if needed
const originalOnclick = this.getAttribute('onclick');
if (originalOnclick) {
new Function(originalOnclick.replace(/validator\('1',''\)/g, 'true'))();
}
}
else{
$('html, body').animate({
scrollTop: $('.validError').filter(function() {
return $(this).text().trim().length > 0;
}).first().offset().top
}, 1000);
fixTextAreas();
}
} catch (error) {
console.error('Validation error:', error);
}
});
/* Favicon for Light/Dark Mode*/
/* Initialization */
var userMode = window.matchMedia('(prefers-color-scheme: dark)')
if (userMode.matches){
$('link[rel="shortcut icon"]').attr('href','https://mushlam-frontend.wiz.digital.idf.il/getFile.aspx?profile=10054&fname=mil360Dark.png')
}
else{
$('link[rel="shortcut icon"]').attr('href','https://mushlam-frontend.wiz.digital.idf.il/getFile.aspx?profile=10054&fname=mil360Light.png')
}
/* The user changes between modes */
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change',event => {
/* User is on Dark Mode */
if (event.matches){
$('link[rel="shortcut icon"]').attr('href','https://mushlam-frontend.wiz.digital.idf.il/getFile.aspx?profile=10054&fname=mil360Dark.png')
}
/* User Is On Light Mode */
else {
$('link[rel="shortcut icon"]').attr('href','https://mushlam-frontend.wiz.digital.idf.il/getFile.aspx?profile=10054&fname=mil360Light.png')
}
})
/* Appeal Subject Handling - Written By Tomer 11/03/2025 */
/* Remove the option to appeal on appeal*/
$(`[fieldid="fld_AppealSubject"]`).children().filter('[value="kerenTemp"]').remove();
$(document).on('change',function(){
var current_selection_val = $(`[fieldid="fld_AppealSubject"]`).val()
var current_selection_text = $(`[fieldid="fld_AppealSubject"] option[value="${current_selection_val}"]`).text()
$(`[fieldid="fld_AppealSubjectText"]`).val(`${current_selection_text}`)
});
});