

function ajaxLaunch(url,retfnc) {
    ifrm = document.createElement("IFRAME");
    var id = guidGenerator();


    ifrm.id = id;
    if (retfnc != undefined) {
        var x = (url.indexOf("?"));
        if (x > 0) {
            url = url + '&';
        }
        else {
            url = url + '?';
        }
        url = url + 'retfnc=' + retfnc;
    }

    var x = (url.indexOf("?"));
    if (x > 0) {
        url = url + '&';
    }
    else {
        url = url + '?';
    }
    url = url + "ajaxid=" + id + "";
        
    ifrm.setAttribute("src", url);
    ifrm.style.width = 1 + "px";
    ifrm.style.height = 1 + "px";
    ifrm.style.visibility = "hidden";
    ifrm.className = "Hidden";
    document.body.appendChild(ifrm);

    /*
    oHead = ifrm.document.getElementsByTagName('head')[0];
    var h = "";
    //h = h + "parent.ajaxClose('" + id + "');";
    h = h + "function scriptLoaded(){";
    h = h + "alert('woot');}";
    

    var newScript = ifrm.document.createElement('script');
    newScript.type = 'text/javascript';
    newScript.onload = scriptLoaded;
    newScript.src = h;
    oHead.appendChild(newScript);
    alert(newScript);           
    // ifrm.document.write(h);
    */


}

function ajaxClose(id) {
    var obj = document.getElementById(id);
    if (obj != null) {
        // Destroy the ajax object        
        document.body.removeChild(obj);        
    }
}


//function guidGenerator() { var S4 = function () { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); }
function guidGenerator() { var S4 = function () { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; return (S4() + S4()  + S4()  + S4()  + S4() + S4() + S4() + S4()); }

