
<!-- HIDE FROM OTHER BROWSERS

// SET GLOBAL JS VARIABLES

// This script sets searchOffset to the number of links in the header
// This is used by search results pages when displaying the number of results   
   var searchOffset = 7;
   var formOffset = 2;
// END GLOBAL VARIABLES


//  Function to return the value of the cookie specified by "name".
	function GetFocusCookie (name) {
	    var arg = name + "=";
	    var alen = arg.length;
	    var clen = document.cookie.length;
	    var i = 0;
	    while (i < clen) {
	        var j = i + alen;
	        if (document.cookie.substring(i, j) == arg) {
	            var temp=getFocusCookieVal(j);
	            if ((temp=="\n") || (temp==null)) temp="X";
	            return temp;
	        }
	        i = document.cookie.indexOf(" ", i) + 1;
	        if (i == 0) break;
	    }
	    return "";
	}
	
	function getFocusCookieVal (offset) {
	    var endstr=document.cookie.indexOf (";", offset-1);
	    if (endstr == -1) endstr = document.cookie.length;
	    return unescape(document.cookie.substring(offset, endstr));
	}

//  Cookie Functions - Second Helping  (21-Jan-96)
//  Written by:  Bill Dortch, hIdaho Design <bdortch@netw.com>
//  The following functions are released to the public domain.
// "Internal" function to return the decoded value of a cookie
function getCookieVal (offset) {
    var endstr=document.cookie.indexOf (";", offset-1);
    if (endstr == -1) endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}

//  Function to return the value of the cookie specified by "name".
function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg) {
            var temp=getCookieVal(j);
            if ((temp=="\n") || (temp==null)) temp="X";
            return temp;
        }

        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return "";
}

//  Function to create or update a cookie.
function SetCookie (name, value) {
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;

//    var expires = (argc > 2) ? argv[2] : null;

    var expires = new Date();
    expires.setTime(expires.getTime() + (365*24*60*60*1000));
    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    document.cookie = name + "=" + escape (value) +
       ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
       ((path == null) ? "" : ("; path=" + path)) +
       ((domain == null) ? "" : ("; domain=" + domain)) +
       ((secure == true) ? "; secure" : "");
    }

//  Function to delete a cookie. 
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// START TEXT SIZE CONTROLLER
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
	 SetCookie("style", title);
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

// END TEXT SIZE CONTROLLER

// START FRAME BUSTER
// prevent site from being opened in a frameset
if (top != self) {
   top.location = location
}
// END FRAME BUSTER
// START IMG_CHANGE
// when you mouseover, change the image to the selected graphic              
   function img_change(imgName , imgSelect)  {
      if (document.images) {
         document[imgName].src = graphics[imgSelect];
      }
   }    
// END IMG_CHANGE

// Start ISSAIC Cursor Focus and Search cookie functions

/* The checkCursorFocus function gets the user's cursor preference from the cookie and
if the cookie is set to 'ISSAIC' it gives the Search ISSAIC box focus.
If there is no cookie or if preference is 'People' gives the Search People box focus.
Otherwise (cookie set to 'Use Default') the browser default focus will be used. */

function checkCursorFocus() {
   var getCursorFocus = GetCookie("cursorFocus") 
   if(self.document.seek1 == null) { 
      return; //check to see if the form element has loaded, if not abort.
   }
   else if(getCursorFocus == "ISSAIC"){
      self.document.seek1.qt.focus();       
   }
	else if(getCursorFocus == "Google"){
      self.document.googleForm.q.focus();       
   }
   else if(getCursorFocus == "" || getCursorFocus == "People") {
      self.document.seek.value1.focus();
   }
   else {
      return;
   }
}

// End ISSAIC Cursor Focus and Search cookie functions


// START ERROR HANDLER
// This script alerts the user of JavaScript errors in the page.

function errorHandler(message, url, line){
	switch (message)
	{
   	case "document.getElementsByTagName is not a function" : 
		break; 

   	case "$v is not defined" : 
		break; 

	case "Error loading script" :
		if (line == 1){
			break;
		}
   	
	default : 
	alert(   
   'A JavaScript error has occurred.  \n'
   +'Please report the following details to \n' 
   +'the SAIC Help Desk at (858) 826-2511 \n' 
   +'\nError description: \t'+message
   +'\nPage address:      \t'+url
   +'\nLine number:       \t'+line);
   return true;    
	}  // end switch
}

// START OPENHELP
// For JavaScript 1.0 browsers, don't do anything
// except send users to the next page

function openhelp () {
   return true;
} 
// END OPENHELP 
	// For JavaScript 1.1 browsers, open a new window
	// Openhelp allows users to open links in a new browser window
	// URL is URL to open in new window
	// window_name is name of new window - default is helpWin
	// width is width of new window, default is 465
	// height is height of new window, default is 310
	// additionalAttributes are any additional attributes to add
	// menubar, toolbar, location, and status are the only recommended
	// and tested attributes
	
	window.onerror = errorHandler;
	
	function openhelp (URL , window_name, width, height, addlAttributes) {
	   if (window_name == null) window_name = 'helpWin';
	   if (width == null) width = '465';
	   if (height == null) height = '310';
	   var attributes = 'width=' +width+ ',height=' +height+ ',scrollbars,resizable'
	   if (addlAttributes != null) {
	      attributes +=  ',' +addlAttributes;
	   }
	             
	   // Open the window
	   var newWindow = window.open(URL,window_name,attributes);
	        
	   newWindow.focus();        // Bring window to front
	}  
	// end function openhelp

function clearDefault(){
document.seek1.qt.value="";
}
// END HIDE -->

