function xmlhttpPost(strURL, strSubmit, strResultFunc,showloading) {
   var xmlHttpReq = false;
	var browser = navigator.appName;
//alert('fdf');

	if(browser == "Microsoft Internet Explorer"){
			xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			xmlHttpReq = new XMLHttpRequest();
		}


	xmlHttpReq.open('POST', strURL, true);
	xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xmlHttpReq.onreadystatechange = function() {
	if (xmlHttpReq.readyState == 4) {
           strResponse = xmlHttpReq.responseText;
		  // alert('aa'+strResponse);

           switch (xmlHttpReq.status) {
                   // Page-not-found error
                   case 404:
                           alert('Error: Not Found. The requested URL ' +  strURL + ' could not be found.');
						break;
                   // Display results in a full window for server-side errors
                   case 500:
                           handleErrFullPage(strResponse);
                           break;
                   default:
                           // Call JS alert for custom error or debug messages
                           if (strResponse.indexOf('Error1:') > -1 || 
                                   strResponse.indexOf('Debug:') > -1) {
                                   alert(strResponse);
                           }
                           // Call the desired result function
                           else {
							   //alert(strResponse);
							   //return false;
                                 eval(strResultFunc + '(strResponse);');
                           }
                           break;
           }
   }
 }	

/**/
	if(showloading==null){

			showloading=true;
	}

	var objBody = document.getElementById('ajaxManager');
	var objOverlayBody = document.getElementById('contaner');
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id','newOverlay');
	objOverlay.style.position = 'absolute';
	objOverlay.style.textAlign = 'center';
	objOverlay.style.verticalAlign = 'middle';
	objOverlay.style.width = screen.width;
	objOverlay.style.height = screen.height;
	objOverlay.style.zIndex = 99999;
	objOverlay.style.left=0;
	objOverlay.style.top=0;
	objOverlay.style.filter = 'alpha(opacity=50)';
	objOverlay.style.opacity = 0.5;
	objOverlay.style.backgroundColor="#ffffff";
	objOverlayBody.insertBefore(objOverlay, objOverlayBody.firstChild);
	objOverlay.style.display = 'block';
	//alert(objOverlayBody.clientWidth);
	//alert(screen.width);
		//alert('ff');

if(showloading){
		//alert('aa');

    document.getElementById("newOverlay").innerHTML = '<table  width="'+screen.width+'"  height="'+screen.height+'"  border="0" ><tr><td align="center" valign="middle"><img src="images/ajax-loader.gif"></td></tr></table>';
	window.scroll(0,0);
	//alert('aavvv');
	//alert(document.getElementById("newOverlay").value);
	//document.getElementById("overlay").style.display='none';
	}

/**/
  xmlHttpReq.send(strSubmit);

}

function handleErrFullPage(strIn) {
        var errorWin;
        // Create new window and display error
        try {
                errorWin = window.open('', 'errorWin');
                errorWin.document.body.innerHTML = strIn;
        }
        // If pop-up gets blocked, inform user
        catch(e) {
                alert('An error occurred, but the error message cannot be' +
                        ' displayed because of your browser\'s pop-up blocker.\n' +
                        'Please allow pop-ups from this Web site.');
        }
}


