// this is global JS for the sensibletransportation.org site.
// written October 04, 2007.
//
// the following mysterious code serves to prevent URLs from
// being displayed in the status bar
//
document.onmouseover = function (e) {   
    if (!e) e=window.event;   
    var el = e.target ? e.target : e.srcElement;   
    while (el != null && el.tagName != "A") el=el.parentNode;   
    if (el == null) return;   
    if (e.preventDefault) e.preventDefault();   
    else e.returnValue = true;
}
//
// the following uses JS to get the height of the viewport (in
// pixels), which it then writes to CSS as the height of the
// body tag.  the purpose is to provide a basis for setting
// the heights of the div tags for the navbar, the wrapper and
// the main to 100%, so our stuff extends right to the bottom
// of the viewport.  this code was grabbed from
// http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/
// and i just experimented with how to get the value of viewportheight
// into CSS.  seems to work!  NOTE: if this code is inserted between
// script tags in either head or body, the HTML validator will complain
// about the presence of the && strings, but not if this script is (as
// here) in an external file.  it's supposed to work with IE, but i
// have not checked it yet.  it's OK with firefox and opera.
//
// var viewportheight;
// if (typeof window.innerWidth != 'undefined') {
//     viewportheight = window.innerHeight;
// }
// else if ((typeof document.documentElement != 'undefined')
//     && (typeof document.documentElement.clientWidth != 'undefined')
//     && (doscument.documentElement.clientWidth != 0)) {
//     viewportheight = document.documentElement.clientHeight;
// }
// else {
//     viewportheight = document.getElementByTagName('body')[0].clientHeight;
// }
// // document.write('<style type=\"text/css\"> body{height: '+viewportheight+'px;}</style>');
// //
// // the following from page 276 of flanagan
// var Geometry = {};
// 
// if (window.innerWidth) { // non-IE browsers
//     Geometry.getViewportHeight = function() {
//         return window.innerHeight;
//     };
//     Geometry.getVerticalScroll = function() {
//         return window.pageYOffset;
//     };
// }
// // alert("viewport height = "+Geometry.getViewportHeight());
// 
// if (document.documentElement && document.documentElement.scrollWidth) {
//     Geometry.getDocumentHeight = function() {
//         return document.documentElement.scrollHeight;
//     };
// }
// else if (document.body.scrollWidth) {
//     Geometry.getDocumentHeight = function() {
//         return document.body.scrollHeight;
//     };
// }
// alert("document height = "+Geometry.getDocumentHeight());

