jquery ie7 don't read script

jquery ie7 don't read script

Hi Everyone. 

I have some problem with my jquery/javascript code. 
Every browser (except Internet Exploder 7) read and executes the code. 
In IE7 looks like the code is not read - I have a few hidden fields - all are visible.


I try with:  $ ( document ). ready ( function () but nothing change.
  1. var disabledDays = ['15/8/2012', '1/11/2012', '11/11/2012', '25/12/2012', '26/12/2012'];

  2. function nationalDays(date) {
  3.     var m = date.getMonth(),
  4.         d = date.getDate(),
  5.         y = date.getFullYear();
  6.     for (i = 0; i < disabledDays.length; i++) {
  7.         if ($.inArray(d + '/' + (m + 1) + '/' + y, disabledDays) != -1 || new Date() > date) {
  8.             return [false];
  9.         }
  10.     }
  11.     return [true];
  12. }

  13. $(function () {

  14.     $("#date_from, #date_to").datepicker({
  15.         defaultDate: "+1d",
  16.         minDate: "+1d",
  17.         changeMonth: true,
  18.         changeYear: true,
  19.         dateFormat: "dd/mm/yy",
  20.         monthNamesShort: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paz", "Lis", "Gru"],
  21.         dayNamesMin: ["Nie", "Pon", "Wt", "Śr", "Czw", "Pt", "Sob"],
  22.         numberOfMonths: 1,
  23.         constrainInput: true,
  24.         beforeShowDay: nationalDays, 
  25.         firstDay: 1
  26.         onSelect: function (selectedDate) {
  27.             if (this.id == 'date_from') {
  28.                 var dateMin = $('#date_from').datepicker("getDate");
  29.                 var dateMax = $('#date_to').datepicker('getDate');
  30.                 var rent_date_from = new Date(dateMin.getFullYear(), dateMin.getMonth(), dateMin.getDate() + 1);
  31.                 var rent_date_to = new Date(dateMin.getFullYear(), dateMin.getMonth(), dateMin.getDate() + 29);
  32.                 $('#date_to').datepicker("option", "minDate", rent_date_from);
  33.                 $('#date_to').datepicker("option", "maxDate", rent_date_to);
  34.             }
  35.             compute();
  36.         }

  37.     });

  38.     $.viewMap_get = {
  39.         '0': $([]),
  40.         'City1': $('#c1a, #c1b, #c6, #c7'),
  41.         'City2': $('#c2a, #c2b, #c6, #c7'),
  42.         'City3': $('#c3a, #c3b, #c6, #c7'),
  43.         'City4': $('#c4a, #c4b, #c6, #c7'),
  44.         'City5': $('#c5a, #c5b, #c6, #c7'),
  45.     };

  46.     $.each($.viewMap_get, function () {
  47.         this.hide();
  48.     });
  49.     $('#get_city_district').hide();

  50.     $('#get_car').on('change', function () {
  51.         $.each($.viewMap_get, function () {
  52.             this.hide();
  53.         });
  54.         $('#get_city_district').hide();
  55.         $.viewMap_get[$(this).val()].show();
  56.         $('#get_city_district').show();

  57.         var id = $.viewMap_get[$(this).val()].attr("id");
  58.         $('#' + id).attr('selected', 'selected');
  59.     });

  60.     $.viewMap_return = { 
  61.         '0': $([]),
  62.         'City1': $('#d1a, #d1b, #d7'),
  63.         'City2': $('#d2a, #d2b, #d7'),
  64.         'City3': $('#d3a, #d3b, #d7'),
  65.         'City4': $('#d4a, #d4b, #d7'),
  66.         'City5': $('#d5a, #d5b, #d7'),
  67.     };

  68.     $.each($.viewMap_return, function () {
  69.         this.hide();
  70.     });
  71.     $('#return_city_district').hide();

  72.     $('#return_car').on('change', function () {
  73.         $.each($.viewMap_return, function () {
  74.             this.hide();
  75.         });
  76.         $('#return_city_district').hide();
  77.         $.viewMap_return[$(this).val()].show();
  78.         $('#return_city_district').show();
  79.         var id = $.viewMap_return[$(this).val()].attr("id");
  80.         $('#' + id).attr('selected', 'selected');
  81.     });

  82.     function compute() {
  83.         var c = $('select#time_from_hour').val();
  84.         var d = $('select#time_from_minute').val();
  85.         var e = $('select#time_to_hour').val();
  86.         var f = $('select#time_to_minute').val();
  87.         var g = $('input#date_from').val();
  88.         var h = $('input#date_to').val();
  89.         var hour1 = g + ' ' + c + ':' + d; 
  90.         var hour2 = h + ' ' + e + ':' + f; 

  91.         hour1 = hour1.split("/");
  92.         var hour1 = hour1[1] + "," + hour1[0] + "," + hour1[2];
  93.         var timestamp = (new Date(hour1).getTime() / 1000) + 7200;
  94.         $('#total_hour1').val(timestamp);

  95.         hour2 = hour2.split("/");
  96.         var hour2 = hour2[1] + "," + hour2[0] + "," + hour2[2];
  97.         var timestamp = (new Date(hour2).getTime() / 1000) + 7200;
  98.         $('#total_hour2').val(timestamp);

  99.         var x = -$('input#total_hour1').val();
  100.         var y = -$('input#total_hour2').val();
  101.         var total_time = x - y; 
  102.         result = total_time / 86400;
  103.         new_number = Math.ceil(result); 

  104.         if (isNaN(new_number)) { 
  105.             var new_number = 0;
  106.         }
  107.         $('#finish_day').val(new_number);

  108.         if (parseInt($("#finish_day").val()) < 4) { 
  109.             $('#return_car').children('#return_car option[value=' + $('#get_car').val() + ']').attr('selected', 'selected').siblings().attr('disabled', true);
  110.             if ($('#return_car').val()) $('#return_car').change(); 
  111.         } else {
  112.             $('#get_car > option, #return_car > option').prop('disabled', false);
  113.             $('#three_day').hide(2000, function () {
  114.                 $(this).remove();
  115.             });
  116.         }
  117.     }

  118.     $('#time_from_hour').change(function () {
  119.         $('#time_to_hour').val($(this).val());
  120.     });

  121.     $('#time_from_minute').change(function () {
  122.         $('#time_to_minute').val($(this).val());
  123.     });

  124.     $('select#time_from_hour').change(compute);
  125.     $('select#time_from_minute').change(compute);
  126.     $('select#time_to_hour').change(compute);
  127.     $('select#time_to_minute').change(compute);
  128.     // $('select#return_car').change(compute);
  129.     $('select#get_car').change(compute);
  130.     $('input#finish_day').change(compute);

  131.     $("#birthday").datepicker({
  132.         changeMonth: true,
  133.         changeYear: true,
  134.         dateFormat: "dd-mm-yy",
  135.         monthNamesShort: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paz", "Lis", "Gru"],
  136.         dayNamesMin: ["Nie", "Pon", "Wt", "Śr", "Czw", "Pt", "Sob"],
  137.         yearRange: '1920:2000',
  138.         firstDay: 1, // Start with Monday
  139.         numberOfMonths: 1
  140.     });

  141.     // konkiguracja wywietlania błędu

  142.     $(".error").mouseover(function () {
  143.         $(this).hide(2000, function () {
  144.             $(this).remove();
  145.         });
  146.     });
  147. });

The code is called by: 
  1. <script src="http://example.com/js/form.js" type="text/javascript"></script>

Does anyone can tell 
me  where is the problem?