if (screen.width<1024) {
 location.href="http://m.belvedere-namur.be";
}

$(document).ready(function(){	

 $('a[rel^=lightbox]').lightBox();

 $("#slider").easySlider({
  auto: true,
  continuous: true,
  speed: 400,
  pause: 5000,
  prevText: '',
  nextText: ''
 });
 
 $("#social-links li").hover(
  function() {$(this).animate({top: '0px'},500);},
  function() {$(this).animate({top: '-55px'},500);}
 );
 
 $("#lang-select a").click(function() {
  $("p.lang-tab").hide();
  lang = $(this).text();
  filtre = "p.lang-tab[rel="+lang+"]";
  $(filtre).show();
  return false;
 });
 
 $("#form-newsletter").submit(function() {
  $(this).find(".error-message").remove();
  var email = $(this).find("input[name=email]").val();
  if (email != '') {
   if ((email.indexOf('@') > 0) && (email.lastIndexOf('.') > 3)) {
    $.post('/save_email.php',{email: email}, function(data) {
     if (data != 'error') {
 	  $("#form-newsletter").html("<strong>"+data+"</strong>");
	 }
    });
   }
   else {
    $(this).append("<div class=\"error-message\">adresse e-mail incorrecte</div>");
	$(this).find(".error-message").slideDown('fast').delay(1000).slideUp('fast').delay(300);
   }
  } 
  return false;
 });
 
});
