jQuery(window).load(function(){
    jQuery("#slider").nivoSlider({
        effect:"random",
        slices:15,
        boxCols:8,
        boxRows:4,
        animSpeed:500,
        pauseTime:5000,
        startSlide:0,
        directionNav:true,
        directionNavHide:true,
        controlNav:true,
        controlNavThumbs:false,
        controlNavThumbsFromRel:true,
        keyboardNav:true,
        pauseOnHover:true,
        manualAdvance:false
    });
});
$(document).ready(function(){

/*---------------Главное меню----------------------*/
 $('.main_menu ul.lvl1 li').hoverIntent(
					 function(){$(this).find('.lvl2').slideDown('slow');},
					 function(){$(this).find('.lvl2').slideUp('slow');}
				);//end hover
 
 var url=location.toString();
 $('.main_menu ul.lvl1 li').each(function(){
                                             var href=$(this).find('a').attr('href');
                                             if(url.indexOf(href) !=-1){
                                                                         $('.main_menu .current').removeClass('current');
                                                                         $(this).addClass('current');
                                                                       }
                                            });

/*-------------------скрыть/показать резюме-----------------------*/
$('#rezume').hide();
$('.rez').toggle(function() {$("#info").hide();$("#rezume").show();$(this).html('Назад');},
		function() {$("#info").show();$("#rezume").hide();$(this).html('Резюме');});


/*-----------------HРотация картинок на главной----------------*/

$('.promo ul li:first').addClass('active');
$('.promo ul').each(function(){
 $(this).everyTime(5000,function(i){
			var li2, li1 = $(this).children('.active');
                li2 = li1.next('li');
                if (li2.size() == 0) {
                    li2 = $(this).children('li:first');
                }
				li1.animate({'opacity':'0'},1000,"linear",
					function(){
						$(this).css('display','none')
						       .removeClass('active');
						li2.css('display','block').animate({'opacity':'1'},1000,"linear",function(){$(this).addClass('active');});
						});

				});
 });
/*-----------------Проверка формы------------------*/
$('#email').blur(function() {
var email=$('#email').val();
var premail= /[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}/;
if (email.search(premail) = -1)
{
$('#email').next('.prov').fadeIn('normal')
                         .html('<p>Email введён неправельно</p>')
                         .css("color","red");
}
});//end blur
$('#name').blur(function(){
var name=$('#name').val();
if(name==""){
$('#name').next('.prov').fadeIn('normal')
                        .html('<p>Поле не заполненно</p>')
                        .css("color","red");
}

});

$('#lastname').blur(function(){
var name=$('#lastname').val();
 if(name=="")
 {
  $('#lastname').next('.prov').fadeIn('normal')
                              .html('<p>Поле не заполненно</p>')
                              .css("color","red");
 }
});


});//end ready
