function adjustContentWidth()
{
	/* Set the width of the "content" element to take into account the browser width and the width of the two borders */
	contentz = document.getElementById('content'); // content seems to be a reserved word in IE so we use the name contentz
	contentz.style.width = (parseInt(document.body.clientWidth) - 440) + "px";
}

function adjustIEBannerLineWidths()
{
 	/* IE doesn't work properly with the 100% width for the banner_line style so we have to adjust the width manually */
	for (i = 1; i < 7; i++)
	{
	 	banner_line = document.getElementById('bl' + i);
		/* get rid of the px from the banner's left css property */
	   	banner_left = banner_line.style.left.substring(0,banner_line.style.left.length-2);
		banner_line.style.width = (parseInt(document.body.clientWidth) - banner_left) + "px";
	}
}

// Have an on page resize that resizes everything
function resizeElements()
{
	adjustContentWidth();
	adjustIEBannerLineWidths();
}

// This function gets called when the page is loaded to compensate for browser/platform differences and stuff that can't be done with css
function pageLoaded()
{
	resizeElements();
	adjustCSSForDifferentBrowsersPlatforms();
}

function adjustCSSForDifferentBrowsersPlatforms()
{
	if (getPlatform() == 'Windows')
	{
		// adjust the colours which appear different on the windows platform
		
		// adjust the page background colour
		bodie = document.getElementsByTagName('body')[0];
		bodie.style.backgroundColor = '#898458';

		// adjust the left and right border colour
		lbz = document.getElementById('lb'); // add z to the variable name since I don't think IE likes variable names with 2 chars or less
		lbz.style.backgroundColor = '#c7bd8d';
		
		rbz = document.getElementById('rb');
		rbz.style.backgroundColor = '#c7bd8d';
		
		// adjust the banner line arrow colour
		for (i = 1; i < 7; i++)
		{
	 		banner_line = document.getElementById('bl' + i);
			banner_line.style.backgroundColor = '#5B583C';
		}
		
		// adjust the vertical line so it aligns correctly with the navigation menu, to do this we need
		// to set the left value differently on windows then the Mac
		vlz = document.getElementById('vl');
		vlz.style.left = '193px';
		// on Opera we need to set the value differently then IE and Firefox
		if (getBrowser() == 'Opera')
		{
			vlz.style.left = '210px';
		}
		
	}
	
}

function getBrowser()
{
	agent = navigator.userAgent;
	
	isCamino = (agent.indexOf('Camino') != -1);
	isSafari = (agent.indexOf('Safari') != -1);
	isFirefox = (agent.indexOf('Firefox') != -1); 
	isIE = (agent.indexOf('MSIE') != -1);
	isOpera = (agent.indexOf('Opera') != -1);

	if (isCamino)
	{
		return 'Camino';
	}
	else if (isSafari)
	{
		return 'Safari';
	}
	else if (isFirefox)
	{
		return 'Firefox';
	}
	else if (isIE)
	{
		return 'IE';
	}
	else if (isOpera)
	{
		return 'Opera';
	}
	else
	{	
		return 'Unknown';
	}
}

function getPlatform()
{
	agent = navigator.userAgent;
	
	isMac = (agent.indexOf('Mac') != -1);
	isWindows = (agent.indexOf('Windows') != -1);
	
	if (isMac)
	{
		return 'Mac';
	}
	else if (isWindows)
	{
		return 'Windows';
	}
	else
	{
		return 'Unknown';
	}
}