﻿function createXmlHttp() {
    var XmlHttp;
    try {
        XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
        try {
            XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (Error) {
            XmlHttp = null;
        }
    }
   
    
    
    return XmlHttp;

}

 


function AddItem(Text, Value, lst) {
    var opt = document.createElement("option");

    // Add an Option object to Drop Down/List Box
    lst.options.add(opt);        // Assign text and value to Option object
    opt.text = Text;
    opt.value = Value;

}

function ReplaceAll(Source, stringToFind, stringToReplace) {

    var temp = Source;
    var index = temp.indexOf(stringToFind);

    while (index != -1) {

        temp = temp.replace(stringToFind, stringToReplace);

        index = temp.indexOf(stringToFind);

    }

    return temp;

}