
function doRestrictSel() {
    
    var theRestrictEle = document.getElementById( "theRestrictId" );
    var theCategEle = document.getElementById( "theCategId" );
    
    var op1;
    if( theRestrictEle ) op1 = theRestrictEle.options[theRestrictEle.selectedIndex];
    
    if( theRestrictEle && op1.value >= 0 && theCategEle && op2.value >= 0 ) window.location.href = "atoz.php?restrict=" + op1.value + "&categ=" + op2.value;
    else if( theRestrictEle && op1.value >= 0 ) window.location.href = "atoz.php?restrict=" + op1.value;
    else window.location.href = "atoz.php";
}
            
function toggleMp3Service( theId ) {
    
    var theEle = document.getElementById( "mp3service" );
    
    if( theEle ) {
    
        if( theEle.className == "hidden" ) {
            
            theEle.className = "mp3service";
            if( theEle.src.search( /[?]id=/ ) == -1 ) {
            
                theEle.src += "?id=" + theId;
            }

        } else theEle.className = "hidden";
    }
}

var ajaxRequest = null;

function lateisbn( theId ) {
    
    if( ajaxRequest == null ) {
        
        try { ajaxRequest = new XMLHttpRequest(); }
        catch( e ) { try { ajaxRequest = new ActiveXObject( "Msxml2.XMLHTTP" ); }
            catch( e ) { try { ajaxRequest = new ActiveXObject( "Microsoft.XMLHTTP" ); }
                catch( e ) { ajaxRequest = null; }
            }
        }
    }
    
    if( ajaxRequest != null ) {
        
        ajaxRequest.open( "GET", "lateisbn.php?id=" + theId, true );
        ajaxRequest.onreadystatechange = lateisbnResponse;
        ajaxRequest.send( null );
    }
}

function lateisbnResponse() {
    
    if( ajaxRequest.readyState == 4 ) {
        
        if( ajaxRequest.status == 200 ) {
            
            var urls = ajaxRequest.responseXML.getElementsByTagName( "url" );
            if( urls.length == 1 ) {
            
                if( urls[0].firstChild ) {
                
                    var url = urls[0].firstChild.nodeValue;
                    var lateisbndiv = document.getElementById( "lateisbn_div" );
                    var lateisbnframe = document.getElementById( "lateisbn_frame" );
                    
                    if( lateisbndiv && lateisbnframe && url ) {
                        
                        lateisbndiv.className = "sidebar_container";
                        lateisbnframe.src = url;
                    }
                }
            }
        }
    }
}


