// Start Timer for Session End

function startSession() {
  setTimeout('endSession()','900000')
}


function endSession() {
  window.location='logout.php'
}

 function popSecure(lnk,w,h,options,name) {
   nwl="newWin=window.open('https://redbaronracing.net/"+lnk+"','"+name+"','width="+w+",height="+h
   if ( options == "on" ) {
      nwl += ",resizable=yes,status=yes,scrollbars=yes,location=yes,screenX=0,screenY=0,left=0,top=0')"
   } else {
      nwl += "')"
   }
  eval(nwl)
  newWin.focus()
 }

 function popWin(lnk,w,h,options,name) {
   nwl="newWin=window.open('"+lnk+"','"+name+"','width="+w+",height="+h
   if ( options == "on" ) {
      nwl += ",resizable=yes,status=yes,scrollbars=yes,location=yes,screenX=0,screenY=0,left=0,top=0')"
   } else {
      nwl += "')"
   }
  eval(nwl)
  newWin.focus()
 }

// function to validate input
function checkInput() {
  var missing=focusVal=""
  df=document.forms[0]
  arg_num = arguments.length
  j=1
  for(i=0;i<arg_num;i=i+2) {
     current_val = eval("df."+arguments[i]+".value")
     if ( current_val == "" ) {
            missing += "- " + arguments[j] + "\n"
        if ( focusVal=="" ) focusVal = arguments[i]
         }
         j=j+2
  }

  if ( df.confirm ) {
     if ( df.confirm.value != df.password.value ) missing =+ "- Passwords do not match"
  }
  if (missing != "") {
    alert("The following information is required:\n"+missing)
        df.item(focusVal).focus()
        return false
  }
}
 
