
//Script begins

function AccessGranted() 
{
 document.write('<bgsound src="AccessGranted.wav" loop=1>')
 
 
 if (confirm("I certify that I am an authorized user of this site and agree to all terms and condtions. "))
     {
      window.location="http://www.lminews.com/lmi.htm" 
      
     }
 else document.location="javascript: history.go(-1)" 

}

function IntruderAlert()
{
 document.write('<bgsound src="IntruderAlert.wav">')
 alert("Please contact LMI Support")
 document.location="javascript: history.go(-1)"
}

function checkPassword()
{
 var turn
 var yourPassword = "gadsden" 

 for(turn=0;turn<3;++turn)
 {
  switch(turn)
  {
   case 0:
     password=prompt('Enter password:',"");
     if (password == yourPassword) AccessGranted()
     else alert("Password incorrect. Please try again.")     
     break
    
   case 1:
     password=prompt('Enter password:',"");
     if (password == yourPassword) AccessGranted()
     else alert("You are not authorized to access this site.")     
     IntruderAlert()
  }
 if (password == yourPassword) break;
 }
}

document.write('<form><input type=button value="User Login" onClick="checkPassword()">')
//Script ends