$(function()
{
	// shadows on _m images
	var h = $('.thumbnailsM img').height() + 4;
	$('.thumbnailsM').append('<img src="images/shadowTR.jpg" alt="shadowTR" style="width:7px;height:7px;position:absolute;top:0;right:0;" />');
	$('.thumbnailsM').append('<img src="images/shadowBL.jpg" alt="shadowBL" style="width:7px;height:7px;position:absolute;top:' + h + 'px;left:0;" />');

	// external links in new window (anything starting with http)
	$('a[@href^=http:]').click(function()
	{
		window.open($(this).attr('href'));
		return false;
	});
	
	
	
	
	// text sizing up
	$('#control_textUp').click(function()
	{
		var sizeNow = parseFloat($('#content-wrapper').css('font-size'));
		if ( sizeNow <= 9 ) // make it middle size
		{
			$('#content-wrapper').css('font-size', '1.0em');
		}
		else if ( sizeNow <= 12 ) // make it large
		{
			$('#content-wrapper').css('font-size', '1.3em');
		}
		return false;
	});
	// text sizing down
	$('#control_textDown').click(function()
	{
		var sizeNow = parseFloat($('#content-wrapper').css('font-size'));
		if ( sizeNow >= 14 ) // make it middle size
		{
			$('#content-wrapper').css('font-size', '1.0em');
		}
		else if ( sizeNow >= 11 ) // make it small
		{
			$('#content-wrapper').css('font-size', '0.8em');
		}
		return false;
	});


	
	// IE 6/7 fixes 
	if ( $.browser.msie && $.browser.version < 8 )
	{
		$('#top_navbar li ul').css('left', '-40px');
	}
	
	$('#top_navbar li').hover(
	
		function(){
			$(this).addClass('navigationHover');
			$('ul', $(this)).show();
		},
		function(){
			$(this).removeClass('navigationHover');
			$('ul', $(this)).hide();
		}
	);
	
	
	
	
	// gallery 
	$('#galleryWrap a').lightBox();
	
	
	
	
	// header images
	$('#headerRotate').cycle({
		fx: 'fade', 
		speed: 1000, 
		timeout: 5000,
		pause: 1
	});
	

	
	
	
	
	
});