//     ********************************************************* 
//     * You may use this code for free on any web page provided that 
//     * these comment lines and the following credit remain in the code.
//     * TopLeft Floating Div from http://www.javascript-fx.com
//     ********************************************************
function JSFX_FloatTopLeft()
{
	var startX = 0;
	var startY = 0;
	
	// (1)
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	var px = document.layers ? "" : "px";

	// (3)
	function ml(id)
	{
		// if specific div id exist, grab the specific div, else...
		var el = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		
		// if array of layers exists, set specific div style
		if(d.layers)el.style = el;
		
		// function to set specific div position to new x & y
		el.sP = function(x,y){ this.style.left=x+px; this.style.top=y+px; };
		
		el.x = startX; el.y = startY;
		
		return el;
	}

	// (5)
	window.stayTopLeft = function()
	{
		// if not netscape/firefox, get pageYOffset (y position of current page with relation to upper left corner of window display area)
		// if IE
		//var pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
		
		var pY, maplistY;
		
		if (ns) {
			pY = pageYOffset;	
		}
		else {
			
			if (document.documentElement && document.documentElement.scrollTop) {
				pY = document.documentElement.scrollTop;
			}
			else {
				pY = document.body.scrollTop;
			}
		}
		
		maplistY = document.getElementById('map_list').offsetTop;
			
		//document.getElementById('testmap').innerHTML = '('+pY + ' + ' + startY + ' - ' + ftlObj.y +') ' + ' ***** ' + maplistY;		
		
		//ftlObj.y += (pY + startY - ftlObj.y)/8;	
		if (pY <= maplistY) {
			ftlObj.y += (startY - ftlObj.y) / 8;
		}
		else {
			ftlObj.y += ((pY + startY - ftlObj.y - (maplistY-20))) / 8;	
		}

		ftlObj.sP(ftlObj.x, ftlObj.y);	
	
		// (6)
		setTimeout("stayTopLeft()", 40);		
		
	}
	
	// (2)
	ftlObj = ml("map_display");
	
	// (4)
	stayTopLeft();
}

function sbar(st) {
	document.getElementById("t"+st).style.color = '#FF8A00';
	//st.style.fontWeight = 'bold';
	//st.style.border = '1px solid #666666';
}

function cbar(st) {
	document.getElementById("t"+st).style.color = '';
	//st.style.fontWeight = 'normal';
	//st.style.border = '';
	//st.style.borderBottom = '1px solid #cccccc';
}

function PrintContent(id)
{
	var DocumentContainer = document.getElementById('dp'+id);
	var WindowObject = window.open('', 'dp'+id, "width=500,height=500,top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=no");
	
	WindowObject.document.writeln(DocumentContainer.innerHTML);
	WindowObject.document.close();
	WindowObject.focus();
	WindowObject.print();
	WindowObject.close();
}
