function loadXMLDoc(module, put_vars) {
	var url="index_ajax.php?module="+module;
	var req = new Subsys_JsHttpRequest_Js();
	req.onreadystatechange = function() {
		if (req.readyState == 4) {
			if (req.responseJS) {
				for (var id in req.responseJS) {
					if (document.getElementById(id)) {
						document.getElementById(id).innerHTML = req.responseJS[id];
					}
				}
			}
			if (document.getElementById('debug')) {
				document.getElementById('debug').innerHTML = req.responseText;
			}
		}
	}
	req.caching = true;
	req.open('POST', url, true);
	req.send(put_vars);
}

function hashFormFields(of) {
	var hsh = new Object();
	for(var i=0;i<of.length;i++) {
		var sb=of[i].name;
//		alert([of[i].type,of[i].name,of[i].value]);
		if(!(/submit/i.test(of[i].type))) {
			if((/checkbox/i.test(of[i].type))) {
				if(of[i].checked) {
					hsh[sb]=of[i].value;
				}
			} else {
				hsh[sb]=of[i].value;
			}
		}
	}
	return hsh;
}

function clearFormFields(of) {
	for(var i=0;i<of.length;i++) {
		var sb=of[i].name;
//		alert([of[i].type,of[i].name,of[i].value]);
		if(!(/submit/i.test(of[i].type)) && !(/hidden/i.test(of[i].type))) {
			if((/checkbox/i.test(of[i].type))) {
				if(of[i].checked) {
					of[i].checked = false;
				}
			} else {
				of[i].value = 0;
			}
		}
	}
	return false;
}