//    To use this script, simply define the first or both variables below...

 var image = "images/banners/tm.gif"     // The path to & name of the image.
 var link  = "";                 //Link URL, if want the image to be a link.



//This sets the default image to the Torgo logo only if you don't change the
//path above.
try {
	if( image == "path/to/image" || image == "path/to/image.gif" ) {
		image = "http://www.torgo.org/media/images/other/floater.gif";
		link  = "http://www.torgo.org/";
	}

	document.write('<DIV ID="float_pane" STYLE="position:absolute;visibility:hidden">\n');
	if( link != "" )
		document.write('<A HREF="' + link + '">');
	document.write('<IMG SRC="' + image + '" BORDER="0">');
	if( link != "" )
		document.write('</A>');
	document.write('\n</DIV>');

	var fl_oTop, fl_oLeft, fl_tTop, fl_tLeft, fl_tHeight, fl_tWidth, fl_tShow;
	var fl_cHeight = 0;
	var fl_cWidth = 0;
	

	function checkAgent(_agent) {
		return( navigator.userAgent.toLowerCase().indexOf(_agent.toLowerCase()) != -1 );
	}
	function isMozilla() {
		return navigator.userAgent.lastIndexOf("/") == (navigator.userAgent.indexOf('Gecko/') + 5)
	}

	function getTop() {
		eval( "var _result = parseInt(" + fl_tTop + ")" );
		return _result;
	}
	function getLeft() {
		eval( "var _result = parseInt(" + fl_tLeft + ")" );
		return _result;
	}

	function setTop(_value) {
		eval( fl_tTop + " = _value" );
	}
	function setLeft(_value) {
		eval( fl_tLeft + " = _value" );
	}

	function floatRefresh() {
		getValues();
		fl_oTop = getTop() - (fl_cHeight + document.body.scrollTop - (  eval(fl_tHeight) + 3 ));
		fl_oLeft = getLeft() - (fl_cWidth + document.body.scrollLeft - (  eval(fl_tWidth) + 3 ));
		if( fl_oTop < 0)
			setTop(getTop() + 1 + (Math.round(Math.abs(getTop() - (fl_cHeight + document.body.scrollTop - (  eval(fl_tHeight) ))) / 10)));
		if(  fl_oTop > 0 )
			setTop(getTop() - ( 1 + (Math.round(Math.abs(getTop() - (fl_cHeight + document.body.scrollTop - (  eval(fl_tHeight) ))) / 10))));
		if( fl_oLeft < 0)
			setLeft(getLeft() + 1 + (Math.round(Math.abs(getLeft() - (fl_cWidth + document.body.scrollLeft - (  eval(fl_tWidth) ))) / 10)));
		if(  fl_oLeft > 0 )
			setLeft(getLeft() - (1 + (Math.round(Math.abs(getLeft() - (fl_cWidth + document.body.scrollLeft - (  eval(fl_tWidth) ))) / 10))));
	}
	function getValues() {
		if( checkAgent("Safari") ) {
			fl_cHeight = document.clientHeight;
			fl_cWidth = document.clientWidth;
			fl_tTop = "float_pane.style.pixelTop";
			fl_tLeft = "float_pane.style.pixelLeft";
			fl_tHeight = "float_pane.offsetHeight";
			fl_tWidth = "float_pane.offsetWidth";
			fl_tShow = "float_pane.style.visibility = 'visible'";
		} else if( checkAgent("MSIE") ) {
			fl_cHeight = document.body.clientHeight;
			fl_cWidth = document.body.clientWidth;
			fl_tTop = "float_pane.style.pixelTop";
			fl_tLeft = "float_pane.style.pixelLeft";
			fl_tHeight = "float_pane.offsetHeight";
			fl_tWidth = "float_pane.offsetWidth";
			fl_tShow = "float_pane.style.visibility = 'visible'";
		} else if( checkAgent("FireFox") || isMozilla()) {
			fl_cHeight = document.body.clientHeight;
			fl_cWidth = document.body.clientWidth;
			fl_tTop = "float_pane.style.top";
			fl_tLeft = "float_pane.style.left";
			fl_tHeight = "float_pane.offsetHeight";
			fl_tWidth = "float_pane.offsetWidth";
			fl_tShow = "float_pane.style.visibility = 'visible'";
		} else if( checkAgent("Netscape") ) {
			fl_cHeight = document.body.clientHeight;
			fl_cWidth = document.body.clientWidth;
			fl_tTop = "document.getElementById('float_pane').style.top";
			fl_tLeft = "document.getElementById('float_pane').style.left"
			fl_tHeight = "document.getElementById('float_pane').offsetHeight";
			fl_tWidth = "document.getElementById('float_pane').offsetWidth";
			fl_tShow = "document.getElementById('float_pane').style.visibility = 'visible'";
		}
	}

	getValues();
	if( fl_cHeight && fl_cWidth ) {
		setLeft(fl_cWidth + document.body.scrollLeft - (  eval(fl_tWidth) + 3 ));
		setTop(fl_cHeight + document.body.scrollTop - (  eval(fl_tHeight) + 3 ));
		eval(fl_tShow);
		setInterval("floatRefresh()",5);
	}
} catch(e) {}