var newwin = null ;
var menubar = 'null' ;
var scroll_bars = 'null' ;

function display_small(window_name,ih,iw,menubar,scroll_bars)
{

oh = ih + 80 ;
ow = iw + 40 ;

// make sure any existing instance of the window is closed first

if ( ( newwin != null )
     && !newwin.closed )
 {
       newwin.close();
 }

// set up options

opt1 = 'toolbar=no,menubar='+menubar+',directories=no,location=no,resizeable=no' ;
size = 'innerHeight='+ih+',outerHeight='+oh+',innerWidth='+iw+',outerWidth='+ow;
oldsize = 'height='+oh+',width='+ow ;
position= 'screenX=100,screenY=100,left=100,top=100' ;
other= 'scrollbars='+scroll_bars ;

options = opt1+','+size+','+other+',' +oldsize +',' +position;

// open the window

newwin = open(window_name,'mydoc',options) ;

//move the focus to the new window

newwin.focus() ;

}

function remove_small() 
{
if ( newwin != null ) newwin.close() ;
}



function swap(text) 
{

window.status='Relationship begins -- Ash & Luke Stanley-Ryan are ' + text ;

}

function swapback()
{

window.status= ' ' ;

}

/************ TOOLTIP HANDLER ****************/
var timerID = null;
// avoid error of passing event object in older browsers
if (!document.layers && !document.all) event = "none";

function showToolTip(sTipText, sBGColor, sFontFace, sSize, e) {
    if (document.layers) { // Netscape 4.7x
        var ToolTip = document.layers.tooltip;
        var ToolTipDoc = ToolTip.document;
        ToolTipDoc.open();
        ToolTipDoc.write('<body><div id="tt" style="position:absolute;border:solid;border-width:1;border-color:#000000;layer-background-color:'
+ sBGColor + ';">');
        ToolTipDoc.write('<font face="' + sFontFace + '" size="' + sSize +
'">' + sTipText);
        ToolTipDoc.write('</font></div></body>');
        ToolTipDoc.close();
        ToolTip.clip.width = ToolTipDoc.layers.tt.clip.width;
        ToolTip.clip.height = ToolTipDoc.layers.tt.clip.height;
        document.captureEvents(Event.MOUSEMOVE);
        document.onmousemove = delayToolTip;
        delayToolTip(e);
     }
     if (document.all) { // IE
        var ToolTip = document.all.tooltip;
        var sInnerHTML = '<div id="tt" style="position:absolute;border:solid;border-width:1;padding:2;border-color:#000000;background-color:'
+ sBGColor + ';">';
        sInnerHTML += '<font face="' + sFontFace + '" size="' + sSize + '">' +
sTipText + '</font></div>';
        ToolTip.innerHTML = sInnerHTML;
        ToolTip.noWrap = true;
        document.onmousemove = delayToolTip;
        delayToolTip(e);
     }
} // showToolTip()

function delayToolTip(e) {
    if (timerID) clearTimeout(timerID);
    var nX = 0;
    var nY = 0;
    if (document.layers) { // Netscape 4.7x
        nX = e.pageX;
        nY = e.pageY;
    }
    if (document.all) { // IE
        nX = window.event.clientX + document.body.scrollLeft;
        nY = window.event.clientY + document.body.scrollTop;
    }
    timerID = setTimeout("displayToolTip(" + nX + ", " + nY + ")", 300);
} // delayToolTip()

function displayToolTip(nX, nY) {
    if (document.layers) { // Netscape 4.7x
        document.releaseEvents(Event.MOUSEMOVE);
        document.onmousemove = null;
        var ToolTip = document.layers.tooltip;
        var ToolTipClip = ToolTip.clip;
        var nRightMargin = window.innerWidth + window.pageXOffset;
        if ((nX + ToolTipClip.width) > (nRightMargin - 10)) { // if the tooltip runs off right
            nX = nRightMargin - ToolTipClip.width - 20;
        }
        if ((nY + ToolTipClip.height) > (window.innerHeight +
window.pageYOffset - 38)) { // if tooltip runs off bottom
            nY -= ToolTipClip.height + 22;
        }
        ToolTip.left = nX;
        ToolTip.top = nY + 20;
        ToolTip.visibility = 'visible';
     }
     if (document.all) { // IE
        document.onmousemove = null;
        var ToolTip = document.all.tooltip;
        var ToolTipStyle = ToolTip.style;
        var InnerToolTip = ToolTip.all.tt;
        var nRightMargin = document.body.clientWidth +
document.body.scrollLeft;
        if ((nX + InnerToolTip.clientWidth) > nRightMargin) { // if the tooltip runs off right
            nX = nRightMargin - InnerToolTip.clientWidth - 6;
        }
        if ((nY + InnerToolTip.clientHeight) > (document.body.clientHeight +
document.body.scrollTop - 20)) { // if tooltip runs off bottom
            nY -= InnerToolTip.clientHeight + 30;
        }
        ToolTipStyle.pixelLeft = nX;
        ToolTipStyle.pixelTop = nY + 20;
        ToolTipStyle.visibility = 'visible';
     }
} // displayToolTip()

function hideToolTip() {
    if (timerID) clearTimeout(timerID);
    if (document.layers) { // Netscape 4.7x
        document.releaseEvents(Event.MOUSEMOVE);
        document.onmousemove = null;
        document.layers.tooltip.visibility = 'hidden';
    }
    if (document.all) { // IE
     document.onmousemove = null;
     var ToolTipStyle = document.all.tooltip.style;
     ToolTipStyle.visibility = 'hidden';
     ToolTipStyle.pixelLeft = 0; // move layer to top left corner, otherwise when you
     ToolTipStyle.pixelTop = 0;  // set innerHTML again, it may cause a horizontal scrollbar
    }
} 