// JavaScript Document

$(document).ready(function(){

// EXTERNAL LINKS
	$('.extLink').click(function(){ window.open( $(this).attr('href') ); return false; });
	$('.at').parent().addClass('mailto').click(function(){ window.open('mailto:'+$(this).text(),'_self', false); }).find('.at').replaceWith('&#64;'); //<span>contact<span class="at">(at)</span>digitaledeluxe.fr</span>

// RECRUTEMENT : switch offers / candidature
	if($("body#recrutements").length > 0 ){
		var isForm = $('#recrutement-wrapper2').position();$
		if(isForm.left < 0){
			//si on est sur le formulaire, on met l'onglet 'candidature' actif
			//console.log(isForm.left);
			$("h2.tab.active").removeClass('active');
			$('#candidat_form h2.tab').addClass('active');
		}
		$("h2.tab a").click(function(){
			if( ! $(this).parent().hasClass('active') ){
				$("h2.tab.active").removeClass('active');
				$(this).parent().addClass('active');
				$('#recrutement-wrapper').scrollTo( $( $(this).attr('href') ), 700, {easing:'swing'} );
			}
			return false;
		});
	}
	
	//console.log($("#sidebar .img div").height() + ' > ' + $("#contenu-wrapper").height());
	if( $("#sidebar .img div").height() > $("#contenu-wrapper").height() ){
		 $("#sidebar .img div").height($("#contenu-wrapper").height()+40);
	}
	
	/* lancer cufon plus vite
	if( $('body').hasClass('LTEie8') ) 
		Cufon.now(); */
	
	// ACTUALITES : scroll jusqu'à l'actu souhaitée.
	if( typeof actuScrollTo != 'undefined' ){
		$(window).scrollTo(actuScrollTo, 700, {easing:'swing'} );
	}
	
	// COMPTE CLIENT 
	$('#form-account').submit(function() {
		alert('Ce service est actuellement indisponible.');
		return false;
	});
//END READY
});


$(window).resize(function(){

//END RESIZE
});
