/* hijacking this file so i don't have to make 100 edits to fix this bug - paul */
document.write("<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>");
document.write("<script type='text/javascript'>$(document).ready(function(){$(\"a[href^=#]\").each(function(){var href = window.location + $(this).attr('href').replace('/X.*/i','');$(this).attr('href',href);})});</script>");
/* end hijack */


sfHover = function() {
	var sfEls = document.getElementById("globalnav").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"), "");
		}
	}
}


 var cur_menu = '';

 function swap_menu(menu) { 
  if (cur_menu)
    killLayer(cur_menu)
    	
   cur_menu = menu;
   blockLayer(cur_menu);
 }
 
 
 var cur_ses = '';

 function swap_ses(ses) { 
  if (cur_ses)
    killLayer(cur_ses)
	
   cur_ses = ses;
   blockLayer(cur_ses);
 }
   
   
 var ie = document.all ? 1:0;
 var ns = ie ? 0 : 1;
 var ie_mac = ((navigator.appName.indexOf('Microsoft') != -1) && (navigator.appVersion.indexOf('Mac') != -1)) ? 1 : 0;
 var moz = document.getElementById ? 1 : 0;

  function isLayer(l, p) {

   if (ie)  return (typeof(document.all[l]) != "undefined");

    else

   if (document.documentElement)
 
     return typeof(document.getElementById(l)) != "undefined";

    else {

     if (p)  return typeof(document.layers[p].document.layers[l]) != "undefined";
       else  return typeof(document.layers[l]) != "undefined";

    } 

  }

  function getLayer(l, p) {

   if (ie)  return document.all[l].style;

    else

   if (document.documentElement)
 
     return document.getElementById(l).style;

    else {

     if (p)  return document.layers[p].document.layers[l];
       else  return document.layers[l];

    } 

  }
  
  function showLayer(l, p) { // layer, parent
    getLayer(l, p).visibility = ( (ie || document.documentElement) ? "visible" : "show");
  }

  function hideLayer(l, p) { // layer, parent
    getLayer(l, p).visibility = ( (ie || document.documentElement) ? "hidden" : "hide");
  }

  function inlineLayer(l, p) { // layer, parent
  getLayer(l, p).display =  "inline";
  }

  function blockLayer(l, p) { // layer, parent
  getLayer(l, p).display =  "block";
  }
  
  function killLayer(l, p) { // layer, parent
    getLayer(l, p).display = "none";
  }

  

  function getImageOb(n, l, p) {
   if (ns && l)  return getLayer(l, p).document.images[n];
    else return document.images[n];
  }
  
  function setImageSrc(n, s, l, p) {
    getImageOb(n, l, p).src = s;
  }
  
  function setLayerXY(l, x, y, p) {
  var lOb = getLayer(l, p);
  
   if (ie) {
     lOb.posLeft = x;
     lOb.posTop = y;
   } else {
     lOb.left = x;
     lOb.top = y;
   }
  }
  
  function setLayerY(l, y, p) {
   if (ie)  getLayer(l, p).posTop = y;
    else getLayer(l, p).top = y;
  }

  function setLayerX(l, x, p) {
   if (ie)  getLayer(l, p).posLeft = x;
    else getLayer(l, p).left = x;
  }
  
  function setLayerZ(l, z, p) {
    getLayer(l, p).zIndex = z;
  }
  

    
  function getLayerY(l, p) {
    return ie?(getLayer(l, p).posTop):(getLayer(l, p).top);
  }
  
  function getLayerX(l, p) {
    return ie?(getLayer(l, p).posLeft):(getLayer(l, p).left);
  }
    
  function getLayerZ(l, p) {
    return getLayer(l, p).zIndex;
  }
   
  function getLayerHeight(l, p) {
//    return ie ? (document.all[l].scrollHeight) : (getLayer(l, p).document.height);
    return ie ? (document.all[l].scrollHeight) :                 (
                  document.documentElement 
                   ? 
                  (document.getElementById(l).offsetHeight)
                   :
                  (getLayer(l, p).document.height)

	);
  }

  
  function getLayerWidth(l, p) {
//    return ie ? (document.all[l].scrollWidth) : 
    return ie ? (document.all[l].offsetWidth) : 
                (
                  document.documentElement 
                   ? 
                  (document.getElementById(l).offsetWidth)
                   :
                  (getLayer(l, p).document.width)
                );
  }



  function layerWrite(str, l, p) {
   if (ie)
     document.all[l].innerHTML = str;
   else if(moz)
   {
        document.getElementById(l).innerHTML = str;
   }
   else {
    var ob = getLayer(l, p).document;
    
     ob.open();
     ob.write(str);
     ob.close();
   }
  }
  
  function setLayerClip(iX, iY, fX, fY, l, p) {
   var ob = getLayer(l, p);
   
   if (ie) 
     ob.clip = "rect(" + iY + "px " + fX + "px " + fY + "px " + iX + "px)";
   else {
     ob.clip.left = iX;
     ob.clip.top = iY;

     ob.clip.right = fX;
     ob.clip.bottom = fY;
   }
  }
  
  function getWindowHeight() {

    return (ie ? document.documentElement.clientHeight : window.innerHeight);    
//    return (ie ? document.body.clientHeight : window.innerHeight);    
  }

  function getWindowWidth() {
    return (ie ? document.body.clientWidth : window.innerWidth);    
  }
  
  function centerLayerV(l, xOfs, p, h) {
    setLayerY(l, ( (getWindowHeight() - (h?h:getLayerHeight(l, p)) ) / 2 ) + (xOfs ? xOfs : 0), p);
  }
  
  function centerLayerH(l, yOfs, p, w) {
    setLayerX(l, ( (getWindowWidth() - (w?w:getLayerWidth(l, p)) ) / 2 ) + (yOfs ? yOfs : 0), p);
  }
  
 
