function ajax_request() {
	if(arguments.length < 1) {
		return false;
	}
	// Determine webpage for the AJAX call
	var webpage = window.location.protocol + "//" + window.location.host + window.location.pathname.replace('.php', '.ajax.php');
	
	// Add special case for detecting webadmin pages
	if(window.location.pathname.indexOf('/webadmin/') == -1) {
		
		// Add special case for detecting school pages
		if(window.location.pathname.indexOf('/school/') != -1) {
			webpage = window.location.protocol + "//" + window.location.host + '/school.ajax.php';
		}
		
		// Add special case for detecting pages
		if(window.location.pathname.indexOf('/pages/') != -1) {
			webpage = window.location.protocol + "//" + window.location.host + '/pages.ajax.php';
		}
	}
	
	// Code to account for example.com/sample/ defaulting to example.com/sample/index.php
	if(webpage.charAt(webpage.length - 1) == '/') {
		webpage += 'index.ajax.php';
	}
	
	// Load arguments
	var function_name = arguments[0];
	var html_id = (arguments[1]) ? arguments[1] : '';
	var argument_list = "function="+function_name+"&id="+html_id;
	// Load optional arguments
	if(arguments.length > 2) {
		for(var index=2; index<arguments.length; index++) {
			if(index == 2) {
				argument_list += "&args="+(arguments[index] + '').replace(/&/g, "<<amp>>");
			}
			else {
				argument_list += "__"+(arguments[index] + '').replace(/&/g, "<<amp>>");
			}
		}
	}
	
	// Special characters
	argument_list = argument_list.replace(/#/g, "<<pound>>");
	
	// Generate AJAX request
	ao = new AjaxObject101();
	ao.sndReq('get', webpage, argument_list.replace("'", "\'"));
}

//Created by Sean Kane (http://celtickane.com/programming/code/ajax.php)
//Feather Ajax v1.0.1
function AjaxObject101() {
	this.createRequestObject = function() {
		try {
			var ro = new XMLHttpRequest();
		}
		catch (e) {
			var ro = new ActiveXObject("Microsoft.XMLHTTP");
		}
		return ro;
	}
	this.sndReq = function(action, url, data) {
		if (action.toUpperCase() == "POST") {
			this.http.open(action,url,true);
			this.http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			this.http.onreadystatechange = this.handleResponse;
			this.http.send(data);
		}
		else {
			this.http.open(action,url + '?' + data,true);
			this.http.onreadystatechange = this.handleResponse;
			this.http.send(null);
		}
	}
	this.handleResponse = function() {
		if ( me.http.readyState == 4) {
			if (typeof me.funcDone == 'function') { me.funcDone();}
			var rawdata = me.http.responseText.split("||");
			for ( var i = 0; i < rawdata.length; i++ ) {
				var item = (rawdata[i]).split("=>");
				if (item[0] != "") {
					if (item[1].substr(0,3) == "%V%" ) {
						document.getElementById(item[0]).value = item[1].substring(3);
					}
					else {
						document.getElementById(item[0]).innerHTML = item[1];
						if(item[0] == "navigation") {
							Shadowbox.setup("a.iframe");
						}
					}
				}
			}
		}
		if ((me.http.readyState == 1) && (typeof me.funcWait == 'function')) { me.funcWait(); }
	}
	var me = this;
	this.http = this.createRequestObject();
	
	var funcWait = null;
	var funcDone = null;
}
