$(function() {
	// FIX PNGS FOR IE
	DD_belatedPNG.fix('#side','#main','#top','.tooltip'); 
	
	// TESTIMONIALS
	$("#controller").jFlow({
		slides: "#testimonials",
		width: "330px",
		height: "150px" 
	});
	
	// PROJECT IMAGES
	$(".project").lazyload({
	   effect : "fadeIn",
	   threshold : 50
	});
	$("dd").hoverIntent(function() {
		var thumbOver = $(this).find(".image img").attr("src");
		$(this).find(".image").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
		$(this).find(".image img").stop().fadeTo('normal', 0 , function() {
			$(this).hide()
		});
	} , function() {
		$(this).find(".image img").stop().fadeTo('normal', 1).show();
	});

	// TOGGLE SIDE
	$('#toggle').click(function(){
		$('#side').animate({ left : '-=320', opacity : .5 }, 1000);	
		$('#main').animate({ marginLeft : '-=320' }, 1000);	
		$('#toggle2').fadeIn();
	});
	$('#toggle2').click(function(){
		$(this).fadeOut();
		$('#side').animate({ left : '+=320', opacity : 1 }, 1000);	
		$('#main').animate({ marginLeft : '+=320' }, 1000);	
	});
	
	// IMAGE ZOOM
	$('a.zoom').fancyZoom({ directory: '/img/fancy' });
	
	// SCROLL TO TOP
	$('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });
	$(window).scroll(function() {
		if ($(window).scrollTop() > 400) {
			$('#top').show();
		} else {
			$('#top').hide();
		};
	});
	
	//TOOL TIPS
	$('#t1').tooltip({direction: 'e'}, 'Providing clients with professional quality solutions for 10 years.','false');
	$('#t2').tooltip({direction: 'e'}, 'Currently residing in Bel Air, about 30 minutes north of Baltimore.','false');
	$('#t3').tooltip({direction: 'e'}, 'Bachelors in Visual Arts; Graphic Design from University of Maryland Baltimore County.','false');
	$('#t4').tooltip({direction: 'e'}, 'Chat with me on instant messenger.','false');
	$('.emoxie').tooltip({direction: 'e'}, 'Developed by <a href="http://www.e-moxie.com">E-Moxie</a>','false');
});
