$(document).ready(function() {

	/*--Cufon--*/	

	Cufon.replace('#frame-header h2, #frame-about h1, #frame-about h2, #frame-results h1, #frame-results h2, #frame-tools h1, #frame-tools h2, #frame-contact h1, #frame-contact h2, .gallery h3',{ fontFamily: 'garamond-regular' });
	Cufon.replace('#frame-header h1, #frame-about h1 strong, #frame-results h1 strong, #frame-tools h1 strong, #frame-contact h1 strong, #frame-contact h1 span.blue',{ fontFamily: 'garamond-bold' });

	/*--Menu--*/

	$('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}, 1000);
			return false;
			}
		}
	});

	/*--Gallery--*/

	$('#categories') 
	.cycle({ 
		fx:     'fade', 
		speed:  'slow', 
		timeout: 0, 
		pager:  '#navigation-menu li' ,
		next:   '#next', 
		prev:   '#prev' 
	});	

	$('.description').css('height', 0);

	$('.gallery .work').mouseenter(function() {
		var expandable = $(this).find('.description');
		expandable.stop();
		expandable.animate({
			height: 356
		}, 250);
	});

	$('.gallery .work').mouseleave(function() {
		var expandable = $(this).find('.description');
		expandable.stop();
		expandable.animate({
			height: 0
		}, 250);
	});

	

	$('.gallery .col-one .work-bottom').mouseenter(function() {
		$('.col-one .work').animate({
				top: '-=178'
			}, 250, function() {
		});
	});

	

	$('.gallery .col-one .work-bottom').mouseleave(function() {
		$('.col-one .work').animate({
				top: '+=178'
			}, 250, function() {
		});
	});

	

	$('.gallery .col-two .work-bottom').mouseenter(function() {
		$('.col-two .work').animate({
				top: '-=178'
			}, 250, function() {
		});
	});

	

	$('.gallery .col-two .work-bottom').mouseleave(function() {
		$('.col-two .work').animate({
				top: '+=178'
			}, 250, function() {
		});
	});



	$('.gallery .col-three .work-bottom').mouseenter(function() {
		$('.col-three .work').animate({
				top: '-=178'
			}, 250, function() {
		});
	});

	

	$('.gallery .col-three .work-bottom').mouseleave(function() {
		$('.col-three .work').animate({
				top: '+=178'
			}, 250, function() {
		});
	});


	/*--Gallery Popup--*/

	Shadowbox.init({
		handleOversize: "drag",
		modal: true
	});

	/*--Form Submit--*/

		$('#contact-form').ajaxForm(function(data) {
			if (data==0){$('.contact-error').hide();$('.contact-success').fadeIn("slow");$('.contactForm').resetForm();}
			else if (data==1){$('.contact-success').hide(); $('.contact-error').fadeIn("slow");}
		});

	/*--Analytics--*/

	var _gaq = _gaq || [];
		_gaq.push(['_setAccount', 'UA-13069537-2']);
		_gaq.push(['_trackPageview']);
		
		(function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		})
	();

	/*--Target Blank--*/

	$(function(){
		$('a.blank').click(function(){
		window.open(this.href);
		return false;
	});

});



	

});








