$(document).ready(function() {
	// detect browser
	BrowserDetect.init();
	log( BrowserDetect.browser + " " + BrowserDetect.version + " on " + BrowserDetect.OS );
		
	// jquery blocks
	var blockSoftware = $('#software-block'),
		blockWeb = $('#web-block'), 
		blockPhoto = $('#photo-block'),
		blockTravel = $('#travel-block');
	
	var winScroll = null;

	// set up link click actions
	$('#main-header #nav a, .top-icon a').click( function() {
		scrollWin( $(this).attr('href'), main_spacer );
		// return false;
	});
	
	// set up event for scrolling
	$(window).scroll( function() { timerNavbarLogic(); });
	
	// firefox: call nav logic in case the page is reloaded and already scrolled
	navbarLogic();
	
	// set up ext links
	jqExternalLinks();
	
	// set up colorbox
	$('.contact-colorbox').colorbox({ width:'700px', height:'700px', iframe:true});
	
	// set up carousel
	carouselSetup();
	
	// mobile only should not redirect, but should show a message
	$('a.mobileOnly').click( function(e) {
		if ( ! isMobilePlatform() ) {
			var id = $(e.target).attr('data-id'), $error = $('p.mobileOnly[data-id=' + id + ']');
			e.preventDefault();
			$error.hide();
			$error.fadeIn();
		}
	});
	
	// raw photo comparison
	var pc = $('.photoCompare'), br = $.browser,
		can3d = br.webkit || (br.mozilla && br.version > 9);
	if ( can3d ) pc.addClass('threeD');
	pc.click( function(e) {
		var $this = $(this);
		$this.toggleClass('show');
	});
	// reset height of photo compare 
	pc.height( pc.find('div').eq(0).height() );

	// detect and open
	detectIE( false );
	
	// scroll us to a specific location if we're bookmarked
	setTimeout( 'handleAnchor( location.href )', 200 );
});
