$(document).ready(function() {	
	// binding hooks to sliding events
	$().bind('slide_loaded', function(event, link) { // everytime this page is loaded, remove and reattach hooks for this page		
		if ($('.content.video').length > 0) { // only do this if we're at the video page
			$()
				.unbind('.video')
				.bind('slide_start.video', function(event, link) {	
					if ($('.content.video').length > 0) { // we're leaving the video page
						$('#container').removeClass('video');
						stop(); // pause the video when sliding
					}
				}).bind('slide_complete.video', function(event, link) {
					if ($('.content.video').length > 0) {  // we're arriving at the video page and not the login page
						showNavigationItem($('#navigation li.gallery'));
						
						$('#video-navigation a, #video-navigation .video-3 img, #navigation a').ifixpng();
						
						if (!isUnderIE8()) {
							$('#container').addClass('video');
						}
					} else {
						$().unbind('.video'); // we've left the video page, unbind hooks
					}
			});
			
		}
	});
});