$(document).ready(function() {

	// Slideshow
	
    $('#slideshow-large').cycle({
		fx: 'fade',
	    speed:  1500, 
	    timeout: 4500
	});
	
    $('.slideshow-column').cycle({
		fx: 'scrollHorz',
	    speed:  1500, 
	    timeout: 4500
	});
	
	// Slideshow with Pager, Next/Prev Links and Smart Linking
	
	 $('#large-slideshow-slide img:first').fadeIn(850, function() {
	
	    $('#slideshow').cycle({
		    fx:     'scrollHorz', 
		    speed:  1500, 
		    timeout: 1000,
	        prev:    '#slides-prev',
	        next:    '#slides-next',
		    pager:  '#nav-slideshow', 
		    pagerAnchorBuilder: function(idx, slide) { 
		        return '#nav-slideshow li:eq(' + idx + ') a'; // Pager
		    },
		    before: function () {
				$('#slideshow-name').html(this.alt);
				$('#slideshow-title').html(this.title);
				var slideshowlink = $(this).attr("rel");
				$('#slideshow-link').attr("href", slideshowlink);
	        }
		});
	
	}); 
	
	// Alert
	
	$("#notification").slideDown(400).delay(1500).slideUp(400);
	
	// Hover
	
	$("#list-boxes li").hover(function() {
		$(this).css("background-color","#182351");
	}, function() {
		$(this).css("background-color","#4f5d9a");
	});
	
	// Clear Form
	
	$('.clear').focus(function() {
		$(this).val("");
	});
	
	$('.clear').blur(function() {
		var clearTitle = $(this).attr("title");
		$(this).val(clearTitle);
	});
	
	// Validation
	
	$("#form").validate({
		rules: {
			email_address: {
				required: true,
				email: true
			},
			phone: {
				required: true,
				digits: true
			}
		}
	});

});


