$(document).ready(function() {
	
	$('aside .ul2 li').hover(function(){$(this).stop().animate({backgroundPosition:'0px 0px'}, 800, 'easeOutExpo')}, function(){$(this).stop().animate({backgroundPosition:'0px -273px'}, 600, 'easeOutExpo')});
	
	$('#submitform').click(function() {
										var name = $('form #name').val();
										var email = $('form #email').val();
										var message = $('form #message').val();
										var message2 = $('form #message2').val();
										
										var error = 0;
										
										if((name == '' || name == 'Your Name'))
										{										
											error = 1;		
										}
										if((email == '' || email == 'Your Email'))
										{										
											error = 1;		
										}
										if((message == '' || message == 'Message'))
										{										
											error = 1;	
										}
										if((message2 != ''))
										{										
											error = 2;
										}
										
										if(error == 1)
										{
											alert("All fields are required! Please fill in all the fields and re-submit the form.");
										}
										else if(error == 2)
										{
											alert("We have encountered an error! If you have any question please call us at (800) 543-8662.");
										}
										else
										{
											$('#form').submit();
										}
										
									});
	
});
   $(window).load(function() {
   $('#slider').nivoSlider({
        effect:'fold', //Specify sets like: 'fold,fade,sliceDown, sliceDownLeft, sliceUp, sliceUpLeft, sliceUpDown, sliceUpDownLeft' 
        slices:17,
        animSpeed:500,
        pauseTime:6000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:false, //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:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:1, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){} //Triggers after all slides have been shown
    });
});
   
