var map_width = 450;
var map_height = 450;
var half_width = map_width / 2;
var half_height = map_height / 2;
var scale_default = 10;
var hourglass_count = 0;
	
function init() {
		// quit if this function has already been called
		if (arguments.callee.done) return;
		// flag this function so we don't do the same thing twice
		arguments.callee.done = true;
		// create the "page loaded" message 
		var http = getHTTPObject(); // We create the HTTP Object
		hourglass('init');
		toggleThemeLinks(0);
//		getMap();
//		getLegend();
		initDrag();
		}
		/* for Mozilla */
		if (document.addEventListener) {
			document.addEventListener("DOMContentLoaded", init, null);
		}
		/* for Internet Explorer */
		/*@cc_on @*/
		/*@if (@_win32)
			 document.write("<script defer src=javascripts/ie_onload.js><"+"/script>");
		/*@end @*/
		/* for other browsers */
// moved following code to index.php in order to incorporate other JS - 9/21/2007 Paul Esling
//		window.onload = init; 
	

function hourglass(status) {
	var hg = document.getElementById("hourglass");;
	if (status=='stop') {
		hourglass_count = hourglass_count - 1;
		if (hourglass_count<1) {
			hg.style.display='none';
			}
		}
	else if (status=='init') {
		hourglass_count = 0;
		hg.style.display='none';
		}
	else {
		hourglass_count = hourglass_count + 1;
		if (hourglass_count<2) {
			hg.style.display='block';
			}
		}
	}	

function getHTTPObject() {
  var xmlhttp;
/*@cc_on
  @if (@_jscript_version >= 5)
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  @else
    xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
