// MAIN SLIDESHOW (images)

$(function() {
	var imgWrapper = $('#slider > div');
	// only show the first image, hide the rest
	imgWrapper.hide().filter(':first').show();
	
	$('#slider_nav ul li a').click(function () {
	
	    // check if this item doesn't have class "current"
	    // if it has class "current" it must not execute the script again
	    if (this.className.indexOf('current') == -1){
	    	imgWrapper.hide();
	    	imgWrapper.filter(this.hash).fadeIn(500);
	    	$('#slider_nav ul li a').removeClass('current');
	    	$(this).addClass('current');
	    }
	    return false;
	});
});

// BOTTOM SLIDESHOW (content slideshow on the home page)

$(function() {
	var contentWrapper = $('#slider2 > .item');
	// only show the first item, hide the rest
	contentWrapper.hide().filter(':first').show();
	
	$('#slider2_nav ul li a').click(function () {
	
	    // check if this item doesn't have class "current"
	    // if it has class "current" it must not execute the script again
	    if (this.className.indexOf('current') == -1){
	    	contentWrapper.hide();
	    	contentWrapper.filter(this.hash).fadeIn(500);
	    	$('#slider2_nav ul li a').removeClass('current');
	    	$(this).addClass('current');
	    }
	    return false;
	});
});

// CONTACT FORM PLUGIN

