var currentPage = '/' + location.pathname.split( "/" )[1],
	links = [
		new Link( 'Blog',			'/' ),
		new Link( 'DIY Hair',		'/diy.html' ),
		new Link( 'Biography',		'/bio.html' ),
		new Link( 'Gallery',		'/gallery.html' ),
		new Link( 'Video',			'/reel' ),
		new Link( 'Press',			'/press.html' ),
		new Link( 'Contact',		'/contact.html' )
	];

function Link( name, href )
{
	this.name = name;
	this.href = href;
	return this;
}

function listLinks()
{
	var out = '', thisLink, x;
	for ( x=0; x < links.length; x++ )
	{
		thisLink = links[x];
		out += ( ( currentPage == thisLink.href ) ? '<span class="active">' + thisLink.name + '</span>' : '<a href="' + thisLink.href + '">' + thisLink.name + '</a>' ) + ( ( x < links.length-1 ) ? '<span class="divider">//</span>' : '' ) ;
	}
	return out;
}

function showHeader()
{
	var out = '\n<div id="borderTop"></div>'
			+ '\n<div id="page">'
			+ '\n	<div id="header">'
			+ '\n		<a href="/"><img  id="logo"src="/img/thymai.gif" width="300" alt="Thy Mai" border="0" /></a><br clear="all" />'
			+ '\n		<div class="slug_outter"><span class="fon">(TEE-MY)</span><br /><span class="slug">L.A. based hair stylist</span></div>'
			+ '\n		<div id="navbar">' + listLinks() + '</div>'
			+ '\n	</div>'
			+ '\n	<div id="sandbox">';7
	document.write( out );
// Debug( out );
}

function showFooter()
{
	var out = '\n	</div></div><br /><br />';
	document.write( out );
// Debug( out );
}


/************************************
	reel functions                 **
************************************/
// MOTION
var lastMovie = 'chopchop';
function play( src, w, t )
{
	var thisMovie = src.replace(/\..*/gi, ''),
		out = '<b>' + t + '</b><br claer="all" />' + d( thisMovie ).innerHTML;
	d( 'link_' + lastMovie ).className = "";
	d( 'link_' + thisMovie ).className = "active";
	lastMovie = thisMovie;

	sr.Video(
	{
		vidDir: 'http://thymai.com/av/',
		container: 'motion',
		src: src,
		width: w,
		caption: out
	})
}


// Google Analytics Tracking Code
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10972996-1']);
_gaq.push(['_trackPageview']);

(function()
{
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


