<!--
//menu popdown
sfHover = function() {
	var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


// popup window

function newWin(url, name, w, h) {
  l = 10;
  t = 10;

  features = "width="+w+",height="+h+",left="+l+",top="+t;
  features += ",screenX="+l+",screenY="+t;
  features += ",scrollbars=1,resizable=1,location=0";
  features += ",menubar=0,toolbar=0,status=0";

  window.open(url, name, features);
}

// open one window, then close current one

function openclose(url) {
  window.open(url);
  window.close();
}

//--
function newWindow(URL) {
	remote=window.open("","console",'toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes');
	remote=window.open(URL,"console",'toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes');
	if (!remote.opener)remote.opener=self;
    remote.opener.name = "main";
	if (remote.focus)remote.focus();
} 
window.pup = newWindow;

// ----------
// POPS UP SUBMENU WHEN ROLLING OVER MENU - HIDES ALL OTHER SUBMENUS
function showText(name) {
if(name!=0) {
       document.getElementById 
         (name).style.display = 'inline'; }
   
  for(i=1;i<=count;i++)
 {  var themenubaritem, themenu;
     if(name!=i)
    {
  if(document.getElementById(i))
      { themenubaritem=document.getElementById(i);
        themenubaritem.style.display = 'none';
        themenu=document.getElementById(i);
        themenu.style.display = 'none'; }
    }
     else
    { themenu=document.getElementById(i);
  if(themenu.style.display = 'inline')
      { themenubaritem=document.getElementById(i);
        themenubaritem.style.display = 'inline'; }
    } 
 } 
}

// --------------
// HIDES SUBMENU WHEN YOU ROLL OUT OF SUBMENU
function hideText(obj, e, name) {
  var toEl;
  subname = name;
  if (window.event) toEl = window.event.toElement;
  else if (e.relatedTarget) toEl = e.relatedTarget;
  if ( obj != toEl && !contained(toEl, obj) )
  setTimeout("hide(subname)",750);
}
// returns true of oNode is contained by oCont (container)
function contained(oNode, oCont) {
  if (!oNode) return; // in case alt-tab away while hovering (prevent error)
  while ( oNode.parentNode ) {
    oNode = oNode.parentNode;
    if ( oNode == oCont ) return true;
  }
  return false;
}

function hide(name) {
  document.getElementById(name).style.display = 'none';
}

function show(name) {
  document.getElementById(name).style.display = 'block';
}

//-------------------------
//ONE-TIME POPUP
// The following scripts create a cookie to make a window pop up only once per day
// This first script sets up cookies
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

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";
  }
}

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

//this script sets the date and determines whether to execute popup or not
var now = new Date();
fixDate(now);
now.setTime(now.getTime() + 1000 * 60 * 60 * 24 * 15) // expires in 15 day (milliseconds * seconds * minutes * hours * days)
var visits = getCookie("pop");

var oneTimeWinName = "oneTimePop"
function openPopWinOnce(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
  var d_winLeft = 20  // default, pixels from screen left to window left
  var d_winTop = 20   // default, pixels from screen top to window top
  var popcookies = document.cookie
  if (openPopWinOnce.arguments.length >= 4)  // any additional features? 
    winFeatures = "," + winFeatures
  else 
    winFeatures = "" 
  if (openPopWinOnce.arguments.length == 6)  // location specified
    winFeatures += getLocationOne(winWidth, winHeight, winLeft, winTop)
  else
    winFeatures += getLocationOne(winWidth, winHeight, d_winLeft, d_winTop)
  if (!visits) {
  visits = 1; // no cookie
    window.open(winURL, oneTimeWinName, "width=" + winWidth 
           + ",height=" + winHeight + winFeatures)
    setCookie("pop", visits, now);
    }
  }
function openPopWinOnceBack(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
  openPopWinOnce(winURL, winWidth, winHeight, winFeatures, winLeft, winTop)
  self.focus()
  }
function getLocationOne(winWidth, winHeight, winLeft, winTop){
  return ""
  }
  
  // for Netscape 4+ and IE 4+
function getLocationOne(winWidth, winHeight, winLeft, winTop){
  var winLocation = ""
  if (winLeft < 0)
    winLeft = screen.width - winWidth + winLeft
  if (winTop < 0)
    winTop = screen.height - winHeight + winTop
  if (winTop == "cen")
    winTop = (screen.height - winHeight)/2 - 20
  if (winLeft == "cen")
    winLeft = (screen.width - winWidth)/2
  if (winLeft>0 & winTop>0)
    winLocation =  ",screenX=" + winLeft + ",left=" + winLeft	
                + ",screenY=" + winTop + ",top=" + winTop
  else
    winLocation = ""
  return winLocation
  }
  
  //--------
  

-->

