function openAlbumPhoto (url, background, width, height)
{
    var containerId = "spin_album_feature";
    var contentId = "spin_album_feature_photo";
    var obj;

    if ( background )
	setBackground(background, width, height);

    obj = myGetElementById(containerId);
    if ( obj )
    {
	imgObj = myGetElementById (contentId);
	if ( imgObj )
	{
	    imgObj.innerHTML = "<IMG ALT='' SRC='" + url + 
		"' BORDER='0' WIDTH='" + width + "' HEIGHT='" + height + "'>";

	    obj.parentNode.style.visibility = "visible";
	    if ( obj.parentNode.MINIMIZED )
		restorePanel(obj.parentNode.dfObj);
	}
    }

    return false;
}

function openAlbumInfo (url, background, width, height)
{
    var contentId = "spin_album_albuminfo";
    var obj;

    if ( background )
	setBackground(background, width, height);

    obj = myGetElementById(contentId);
    if ( obj )
    {
	openLink(url, contentId);
	obj.parentNode.style.visibility = "visible";
	if ( obj.parentNode.MINIMIZED )
	    restorePanel(obj.parentNode.dfObj);
    }

    return false;
}

function popupVideo (id)
{
    url = "dancefloor-video-popup-" + id + ".php";
    popup (url, "video_popup", "width=380,height=315,menubar=0,titlebar=0,toolbar=0,location=0,scrollbars=0,resizable=0,status=no");
    return false;
}

function popupAudio (url, album, title)
{
    var murl;
//    var re = new RegExp(" ", "g");
//    url = url.replace (re, "_");

    murl = "/sampleplayer.html?murl=samples/" + escape (url) +
	"&malbum=" + escape (album) +
	"&mtitle=" + escape (title);

    popup (murl, "audio_popup", "width=241,height=78,menubar=0,titlebar=0,toolbar=0,location=0,scrollbars=0,resizable=0,status=no");
    return false;
}

/*
 * showSpinTip() - this shows where a link on the Album Nav link leads
 */
function showSpinTip (obj, tipStr, albumImg)
{
    var tipObj = myGetElementById('spinTip');
    var tipTextObj = myGetElementById('spinTipText');
    var objLeft, objTop;
    var newText = "";

    if ( ! tipObj || ! tipTextObj ) return;

    tipObj.obj = obj;

    if ( albumImg )
	newText += "<IMG ALT='' HEIGHT=60 WIDTH=60 SRC='up_images/"
	    + albumImg + "'><BR>";

    newText += tipStr;
    tipTextObj.innerHTML = newText;
    tipObj.style.display = "block";

    // i'm testing this part where i ignore (unset) whether the
    // current settings are based on bottom or right and
    // that results in being able use top/left for everything
    tipObj.style.bottom = "";
    tipObj.style.right = "";

    objLeft = getAbsOffset(obj, 'offsetLeft');
    objTop = getAbsOffset(obj, 'offsetTop');

    if ( tipObj.style.bottom )
	tipObj.style.bottom = pageHeight - objTop - 5;
    else
	tipObj.style.top = objTop - tipObj.offsetHeight + 5;

    if ( tipObj.style.right )
	tipObj.style.right = pageWidth - tipObj.offsetWidth - objLeft - 5 - 7;
    else
	tipObj.style.left = objLeft + 5 - 7;

    /*
    debug ("dbObj="+obj.getAttribute('ID')
	+ " tipObj.style.top=" + tipObj.style.top
	+ " offsetTop=" + objTop
	+ " offsetLeft=" + objLeft
	+ " tipTop=" + getAbsOffset(tipObj, 'offsetTop')
	+ " tipLeft=" + getAbsOffset(tipObj, 'offsetLeft')
	+ " tipWidth="  + tipObj.offsetWidth
	+ " tipHeight=" + tipObj.offsetHeight);
    */
}

// these icons are close together, so a mouseover the tip forces it to
// act as a mouseout on the parent icon
function spinTipMouseOver (tipObj) { if ( tipObj.obj ) tipObj.obj.onmouseout(); }
function spinTipMouseOut (tipObj) { if ( tipObj.obj ) tipObj.obj.onmouseout(); }
function spinTipClick (tipObj) { if ( tipObj.obj ) tipObj.obj.onclick(); }

/*
 * hideSpinTip() - this shows a little info about what is in a panel
 */
function hideSpinTip ()
{
    var tipObj = myGetElementById('spinTip');
    var tipTextObj = myGetElementById('spinTipText');
    if ( tipObj && tipTextObj )
    {
	tipObj.style.display = "none";
	tipTextObj.innerHTML = "";
    }
}

