$(document).ready(function(){

	// jQuery Scroller

	$('#scroller').easySlider({
		continuous: true,
		prevId: 'scroll-prev',
		nextId: 'scroll-next'
	});
	
	// Fancybox lightbox elements
	
	$('a.lightbox').fancybox();
	
	$('a.portfolio-mag').fancybox();
	
	$('a.scroll-mag').fancybox();
	
	$('.scroll-mag').stop().css({
		'opacity': 0
	});
	
	// Custom magnify icon fades
	
	$('a.lightbox').hover(function(){
		$('.scroll-mag').stop().animate({
			'opacity': 1
		}, 700);
	}, function(){
		$('.scroll-mag').stop().animate({
			'opacity': 0
		}, 700);
	});
	
	$('a.scroll-mag').hover(function(){
		$('.scroll-mag').stop().animate({
			'opacity': 1
		}, 700);
	}, function(){
		$('.scroll-mag').stop().animate({
			'opacity': 0
		}, 700);
	});
	
	// Input Fields

	$('input, textarea').each(function () {
		if ($(this).val() == '') {
			$(this).val($(this).attr('name'));
		}
	}).focus(function () {
		$(this).removeClass('inputerror');
		if ($(this).val() == $(this).attr('name')) {
			$(this).val('');
		}
	}).blur(function () {
		if ($(this).val() == '') {
			$(this).val($(this).attr('name'));
		}
	});
});