/*
I H S Internet web site - Navigation Functions
Created:     Sep 16, 2000 MarkL, code taken from Navigation.asp; broken out into
                          separate file so ASP and CF navigation elements can
                          share single source of JS functions.
Last Update: Sep 17, 2000 MarkL, more development work and code fixes.
             Sep 27, 2000 MarkL, fixed typo errors.
             Oct 12, 2000 MarkL, added 'reload_opener' function from Jo's infrastructure components.
             Oct 23, 2000 MarkL, added 'document.domain' JS code so componets will work across servers,

*/

// DETECT IF BROWSER SUPPORTS STYLE SHEETS
if (document.all) { NavStyles = 1; } //IE w/ CSS
//else {
// if (document.tags.body) { NavStyles = 1; } //NS w/ CSS
 else { NavStyles = 0; } //browser doesnt support CSS
//}

// 
var Flag = 0;
function ReloadWindow() {
  if (Flag!=1) { Flag = 1;  }
		else { window.location.reload(); }
}
window.onResize=ReloadWindow();


// IMAGE ROLL-OVER FUNCTION
var NavUseImages = 1;
function ChngImg(imgDocID, imgObjName) {
 if (NavUseImages=="1") { document.images[imgDocID].src=eval(imgObjName+".src"); }
}

// STATUS LINE UPDATE FUNCTION
function ChngStat(Msg) {
 if (Msg!="") { window.status = Msg; }
}

// TEXT LINK ROLL-OVER FUNCTIONS
//  Event handlers to produce the roll-over effect on text links
//  in IE (if the link does not have a style defined).
//function RollOn() {
// if ((window.event.srcElement.tagName=="A") && (window.event.srcElement.className=="")) {
//  window.event.srcElement.style.color=window.document.alinkColor;
// }
//}
//function RollOff() {
// if ((window.event.srcElement.tagName=="A") && (window.event.srcElement.className=="")) {
//  window.event.srcElement.style.color="";
// }
//}
//document.onmouseover = RollOn;
//document.onmouseout = RollOff;

// Get a cookie - returns null if cookie doesn't exist.
function GetCookie(CookieName) {
 var CkName = CookieName + "=";
 var DocCookie = document.cookie;
 if (DocCookie.length > 0) {
  begin = DocCookie.indexOf(CkName);
  if (begin != -1) {
   begin += CkName.length;
   end = DocCookie.indexOf(";",begin)
   if (end == -1) end = DocCookie.length;
   return unescape(DocCookie.substring(begin,end));
  }
 }
 return null;
}

function NewWindow(URL,DESC) {
 var xwin = window.open(URL,DESC,config='height=600,width=700,scrollbars=yes,location=yes,toolbar=yes,directories=no,menubar=yes,status=yes,resizable=yes');
}

//function PopUpWindow(URL,DESC,CONFIG,WINNAME) {
// if (CONFIG) { CONFIG="height=600,width=700,scrollbars=yes,location=yes,toolbar=yes,directories=no,menubar=yes,status=yes,resizable=yes"; }
// if (WINNAME) { WINNAME="xwin"; }
// WINNAME = window.open(URL,DESC,CONFIG);
//}

// "POP-UP" WINDOW CONTROL FUNCTIONS
//  Refresh parent window and close.
function reload_opener() {
 self.opener.location.reload();
 self.close();
}

//var NavImages="<%= NavImagesDir %>";

// Set the domain property so components work across servers.
document.domain = "ihs.gov";
