function ajaxManager(){
	var args = ajaxManager.arguments;
	switch (args[0]){
		case "load":
			if(document.getElementById){
				var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
			}
			if(x){
				x.onreadystatechange = function(){
					if (x.readyState == 4 && x.status == 200){
						switch(args[2]){
							case 'properties':
								properties(x.responseText);
							break;
							case 'info':
								info(x.responseText);
							break;
							case 'image':
								image(x.responseText);
							break;
							case 'states':
								states(x.responseText);
							break;
							case 'suburbs':
								suburbs(x.responseText);
							break;
							case 'days':
								days(x.responseText);
							break;
							case 'do_suburbs':
								do_suburbs(x.responseText);
							break;
							case 'do_days':
								do_days(x.responseText);
							break;
							case 'do_prices':
								do_prices(x.responseText);
							break;
						}
					}else if(x.readyState == 4 && x.status == 404){
						alert("failed to find "+args[1]);
					}
				}
				x.open("GET", args[1],true);
				x.send(null);
			}
		break;
		case "start_up":
			ajaxManager('load', 'get_image.php?current_gallery='+args[1]+'&current_item='+args[2],'image');
			//ajaxManager('load', 'update.php?type=states','states');
			//ajaxManager('load', 'update.php?type=suburbs','suburbs');
		break;
	}
}
function image(Text){
	var upload_div = document.getElementById('image_div');
	if(upload_div){
		upload_div.innerHTML = Text;
	}else{
		alert("Upload failed");
	}
}


