function cRqObj () {
 			var A;
			try {
				A=new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					A=new ActiveXObject("Microsoft.XMLHTTP");
				} catch (oc) {
					A=null;
				}
			}
			if(!A && typeof XMLHttpRequest != "undefined")
				A = new XMLHttpRequest();
			if (!A)
				alert('ikke noGET XMLHttpRequest !');
			return A;
}


var http = cRqObj(); // skal decl foer kald xhreq()

/* Function called to GET the product categories list */
function xhreq(serverstr,handleFunc){


	/* Create the request. The first argument to the open function is the method (POST/GET),
		and the second argument is the url... 
		document contains references to all items on the page
		We can reference document.form_category_select.select_category_select and we will
		be referencing the dropdown list. The selectedIndex property will give us the 
		index of the selected item. 
	*/

	//http.open('GET','http://paula/jo/XMLHttpReq/xhrdb.php?valg=' + document.form1.tbox.value);
	http.open('GET',serverstr,true);

	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	//http.onreadystatechange = handleProducts; 

	http.onreadystatechange = handleFunc; 

	/* Send the data. We use something other than null when we are sending using the POST
		method. */
	http.send(null);

	/* send som POST
	http.abort;
	http.open('post',  'back_end.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1=val1&arg2=val2&arg3=val3');	
	
	*/

}

function xhreqpost(serverstr,handleFunc,str,fil,iskabelon0,ipw0) {
	//httpp.abort; NB duer i moz, ikke i ie
	//httpp.abort;
	httpp.open('post', serverstr,true);
	//alert("xhreqpost");
	httpp.onreadystatechange = handleFunc; 
	httpp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	httpp.send('menuxml=' + str + "&fil=" + fil + "&iskabelon=" + iskabelon0 + "&ipw=" + ipw0);	

}
