﻿function ChangeValue() {
    $('#MSOZoneCell_WebPartWPQ2').each(function() {
        $(this).find('table').each(function() {
            $(this).find('.ms-cal-nav-buttonsltr').hide();
        });
    });
    $('#MSOZoneCell_WebPartWPQ3').each(function() {
        $(this).find('table').each(function() {
            $(this).find('.ms-cal-nav-buttonsltr').hide();
        });
    });
    $('#MSOZoneCell_WebPartWPQ4').each(function() {
        $(this).find('table').each(function() {
            $(this).find('.ms-cal-nav-buttonsltr').hide();    
        });
    });
    var hdn = document.getElementById('ctl00_bilingual_hdn');
    if (hdn.value == "0") {
        document.getElementById('MSOZoneCell_WebPartWPQ2').style.display = "block";
	    document.getElementById('MSOZoneCell_WebPartWPQ3').style.display = "none";
        document.getElementById('MSOZoneCell_WebPartWPQ4').style.display = "none";
    }
    else if (hdn.value == "1") {
        document.getElementById('MSOZoneCell_WebPartWPQ2').style.display = "none";
        document.getElementById('MSOZoneCell_WebPartWPQ3').style.display = "block";
	    document.getElementById('MSOZoneCell_WebPartWPQ4').style.display = "none";
	    return;
    }
    else {
	    document.getElementById('MSOZoneCell_WebPartWPQ2').style.display = "none";
        document.getElementById('MSOZoneCell_WebPartWPQ3').style.display = "none";
	    document.getElementById('MSOZoneCell_WebPartWPQ4').style.display = "block";
	    return;
    }
    $('.ms-cal-gempty').each(function() {
        var i = 0;
        $(this).find('.ms-cal-weekname').each(function() {
            if (i == 0) {
                var day1 = $.trim($(this).find('.ms-cal-weekday').text().replace('Sunday', 'Minggu'));
                $(this).find('.ms-cal-weekday').text(day1);
            }
            if (i == 1) {
                var day2 = $.trim($(this).find('.ms-cal-weekday').text().replace('Monday', 'Senin'));
                $(this).find('.ms-cal-weekday').text(day2);
            }
            if (i == 2) {
                var day3 = $.trim($(this).find('.ms-cal-weekday').text().replace('Tuesday', 'Selasa'));
                $(this).find('.ms-cal-weekday').text(day3);
            }
            if (i == 3) {
                var day4 = $.trim($(this).find('.ms-cal-weekday').text().replace('Wednesday', 'Rabu'));
                $(this).find('.ms-cal-weekday').text(day4);
            }
            if (i == 4) {
                var day5 = $.trim($(this).find('.ms-cal-weekday').text().replace('Thursday', 'Kamis'));
                $(this).find('.ms-cal-weekday').text(day5);
            }
            if (i == 5) {
                var day6 = $.trim($(this).find('.ms-cal-weekday').text().replace('Friday', 'Jumat'));
                $(this).find('.ms-cal-weekday').text(day6);
            }
            if (i == 6) {
                var day7 = $.trim($(this).find('.ms-cal-weekday').text().replace('Saturday', 'Sabtu'));
                $(this).find('.ms-cal-weekday').text(day7);
            }
            i += 1;
        });
    });
}
