// JavaScript Document
function ShowPopup1(text){ 
var id = "#show_form1";
var maskHeight = $(document).height(); 
var maskWidth = $(window).width();
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect 
$('#mask').fadeIn(1000); 
$('#mask').fadeTo("slow",0.8);
//Get the window height and width 
var winH = $(window).height(); 
var winW = $(window).width();
//Set the popup window to center 
$(id).css('top', winH/2-$(id).height()/2); 
$(id).css('left', winW/2-$(id).width()/2);
//transition effect 
$(id).fadeIn(2000);
$('#form1title').text(text);
return false;
};
function ShowPopup2(text){ 
var id = "#show_form2";
var maskHeight = $(document).height(); 
var maskWidth = $(window).width();
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect 
$('#mask').fadeIn(1000); 
$('#mask').fadeTo("slow",0.8);
//Get the window height and width 
var winH = $(window).height(); 
var winW = $(window).width();
//Set the popup window to center 
$(id).css('top', winH/2-$(id).height()/2); 
$(id).css('left', winW/2-$(id).width()/2);
//transition effect 
$(id).fadeIn(2000);
//$('#form1title').text(text);
return false;
};
function ShowPopup3(text){ 
var id = "#show_form3";
var maskHeight = $(document).height(); 
var maskWidth = $(window).width();
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect 
$('#mask').fadeIn(1000); 
$('#mask').fadeTo("slow",0.8);
//Get the window height and width 
var winH = $(window).height(); 
var winW = $(window).width();
//Set the popup window to center 
$(id).css('top', winH/2-$(id).height()/2); 
$(id).css('left', winW/2-$(id).width()/2);
//transition effect 
$(id).fadeIn(2000);
//$('#form1title').text(text);
return false;
};
function ShowPopup4(text){ 
var id = "#show_form4";
var maskHeight = $(document).height(); 
var maskWidth = $(window).width();
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect 
$('#mask').fadeIn(1000); 
$('#mask').fadeTo("slow",0.8);
//Get the window height and width 
var winH = $(window).height(); 
var winW = $(window).width();
//Set the popup window to center 
$(id).css('top', winH/2-$(id).height()/2); 
$(id).css('left', winW/2-$(id).width()/2);
//transition effect 
$(id).fadeIn(2000);
//$('#form1title').text(text);
return false;
};
function Send1(){ 
		$('#mask').hide();
		$('#show_form1').hide();
        name1=$(".name1").val();
        phone1=$(".phone1").val();
        comm1=$(".comment1").val();
		zakaz = $('#form1title').text(); 
		if (name1=="")
		{
			alert("Введите имя!");
			return false;
		}
		if (phone1=="")
		{
			alert("Введите телефон!");
			return false;
		}
		text = "mess=Клиент "+name1+" хочет "+zakaz+", свяжитесь с ним по телефону:"+phone1;
		if (comm1!="")
		{
			text+=" Коментарии к заказу:"+comm1;
		}
		$.ajax({
		type: "POST",
          url: "/send.php",
          data: text,
          success: function(html){
            alert(html);
           }
        });
};
function Send2(){ 
		$('#mask').hide();
		$('#show_form2').hide();
        name2=$(".name2").val();
        phone2=$(".phone2").val();
        cod2=$(".cod2").val();
		prod2 =$(".product2").val();
		if (name2=="")
		{
			alert("Введите имя!");
			return false;
		}
		if (phone2=="")
		{
			alert("Введите телефон или емеил!");
			return false;
		}
		if (prod2=="")
		{
			alert("Введите продукцию!");
			return false;
		}
		if (cod2=="")
		{
			alert("Введите код ТН-ВЭ или ОКП!");
			return false;
		}
		text2 = "mess=Клиент "+name2+" хочет оформить заявку продукции "+prod2+". Код ТН-ВЭ или ОКП:"+cod2+". Свяжитесь с ним по Тел./e-mail:"+phone2;
		$.ajax({
		type: "POST",
          url: "/send.php",
          data: text2,
          success: function(html){
            alert(html);
           }
        });
};
function Send3(){ 
		$('#mask').hide();
		$('#show_form3').hide();
		
        name3=$(".name3").val();
        phone3=$(".phone3").val();
        price3=$(".price3").val();
		doc3 =$(".doc3").val();
		if (name3=="")
		{
			alert("Введите имя!");
			return false;
		}
		if (phone3=="")
		{
			alert("Введите телефон или емеил!");
			return false;
		}
		if (price3=="")
		{
			alert("Введите цену!");
			return false;
		}
		if (doc3=="")
		{
			alert("Введите надвание документа");
			return false;
		}
		text3 = "mess=Клиент "+name3+" хочет сказать свою цену документа "+doc3+", цена:"+price3+". Свяжитесь с ним по Тел./e-mail:"+phone3;
		$.ajax({
		type: "POST",
          url: "/send.php",
          data: text3,
          success: function(html){
            alert(html);
           }
        });
}
function Send4(){ 
		
		name4=$(".name4").val();
        phone4=$(".phone4").val();
      
		if (name4=="")
		{
			alert("Введите имя!");
			return false;
		}
		if (phone4=="")
		{
			alert("Введите телефон!");
			return false;
		}
		
		text4 = "mess=Клиент "+name4+" хочет Заказать обратный звонок. Свяжитесь с ним по Тел:"+phone4;
		        
		$.ajax({
		type: "POST",
          url: "/send.php",
          data: text4,
          success: function(html){
            alert(html);
           }
        });
};
function Send5(){ 
		
		name5=$(".name5").val();
        phone5=$(".phone5").val();
		doc5=$(".doc5").val();
        org5=$(".org5").val();
		nom5=$(".nom5").val();

		if (name5=="")
		{
			alert("Введите имя!");
			return false;
		}
		if (phone5=="")
		{
			alert("Введите телефон!");
			return false;
		}
		if (doc5=="")
		{
			alert("Введите название документа!");
			return false;
		}
		if (org5=="")
		{
			alert("Введите орган выдавший документ!");
			return false;
		}
		if (nom5=="")
		{
			alert("Введите номер документа!");
			return false;
		}
		text5 = "mess=Клиент "+name5+" хочет Проверить подленость документа"+doc5+". №"+nom5+". Орган выдавший докумен:"+org5+" Свяжитесь с ним по Тел:"+phone5;
		        
		$.ajax({
		type: "POST",
          url: "/send.php",
          data: text5,
          success: function(html){
            alert(html);
           }
        });
}



 $(document).ready(function() {
	var Wdh = $(window).width()/2+500;
	var Hdh = $(window).height()/2+80;
	var chack = $(window).width() - Wdh-160;
	if(chack<0)
	{
		Wdh+=chack;
	}
	$('#baner_cena').css('left',Wdh);
	$('#baner_comment').css('top',Hdh);
	
  $('#mask, #closebtn').click(function() {
  $('#mask').hide();
$('#show_form1').hide();
$('#show_form2').hide();
$('#show_form3').hide();
$('#show_form4').hide();
});
$(window).bind("resize", function(){
    var Hdh = $(window).height()/2+80;
	$('#baner_comment').css('top',Hdh);
});
$('#slogan').hover(function(){

                $('.realprice').show();
    },function(){
                $('.realprice').hide();
    });
$('.logo').hover(function(){

                $('.logo_online').show();
    },function(){
                $('.logo_online').hide();
    });

 });
