
function mtsb_weatherapi_loadWidget( elem, widget ) {

    var xmlHttp = null,
        url, node;

    url = '?eID=tx_mtsbweatherapi_getwidget&id=' + widget;
    node = document.getElementById( elem )
    if ( node ) {
        try { xmlHttp = new XMLHttpRequest(); } catch(e) {
            try { xmlHttp  = new ActiveXObject( "Microsoft.XMLHTTP" ); } catch(e) {
                try { xmlHttp  = new ActiveXObject( "Msxml2.XMLHTTP" ); } catch(e) {
                    xmlHttp  = null; } } }
        if ( xmlHttp ) {
            xmlHttp.open( 'GET', url, true );
            xmlHttp.onreadystatechange = function () {
                if ( xmlHttp.readyState == 4 ) {
                    node.innerHTML = xmlHttp.responseText;
                }
            };
            xmlHttp.send( null );
        }
    }
}

