$(document).ready(function() {

	$('a#toTop').click(function() {
		$('html, body').animate({ scrollTop: 0 }, 'slow');
		return false;
	});

	/*
	$("a[rel='caseStudy']").each(function() {
	$(this).colorbox({
	title: $(this).attr('title')
	});
	});
	*/
	$("a[rel^='caseStudy']").colorbox();

	$("a[rel^='prettyPhoto']").prettyPhoto();

	$('#shuffle div').hide();
	$('#shuffle div.first').removeClass('first');
	$('#shuffle').shuffle();
	$('#shuffle div:first-child').addClass('first');
	$('#shuffle div.first').hide().fadeIn('slow');

	$('#shuffle').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 3000
	});

	$('.contact #image').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 3000
	});

	$('#topNav #navHolder').hover(function() {
		if (this.className != "active") {
			$(this).children('.navHolderEx').animate({ marginLeft: -92 }, 100);
		} //if
	}, function() {
		if (this.className != "active") {
			$(this).children('.navHolderEx').animate({ marginLeft: -0 }, 100);
		} //if
	});

	for (i = 1; i < 11; i++) {
		$('#topNav #navHolder' + i).hover(function() {
			if (this.className != "active") {
				$(this).children('.navHolderEx').animate({ marginLeft: -92 }, 100);
			} //if
		}, function() {
			if (this.className != "active") {
				$(this).children('.navHolderEx').animate({ marginLeft: -0 }, 100);
			} //if
		});
	} //for

});
