// JavaScript Document

document.observe('dom:loaded', function () { 
	
	/*$$('.anatips').each(function(el) {
	 el.observe('mouseover', function() { $('transparent').setStyle({ backgroundImage: 'url(img/prehome/departements/'+el.readAttribute('alt')+'.png)' }); $('departement_'+el.readAttribute('alt')).down(0).addClassName('active'); }).observe('mouseout', function() { $('transparent').setStyle({ backgroundImage: 'none' }); $('departement_'+el.readAttribute('alt')).down(0).removeClassName('active'); });							 
	});
	$$('.lien').each(function(el) {
	 el.observe('mouseover', function() { $('transparent').setStyle({ backgroundImage: 'url(img/prehome/departements/'+el.readAttribute('title')+'.png)' }); }).observe('mouseout', function() { $('transparent').setStyle({ backgroundImage: 'none' }); });							 
	});*/
	
	// On va agrandir le calque pour qu'il fasse toutes la page
	var _height = $('principale').getHeight();
	$('choix-departement').setStyle({ height: _height+'px' });
	
});

// On choisi pas de departement
function choixDepartement(value, calque) {
	
	// On crée le cookie
      var expireDate = new Date();
      expireDate.setTime(expireDate.getTime() + 365*24*3600*1000);
      document.cookie = "departement=" + escape(value) + ";expires=" + expireDate.toGMTString();
	  
	  // On redirige si il choisi un departement
	  if(value != 0) { 
	   location.href = 'departement-'+value+'.html';
	  } else { 
	   if(calque == 1) { $('choix-departement').hide() } else { location.href = 'accueil.html' }
	  }
	
}
	
	