// declare new variables for each new div that you add, and link to the div by ID
// var region_div = document.getElementById("region_div");

var req = null;

function InitXMLHttpRequest() {
	// Make a new XMLHttp object
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function SelectForm(id_form, destination){

    if (id_form != '') {
	InitXMLHttpRequest();
	// Load the result from the response page
	if (req) {
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				destination.innerHTML = req.responseText;
			} else {
				destination.innerHTML = "<font class='text'>&nbsp;Loading data...</font>";
			}
		}
		req.open("GET", "joint_ajax.php?fid=" + id_form, true);
		req.send(null);
	} else {
		destination.innerHTML = 'Browser unable to create XMLHttp Object';
	}
    }
    else {
    	destination.innerHTML = "Form is not selected";
    }
}

