// Executed when the first page is loaded. Set the xmlhttp object correctly, depending on the browser.
// Check if we are using IE.
try {
	//If the javascript version is greater than 5.
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	//If not, then use the older active x object.
	try { 
		//If we are using IE.
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		//Else we must be using a non-IE browser.
		xmlhttp = false;
	}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp = new XMLHttpRequest();
}      



// Move the button back to the left when the cursor leaves the button. 
function moveleft(obj) {
	obj.style.left = '20px';
}

// Move the button to the right when the cursor is over the button.
function moveright(obj) {
	obj.style.left = '10px';
}


// Load the corresponding page when a button is clicked. It uses AJAX.
function linkto(page) {
	var obj = document.getElementById("content_holder");
	xmlhttp.open("GET", page);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			//obj.innerHTML = xmlhttp.responseText;  // Works only if not IE
			
			var temp = document.createElement("div");
			temp.innerHTML = xmlhttp.responseText;
			if(obj.hasChildNodes())
			  obj.replaceChild(temp.firstChild, obj.firstChild);
			else
		      obj.appendChild(temp.firstChild);
			//posfooter();
			
			if(page=="spots.htm")
		        loadSpotMaps();
		}
	}
	xmlhttp.send(null);
}



// Not used  
function posfooter() {
	var contentHeight = parseInt(document.getElementById("content").style.height);
	document.getElementById("footer").style.top = (contentHeight + 300).toString() + 'px';
;}