// trinitywebscripts.js
//
// Copyright 2008 Elephant's Task LLC
//
  
function startIt() {
    if ( asy._xmlhttp.readyState < 4 ) {
        updateProgressBar( ++counter );
        window.setTimeout( "startIt()", 300 );
    } else {
        window.setTimeout( "hideProgressBar()", 300 );
    }
}


// showLinkDetails shows the information for each of the navigation links in the lower box.
	function showLinkDetails( value ) {
		var div = document.getElementById('linkDetails');
		div.innerHTML = value;
	}
	
	function msieversion() {
      var ua = window.navigator.userAgent
      var msie = ua.indexOf ( "MSIE " )

      if ( msie > 0 )      // If Internet Explorer, return version number
         return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
      else                 // If another browser, return 0
         return 0

   }
	
	function determinePosition() {
		if (typeof(window.innerHeight) == 'number') {
				// Firefox
				 position = (document.body.clientHeight - (window.innerHeight / 2));
			} else {
				if ( msieversion() == 6 ) {
					position = document.body.scrollTop + ( screen.height / 2 );
				} else if ( msieversion() == 7 ) {
					position = document.body.clientHeight - ( screen.height / 2 );
				}
			}
	
		return position;
	}

	function setContent( divid ) {
			if (document.getElementById) {
				var pos = determinePosition();
				if (pos > 0) {
					var contentElement = document.getElementById( divid );
					var contentHeight = contentElement.offsetHeight;
					if (pos - contentHeight > 0) {
						contentElement.style.top = (pos - (contentHeight / 2)) + 'px';
					}
					else {
						contentElement.style.position = pos;
					}
				}
			}
		}


