function formcheck(){
  var email_format=/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z0-9\._-]+$/;
  var tel_format=/^\+[0-9 ][0-9 ][0-9 ][0-9 ]{7,}$/;
  var num_format=/^[0-9]*$/;
  var text_format=/^.+$/;
  var err=0;
  for(i=0;i<form_check_objs.length;i++){
   xobj=form_check_objs[i];
   m=document.getElementById(xobj);
   if(!m){alert(xobj);}
   val=m.value;
   ok=1;
   if(val==''){ok=0;}
   if(ok==1){
    if(val.length<form_check_minsize[i]){ok=0;}
    if(val.length>form_check_maxsize[i]){ok=0;}
   }
   if(ok==1){
    if(form_check_objfmts[i]=="text"){if(text_format.test(val)==false){ok=0;}}
    if(form_check_objfmts[i]=="email"){if(email_format.test(val)==false){ok=0;}}
    if(form_check_objfmts[i]=="tel"){if(tel_format.test(val)==false){ok=0;}}
    if(form_check_objfmts[i]=="num"){if(num_format.test(val)==false){ok=0;}}
   }
   if(ok==0){
    document.getElementById(xobj+'label').setAttribute('className','tbold');
    document.getElementById(xobj+'label').setAttribute('class','tbold');
    err++;
   }else{
    document.getElementById(xobj+'label').setAttribute('className','tnormal');
    document.getElementById(xobj+'label').setAttribute('class','tnormal');
   }
  }
  m=document.getElementById(form_check_divname);
  if(err>0){
   m.style.display='block';
   return false;
  }else{
   m.style.display='none';
  }
  document.getElementById(form_check_forname).submit();
  return true;
 }
 function changecounter(xcnt,xvar,xmax){
  document.getElementById(xcnt).innerHTML='/ '+(xmax-document.getElementById(xvar).value.length);
 }

