function inputSubst(formId){
    var idArr=[];
    form=(formId)?$('#'+formId):null;
    $.each($("input[subst]",form), function(){
      var subst=$(this).attr("subst");
      subst=subst.split(':');
      var out='';
      switch(subst[0]){
        case 'nst':
          out+='<select name="'+this.name+'">';
          for (var i=subst[1]; i<=subst[2]; i++){
            var d=(i==subst[3])?'selected':'';
            out+='<option value="'+i+'" '+d+'>'+i+'</option>'
          }
          if (out!='') $(this).replaceWith($(out+'</select>'));
        break;
        case 'sub':
        $(this).unbind( "click" );
        $(this).bind("click", function(){
            submitForm(form,form.attr('action'));
            return false;
          });
        break;
      }
    });
}
function submitForm(form,path){
//  $.each(form.elements,function(){alert($(this).val());})
  vars={reqType:'ajax'};
  $("*[name]",form).each(function(){
    vars[this.name]=this.value;
  });
  try {eval('var err='+form.attr('verFunc')+'();');} catch(e){}

  if (err) return; 
  $("*[type=submit]",form).each(function(){this.disabled=true;});

  $.post(path,vars,function(data){
//    alert(data.substr(0,2));
    $("*[type=submit]",form).each(function(){this.disabled=false;});
    if (data.substr(0,2)=='a:') alert(data.substr(2));
    if (data.substr(0,2)=='r:') form.replaceWith ($('<div class="respTxt">'+data.substr(2)+'</div>'));
  });
}