/******************************************************
**	updateTab()   is specific to IrisMoreau.com      **
******************************************************/
var currentPage = ( ie4 ) ? '/' + location.pathname.split(/\/|\./)[0] : location.pathname.replace(/\/$/, ''), gallery;

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

var Links = [
	new Link( '/',						'home' ),
	new Link( '/fashion',			'fashion' ),
	new Link( '/beauty',				'beauty' ),
	new Link( '/commercial',				'ads' ),
	new Link( '/celebrities',			'celebrities' ),
	new Link( '/bio.html',				'bio' ),
	new Link( '/clients.html',			'clients' ),
	new Link( '/contact.html',			'contact' )
];

function showHeader()
{
	var noURLmatch = true,
		thisLink,
		out = '\n<table border="0" cellpadding="0" cellspacing="0" width="100%" height="99%" id="header">'
			+ '\n<tr><td width="300" height="20"><img src="/img/casper.gif" width="300" height="20" alt="" /></td>'
			+ '\n	<td><img src="/img/casper.gif" width="500" height="10" alt="" /></td>'
			+ '\n	<td><img src="/img/casper.gif" width="50" height="1" alt="" /></td>'
			+ '\n</tr>'
			+ '\n<tr><td height="25" colspan="2" class="contact">Iris Moreau</td>'
			+ '\n	<td align="right" valign="top" id="social">'
			+ '\n		<a href="http://twitter.com/irismoreau" title="Iris Moreau on Twitter" target="_new"><img src="/img/twitter.png" width="18" height="18" alt="Twitter" border="0" /></a>'
			+ '\n		<a href="http://www.facebook.com/pages/IRIS-MOREAU-MAKEUP/117161318299509" title="Iris Moreau on Facebook" target="_new"><img src="/img/facebook.png" width="18" height="18" alt="Facebook" border="0" /></a>'
			+ '\n		<a href="http://irismoreaumakeup.blogspot.com" title="Iris Moreau Blog" target="_new"><img src="/img/blogspot.gif" width="18" height="18" alt="Blogspot" border="0" /></a>'
			+ '\n	</td>'
			+ '\n</tr>'
			+ '\n<tr><td colspan="3" class="redLine" height="1"><img src="/img/casper.gif" width="1" height="1" alt="" /></td></tr>'
			+ '\n<tr><td class="slug" nowrap="nowrap" height="20">make-up artist</td>'
			+ '\n	<td class="navbar" align="right" colspan="2">';
	for ( var x=Links.length-1; x > 0; x-- )
	{
		thisLink = Links[x];
		if ( thisLink.href == currentPage )
		{
			noURLmatch = false;
			out += '\n		<div class="active">' + thisLink.name + '</div>';
		}
		else
		{
			out += '\n		<a href="' + thisLink.href + '" id="' + thisLink.name + '">' + thisLink.name + '</a>';
		}
	}
	out += '\n		<a href="' + Links[0].href + '" id="' + Links[0].name + '"' + ( ( noURLmatch ) ? '" class="active">' : '>' ) + Links[0].name + '</a>';
	out += '\n</tr>'
		+  '\n<tr><td colspan="99" valign="middle">';
	document.write( out );
//	Debug( out );
}

function updateNav()
{
	if ( this != parent )
	{
		d("page", parent).style.height = 40 + d("pageHeight").offsetHeight + "px";
		window.resizeBy(-1,0);
		window.resizeBy(1,0);
	}

	d( top.previousTab, top ).className = "";
	d( currentPage, top ).className = "active";
	top.previousTab = currentPage;
}

function showFooter()
{
	var out = '</td></tr></table><div id="footer" align="right">site design by <a href="http://samrod.com">Samrod Shenassa</a></div>';
	document.write( out );
}

var totalGalleryWidth = 0;
function showGallery( galleryIndex )
{
	var out = '', currentGallery = gallery[ galleryIndex ];
	for ( var x=0; x < currentGallery.length; x++ )
		out += '<img src="/img' + top.currentPage + '/' + currentGallery[x] + '" height="470" alt="" onload="expandGalleryPage(this.width)" />';
	d('gallery').innerHTML = out;
//Debug( out );
}

function expandGalleryPage( width ) {
	totalGalleryWidth += width + 30;
	document.body.style.width = totalGalleryWidth + 'px';
	d("gallery").style.width = totalGalleryWidth + 'px';
}

function showGalleryFrame() {
	if ( ( mac && ie4 ) || (navigator.userAgent.indexOf( "iPhone" ) > -1 ) )
	{
		out = '<iframe id="galleryFrame" name="galleryFrame" src="" width="100%" height="485" frameborder="0" scrolling="auto"></iframe>';
	}
	else out = '<iframe id="galleryFrame" name="galleryFrame" src="" width="100%" height="485" frameborder="0" scrolling="auto" onmouseout="galleryFrame.stopHover()"></iframe>';
	out += '<br />\n<span class="help">scroll to view more</span>';
	document.write( out );
}
