﻿// JavaScript SF Hover
/*
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
		    if (this.className == "last")
		    {
                this.className="sfhover last"
			}
			else
			{
	            this.className="sfhover";
			}
		}
		sfEls[i].onmouseout=function() {
		    if (this.className == "sfhover last")
		    {
			    this.className= "last";
			}
			else
			{
			this.className="";
			}
		}
	}
}

if (window.addEventListener) //DOM method for binding an event
window.addEventListener("load", sfHover, false)
else if (window.attachEvent) //IE exclusive method for binding an event
window.attachEvent("onload", sfHover)
else if (document.getElementById) //support older modern browsers
window.onload=sfHover
*/

      function hover(id, imgId, newImgId)
      {
        document.getElementById(id).className = "sfhover";
        replace(imgId, newImgId);
      }
      
      function hover2(id, imgId, newImgId)
      {
        document.getElementById(id).className = "sfhover";
        document.getElementById(imgId).className = "hidden";
        document.getElementById(newImgId).className = "visible";
        
      }
      
      function hoverPersist(id, imgId, newImgId)
      {
        replace(imgId, newImgId);
      }
      
      function hoverPersist2(id, imgId, newImgId)
      {
        document.getElementById(imgId).className = "hidden";
        document.getElementById(newImgId).className = "visible";
      }
      
      function nohover(id, imgId, newImgId)
      {
        document.getElementById(id).className = "";
        replace(imgId, newImgId);
      }
      
      function nohover2(id, imgId, newImgId)
      {
        document.getElementById(id).className = "";
        document.getElementById(imgId).className = "hidden";
        document.getElementById(newImgId).className = "visible";
      }
      
      function replace(id, newId)
      {
        document.getElementById(id).style.display = "none";
        document.getElementById(newId).style.display = "";
      }
      
      function replace2(id, newId)
      {
        document.getElementById(id).className = "hidden";
        document.getElementById(newId).className = "visible";
      }
      
      function swap(id, newImg)
      {
        document.getElementById(id).src = newImg;
      }
      
    function minMax(elem)
    {
      var parent = elem.parentNode;
      var nodes = parent.childNodes;
      for (var i=0; i<nodes.length; i++)
      {
        if (nodes[i].className == "content")
        {
           nodes[i].className = "content content-visible"; 
        }
        else if (nodes[i].className == "content content-visible")
        {
          nodes[i].className = "content";
        }
        else if (nodes[i].className == "title")
        {
          nodes[i].className = "title title-visible";
        }
        else if (nodes[i].className == "title title-visible")
        {
          nodes[i].className = "title";
        }
      }
      document.getElementById('footer-wrapper').style.background = "";
      document.getElementById('footer-wrapper').style.bottom = "0px";
    }
    
    function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
  document.getElementById('outer').height = myHeight;
}