jQuery.noConflict();

function start($section) {
	$link = '#n' + $section.substring(0, 1).toUpperCase() + $section.substring(1, $section.length);
	jQuery($link).addClass('active');
	jQuery('.section:not(#' + $section + ')').hide();
}

function update($link, $section) {
	jQuery('#navigation a').removeClass('active');
	$link.addClass('active');
	jQuery('.warning:visible').remove();
	jQuery('.section:visible').fadeOut(600, function() {
		jQuery($section).fadeIn(1000);
	});
}

jQuery(document).ready(function () {
	
	jQuery('#navigation a').click(function() {
		$id = jQuery(this).attr('id');
		update(jQuery(this), '#' + $id.substring(1, $id.length).toLowerCase());
	});
	
	jQuery('#formContact').submit(function() {
		var $valid = true;
		jQuery('#contact .warning:visible').remove();
		if (jQuery('#inputContactName').val() == '') $valid = false;
		if (jQuery('#inputContactEmail').val() == '') $valid = false;
		if (jQuery('#inputContactSubject').val() == '') $valid = false;
		if (jQuery('#inputContactMessage').val() == '') $valid = false;
		if (!$valid) jQuery('#formContact').before('<p class="warning">Veuillez remplir tous les champs s.v.p.</p>');
		jQuery('#contact .warning').fadeIn(1000);
		return $valid;
	});
	
	jQuery('#portfolio > div').addClass('ie6');
	jQuery('#portfolio > div')
        .before('<span id="scrollLeft" class="scrollButton">left</span>')
        .after('<span id="scrollRight" class="scrollButton">right</span>');
    jQuery('.scrollButton').hover(function() {jQuery(this).addClass('hover');}, function() {jQuery(this).removeClass('hover');});
	
	jQuery('#portfolio > div').jCarouselLite({
        btnNext: '#scrollRight',
        btnPrev: '#scrollLeft',
        scroll: 1,
        visible: 1,
        circular: true,
        easing: 'swing',
        speed: 400
    });
});