/**
* Simulates the :hover state for <li> elements in Internet Explorer
*
* Works by applying a class 'hover' to <li> elements when rolled over. The 'hover' class shares
* the same properties as the corresponding :hover class.
*
* Taken from http://www.alistapart.com/articles/dropdowns
*/
function init_menu() {

  if (!document.all || !document.getElementById) return;
  
  var navRoot = document.getElementById('top-nav');
  for (i = 0; i < navRoot.childNodes.length; i++) {
    var node = navRoot.childNodes[i];      
    if (node.nodeName == 'UL') {        
          for (k = 0; k < node.childNodes.length; k++) {
            var nodeC2 = node.childNodes[k];
            if (nodeC2.nodeName == 'LI') {
              nodeC2.onmouseover = function() { this.className += ' hover'; }
              nodeC2.onmouseout  = function() { this.className = this.className.replace(' hover', ''); }              
            } // end if
          } // end for      
    } // end if
  } // end for
} // end function

function splitTextVertical(elemId) {
	var ua = navigator.userAgent;
	if ( document.getElementById ) {
		var elem = document.getElementById(elemId);
		var string = elem.innerHTML;
		if ( string.length >= 2 ) {
			var splitString = string.split("");
			//splitString = splitString.reverse();
			elem.innerHTML = "";
			for ( var i = 0; i <= splitString.length; i++ ) {				
				if (splitString[i] != null && splitString[i] != " " ) {
					//console.log('writing out %s from split string', splitString[i]);
					elem.innerHTML += "<div>" + splitString[i] + "</div>";
				}// End if
			}// End for
		}// End if
	}// End if
}// End function

window.onload = function() {

	init_menu();

}// End function
