
if( typeof(isHome) != 'undefined' && isHome == '1'){
	var images = ["/imports/images/bg-accueil.jp" ];
}else{
	var images = ["/imports/images/bg-glissiere.jpg", "/imports/images/bg-info-AIGG.jpg" , "/imports/images/bg-automatech.jpg" , "/imports/images/bg-auditif.jpg" ];
}

$(function() {
  var img = images[Math.floor(Math.random() * images.length)];
  $("body").css("background", "url(" + img + ") top no-repeat fixed #000" );
});


$(document).ready(function() { 
  $('.navigation li ul').css({
    display: 'none',
    left: 'auto'
 });


$('.navigation li').hover(function() {
    $(this)
      .find('ul')
      .stop(true, true)
      .fadeIn('fast')
	   .parent().css('background', "url(/imports/images/bg-menu-over.gif) bottom left no-repeat #FFF" );
  }, function() {
    $(this)
      .find('ul')
      .stop(true,true)
      .fadeOut('fast')
	   .parent().css('background', '');  
  }); 
});  


$(document).ready(function() {
    $('.slideshow').each(function(index) 
    {
        $(this).cycle({
			fx:     'fade',
         	timeout: 12000,
			speed:  1000,
			//pause: 1,
			sync:  1,
			pager:  '#nav',
			pagerAnchorBuilder: function(i) {
				if (index == 0)
					// for first slideshow, return a new anchro
					return '<li><a href="#">'+(i+1)+'</a></li>';
				// for 2nd slideshow, select the anchor created previously
				return '#nav a:eq('+i+')';
        	}
		});
    });
});


$(document).ready(function(){
			$("#carte").colorbox();
});
