var mccdotnet = {}

mccdotnet.req = null;

mccdotnet.fetch_url = function(url,callback,error_callback) {

    if ( mccdotnet.req == null) {
        try { mccdotnet.req = new ActiveXObject("Msxml2.XMLHTTP"); } 
        catch(e) {}
    }
    if ( mccdotnet.req == null) {
	    try { mccdotnet.req = new ActiveXObject("Microsoft.XMLHTTP"); } 
        catch(e) {}
    } 
    if ( mccdotnet.req == null) {
	    try { mccdotnet.req = new XMLHttpRequest(); } 
        catch(e) { return null; }
    }

    var async = false;
    if (callback) {
        async = true;
    }
    
    if (async) {
        mccdotnet.req.onreadystatechange = function() {
	        if (mccdotnet.req.readyState==4) {
		        if (mccdotnet.req.status == 200) {
		            callback(mccdotnet.req.responseText);	   
	            }
            }
        }
    }

    mccdotnet.req.open("get",url,async);
    mccdotnet.req.send("");
    if (!async) {
        return mccdotnet.req.responseText;
    }
}


