function getXMLHTTP() { //fuction to return the xml http object
        var xmlhttp=false;
        try{
            xmlhttp=new XMLHttpRequest();
        }
        catch(e)    {
            try{
                xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e){
                try{
                req = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch(e1){
                    xmlhttp=false;
                }
            }
        }

        return xmlhttp;
    }



    function getArtist(stURL,a) {
    //alert(a);
    var a=a;
    var strURL="/lyrics/admin/findartist.php?alphatype="+stURL;

        var req = getXMLHTTP();

        if (req) {

            req.onreadystatechange = function() {
                if(req.readyState != 4)
                {
                    document.getElementById('artdiv').innerHTML = '<select disabled><option>Please Wait...</option></select>' ;
                }
                else if (req.readyState == 4) {

                    // only if "OK"
                    if (req.status == 200) {
//                    alert(document.getElementById('citydiv').innerHTML);
                        document.getElementById('artdiv').innerHTML=req.responseText;
                    } else {
                        alert("There was a problem while using XMLHTTP:\n" + req.statusText);
                    }
                }
            }
            req.open("GET", strURL, true);
            req.send(null);
        }
        if(a==1){
        getAlbum('');
        }

    }

function getAlbum(stURL) {
    //alert(stURL+'aa');
var strURL="/lyrics/admin/findalbum.php?artist="+stURL;
//alert(strURL);
        var req = getXMLHTTP();

        if (req) {

            req.onreadystatechange = function() {
                 if(req.readyState != 4)
                {
                    document.getElementById('albdiv').innerHTML = '<select disabled><option>Please Wait...</option></select>' ;
                }
                else if (req.readyState == 4) {

                    // only if "OK"
                    if (req.status == 200) {
//                    alert(document.getElementById('citydiv').innerHTML);
    //getCity('categorytype=""');
                        document.getElementById('albdiv').innerHTML=req.responseText;

                    } else {
                        alert("There was a wwproblem while using XMLHTTP:\n" + req.statusText);
                    }
                }



            }
            req.open("GET", strURL, true);
            req.send(null);
        }

    }
    function getart(strURL) {

        var req = getXMLHTTP();

        if (req) {

            req.onreadystatechange = function() {
                 if(req.readyState != 4)
                {
                    document.getElementById('all').innerHTML = 'Please wait... ' ;
                }
                else if (req.readyState == 4) {

                    // only if "OK"
                    if (req.status == 200) {
                    //alert(document.getElementById('all').innerHTML);
                        document.getElementById('all').innerHTML=req.responseText;
                    } else {
                        alert("There was a problem while using XMLHTTP:\n" + req.statusText);
                    }
                }
            }
            req.open("GET", strURL, true);
            req.send(null);
        }

    }
