// Configuration options
var contentprefix = 'menu/';
var ajaxdivid = 'content';
var linksdivid = 'prevnextbox';
var wrapprev = false;
var wrapnext = false;
var changelinks = false;

// General Purpose Variables
var currentpage;
var receiveReq;
var numberofpages;

function initAjax() {
	receiveReq  = getXmlHttpRequestObject();
	getNumberofPages();
	currentpage = 1;
	getResponse(ajaxdivid,false,1);
}

function getXmlHttpRequestObject() {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				xmlhttp = null;
			}
		}

		if (! xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				xmlhttp = new XMLHttpRequest();
			} 
		}
		return xmlhttp;
}

function getNumberofPages(){
	numberofpages = 2;
	return false;
}


function getResponse(thediv,c_or_l,what) {


	if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
		myRand=parseInt(Math.random()*99999999);  // cache buster
		if(c_or_l == true){
		receiveReq.open("GET", contentprefix + currentpage +'.html?rand='+myRand, false);
		}else{
		receiveReq.open("GET", contentprefix + what +'.html?rand='+myRand, false);
		}
		receiveReq.send(null);
		if (receiveReq.status == 200) {
		document.getElementById(thediv).innerHTML = receiveReq.responseText;
		}
	}
}


function blockSubmit(str) {
	currentpage = str;
	getResponse(ajaxdivid,true,null);
	return false;
}

