function redir(lnk) {
 window.location = lnk;
}

function pickquote(val) {

  if(val == '1') {
    redir('/get--a--quote--business--insurance');
  } else if(val == '2') {
    redir('/get--a--quote--truck--insurance');
  }

}

function formsubmit_bi() {

 frm = document.getElementById('biform'); 
 t_business_name = document.getElementById('t_business_name');
 t_phone = document.getElementById('t_phone'); 
 t_email = document.getElementById('t_email'); 

 if(!t_business_name.value.length) {
  alert('Please fill out the business name field.');
  return;
 }

 if(!t_phone.value.length) {
  alert('Please fill out your phone field.');
  return;
 }
 
 if(!t_email.value.length) {
  alert('Please fill out your email field.');
  return;
 }

 frm.action = '/get--a--quote--business--insurance--submit';
 frm.submit();
 

}

function formsubmit_ti() {

 frm = document.getElementById('tiform'); 
 t_insured_name = document.getElementById('t_insured_name');
 t_phone = document.getElementById('t_phone'); 
 t_email = document.getElementById('t_email'); 

 if(!t_insured_name.value.length) {
  alert('Please fill out the insured name field.');
  return;
 }

 if(!t_phone.value.length) {
  alert('Please fill out your phone field.');
  return;
 }
 
 if(!t_email.value.length) {
  alert('Please fill out your email field.');
  return;
 }

 frm.action = '/get--a--quote--truck--insurance--submit';
 frm.submit();
 

}

function formsubmit_contactus() {

 frm = document.getElementById('cform'); 
 t_name = document.getElementById('t_name');
 t_phone = document.getElementById('t_phone'); 
 t_email = document.getElementById('t_email'); 

 if(!t_name.value.length) {
  alert('Please fill out your name field.');
  return;
 }

 if(!t_phone.value.length) {
  alert('Please fill out your phone field.');
  return;
 }
 
 if(!t_email.value.length) {
  alert('Please fill out your email field.');
  return;
 }

 frm.action = '/contact--us--submit';
 frm.submit();
 

}
