$(document).ready(function(){

	//urls
    var urltxt;
    urltxt = location.href;
    var ar=urltxt.split('/');
    var newurl=ar.slice(3,ar.length).join('/');
	
    $(".nav li a").each(
        function(){
            if($(this).attr("href")=="/"+newurl)
            {
                $(this).parent().replaceWith('<span class="current"><span class="btt">'+ $(this).text() +'</span></span>');
				
				
            }
        }
    );
	
	//animate dot
	$(".production a").bind('mouseover', function(){
		$(this).find(".dot").stop(true,false).animate({'left':'125px','top':'150px'},500,'linear');
	});
	$(".production a").bind('mouseout', function(){
		$(this).find(".dot").animate({'left':'35px','top':'175px'},500,'linear');
	});
	
	
	//lb
$('.galery_img').lightBox(); 

	//close
$(".close").click(function(){$('.formdiv').hide(); $(".blackscreen").remove();});

});

	//form
function zakaz_show(){
$("body").append("<div class='blackscreen' style='height:"+ $(document).height() +"px'></div>");
$(".formdiv").show();
}


	//formsend
function sendMessage(){

name_ = $("#sendform #fio").val();
phone_ = $("#sendform #tel").val();
company_ = $("#sendform #company").val();
mail_ = $("#sendform #mail").val();
message_ = $("#sendform #message").val();

if(!name_ || !phone_ || !mail_ || !company_ || !message_){
$(".system_msg").text('Пожалуйста, заполните все поля');
}
else{
	var msg = $('#sendform').serialize(); 
		$.ajax({
			type:'POST',
			url: "/include/module/msg.php",
			dataType : "text",
			data:msg,
			beforeSend:function(){},
			success: function(data) {
					$(".system_msg").text('Сообщение отправлено');
					$("#sendform dl input, #sendform dl textarea").attr("value","");
				}
		});	
	}

}
