function SubmitControl(tocheack) {
if (document.all || document.getElementById)
{for (i=0; i < tocheack.length;i++)
{if(tocheack.elements[i].type.toLowerCase()=="submit"||tocheack.elements[i].type.toLowerCase()=="reset")
{tocheack.elements[i].disabled = true }}}
}


function validformstore() { var sr, dataright; dataright=true; sr=document.sendstore.contactstore.value;
if (sr.length < 3) { dataright=false; message = 'Как с вами связаться?'; sendstore.contactstore.focus(); }
if (!dataright) { alert(message); } return  dataright; } 



function validform() { var sr, dataright; dataright=true; sr=document.send.contact.value;
if (sr.length < 3) { dataright=false; message = 'Как с вами связаться?'; send.contact.focus(); }
if (!dataright) { alert(message); } return  dataright; } 

function validforms() { var sr, dataright; dataright=true; sr=document.sendpr.sendprice.value;
mail_pr=/([0-9a-zA-Z.-_]+)@([0-9a-zA-Z.-_]+).([a-zA-Z]){2,4}/;
if (sr.match(mail_pr) == null)  { dataright=false; message = 'Не корректный или пустой e-mail адрес'; sendpr.sendprice.focus();  } 
if (!dataright) { alert(message); } return  dataright; } 

function pm(o, a) { 
var x = o.parentNode.firstChild; 
var val = parseInt(x.value); 
if (a) { x.value = !isNaN(++val)? val : 1; } else { x.value = !isNaN(--val)? val : 0; 
if (val <= 0) x.value = 0; } return; }


function outliner(newId) {

var sel_all = false; 
var img_plus = "design/plus.gif"; 
var img_minus = "design/minus.gif";

    child = document.all[newId];
    childImg = newId + 'vis';
    childImgAll = 'iall';
    sel = true;
    if (null == child.length) { 
      if (child.style.display == "none") sel = false;
      child.style.display = sel ? "none" : "";
    }
    else { 
      for (var i = 0; i < child.length; i++) {
        if (child[i].style.display == "none") sel = false;
        child[i].style.display = sel ? "none" : "";
      }
    }
    document.images(childImg).src = sel ? img_plus : img_minus;
//  sel_all = outliner_all_check(); 
    document.images(childImgAll).src = sel_all ? img_minus : img_plus;
    document.images(childImgAll).title = sel_all ? 'Все развернуть' : 'Все свернуть';
    sel_all = sel_all ? sel_all : !sel_all;
}


function otkl(b) {
for (i=2;i<b;i++) { document.getElementById('i'+i).style.display='none'; }}

