function radio_selected(radiobutton) {
 for (i = 0; i < radiobutton.length; i++) {
  if (radiobutton[i].checked) {
   return true;
  }
 }
 return false;
}
function checkbox_selected(checkbox, tr, rl, rh, ve, extrafield) {

 var tc = 0;

 for (i = 0; i < checkbox.length - 1; i++) {
  if (checkbox[i].checked) {
   tc++;
  }
 }
 
 if (checkbox[i].checked) {
  tc++;
  if (ve == 1 && !extrafield.value) {
   return false;
  }
 }

 if (tr == 1 && tc >= rl) {
  return true;
 } else if (tr == 2 && tc <= rh) {
  return true;
 } else if (tr == 3 && tc >= rl && tc <= rh) {
  return true;
 } else {
  return false;
 }

}
function checkbox_selected(checkbox, tr, rl, rh, ve, extrafield) {

 var tc = 0;

 for (i = 0; i < checkbox.length - 1; i++) {
  if (checkbox[i].checked) {
   tc++;
  }
 }
 
 if (checkbox[i].checked) {
  tc++;
  if (ve == 1 && !extrafield.value) {
   return false;
  }
 }

 if (tr == 1 && tc >= rl) {
  return true;
 } else if (tr == 2 && tc <= rh) {
  return true;
 } else if (tr == 3 && tc >= rl && tc <= rh) {
  return true;
 } else {
  return false;
 }

}
function check_form(page) {
if ( (page == 1) && (!document.prontosurvey.q1.value) ) {
 alert('Yasadiginiz sehri belirtiniz');
 return false;
}
if ( (page == 1) && (!document.prontosurvey.q2.value) ) {
 alert('BOS BIRAKMAYINIZ');
 return false;
}
if ( (page == 1) && (!document.prontosurvey.q3.value) ) {
 alert('Do\x11Fum y\x131l\x131n\x131z\x131 say\x131sal olarak belirtiniz');
 return false;
}
if ( (page == 1) && (!radio_selected(document.prontosurvey.q4)) ) {
 alert('Cinsiyet belirtiniz');
 return false;
}
if ( (page == 1) && (!radio_selected(document.prontosurvey.q5)) ) {
 alert('\xD6\x11Frenim durumu belirtiniz');
 return false;
}
if ( (page == 1) && (!document.prontosurvey.q6.value) ) {
 alert('Mesleginizi yaziniz, \xF6\x11Frenci iseniz "Ogrenci" yaz\x131n\x131z');
 return false;
}
if ( (page == 1) && (!radio_selected(document.prontosurvey.q7)) ) {
 alert('Medeni durumunuzu yaz\x131n\x131z.');
 return false;
}
if ( (page == 1) && (!radio_selected(document.prontosurvey.q8)) ) {
 alert('Lutfen belirtiniz');
 return false;
}
if ( (page == 1) && (!document.prontosurvey.q9.value) ) {
 alert('L\xFCtfen belirtiniz');
 return false;
}
if ( (page == 1) && (!radio_selected(document.prontosurvey.q10)) ) {
 alert('L\xFCtfen t\xFCketim s\x131kl\x131\x11F\x131n\x131z\x131 belirtiniz');
 return false;
}
if ( (page == 1) && (!radio_selected(document.prontosurvey.q11)) ) {
 alert('L\xFCtfen t\xFCketim s\x131kl\x131\x11F\x131n\x131z\x131 belirtiniz');
 return false;
}
if ( (page == 1) && (!radio_selected(document.prontosurvey.q12)) ) {
 alert('L\xFCtfen t\xFCketim s\x131kl\x131\x11F\x131n\x131z\x131 belirtiniz');
 return false;
}
if ( (page == 2) && (!checkbox_selected(document.prontosurvey.q13, 1, 1, 0, 0, 0)) ) {
 alert('One or more mandatory fields are empty');
 return false;
}
if ( (page == 2) && (!checkbox_selected(document.prontosurvey.q14, 1, 1, 0, 1, document.prontosurvey.q14_extra)) ) {
 alert('Olumsuz etkenleri belirtiniz.');
 return false;
}
if ( (page == 2) && (!radio_selected(document.prontosurvey.q22)) ) {
 alert('One or more mandatory fields are empty');
 return false;
}
if ( (page == 2) && (!checkbox_selected(document.prontosurvey.q23, 1, 1, 0, 0, 0)) ) {
 alert('One or more mandatory fields are empty');
 return false;
}
if ( (page == 2) && (!radio_selected(document.prontosurvey.q24)) ) {
 alert('One or more mandatory fields are empty');
 return false;
}

}