/*
meta {
	author:		jon muller
	company:	pi-squared (www.pi-squared.co.za)
	about:		superior web design and development since 2001
}
*/

/*-------------------------------------------------------------	functions */

function fadeGallery() {
	$('.galleryPhotos').find('div:last').fadeOut(1750,
		function() {
			$('.galleryPhotos').prepend(this);
			$(this).show();
			galleryTimer = setTimeout('fadeGallery()',1750);
		}
	);
}
function fontResize(a) {
	var fontSizePx = $('body').css('font-size');
	var fontSizeNo = new Array();
	fontSizeNo = fontSizePx.split('px');
	if (a == 'bigger') {
		$('body').css('font-size',(fontSizeNo[0]*1) + 1);
	} else if (a == 'smaller') {
		$('body').css('font-size',(fontSizeNo[0]*1) - 1);
	} else {
		$('body').css('font-size',16);
	}
}
/*-------------------------------------------------------------	jquery */
$().ready(function(){

	$('a[rel="external"]').bind('click',
		function() {
			window.open($(this).attr('href'));
			return false;
		}
	);

	$('.fontBigger').bind('click',
		function() {
			fontResize('bigger');
		}
	);
	$('.fontReset').bind('click',
		function() {
			fontResize('reset');
		}
	);
	$('.fontSmaller').bind('click',
		function() {
			fontResize('smaller');
		}
	);

	$(window).load(
		function () {
			$('body').addClass('hasJS');

			if ($('.galleryPhotos div').length > 1) {
				var galleryTimer = setTimeout('fadeGallery()',1750);
			}
			
			$('.right blockquote em').each(
				function() {
					$(this).prepend('<img src="assets/templates/nfib/images/right_blockquote_em-prepend.gif" width="11" height="10" alt="Start blockquote" /> ');
					$(this).append(' <img src="assets/templates/nfib/images/right_blockquote_em-append.gif" width="11" height="10" alt="End blockquote" />');
				}
			);

			$(document).pngFix();
		}
	);


});
