var loc = "" + window.location;

// primary navigation function
function gotoPage( destination )
{
    window.location = destination + ".html";
}

function demoNote( x, y, w, h, str )
{
    document.write( '<div style="position: absolute; top: ' + y + 'px; left: ' + x + 'px; width: ' + w );
    document.write( 'px; height: ' + h + 'px; background-color: #ffbe58; border: 1px solid black; padding: 2px;z-index: 99">' );
    document.write( str );
    document.write( '</div>' );
}

function demoNote2( x, y, w, h, str )
{
    document.write( '<div style="position: absolute; top: ' + y + 'px; left: ' + x + 'px; min-width: ' + w );
    document.write( 'px; min-height: ' + h + 'px; background-color: #6dcc66; border: 1px solid black; padding: 2px;z-index: 99; font-weight:bold">' );
    document.write( str );
    document.write( '</div>' );
}

function homeLink( x, y, levels )
{
    document.write( '<div style="position: absolute; top: ' + y + 'px; left: ' + x + 'px;' );
    document.write( 'background-color: #eeeeee; width:38px; height:14px; font-size:8pt; border: 0px; padding:0px;z-index: 99;">' );
    dotdot = '';
    for (var i = 0; i < levels; i++)
    {
        dotdot += '../';
    }
    document.write( '<a href="index.html">&nbsp;&nbsp;Home</a>' );
    document.write( '</div>' );
}

/*
 * x, y = coordinates
 * w,h = width, height
 * point = direction of pointer ( 0 for none or 1-4 )
 * str = html to display in the bubble
*/
function speechBubble( x, y, w, h, point, str )
{
    var imgBASE = "../../images/";

    if ( loc.indexOf( "index.html" ) != -1 || loc.indexOf( ".html" ) == -1 || loc.indexOf( "tnow-assignment" ) != -1 || loc.indexOf( "tnow-student" ) != -1 )
        imgBASE = "images/";

    document.write( '<div style="position: absolute; top: ' + y + 'px; left: ' + x + 'px; z-index: 98">' );
    document.write( '<table width="' + w + '" height="' + h + '" border="0" cellspacing="0" cellpadding="0" style="font-size: 0.9em">' );
    document.write( '<tr><td width="14" height="14"><img src="' + imgBASE + 'corner-ul.gif"/></td>' );
    document.write( '<td width="100%" height="8" style="background-image: url(' + imgBASE + 'top.gif); background-repeat: repeat-x"></td>' );
    document.write( '<td width="9" height="21"><img src="' + imgBASE + 'corner-ur.gif"/></td></tr>' );
    document.write( '<tr><td width="9" height="100%" style="background-image: url(' + imgBASE + 'left.gif); background-repeat: repeat-y"></td>' );
    document.write( '<td width="100%" height="100%" bgcolor="#f3f3f3" valign="top">' );
    document.write( '<div style="z-index:200; padding: 2px;">' + str + '</div>' );
    document.write( '</td><td width="9" height="100%" style="background-image: url(' + imgBASE + 'right.gif);  background-repeat: repeat-y"></td></tr>' );
    document.write( '<tr><td width="9" height="8"><img src="' + imgBASE + 'corner-ll.gif"/></td>' );
    document.write( '<td width="100%" height="8" style="background-image: url(' + imgBASE + 'bottom.gif); background-repeat: repeat-x"></td>' );
    document.write( '<td width="9" height="8"><img src="' + imgBASE + 'corner-lr.gif"/></td>' );
    document.write( '</tr></table>' );
    document.write( '</div>' );

    var pointX, pointY, pointIMG;

    if ( point == '0' )
          return;
    else if ( point == '1' )
    {
          pointX = x;
          pointY = y-25;
    }
    else if ( point == '2' )
    {
          pointX = x+w-30;
          pointY = y-25;
    }
    else if ( point == '3' )
    {
          pointX = x+w-2;
          pointY = y+h-27;
    }
    else if ( point == '4' )
    {
          pointX = x-28;
          pointY = y+h-30;
    }
    else if ( point == '5' )
    {
        pointX = x;
        pointY = y-25;
        
        document.write( '<div style="position: absolute; top: ' + pointY + 'px; left: ' + pointX + 'px; z-index: 99"><img src="' + imgBASE + "point1.gif" + '"/></div>' );
          
        pointX = x+w-30;
        pointY = y-25;
        
        document.write( '<div style="position: absolute; top: ' + pointY + 'px; left: ' + pointX + 'px; z-index: 99"><img src="' + imgBASE + "point2.gif" + '"/></div>' );
		    
		pointX = x+w+1;
        pointY = y+h;
        
        document.write( '<div style="position: absolute; top: ' + pointY + 'px; left: ' + pointX + 'px; z-index: 99"><img src="' + imgBASE + "point3.gif" + '"/></div>' );
		
		pointX = x-25;
        pointY = y+h-27;
        
        document.write( '<div style="position: absolute; top: ' + pointY + 'px; left: ' + pointX + 'px; z-index: 99"><img src="' + imgBASE + "point4.gif" + '"/></div>' );
    
    }
    
    pointIMG = imgBASE + "point" + point + ".gif";
    if (point < 5)
    {
        document.write( '<div style="position: absolute; top: ' + pointY + 'px; left: ' + pointX + 'px; z-index: 99"><img src="' + pointIMG + '"/></div>' );
    }
}




function linkMouseOver()
{
	this.className = 'handOver';
}

function linkMouseOut()
{
	this.className = 'hand';
}


