$(document).ready(function() {
	
	
	$('html').addClass('jenable');
	$('#headline').attr('src','img/headline.jpg');
	
	$('#portfolio').scuttleslide({'autoplay':false});
	
	$(document.documentElement).bind('keyup', function(e) {
		if(e.which == '39') {
			$('#portfolio').scuttleslide.right();
		}
		if(e.which == '37') {
			$('#portfolio').scuttleslide.left();
		}
	});
	
	var scrollBuffer = 0;
	
	$('img').bind('mousedown',function (e){
		if(e.preventDefault) e.preventDefault();
	});

	$('.portimg').bind('click', function(e) {
		if(e.preventDefault) e.preventDefault();
		$('#portfolio').scuttleslide.autoPlayStop();
		$.fancybox(
			{ 	
				'overlayOpacity':0.7,
				'href':$(this).attr('href'),
				'title':$(this).find('img').attr('alt')});
	});
	
	if($.browser.webkit) {
		if(zoomlevel = (document.width / jQuery(document).width()) != 1) {
			if(zoomlevel < 1) alert('Your browser is zoomed out more than normal, this may produce unexpected results when viewing the slideshow. Please zoom in until your browser is at its default zoom level.');
			else alert('Your browser is zoomed in more than normal, this may produce unexpected results when viewing the slideshow. Please zoom out until your browser is at its default zoom level.');
		}
	}
	
	//contact
	$('.submit').click(function () {
		//do a contact form
	})

});
