$(document).ready(function()
{
	//$('form').validationEngine();
	//
	$("#search_input").keyup(function(e) {
			if(e.keyCode == 13) {
				$("#search_form").submit();
			}
		});
	$('.fancy').fancybox();
	//
	$('p.title').css({'opacity':'.6'});

	var parent = $('.section_holder');

	// background des sections intérieurs
	$('.section_background').css(
		{		
			  'opacity'			: 0.5
			, 'background' 		: '#000'	
			, 'width'			: '493px'
			, 'padding'			:'15px 0 10px 15px'
			, 'height'			: parent.height() - 245
			, 'top'				: '245px'
			, 'z-index'			: 0
		}
	)
	
	// background des sections intérieurs
	$('.mobiliers, .furniture').css(
		{		
			  //'opacity'			: 0.5
			  'background' 		: '#320D14'	
			, 'width'			: '493px'
			, 'padding'			:'15px 0 10px 15px'
			, 'height'			: parent.height() - 245
			, 'top'				: '245px'
			, 'z-index'			: 0
		}
	)
	
	// background des sections intérieurs
	$('.decorations, .decoration').css(
		{		
			//'opacity'			: 0.5
			  'background'		: '#712E1E'	
			, 'width'			: '493px'
			, 'padding'			:'15px 0 10px 15px'
			, 'height'			: parent.height() - 245
			, 'top'				: '245px'
			, 'z-index'			: 0
		}
	)
	
	// background des sections intérieurs
	$('.accessoires, .accessories').css(
		{		
			//  'opacity'		: 0.5
			  'background' 	: '#3B423A'	
			, 'width'		: '493px'
			, 'padding'		:'15px 0 10px 15px'
			, 'height'		: parent.height() - 245
			, 'top'			: '245px'
			, 'z-index'		: 0
		}
	)
	
	// lightbox 
	$('.section_photo').mkLightbox(
	{
		  prev_btn			: site_url + 'public/images/prev_btn.png'
		, next_btn			: site_url + 'public/images/next_btn.png'	
		, big_picture_path	: site_url + 'public/images/pictures/big/'
		, phpThumb_path		: site_url + 'public/phpthumb/phpThumb.php'
		, phpThumb_params	: '&w=508&h=384&zc=1'
	});
	
	var name = lang == 'fr' ? 'Nom' : 'Name';
	var email = lang == 'fr' ? 'Courriel' : 'Email';
	var message = lang == 'fr' ? 'Votre message' : 'Your message';

	// Contact Form default values 
	$('#cNom').focus(function()
	{
		$(this)	.val('');
	}).blur(function() { if($(this).val() == '')	$(this).val(name) });

	$('#cEmail').focus(function()
	{
		$(this)	.val('');
	}).blur(function() { if($(this).val() == '')	$(this).val(email) });
	$('#cMessage').focus(function()
	{
		$(this)	.val('');
	}).blur(function() { if($(this).val() == '')	$(this).val(message) });
	
})
