<!--

/* Source file: kic_death.js
   Author: Jeremiah Wehland
   Date: 6/26/2001
   This script is designed to be used with the document "death_table.html" of the KIC System.
*/

var row_flag = false;
var col_flag = false;
var use_script = false;
var browser_name;
var browser_version;

/* checkBrowser determines if the user's browser will support some of the scripting features
   specifically the disabling of form elements */
function checkBrowser()
{ browser_name = navigator.appName;
  browser_version = parseInt(navigator.appVersion);
  if(browser_name == "Microsoft Internet Explorer")
   { use_script = true; }
  else
   { if(browser_name == "Netscape")
      { if(browser_version > 4)
         { use_script = true; }
	else
         { use_script = false; }
      }
   }
}

/* checkRow determines which radio button in the "row" group is checked */
function checkRow()
{ var found = 0;
  for(v = 0; v < window.document.myform.row.length; v++)
   { if(window.document.myform.row[v].checked)
      { found = v;
        break;
      }
   }
  return found;
}


/* rowColCheck disables the column radio buttons depending on which row button is selected. This prevents a user
   from attempting to request the same variable as the row and column variable. */
function rowColCheck(row)
{ if(use_script)
 //  { 

	{ for(i = 0; i < window.document.myform.col.length; i++)
         { if(i == row)
            { window.document.myform.col[i].disabled = true;
              if(window.document.myform.col[i].checked)
               { window.document.myform.col[i].checked = false;
                 if(i == window.document.myform.col.length-1)
                  	{ window.document.myform.col[0].checked = true; } 
                 else
                 
			{ window.document.myform.col[i + 1].checked = true; }
               }
            }
           else
            { window.document.myform.col[i].disabled = false; }
         }
      }
//     else
//      { for(q = 0; q < window.document.myform.col.length; q++)
//         { window.document.myform.col[q].disabled = false; }
//      }
//   }
}




/* checkForm makes sure a year has been selected before allowing the form to be submitted */
function checkForm()
{ var found_year = false;
  for(j = 0; j < window.document.myform.yr.length; j++)
   { if(window.document.myform.yr[j].checked)
      { found_year = true;
        break;
      }
   }
  if(found_year)
   { return true; }
  else
   { alert("You have not selected a year. Please select a year.");
     return false;
   }
}


//-->

