<!--
	/* 
		DirtyKnickersOnline DOM JavaScript Document
		January 2007
		Mike Hearfield
	*/

	// allow multiple window.onload calls
	function addLoadEvent(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				if (oldonload) {
					oldonload();
				}
				func();
			}
		}
	}
	
	//XMLHTTP code from somewhere on the web
	
	var url = "updateMenu.php"; // The server-side script 

	function handleHttpResponse() {
		if (http.readyState == 4) { // Split the comma delimited response into an array  
// uncomment if you want to see the echos from the PHP
//			alert("http.responseText: "+http.responseText); 
		}
	}
	
	function updateMenu(action,id) {
//		alert("action: "+action+" - id: "+id);
		http.open("GET", url + "?action=" + escape(action) + "&id="+ escape(id), true); 
		http.onreadystatechange = handleHttpResponse; 
		http.send(null);
	 }

	function getHTTPObject() {
		var xmlhttp;
		
		var activeXObjects = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0',
		'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'];
		for(var i=0; i<activeXObjects.length; i++){
				try{
						var xmlhttp = new ActiveXObject(activeXObjects[i]);
				}catch(err){}
		}

		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			try {
				xmlhttp = new XMLHttpRequest();
			} catch (e) {
				xmlhttp = false;
			}
		}
	
		return xmlhttp;
	
	}
	
	var http = getHTTPObject(); // We create the HTTP Object


//-->