//********** gup, Get URL Parameters **********
//http://www.netlobo.com/url_query_string_javascript.html
function gup(variable) { 
	variable = variable.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+variable+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if( results == null ) {
		return "";
	}
	else {
		return results[1];
	}
}

//********** Main Body Retrieving Function **********
function getBody(page) {
	//When page is passed in URL to be opened, use it, and if page in URL is already open, ignore it
	if (gup("page") && "http://zoastertech.com/index.html?page=" + gup("page") != window.location) {
		page = gup("page");
	}
	var xmlhttp;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	} 
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
			} catch (e) {
			xmlhttp=false;
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	xmlhttp.open("GET", page,true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			divBody = document.getElementById("body");
			divBody.innerHTML = xmlhttp.responseText;
		}
 	}
	xmlhttp.send(null)
}
