	
	// On doc ready
	jQuery(document).ready(function()
	{
		// Projects rollover
		if(jQuery('.projects').length > 0)
		{
			jQuery('.projectimages div').hoverIntent(function()
			{
				var cName = jQuery(this).attr('class'), otherCName = (cName == "left") ? "right" : "left";
				if(jQuery(this).css('width') == '311px') {
					var jQueryparent = jQuery(this);
					jQuery('.layer',this).fadeIn(400,function(){
						jQuery('.view',jQueryparent).fadeIn('fast');
					});
				} else {
					jQuery(this).animate({ width : '311'}, 500, function() { 
						var jQueryparent = jQuery(this);
						jQuery('.layer',this).fadeIn(400,function(){
							jQuery('.view',jQueryparent).fadeIn('fast');
						}); 
					});
					jQuery(this).parent().find('.'+otherCName).animate({ width : '230'}, 500);
				}
			}, function(){
				var jQueryparent = jQuery(this);
				jQuery('.view',this).fadeOut('fast',function(){
					jQuery('.layer',jQueryparent).fadeOut(400); 
				});
			});
		}	
		
		// Fancy
		jQuery(".fancybox").fancybox();
	});

