<!--
// 12/13/2005 - updated by Qui - add/remove appropriate code and commend for 2-server and 3-sever access
// 12/18/2006 - updated by Qui - add/remove appropriate code and commend for 2-server, 3-server, and 4-server access
//
// for 2 servers
//
//      The 3-server and 4-server code below should be commended out before activate the following code:
//
// var strLinks 	= new Array("https://eweb2.laccd.edu/","https://eweb3.laccd.edu/");
// var intRandom	= Math.round(Math.random());
//
// end 2-server code
//
// History of the 4-servers
// for 4 servers - 
// for 3 servers - reopen 11/09/05 by Qui Per Lou's request. Reopen 1/19/06 -qui
// for 2 servers - 11/15/05 by LD Per Lou's request (eweb3 changed to eweb2). Closed 1/19/06 -qui
// End History
//
//
// For 3 servers
//
//      The 2-server code above and the 4-server code below should be commended out before activate the following code:
//
// var strLinks = new Array("https://eweb2.laccd.edu/","https://eweb3.laccd.edu/","https://eweb4.laccd.edu/"); 
// var intRandom = Math.round(2 * Math.random());
//
// end 3-server code
//
//
// For 4 servers
//
//      The 2-server and the 3-server code above should be commended out before activate the following code:
//
var strLinks = new Array("https://eweb3.laccd.edu/","https://eweb2.laccd.edu/","https://eweb4.laccd.edu/","https://eweb1.laccd.edu/"); 
var intRandom = Math.round(3 * Math.random());
//
// end 4-server code
//

function openwindow(pageurl){
var urlrefer = "http://www.laccd.edu";
var siswindow = pageurl + "winredirect.asp?urlrefer=" + urlrefer + "&SISURL=" + pageurl + "index4qui.asp";
         window.open(siswindow,"SISLogon","toolbar=0,menubar=0,location=0,scrollbars=1,status=1,resizable=1");
}


function DatePosition(dateString,dateType) {
/*
   function DatePosition 
   parameters: dateString dateType
   returns: integer (-1, 0, 1)
   
   dateString is a date passed as a string in the following
   formats:

   type 1 : 19970529
   type 2 : 970529
   type 3 : 29/05/1997
   type 4 : 29/05/97
   type 5 : 05/29/1997
   type 6 : 05291997
   type 7 : 052997
   
   dateType is a numeric integer from 1 to 7, representing
   the type of dateString passed, as defined above.

   Returns -1 if the date passed is behind todays date
   Returns 0 if the date passed is equal to todays date
   or if dateType is not 1 to 7
   Returns 1 if the date passed is ahead of todays date
   
   Added Y2K checking.  (Works for any century cross over)
*/


    var now = new Date();
    var today = new Date(now.getYear(),now.getMonth(),now.getDate());
    var century = parseInt(now.getYear()/100)*100;
        
    if (dateType == 1)
        var date = new Date(dateString.substring(0,4),
                            dateString.substring(4,6)-1,
                            dateString.substring(6,8));
    else if (dateType == 2)
    {
        if ((now.getYear()%100)>=parseInt(dateString.substring(0,2)))
        {
            var date = new Date(century+parseInt(dateString.substring(4,6)),
                            parseInt(dateString.substring(2,4)-1),
                            dateString.substring(4,6));
        }
        else
        {
            var date = new Date(century-100+parseInt(dateString.substring(0,2)),
                            parseInt(dateString.substring(2,4)-1),
                            dateString.substring(4,6));
        }
        
    }
    else if (dateType == 3)
        var date = new Date(dateString.substring(6,10),
                            dateString.substring(3,5)-1,
                            dateString.substring(0,2));
    else if (dateType == 4)
    {
        if ((now.getYear()%100)>=parseInt(dateString.substring(6,8)))
        {
            document.write(century+parseInt(dateString.substring(6,8)),'<P>');
            var date = new Date(century+parseInt(dateString.substring(4,6)),
                            parseInt(dateString.substring(3,5)-1),
                            dateString.substring(0,2));
        }
        else
        {
            document.write(century-100+parseInt(dateString.substring(6,8)),'<P>');
            var date = new Date(century-100+parseInt(dateString.substring(4,6)),
                            parseInt(dateString.substring(3,5)-1),
                            dateString.substring(0,2));
        }
        
    }
    else if (dateType == 5)
        var date = new Date(dateString.substring(6,10),
                            dateString.substring(0,2)-1,
                            dateString.substring(3,5));
    else if (dateType == 6)
        var date = new Date(dateString.substring(4,8),
                            dateString.substring(0,2)-1,
                            dateString.substring(2,4));
    else if (dateType == 7)
    {
        if ((now.getYear()%100)>=parseInt(dateString.substring(4,6)))
        {
            document.write('datestring Century:',century+parseInt(dateString.substring(4,6)),'<P>');
            var date = new Date(century+parseInt(dateString.substring(4,6)),
                            parseInt(dateString.substring(0,2)-1),
                            dateString.substring(2,4));
        }
        else
        {
            document.write('datestring Century:',century-100+parseInt(dateString.substring(4,6)),'<P>');
            var date = new Date(century-100+parseInt(dateString.substring(4,6)),
                            parseInt(dateString.substring(0,2)-1),
                            dateString.substring(2,4));
        }
        
    }
    else
        return false;

    if (date < today)
    {
        document.write(date.toString(),' is behind ',today.toString(),'<P>');
        return -1;
    }
    else if (date > today)
    {
        document.write(date.toString(),' is ahead of ',today.toString(),'<P>');
        return 1;
        
    }
    else
    {
        document.write(date.toString(),' is the same as ',today.toString(),'<P>');
        return 0;
    }
}

//second list of functions

function isitToday(dateString,dateType) {
/*
   function isitToday 
   parameters: dateString dateType
   returns: boolean
   
   dateString is a date passed as a string in the following
   formats:

   type 1 : 19970529
   type 2 : 970529
   type 3 : 29/05/1997
   type 4 : 29/05/97
   
   dateType is a numeric integer from 1 to 4, representing
   the type of dateString passed, as defined above.

   Returns true if the date passed is equal to todays date
   Returns false if the date passed is NOT equal to todays
   date or if dateType is not 1 to 4.
*/


    var now = new Date();
    var today = new Date(now.getYear(),now.getMonth(),now.getDate());

    if (dateType == 1)
        var date = new Date(dateString.substring(0,4),
                            dateString.substring(4,6)-1,
                            dateString.substring(6,8));
    else if (dateType == 2)
        var date = new Date(dateString.substring(0,2),
                            dateString.substring(2,4)-1,
                            dateString.substring(4,6));
    else if (dateType == 3)
        var date = new Date(dateString.substring(6,10),
                            dateString.substring(3,5)-1,
                            dateString.substring(0,2));
    else if (dateType == 4)
        var date = new Date(dateString.substring(6,8),
                            dateString.substring(3,5)-1,
                            dateString.substring(0,2));
    else
        return false;

    if (date.toString() == today.toString())
        return true;
    else
        return false;
}

/* test values
if (isitToday("19970529",1)) alert('true'); else alert('false');

if (isitToday("970529",2)) alert('true'); else alert('false');

if (isitToday("29/05/1997",3)) alert('true'); else alert('false');

if (isitToday("02/06/97",4)) alert('true'); else alert('false');
*/

function checkdate()
{
var theToday= new Date();
var theHour = theToday.getHours();
var theDay =  theToday.getDay();
var theMins = theToday.getMinutes();


var  DateArray = new Array();
// format for the date in array dd/mm/yyyy
// DateArray[0] = "20/10/2002"
DateArray[0] = "20/08/2005"
DateArray[1] = "21/08/2005"
//DateArray[1] = "15/04/2003"
//DateArray[1] = "10/11/2002"
//DateArray[2] = "15/12/2002"

var k = false;

for(i=0; i<DateArray.length; i++){
 if (isitToday(DateArray[i],3)) 
     {
     k = true;
//     alert('true1');
    break;
    }
//  else alert('false1');
}

if (k) {
     alert("\nThe system is currently unavailable due to planned maintenance." );
    return false;         
}

var  DateArray2 = new Array();

DateArray2[0] = "19/10/2002"
DateArray2[1] = "26/10/2002"
var j = false;

for(i=0; i<DateArray2.length; i++){
 if (isitToday(DateArray2[i],3)) 
     {
     j = true;
//     alert('true11');
    break;
    }
//  else alert('false11');
}

if (j){
       if ((theHour >= 17 && theMins<=59) ||
           (theHour <= 24 && theMins <= 59)) 
           {
           alert("\nThe system is currently unavailable due to planned maintenance." );
           return false;   
            }
}

       if ((theHour < 7 && theMins<=59) ||
           (theHour == 24 && theMins == 00)) 
           {
//          alert("\nThe system is not available now. \nHours of operation are from 7:00 AM to Midnight  PST, Monday through Saturday. \nTry it again later." );
           alert("\nThe system is currently unavailable due to planned maintenance." );
           return false;
            }
      else  return true;
 
// end function checkdate()
}

// detect broswer type
    function goThere()
    {
    var x=document.frm_sites.urlList.options[document.frm_sites.urlList.selectedIndex].value;
    location.href=x;
    return;
    }
    
    var agt = navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    var isNav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)	&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)	&& (agt.indexOf('webtv')==-1));
    var isNav4 = (isNav && (is_major == 4));
    var isNav4up = (isNav && (is_major >= 4));
    var isNavonly	  = (isNav && ((agt.indexOf(";nav") != -1) ||  (agt.indexOf("; nav") != -1)) );
    var isNav6 = (isNav && (is_major >= 6));
    var isIE   = (agt.indexOf("msie") != -1);
    var isIE3  = (isIE && (is_major < 4));
    var isIE4  = (isIE && (is_major == 4) && (agt.indexOf("msie 4.") != -1) );
    var isIE4up  = (isIE  && (is_major >= 4));
    var isMac = (navigator.appVersion.indexOf("Mac") != -1);
    var isWin = (navigator.appVersion.indexOf("Win") != -1);
    var isIE5  = (isIE && (is_major == 4) && (agt.indexOf("msie 5.") != -1) );
    var isIE5up  = (isIE  && !isIE3 && !isIE4);
    if (isIE5 && (is_major == 4)) { is_major = 5; }
// end detecting browser type
// detect coookies enable

var cookieEnabled=(navigator.cookieEnabled)? true : false

//if not IE4+ nor NS6+
if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ 
document.cookie="testcookie"
cookieEnabled=(document.cookie=="testcookie")? true : false
document.cookie="" //erase dummy value
}

//if (cookieEnabled) //if cookies are enabled on client's browser
//do whatever

// end detecting cookies enable

//-->