// V 1.1

function ExtractFileName( URL )
{
	var docName = URL;

	docName = docName.substring( docName.lastIndexOf("\\") + 1 );
	docName = docName.substring( docName.lastIndexOf("\/") + 1 );

	return docName;
}


function WriteMenuCategory( name )
{
	document.write( '<div class="section">' + name + '</div>' );
}


function WriteMenuItem( basePath, currNavName, name, linkURL, description )
{
	if( currNavName != name )
	{
		document.write( '<a class="item" href="' + basePath + linkURL + '" title="' + description + '" >• ' + name + '</a>' );
	}
	else
	{
		document.write( '<a class="this_item" href="' + basePath + linkURL + '" title="' + description + '" >• ' + name + '</a>' );
	}
}


function WriteSiteIndex( basePath, currNavName )
{
	document.write( '<div class="menubuffer" nowrap>' );
	document.write( '<div class="menu" nowrap>' );

	WriteMenuCategory( 'Home' );
		WriteMenuItem( basePath,	currNavName,	'Welcome and News',		'index.html',				'Welcome, come read the latest news about the club!' );

	WriteMenuCategory( 'Information' );
		WriteMenuItem( basePath,	currNavName,	'Description/ Drink Specials',	'description.html',			'Find out what the club is like and who the DJs are!' );
		WriteMenuItem( basePath,	currNavName,	'Location/ Directions',		'location.html',			'Find out where we are at and get directions!' );

	WriteMenuCategory( 'Archive' );
		WriteMenuItem( basePath,	currNavName,	'Photos',			'photos.html',				'See what the club is like!' );
		WriteMenuItem( basePath,	currNavName,	'Flyers',			'flyers.html',				'See our old flyers!' );
		WriteMenuItem( basePath,	currNavName,	'Playlists',			'playlists.html',			'Find out what we have been playing!' );

	WriteMenuCategory( 'Contact' );
		WriteMenuItem( "http:",		currNavName,	'AbSynth on Facebook',	'//www.facebook.com/home.php?#/group.php?gid=56610657546&ref=ts',	'Use Facebook to contact us and be part of the community!' );
		WriteMenuItem( "http:",		currNavName,	'AbSynth on LiveJournal',	'//clubabsynth.livejournal.com/',	'Use LiveJournal to contact us and be part of the community!' );

	document.write( '</div>' );
	document.write( '</div>' );
}


function WritePageStart( basePath, currNavName )
{
	if (typeof basePath == 'undefined')
    {
		basePath='';
	}

	document.write(
		'  <table align="left" valign="top" width="100%" border="0" cellspacing="0" cellpadding="0">' +
		'   <tr>' +
		'    <td colspan="2"><span class="top"><a href="' + basePath + 'index.html" title="MeicoCosmos Home" ><img src="' + basePath + 'logo.jpg" width="413" height="58" border="0" alt="site logo" /></a></span></td>' +
		'   </tr>' +
		'   <tr>' +
		'    <td valign="top" width="*">' +
		'     <a class="skiplink" href="#startcontent" accesskey="2">Skip over navigation</a>' +
		'     <script language="JavaScript" type="text/javascript">WriteSiteIndex("' + basePath + '","' + currNavName + '");</script>' +
		'    </td>' +
		'    <td valign="top" width="100%">' +
		'     <a name="startcontent" id="startcontent"></a>' +
		'     <span class="article">'
		);
}

function WritePageEnd( basePath )
{
	if (typeof basePath == 'undefined')
    {
		basePath='';
	}

	document.write(
		'     </span>' +
		'    </td>' +
		'   </tr>' +
		'   <tr> ' +
		'    <td colspan="2"><span class="bottom"><img src="' + basePath + 'foot.jpg" width="413" height="36" alt="footer image" /></span></td>' +
		'   </tr>' +
		'   <tr>' +
		'    <td colspan="2">' +
		'     <span class="footer">' +
		'      &copy; Copyright 2006 - Twilight Directories PLC.' +
		'     </span>' +
		'    </td>' +
		'   </tr>' +
		'  </table>'
		);
}


function WriteBadPage( basePath )
{
	document.write(
		'<h1>' +
		'Innacessible Area' +
		'</h1>' +
		'<p>' +
		'Sorry, but you seem to have reached an area that should not have been accessible.' +
		'</p>' +
		'<p>' +
		'Please see <a href="' + basePath + 'index.html">the main page of this site</a>.' +
		'</p>' +
		'<p>' +
		'You may have incorrectly typed in an address.  Please check the URL in your browser.' +
		'</p>' +
		'<p>' +
		'If you have any questions or comments please <a href="' + basePath + 'contact.html" accesskey="9">contact</a> me.' +
		'</p>');
}
