Hey this is my java script it works fine in FF , but in IE it shows type mismatch error .It shows my innerhtml page and also runs my script but i want to remove the type mismatch error would really appreciate your help.Thank you .

Here is my javascript function

function submitForm(){

// create request
var xmlhttp = null;
var serverhttp=null;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
serverhttp=new XMLHttpRequest();
if ( typeof xmlhttp.overrideMimeType != 'undefined') {
xmlhttp.overrideMimeType('text/xml');
serverhttp.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
serverhttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert('Perhaps your browser does not support xmlhttprequests?');
return;
}


// submit in JSON notation
var email = document.customer.elements[0].value;
var companyName = document.customer.elements[1].value
var input = '{email:"'+email+'",company_name:"'+companyName+'"}';
var url = "URL";
var cgi = "URL/script.cgi";
xmlhttp.open('POST',url,true);
//serverhttp.open('POST',url,true);
// show feedback
xmlhttp.onreadystatechange = function (aEvt) {
var newDiv = document.createElement("div");
newDiv.innerHTML = "<b>Thank You!</b>";
//type mismatch occures over here
document.body.replaceChild(newDiv,document.customer);
serverhttp.open('POST',cgi,true);
serverhttp.send(companyName);
}
xmlhttp.send(input);
}