    var preloaded_imgs = new Object();

    function calc_total() {
        car = document.getElementById('vehicleList');
        one = document.getElementById('durationTotal');
        two = document.getElementById('durationNight');
        res = document.getElementById('totalSum');

        if (car.value && one.value) {
            if (two.value)
                res.value = Math.round(((eval(one.value) - eval(two.value)) + (eval(two.value) * 1.3)) * eval(arrayPrices[car.value]) + eval(arrayPrices[car.value]));
            else
                res.value = Math.round(eval(one.value) * eval(arrayPrices[car.value]) + eval(arrayPrices[car.value]));
        }
    }


    function showPic(whichpic) {
        if (document.getElementById) {
            document.getElementById('fullsize').src = whichpic.href;
            return false;
        } else {
            return true;
        }
    }



    function update_days() {
        var days_list = document.getElementById('day');
        var months_list = document.getElementById('month');
  
        for (var i = days_list.length; i >= 0 ; i--)
             days_list.options[0] = null;

        if (months_list.selectedIndex != 0)
            for (var i = 1; i <= days[months_list.selectedIndex]; i++) {
               if (i < 10)
                   var day = "0" + i;
               else
                   var day = i;
               days_list.options[days_list.length] = new Option (day, day, false, false);
            }
        else
           for (var i = today; i <= days[months_list.selectedIndex]; i++) {
               if (i < 10)
                   var day = "0" + i;
               else
                   var day = i;
               days_list.options[days_list.length] = new Option (day, day, false, false);
           }
    }



    function set_index(index) {
        if (index < 0)
            return false;

        var element = document.getElementById('day');
        var month = document.getElementById('month');
        if (month.selectedIndex == 0)
            index = index - today;
        element.selectedIndex = index;
    }


    function preload_img () {

        if (document.images && preload_img.arguments.length) {
            for (i = 0; i < preload_img.arguments.length; i++) {
                preloaded_imgs[i] = new Image();
                preloaded_imgs[i].src = preload_img.arguments[i];
            }
        }
    }


    window.onload = function() {
        preload_img('/images/button-cover-on.gif',
                    '/images/button-company-on.gif',
                    '/images/button-services-on.gif',
                    '/images/button-order-on.gif',
                    '/images/button-contacts-on.gif'
                   );

    }
