// used for dynamic function generation on event handlers
var loaddef = "";
var resizedef = "";
 // 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;

var IE_all_cache = {};
$ = function(id){
	return document.getElementById(id)
};
if (document.all && !document.getElementById) {
	$ = function(id) {
		if (IE_all_cache[id] === null) {
			IE_all_cache[id] = document.all[id];
		}
		return IE_all_cache[id];
	};
}
// shelled functions for old javascript
function tog(){}
//
var DARK_COLOR = "black";
var LIGHT_COLOR = "white";
var TEMP = {};


//alert(document.domain);
//alert(self.location.hostname);

//add by esayr
//$ = document.getElementById;

 var d = ""; //declare d as a global variable
 var t = 80;
 var p = 0;
 function getObjects() {
 d = $( 'topicfloat' );
 //t =  20;      
 $( 'items' ).offsetTop + 20;
 }
 function ieFloat() {
 g = window.document.body.scrollTop;
 d.style.top = g;
 d.style.display = g>t ? "block" : "none";
 }
 function mozFloat() {
 g = window.pageYOffset;
 if( g!=p ) {
  d.style.top = g;
  d.style.display = g>t ? "block" : "none";
  p = g;
 }
 }
 try{
 loaddef += "getObjects(); ";
 loaddef += is_ie ? "document.body.onscroll = ieFloat; ieFloat(); " : "window.setInterval( 'mozFloat()', 100 ); ";
 resizedef += is_ie ? "ieFloat();" : "mozFloat();";
 }catch(e){alert(e)}

// if( loaddef != "" ){window.onload=new Function(loaddef);}
// if( resizedef != "" ){window.onresize = new Function(resizedef);}

if( loaddef != "" ) addEvent(window,"load",new Function(loaddef));
//{window.onload=new Function(loaddef);}
if( resizedef != "" ){window.onresize = new Function(resizedef);}

function addEvent(obj, evType, fn){
  if (obj.addEventListener){
	obj.addEventListener(evType, fn, true);
	return true;
  } else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
	return r;
  } else {
	return false;
  }
}

