// JavaScript Document
//в данном коде использованы функции технологов студии А.Лебедева, большое им спасибо



function toggle_menu(ID_toggle, who_, path1 ,path2)
{
if (document.getElementById)
 {
  target = document.getElementById( ID_toggle );
     if (target.style.display == "none")
         {
           target.style.display = "";
           who_.src=path1;
                 }
         else
         {
           target.style.display = "none";
           who_.src=path2;
         }
 }

}

function toggle_menu2(ID_toggle, ID_who,path1,path2)
{
if (document.getElementById)
 {
  who_= document.getElementById( ID_who );
  target = document.getElementById( ID_toggle );
     if (target.style.display == "none")
         {
           target.style.display = "";
           who_.src=path1;
                 }
         else
         {
           target.style.display = "none";
                   who_.src=path2;
         }
 }

}

function change_foto_maf(img1,id_1,id_2,id_3)
{
 if (document.getElementById)
 {
  t0= document.getElementById(img1);
  t1= document.getElementById(id_1);
  t2= document.getElementById(id_2);
  t3= document.getElementById(id_3);

  t0.style.display="block";
  t1.style.display="none";
  t2.style.display="none";
  t3.style.display="none";
 }
}

function change_foto_maf2(img1,src1)
{
 if (document.getElementById)
 {
  t0= document.getElementById(img1);
  t0.src=src1;
 }
}
function toggle_all(ID1,ID2, ID3, ID4)
{

  d1= document.getElementById( ID1 );
  d2= document.getElementById( ID2 );
  d3= document.getElementById( ID3 );
  d4= document.getElementById( ID4 );
  d1.style.display='none';
  d2.style.display='none';
  d3.style.display='none';
  d4.style.display='none';

}

function  proverka_tel(input)
{
 var a=new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "-", " ");
 var found = false;
 for (i=0; i < input.length; i++)
 {
         var chr = input.charAt(i);
    found = false;
    for (var j=0; j < (a.length); j++)
    {  if (chr == a[j]) found=true;     }
    if (found==false) break;
  }
  if (found==false)
    alert('Указан неверный номер телефона');
  return found;
}
function to_show(ID_toggle)
{
target = document.getElementById( ID_toggle );
     if (target.style.display == "none")
         {
           target.style.display = "";
                 }
         else
         {
           target.style.display = "none";
         }
}