
function ajax_httprequest(str_requesturl, str_nextfunction, str_layerid, str_postvars) {
   //alert('hreq');
   var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
	
	var xmlHR_extendsession = false;
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            xmlHR_extendsession = new XMLHttpRequest();
            if (xmlHR_extendsession.overrideMimeType) {
                xmlHR_extendsession.overrideMimeType('text/xml');
            }
        } else if (window.ActiveXObject) { // IE
            try {
                xmlHR_extendsession = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xmlHR_extendsession = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }
	
	
	if (!xmlHR_extendsession) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
    xmlHR_extendsession.open('POST', str_requesturl, true);
    xmlHR_extendsession.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHR_extendsession.onreadystatechange = function() {
		if (xmlHR_extendsession.readyState == 4) {
			eval(str_nextfunction+'(str_layerid,xmlHR_extendsession.responseText)');
		}
    }
    xmlHR_extendsession.send(str_postvars+'&layerid='+str_layerid);
}

//timer_extend_session = setTimeout('ajax_httprequest('ajax_clickmenu_icon_showicons');',1000);

function ajax_alert_response(strLayer, strResponseText)
{
	alert(strResponseText);
}
function refresh_page(strLayer, strResponseText)
{
	window.location.reload(true);
}
