﻿function picUpload(this_form,filenum) {
	alert('start ' + this_form);
	alert(this_form.elements['new_image_file_' + filenum].value);
	var xhri = xhrRequest('html');
	var qry = '';
	//alert("qry = " + qry);
	var url = 'php/pic_uploader.php';
	xhr[xhri].open('POST', url, true);
	xhr[xhri].onreadystatechange = function () {
			if (xhr[xhri].readyState == 4 && xhr[xhri].status == 200) {
				theElementId = "search_content";
				elementToShow = document.getElementById(theElementId);
				alert("update page");
				elementToShow.innerHTML = xhr[xhri].responseText;
				alert("done");
			} else {
				try {
					var alertStr = "xhr[xhri].readyState=" + xhr[xhri].readyState + " xhr[xhri].status=" + xhr[xhri].status;
					//alert(alertStr);
				}
				catch (e) {
					var alertStr = "error getting xhr[xhri].readyState and xhr[xhri].status";
					//alert(alertStr);
				}
			}
		};
	xhr[xhri].setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xhr[xhri].send(qry);
}