﻿function validLogin(passForm) {
  if ((passForm.username.value == "") && (passForm.password.value == "")) {
    alert("You must enter a Username and Password.")
    passForm.username.focus()
    return false
  }
  if (passForm.username.value == "") {
    alert("You must enter a Username.")
    passForm.username.focus()
    return false
  }
  if (passForm.password.value == "") {
    alert("You must enter a Password.")
    passForm.password.focus()
    return false
  }
  return true
}

function validRegForm(regForm) {
 if (regForm.username.value == ""){
   alert("You must enter a Username.")
   regForm.username.focus()
   return false
 }
 if (regForm.password.value == ""){
   alert("You must enter a Password.")
   regForm.password.focus()
   return false
 }
 if (regForm.password.value != regForm.password2.value){
   alert("Passwords don't match! Please try again.")
   regForm.password.value = ""
   regForm.password2.value = ""
   regForm.password.focus()
   return false
 }
return true
}

function validPostform(postForm) {
  if (postForm.title.value == "") {
    alert("You must enter a title.")
    postForm.title.focus()
    return false
  }
  if (postForm.city.value == "") {
    alert("You must enter a location city.")
    postForm.city.focus()
    return false
  }
  if (postForm.item_state.value == "") {
    alert("You must enter a location state.")
    postForm.state.focus()
    return false
  }
  if (postForm.feedback.value == "") {
    alert("You must enter feedback.")
    postForm.feedback.focus()
    return false
  }
  return true
}

function AreYouSure() {
  if (confirm("Are you sure you want to Delete the listing?")){
    return true
  }
  else {
    return false
  }
}

function filepolicy() {
  filepolicywindow = window.open("filepolicy.html", "File_Policy", "width=400,height=450,scrollbars=yes")
  filepolicywindow.focus()
  }

function textpolicy() {
  textpolicywindow = window.open("textpolicy.html", "File_Policy", "width=400,height=350,scrollbars=yes")
  textpolicywindow.focus()
  }


