// Get time for the log function
var ts = new Date().getTime();

// bl function
var bl = {
	// Check if Firebug is installed and output the log
	log: function(msg){if (window.console && window.console.firebug){console.log((new Date().getTime() - ts) + ': '+ msg);};},

	init: function(){
		bl.log('init()');
	},

	domready: function(){
		$('#nav a[href*=#]').click(function() {
			if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
				var $target = $(this.hash);
				$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
				if ($target.length) {
					var targetOffset = $target.offset().top;
					$('html,body').animate({scrollTop: targetOffset-250}, 800);
					$('#nav a[href*=#]').each(function(){
						$(this).removeClass('current');
					});
					$(this).addClass('current');
					return false;
				}
			}
		});	
		
		var strHref = window.location.href;
		if ( strHref.indexOf("#") > -1 ){
			var strAnchor = strHref.substr(strHref.indexOf("#")+1);
		}
		
		$('.frame a.thumb').fancybox();
	}
}
// Execute post DOM ready manipulation
$(document).ready(function(){bl.domready()});

// Execute pre DOM ready manipulation
bl.init();