  dd=document;
  app=navigator.userAgent;
  var IE=(app.indexOf('Explorer')>0)?1:0;
  var OP=(!IE);
    
  var toid;

  function get_el(id) { return dd.getElementById(id); }
  function get_el_s(id) { return dd.getElementById(id).style; }
  function show(id) { get_el_s(id).display="block"; }
  function hide(id) 
   { 
    get_el_s(id).display='none'; 
   }
  function show_hide(id)
   {
    obs=get_el_s(id) ;
    obs.display=(obs.display!='none')?'none':'block';
   }

  function handcur(obj) { obj.style.cursor="hand"; }
  function settxtcolor(obj, col) { obj.style.color=col; }
  function submit_price_form() 
   { 
    obj=get_el('price_form'); 
    obj.submit(); 
   }
 
  function ref_cart()
   {
    if(get_el_s('cart_table').display!='block') 
      {get_el('cart_frame').src="cartdiv.php";}
    else {get_el('g_count').innerText='0';get_el('g_price').innerText='0';};
   }
  function set_cart_val(c, p)
   {
    get_el('g_count').innerHTML='<u>'+c+'</u>';
    get_el('g_price').innerHTML='<u>'+p+'</u>';
   }

  function submit_cart_form(act) 
   { 
    obj=get_el('cart_form');
    obj.target="";
    if (act=='calc'){obj.action="price.php";obj.act.value='';}
    if (act=='clear'){obj.action="price.php"; obj.act.value='delall';}
    if (act=='zak'){obj.action="create_request.php"; obj.target="_blank";}
    obj.submit(); 
   }

  function framepos() 
   {
    id='price_content';
    obs=dd.getElementById(id).style
    obs.height=document.body.clientHeight-158;
   } 

  function price_getcontent()
   {
    id='price_content';
    get_el_s(id).height=15;
   }

  function pmenu_show(x, y)
   {
    show('price_menu');
    get_el_s('price_menu').top=y-15;
    get_el_s('price_menu').left=x+20;
    clearTimeout(toid);
   }

  function pmenu_to() { toid = setTimeout("pmenu_hide()",2000); }

  function pmenu_hide()
   {
    hide('price_menu');
    clearTimeout(toid);
   }
  function testform()
   {
    err=0;
    err1.innerHTML="";
    if (anketa.fio.value=="") err=1;
    if (anketa.town.value=="") err=1;
    if (anketa.tel.value=="") err=1;
    if (anketa.email.value=="") err=1;
    if (anketa.login.value=="") err=1;
    if (anketa.passwd.value=="") err=1;
    if (anketa.pass2.value=="") err=1;
    if (err==1){err1.innerHTML='Все поля обязательны для заполнения!';}
    if ((anketa.pass2.value!=anketa.passwd.value)&&(err==0)){err1.innerHTML='Пароль не совпадает с подтверждением!';err=1;}

    m=anketa.email.value;
    re =/^[\w-](\.?[\w-])*@([A-Za-z]{2,}|[\w-](\.?[\w-])*\.[A-Za-z]{2,})$/i;
    if ((!re.test(m))&&(err==0)){err1.innerHTML='Не верный формат e-mail!';err=1;};
    if (err==0) return true; else return false;
  }
  function go_to(url){document.location.href=url;}

