$(document).ready(function(){
	
	if ($('#contactForm input').val()=='invalid email address' || $('input').val()=='required') {
		$(this).addClass('formError');
	}
	
	$('#contactForm input').focus(function() {
		if ($(this).val()=='invalid email address' || $(this).val()=='required'){
			$(this).val('');
		}
		
		$(this).removeClass('formError');
	});
	
	$('#contactForm input').blur(function() {
		if($(this).val()=='')
		$(this).addClass('formError');
	});
	
	if ($('#contactForm textarea').text()=='required') {
		$(this).addClass('formError');
	}
	
	$('#contactForm textarea').focus(function() {
		if ($(this).text()=='required'){
			$(this).text('');
		}
		
		$(this).removeClass('formError');
	});
	
	$('#contactForm textarea').blur(function() {
		if($(this).text()=='')
		$(this).addClass('formError');
	});
	
	
});

$(window).load(function() {
	var total = $('#slider img').length;
	var rand = Math.floor(Math.random()*total);
	$('#slider').nivoSlider({
		effect:'random', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:500, //Slide transition speed
		pauseTime:4000,
		startSlide:rand, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
});

