//ÀÌ¸áÃ¼Å©

function check_email(input)
{
  if ( input.search(/(\S+)@(\S+)\.(\S+)/) == -1 )
  {
    return false;
  }
return true;
}

function keydown()
{ 
  if (event.keyCode==13) 
  {
    pre_submit();
  }
} 

function change_combobox(C_choice) 
{  
  document.request_form.select.value = C_choice ;
}  


//ÀÔ·Â¹Ú½º Ã¼Å©
function pre_submit(X)
{
  if (!X.select.value)
  {
  	alert("Select a product what you want!");
  	return;
  }

  if (!X.bbs_name.value)
  {
    alert('Type your name!');
    X.bbs_name.focus();
    return;
  }
  else if(X.bbs_name.value.length < 2)
  {
    alert('your name is too short.');
    X.bbs_name.value = "";
    X.bbs_name.focus();
    return;
  }    
  else
  {

  } 
  
  if (!X.bbs_company.value)
  {
    alert('Type your company!');
    X.bbs_company.focus();
    return;
  }
  else if(X.bbs_company.value.length < 2)
  {
    alert('your compnay name is too short.');
    X.bbs_company.value = "";
    X.bbs_company.focus();
    return;
  }    

  if (!X.bbs_tel.value)
  {
    alert('Type your Telephone');
    X.bbs_tel.focus();
    return;
  }
  else if(X.bbs_tel.value.length < 10)
  {
    alert('your telephone is too short. \n\n ex)8-02-123-4567');
    X.bbs_tel.value = "";
    X.bbs_tel.focus();
    return;
  }

  if (!X.bbs_fax.value)
  {
    alert('Type your TAX');
    X.bbs_fax.focus();
    return;
  }
  else if(X.bbs_fax.value.length < 10)
  {
    alert('your FAX is too short. \n\n ex)8-02-123-4567');
    X.bbs_fax.value = "";
    X.bbs_fax.focus();
    return;
  }   
   
  if (!X.bbs_email.value)
  {
    alert('Type your e-mail');
    X.bbs_email.focus();
    return;
  }
  else if (!check_email(X.bbs_email.value))
  {
    alert("You should follow correct e-mail type : ex) activepost@activepost.net");
    X.bbs_email.value = "";
    X.bbs_email.focus();
    return;
  }
  else
  {
   	
  }
 
  if (!X.bbs_licens.value)
  {
  	alert("Type License count");
  	X.bbs_licens.focus();
  	return;
  }  
  
  if (!X.bbs_contents.value)
  {
  	alert("Type Description");
  	X.bbs_contents.focus();
  	return;
  }      

  X.submit();
}