// JavaScript Document

//sliding navigation 
$(document).ready(function() { 
	/* This is basic - uses default settings */ 
	$("a#single_image").fancybox(); 
	/* Using custom settings */ 
	$("a#inline").fancybox({ 'hideOnContentClick': true }); 
	$("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false }); 
}); 

//slimbox
$(document).ready(function() { 
			 $("#portfolio a").fancybox({
			'overlayShow' : true ,
			'hideOnContentClick':false, 
			'zoomSpeedIn' : 600,
			'zoomSpeedOut' : 500,
			'overlayOpacity': 0.4,
			'easingIn' : 'easeOutBack',
			'easingOut' : 'easeInBack'
			
			});
			$("#lastreal a").fancybox({
			'overlayShow' : true ,
			'hideOnContentClick':false,
			'zoomSpeedIn' : 600,
			'zoomSpeedOut' : 500,
			'overlayOpacity': 0.4,
			'easingIn' : 'easeOutBack',
			'easingOut' : 'easeInBack'
			}); 
			 
}); 

//portfolio
$(document).ready(function() {  
$('ul#portfolio').before('<ul id="filter"><li class="current"><a href="#">Tout</a></li><li><a href="#">Webdesign</a></li><li><a href="#">Integration</a></li><li><a href="#">Identite visuelle</a></li></ul>');  
});  

$(document).ready(function() {
	$('ul#filter a').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
				
		if(filterVal == 'tout') {
			$('#portfolio ol li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			
			$('#portfolio ol li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}		
		return false;
		
	});
});



//show hyde
$(document).ready(function(){
	$(".legende").fadeTo("slow", 0.0); // This sets the opacity of the thumbs to fade down to 60% when the page loads	
	$(".legende ").hover(function(){
	$(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover
	},function(){
	$(this).fadeTo("slow", 0.0); // This should set the opacity back to 60% on mouseout
	});
});

//fade lastnews
$(document).ready( function(){
					$('#news').innerfade({
 						speed: 'slow', 
						timeout: 3000, 
						type: 'sequence', 
						containerheight: '85px' 
					 }); 
});

//mailform
$(document).ready(function(){
			$('#myForm').ajaxForm(function(data) {
				if (data==1){
					$('#success').fadeIn("slow");
					$('#myForm').resetForm();
				}
				else if (data==2){
					$('#badserver').fadeIn("slow");
				}
				else if (data==3)
				{
					$('#bademail').fadeIn("slow");
				}
			});
		});

//scrollbar
$(function()
{
	$('.scroll-pane').jScrollPane();
});
