
// mainTop.js. Top of each page
//---------------------------------------------------------------------------------------
function getDirectory()
// Return the name of the directory holding this page.
//---------------------------------------------------------------------------------------
{
	// From the file (page.htm),
	// get the href (.../path/to/public_html/.../page.htm)
	// and return the directory name just left of page.htm

	// First, find out where the directory ends
	var endSlash = location.href.lastIndexOf( '/' );
	// Get the substring of href up to the last slash (not including)
	var subHref = location.href.substring( 0, endSlash );
	// Get the position of the last slash in that string, which is now the last slash in it
	var startingSlash = subHref.lastIndexOf( '/' );
	// Increment that position by 1 and get the substring
	var theDirectory = subHref.substring(++startingSlash,endSlash );

	return theDirectory;

} // function getDirectory()

//---------------------------------------------------------------------------------------
function setPublicPath()
// Return the relative path to the top directory public_html
//---------------------------------------------------------------------------------------
{

	var thePath = '../';
	if ( getDirectory() == 'public_html' ) {
		thePath = './';
	}

	return thePath;

} // function setPublicPath()

var publicPath = setPublicPath();

document.write( '<table border=0 cellspacing=0 cellpadding=0 align="left" width=100% >' + "\n" );
document.write( '<tr>' + "\n" );
document.write( '<td width=300 align="left" valign="top">' + "\n" );
document.write( '<a name="top"></a>' + "\n" );
// Logo Flash
document.write( '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + "\n" );
document.write( 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' + "\n" );
document.write( 'WIDTH=300 HEIGHT=150 id="BuntportLogoMainPage">' + "\n" );
document.write( '<PARAM NAME=movie VALUE="' + publicPath + 'Images/logos/BuntportLogoMainPage.swf">' + "\n" );
document.write( '<PARAM NAME=quality VALUE=high>' + "\n" );
document.write( '<PARAM NAME=bgcolor VALUE=#666666>' + "\n" );
// This is where we pass parameters for IE browsers
document.write(' <PARAM NAME=FlashVars VALUE="publicPath=' + publicPath + '">');
// End IE parameters
// Netscape
document.write( '<EMBED src="' + publicPath + 'Images/logos/BuntportLogoMainPage.swf" quality=high bgcolor=#666666' + "\n" );
document.write( ' WIDTH=300 HEIGHT=150 NAME="BuntportLogoMainPage" ALIGN=""' + "\n" );
document.write( ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"' + "\n" );
// This is where we pass parameters for Netscape browsers
document.write(' FlashVars="publicPath=' + publicPath + '"' + "\n" );
// End Netscape parameters
document.write( '>' + "\n" );
document.write( '</EMBED>' + "\n" );
document.write( '</OBJECT>' + "\n" );
// End Netscape
// End Logo Flash
// Search Form
document.write( '<form method=POST action="' + publicPath + 'Php/Search.php">' + "\n" );
document.write( '<input type="hidden" name="publicPath" value="' + publicPath + '">' );
document.write( '&nbsp;&nbsp;<input type=text name="searchString" size=25>&nbsp;<input type=submit value="Search">' + "\n" );
document.write( '</form>' + "\n" );
// Search Form
document.write( '</td>' + "\n" );
document.write( '<td width="*" valign="top" align="right">' + "\n" );

// Slide Show
document.write( '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + "\n" );
document.write( 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' + "\n" );
document.write( 'WIDTH="450" HEIGHT="190" id="slideshow" ALIGN="">' + "\n" );
document.write( '<PARAM NAME=movie VALUE="' + publicPath + 'Images/Slideshow/slideshow.swf">' + "\n" );
document.write( '<PARAM NAME=quality VALUE=high> ' + "\n" );
document.write( '<PARAM NAME=bgcolor VALUE=#666666>' + "\n" );
// This is where we pass parameters for IE browsers
document.write(' <PARAM NAME=FlashVars VALUE="publicPath=' + publicPath + '">');
// End IE parameters
// Netscape
document.write( '<EMBED src="' + publicPath + 'Images/Slideshow/slideshow.swf" quality=high bgcolor=#666666' + "\n" );
document.write( ' WIDTH="450" HEIGHT="190" NAME="slideshow" ALIGN=""' + "\n" );
document.write( ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"' + "\n" );
// This is where we pass parameters for Netscape browsers
document.write(' FlashVars="publicPath=' + publicPath + '"' + "\n" );
// End Netscape parameters
document.write( '>' + "\n" );
document.write( '</EMBED>' + "\n" );
document.write( '</OBJECT>' + "\n" );
document.write( '</td>' + "\n" );
document.write( '</tr>' + "\n" );
document.write( '</table>' + "\n" );
