            jQuery(document).ready(function(){

                var j = 0;
                jQuery.each(jQuery.browser, function(i, val) {
                    if(j == 0){j = i};
                });

                /*Выставляем по высоте пункты меню для IE*/
                if(j == 'msie'){
                    jQuery("a.firstlevel").each(function() {
                      var steLength = jQuery(this).html().length;
                      var maxLength = 14; /*Максимальная длина строки в пункте меню, при которой не происходит выравнивание по вертикали*/
                      if(steLength > maxLength){
                        jQuery(this).css("padding-top","4px");
                      }

                    });

                }

            // При загрузки страницы делаем все картинки в левой колонке серыми
                var img_col = jQuery('#flash img.reset');

            //Отсев chrome и safari
                if(j == 'webkit'){
                }
                else if(img_col.length != 0){
                    grayscale.prepare( img_col  );
                    grayscale( img_col  );
                    if(j != 'msie'){
                        img_col.animate({opacity: 0.6}, 20);
                    }
                }

            // При наведении на картинку делаем ее цветной. При убирании мышки - черно-белой (там также убираем слой с фильтром с прозрачностью
                jQuery("#flash img.reset").bind("mouseleave",function(){
                        grayscale.prepare( jQuery(this)  );
                        grayscale( jQuery(this)  );
                        if(j != 'msie'){
                            jQuery(this).animate({opacity: 0.6}, 20);
                        }

                    }
                );
                jQuery("#flash img.reset").bind("mouseenter",function(){
                        grayscale.reset( jQuery(this) );
                        if(j != 'msie'){
                            jQuery(this).animate({opacity: 1}, 20);
                        }
                    }
                );

                /*Выбор содрежимого раздела Перевозка персонала - сотрудничество*/
                var htmlToInsert = jQuery("li.level2 a[href='/perevozka_personala/sotrudnichestvo/']").parent().html();
                /*Вставка этого содержимого в предыдущий раздел для разворачивания в меню*/
                jQuery("li.level2 a[href='/perevozka_personala/transfer_v_aeroport/']").next().children().last().after("<li>" + htmlToInsert + "</li>");


                /*Устанавливаем нормальные ссылки на формы отправки заявок*/
                jQuery("a.level3").attr("href", function(){

                  if( (this.href == 'http://www.vezdevoz.ru/perevozka_personala/sotrudnichestvo/rukovoditelyam_predpriyatij/') || (this.href == 'http://vezdevoz.ru/perevozka_personala/sotrudnichestvo/rukovoditelyam_predpriyatij/')){ return 'http://www.vezdevoz.ru/forms.php?vid=27321';}
                  if( (this.href == 'http://www.vezdevoz.ru/perevozka_personala/sotrudnichestvo/vladelcam_avtotransporta/') || (this.href == 'http://vezdevoz.ru/perevozka_personala/sotrudnichestvo/rukovoditelyam_predpriyatij/')){ return 'http://www.vezdevoz.ru/forms.php?vid=27322';}
                  if( (this.href == 'http://www.vezdevoz.ru/gruzoperevozki/sotrudnichestvo/vladelcam_gruzov/') || (this.href == 'http://vezdevoz.ru/perevozka_personala/sotrudnichestvo/rukovoditelyam_predpriyatij/')){ return 'http://www.vezdevoz.ru/forms.php?vid=27323';}
                  if( (this.href == 'http://www.vezdevoz.ru/gruzoperevozki/sotrudnichestvo/vladelcam_transporta/') || (this.href == 'http://vezdevoz.ru/perevozka_personala/sotrudnichestvo/rukovoditelyam_predpriyatij/')){ return 'http://www.vezdevoz.ru/forms.php?vid=27324';}

                });          
                jQuery("a.firstlevel[href='/sdelat_zakaz/']").attr("href", function(){
                  if( (this.href == 'http://www.vezdevoz.ru/sdelat_zakaz/') || (this.href == 'http://vezdevoz.ru/sdelat_zakaz/')){ return 'http://www.vezdevoz.ru/forms.php';}
                });
            });

            jQuery('.menu ul li a').height()

            //Для обработки ч.б. картинок в Chrome и Safari
            //Обход ошибки с событиями (document).ready и ("").load
            jQuery(window).load(function(){
                var j = 0;

                jQuery.each(jQuery.browser, function(i, val) {
                    if(j == 0){j = i};
                });

                if(j == 'webkit'){
                    img_col = jQuery('#flash img.reset');
                    grayscale( img_col  );
                    img_col.animate({opacity: 0.6}, 20);
                }
            });

