// code for 'return to top' link
// ----------------------------------
// used for dynamic function generation on event handlers

var loaddef = "";
var resizedef = "";

// ----------------------------------
// cross-browser functions

var IE_all_cache = new Object();
function IE_getElementById(id) {
  if (IE_all_cache[id] == null) {
    IE_all_cache[id] = document.all[id];
  }
  return IE_all_cache[id];
}

if (document.all) {
  if (!document.getElementById) {
    document.getElementById = IE_getElementById;
  }
}

//-----------------------------------
// Browser detection

var agt = navigator.userAgent.toLowerCase();

var is_opera = (agt.indexOf("opera") != -1);
var is_ie = (agt.indexOf("msie") != -1) && document.all && !is_opera;
var is_ie5 = (agt.indexOf("msie 5") != -1) && document.all;

// ---------------------------------
// shelled functions for old javascript
function tog() {}






// code for 'return to top' link

var d = ""; //declare d as a global variable
var t = 80;
var p = 0;



function getObjects() {
  d = document.getElementById( 'topicfloat' );
  t = document.getElementById( 'ln' ).offsetTop + 20;
}
loaddef += "getObjects(); ";


if( !is_ie ) {
  loaddef += "window.setInterval( 'mozFloat()', 100 ); ";
} else {
    loaddef += "document.body.onscroll = ieFloat; ";
    loaddef += "ieFloat(); ";
}

function ieFloat() {
  g = window.document.body.scrollTop;
  d.style.top = g;
  if( g > t ) {
    d.style.display="block";
  } else {
    d.style.display = "none";
  }
}
function mozFloat() {
  g = window.pageYOffset;
  if( g!=p ) {
   d.style.top = g;
    if( g > t ) {
    d.style.display="block";
    } else {
    d.style.display = "none";
    }
   p = g;
  }
}
if( is_ie == true ) {
  resizedef += "ieFloat();";
} else {
  resizedef += "mozFloat(); ";
}
var tot_img = null;

