/***HIDE / SHOW PROJETS ****/

function _gid(elemId){
	return document.getElementById(elemId);
}
function showProject(num){
	_gid('project'+num).style.display = 'block';
}

function hideProject(num){
	_gid('project'+num).style.display = 'none';
}

/*MENU FADE TO*/
  
 $(document).ready(function() {

        var fadein_speed  = 350; /* Vitesse de transition (show) en ms (350 = 0.350s) */
        var fadeout_speed = 150; /* Vitesse de transition (hide) en ms (150 = 0.150s) */
        var opacity_show  = 1;   /* Opacité du background (show) (1 = 100%) */
        var opacity_hide  = 0;   /* Opacité du background (hide) (0 =   0%) */

        $('#menu a, li #menu_ins a').hover(
            function () { // mouse hover
                // on affiche le span progressivement
                $(this).children('span.background').stop().fadeTo(fadein_speed, opacity_show);    
            },
            function () { // mouse leave
                // si le lien n'est pas "courant"
                if(!$(this).hasClass('courant'))    
                {
                    // on fait disparaitre le span progressivement
                    $(this).children('span.background').stop().fadeTo(fadeout_speed, opacity_hide);
                }
				
        });
	
    });
    
    
    

 /*MENU FADE TO*/






  var viewer = new PhotoViewer();
  viewer.add('img/photos/1.jpg');
  viewer.add('img/photos/2.jpg');
  viewer.add('img/photos/3.jpg');
  viewer.add('img/photos/4.jpg');
  viewer.add('img/photos/5.jpg');
  viewer.add('img/photos/6.jpg');
  viewer.add('img/photos/7.jpg');
  viewer.add('img/photos/8.jpg');
  viewer.add('img/photos/9.jpg');
  viewer.add('img/photos/10.jpg');
  viewer.add('img/photos/11.jpg');
  viewer.add('img/photos/12.jpg');
  viewer.add('img/photos/13.jpg');
  viewer.add('img/photos/14.jpg');
  viewer.add('img/photos/15.jpg');
  viewer.add('img/photos/16.jpg');
  viewer.add('img/photos/17.jpg');
  viewer.add('img/photos/18.jpg');
  viewer.add('img/photos/19.jpg');
  viewer.add('img/photos/20.jpg');
  viewer.add('img/photos/21.jpg');
  viewer.add('img/photos/22.jpg');
  viewer.add('img/photos/23.jpg');
  viewer.add('img/photos/24.jpg');
  viewer.add('img/photos/25.jpg');
  viewer.add('img/photos/26.jpg');
  viewer.add('img/photos/27.jpg');
  viewer.add('img/photos/28.jpg');
  viewer.add('img/photos/29.jpg');
  viewer.add('img/photos/30.jpg');
  viewer.add('img/photos/31.jpg');
  viewer.add('img/photos/32.jpg');
  viewer.add('img/photos/33.jpg');
  viewer.add('img/photos/34.jpg');
  viewer.add('img/photos/35.jpg');
  viewer.add('img/photos/36.jpg');
  viewer.add('img/photos/37.jpg');
  viewer.add('img/photos/38.jpg');
  viewer.add('img/photos/39.jpg');
  viewer.add('img/photos/40.jpg');
  viewer.add('img/photos/41.jpg');
  viewer.add('img/photos/42.jpg');
  viewer.add('img/photos/43.jpg');
  viewer.add('img/photos/44.jpg');
  viewer.add('img/photos/45.jpg');
  viewer.add('img/photos/46.jpg');
  viewer.add('img/photos/47.jpg');
  viewer.add('img/photos/48.jpg');
  viewer.add('img/photos/49.jpg');
  viewer.add('img/photos/50.jpg');
  viewer.add('img/photos/51.jpg');
  viewer.add('img/photos/52.jpg');
  viewer.add('img/photos/53.jpg');
  viewer.add('img/photos/54.jpg');
  viewer.add('img/photos/55.jpg');
  viewer.add('img/photos/56.jpg');
  viewer.add('img/photos/57.jpg');
  viewer.add('img/photos/58.jpg');
  viewer.add('img/photos/59.jpg');
  viewer.add('img/photos/60.jpg');
  viewer.add('img/photos/61.jpg');  
  
  
 var viewer2 = new PhotoViewer();
  viewer2.add('img/photos/42.jpg');
  viewer2.add('img/photos/63.jpg');
  viewer2.add('img/photos/64.jpg');
  viewer2.add('img/photos/65.jpg');
  viewer2.add('img/photos/66.jpg');
  viewer2.add('img/photos/67.jpg');
  viewer2.add('img/photos/68.jpg');
  viewer2.add('img/photos/69.jpg');
















	function slideSwitch() {
    var $active = $('#slideshow A.active');

    if ( $active.length == 0 ) $active = $('#slideshow A:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow A:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});





// <![CDATA[
jQuery(document).ready(function(){
$('#contactform').submit(function(){  
var action = $(this).attr('action');
$.post(action, { 
name: $('#name').val(),
email: $('#email').val(),
company: $('#company').val(),
subject: $('#subject').val(),
message: $('#message').val()
},
function(data){
$('#contactform #submit').attr('disabled','');
$('.response').remove();
$('#contactform').before('<p class="response">'+data+'</p>');
$('.response').slideDown();
if(data=='Message sent!') $('#contactform').slideUp();
}
); 
return false;
});
});
// ]]>




/*TABS*/

$(document).ready(function() {

	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

});


$(document).ready(function() {

	//When page loads...
	$(".tab_content_inscription").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content_inscription:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content_inscription").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

});



