function makeRequest(func, parms) {
    var httpRequest;

    if (window.XMLHttpRequest) { // Mozilla, Safari, ...
        httpRequest = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
        try {
            httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }
    if (!httpRequest) {
        return false;
    }
    httpRequest.onreadystatechange = function() { alertContents(func,httpRequest); };
    httpRequest.open("GET", "/asyn.aspx?f="+ func +"&p="+ parms, true);
    httpRequest.send(null);

}
function alertContents(func,httpRequest) {    
    if (httpRequest.readyState == 4) {
        if (httpRequest.status == 200) {           
            var data = httpRequest.responseText;
            if(data.length>0) {
				writeit("","divtipafriend3");
	            writeit("","divtipafriend3");
	            writeit("","divtipafriend1");
	            writeit("","divtipafriend2");
				
				
				var dataArr = data.split(';');                
                if(func=="taf" || func=="shl") {
					if(dataArr[0]=="YES") writeit("* E-Mail afsendt","divtipafriend3");
	                if(dataArr[0]=="NO") writeit("* E-Mail ikke afsendt","divtipafriend3");
	                if(dataArr[0]=="IAM") writeit("* Afsender Email ugyldig","divtipafriend1");
	                if(dataArr[0]=="IMM") writeit("* Modtager E-Mail Ugyldig","divtipafriend2");
                }                            
            }      
        } else {
            alert('Fejl:'+ httpRequest.status);
        }
    }    
}