var userpwdFocus = false;
function hadFocus(set)
{
    if (set) userpwdFocus = true;
    return userpwdFocus;
}
function getCookie(name) {
	var search = name + "="
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		if (offset != -1) { 
		offset += search.length 
		end = document.cookie.indexOf(";", offset) 
		if (end == -1)
			end = document.cookie.length
		return unescape(document.cookie.substring(offset, end))
		}
	}
}
function clearCache()
{
     var name="usid"
     var value="chocolate-chip-cookies"
     cookie= name + "=" + value + "; path=/cp; domain=.lamarpa.edu; expires=" +
	(new Date(0)).toGMTString();
     if (getCookie (name) != value) document.cookie = cookie;
     doCancel();
}
function doCancel()
{
     document.userid.user.value='';
     document.cplogin.user.value='';
     document.cplogin.pass.value='';
}
function OpenWin(w)
{
  var unDefined;
  if (w == "help")
  {
    stats='resizable=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,'
    stats += 'scrollbars=yes,width=650,height=475';
    helpWindow = window.open ("/site/loginhelp.html","helpWindow",stats)
    setTimeout ("helpWindow.focus ()", 500);
  }
}
function xferFocus()
{
   document.cplogin.pass.focus();
}
function login()
{
   setQueryAsCookie();
   document.cplogin.user.value=document.userid.user.value;
   document.cplogin.submit();
}
function setQueryAsCookie()
{
   var query = document.location.search;
   if (query.length > 1) {
      document.cookie = "query=" + escape(query) + "; path=/cp; domain=.lamarpa.edu;"
   } else {
      document.cookie = "query=; path=/cp; domain=.lamarpa.edu; expires=" +
	(new Date(0)).toGMTString();
   }
}
var size = "12";
if ( ( is_nav4up || is_ie4up ) && is_mac ) { size = "12"; }
else if ( is_nav4_7up) { size = "10"; }
function OpenNotice()
{
		stats='resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,';
		stats += 'width=600,height=400';
		noticeWindow = window.open ( /*URL*/ "/misc/tmNotice.html","tmNotice",stats)
		setTimeout ("noticeWindow.focus ()", 500);
}
