/* Blues Access Javascript Library */

/* Function that swaps images in rollovers. */

function di20(id, newSrc) {
    var theImage = FWFindImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}

/* Functions that track and set toggle group button states. */

function FWFindImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FWFindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

// Opens BluesGoGaGa remote window

function OpenGaga(url) {
     var winOpts = 'toolbar=0,location=0,directories=0,'
     + 'status=0,menubar=0,scrollbars=0,'
     + 'resizable=0,width=200,height=300';
     GagaWin = window.open(url,'PlayWin',winOpts);
}


// Song timing function
// updates the current playing song display

function songTimer(stationName)
{
    now = new Date();
    document.Artist.src = "http://www.gogaga.com/onNowArtist.php3?stationName="+stationName+"&time="+now.getTime();
    document.Song.src = "http://www.gogaga.com/onNowSong.php3?stationName="+stationName+"&time="+now.getTime();
    document.Album.src = "http://www.gogaga.com/onNowAlbum.php3?stationName="+stationName+"&time="+now.getTime();
    document.Label.src = "http://www.gogaga.com/onNowLabel.php3?stationName="+stationName+"&time="+now.getTime();
    setTimeout("songTimer('"+stationName+"')", 30000);
}

// Open the Links Window

function OpenLink(url,width,height) {
    var winOpts = 'toolbar=0,location=0,directories=0,'
               + 'status=1,menubar=0,scrollbar=0,'
               + 'resizable=0,width=635,height=432'; 
    RemoteWin = window.open(url,'LinkWin',winOpts);
}

// Open a 300x300 Window

function Open300(url) {
    var winOpts = 'toolbar=0,location=0,directories=0,'
               + 'status=0,menubar=0,scrollbar=0,'
               + 'resizable=0,width=300,height=300'; 
    var width =
    RemoteWin = window.open(url,'300Win',winOpts);
}

