// Jim Goode	2005/05/26	UNT access turned off.
// Jim Goode	2005/05/26	GTLdemo access turned on.
// Jim Goode	2005/06/16	Texas A&M training turned on.
// Jim Goode	2005/08/04	Add DISD passwords for Science.
// Jim Goode	2005/08/12	Add LaGrange for demo access.
// Jim Goode	2005/08/29	Change A&M Password.
// Jim Goode	2005/08/30	Add UNT access.
// Jim Goode	2006/10/31	Separate Texas and California full online products.

var id = '';
var pwd = '';
var maxCount = 3;
var count = 0;

var tx = 'online_tx/menu.html';
var ca = 'online_ca/menu.html';

//var monthPassword  = '200210710M';
//var lmonthpassword = '200210710m';
//var yearPassword   = '200210710A';
//var lyearpassword  = '200210710a';
//var untTraining01  = 'UNT_math_041';
//var untAccess02    = 'UNT_math_042';
var UNT0805          = 'UNT0805';
var GTLDemo          = 'GTLdemo';
var Mindy            = 'ydnim';

var CATest           = 'CATest';

//var ATM1		 = 'aTm1';
//var ATM2		 = 'aTm2';
//var ATM3		 = 'aTm3';
//var ATM4		 = 'aTm4';
var AnM		   = 'cmse101';

// DISD Science teacher's passwords for 16 schools
var DISDAdams      = 'DISDAdams';
var DISDAdamson    = 'DISDAdamson';
var DISDHillcrest  = 'DISDHillcrest';
var DISDJefferson  = 'DISDJefferson';
var DISDMolina     = 'DISDMolina';
var DISDNDallas    = 'DISDNDallas';
var DISDPinkston   = 'DISDPinkston';
var DISDRoosevelt  = 'DISDRoosevelt';
var DISDSamuell    = 'DISDSamuell';
var DISDSeagoville = 'DISDSeagoville';
var DISDSkyline    = 'DISDSkyline';
var DISDSmith      = 'DISDSmith';
var DISDSOC        = 'DISDSOC';
var DISDSpruce     = 'DISDSpruce';
var DISDSunset     = 'DISDSunset';
var DISDWilson     = 'DISDWilson';

// La Grange ISD
var LaGrangeISD    = 'La-grange_isd';

function update()
{
  id =     document.gtlform1.ID.value;
  if(id == 'undefined') id = '';
  pwd =       document.gtlform1.PWD.value;
  if(pwd == 'undefined') pwd = '';
}

function clear()
{
  document.gtlform1.ID.value = '';
  document.gtlform1.PWD.value = '';
}

function login()
{

//    if ((pwd == monthPassword)  || (pwd == yearPassword)  ||
//        (pwd == lmonthpassword) || (pwd == lyearpassword) ||
//	  (pwd == untTraining01)  || (pwd == untAccess02)  ||
//

  if ((pwd == AnM) ||

    (pwd == UNT0805) ||

    (pwd == DISDAdams) ||
    (pwd == DISDAdamson) ||
    (pwd == DISDHillcrest) ||
    (pwd == DISDJefferson) ||
    (pwd == DISDMolina) ||
    (pwd == DISDNDallas) ||
    (pwd == DISDPinkston) ||
    (pwd == DISDRoosevelt) ||
    (pwd == DISDSamuell) ||
    (pwd == DISDSeagoville) ||
    (pwd == DISDSkyline) ||
    (pwd == DISDSmith) ||
    (pwd == DISDSOC) ||
    (pwd == DISDSpruce) ||
    (pwd == DISDSunset) ||
    (pwd == DISDWilson) ||

    (pwd == LaGrangeISD) ||

    (pwd == Mindy) ||

    (pwd == GTLDemo))

    {
	window.open(tx, "prodWin", "toolbar=no,width=640,height=480,status=no,scrollbars=yes,resizable=yes,menubar=yes,top=20,left=20");
    }

  else
  {
    if ((pwd == CATest))
    {
	window.open(ca, "prodWin", "toolbar=no,width=640,height=480,status=no,scrollbars=yes,resizable=yes,menubar=yes,top=20,left=20");
    }

    else
    {
      clear();
      alert('ID/Password combination is not valid. Please try again.');
      return false;
    }
  }

}
