// --------------------------------------------------------------------------------------------------------------------------------

function stateChanged() {
	alert("gothere");
    // only if req shows "loaded"
	var temp=xmlHttp.readyState;
	alert("temp is "+temp);
    if (temp == 4) {
        // only if "OK"
        alert("status "+xmlHttp.status);
        if (xmlHttp.status == 200 || xmlHttp.status == 0 ) {
        	document.getElementById("tree_main").innerHTML=xmlHttp.responseText;
        } else {
            alert("There was a problem retrieving the XML data:\n" +
                xmlHttp.statusText+ "\nstatus: "+ xmlHttp.status);
        }
    }
}

function stateChanged_newProduct() {
    // only if req shows "loaded"
	var temp=xmlHttp.readyState;
    if (temp == 4) {
        // only if "OK"
        if (xmlHttp.status == 200 || xmlHttp.status == 0 ) {
        	document.getElementById("main_panel").innerHTML=xmlHttp.responseText;
        } else {
            alert("There was a problem retrieving the XML data:\n" +
                xmlHttp.statusText+ "\nstatus: "+ xmlHttp.status);
        }
    }
}

var ajaxObjects = new Array();
/*
function saveMyTree()
{
		saveString = treeObj.getNodeOrders();
		var ajaxIndex = ajaxObjects.length;
		ajaxObjects[ajaxIndex] = new sack();
		var url = 'bin/saveNodes.php?saveString=' + saveString;
		//alert(url);
		ajaxObjects[ajaxIndex].requestFile = url;	// Specifying which file to get
		ajaxObjects[ajaxIndex].onCompletion = function() { saveComplete(ajaxIndex); } ;	// Specify function that will be executed after file has been found
		ajaxObjects[ajaxIndex].runAJAX();		// Execute AJAX function			
	
}
*/
function saveComplete(index)
{
	alert(ajaxObjects[index].response);	
}



