/* This file is automatically generated by Waw. Any edit will probably be lost
 * next time the application is started. */

/* Messages, from waw.resources.messages */
var messages = new Array();
messages['bad_body'] = "Vous n'avez pas introduit de message.";
messages['bad_client'] = "Vous n'êtes pas autorisé à modifier la liste onair depuis cette adresse ip.";
messages['bad_mail'] = "L'adresse email entrée n'est pas valide.";
messages['bad_name'] = "Veuillez introduire vos nom et prénom.";
messages['bad_song'] = "Cette chanson n'est pas bonne, elle ne passera pas sur antenne.";
messages['email_confirm_ok'] = "<b>Votre email nous a bien été envoyé.</b><p>Nous donnerons suite à votre courriel dès que possible.</p><p>L'équipe de Hit Radio Namur.</p>";

/* Actions contributed by HitRadio::AdsController, mapped to / */
/* Actions contributed by HitRadio::OnAirController, mapped to / */
function webserv_onair_song_changed(request_data, form) {
  $.ajax({type: "POST", url: "/webserv/onair/song_changed", data: request_data, dataType: "json",
    error: function(data) {
      window.location = '/feedback?mkey=server_error';
    },
    success: function(data) {
      if (data[0] == 'validation-ko') {
        $(form + ' .feedback').show();
        $(form + ' .feedback').html(messages[data[1][0]]);
      } else if (data[0] == 'success') {
        if (data[1] == 'ok') {
          location.reload(true);
        }
      }
    }
  });
  return false;
}  
/* Actions contributed by HitRadio::Top20Controller, mapped to / */
function webserv_top20_update_from_csv(request_data, form) {
  $.ajax({type: "POST", url: "/webserv/top20/update_from_csv", data: request_data, dataType: "json",
    error: function(data) {
      window.location = '/feedback?mkey=server_error';
    },
    success: function(data) {
      if (data[0] == 'success') {
        if (data[1] == 'ok') {
          location.reload(true);
        }
      }
    }
  });
  return false;
}  
/* Actions contributed by HitRadio::ContactController, mapped to / */
function webserv_contact_send(request_data, form) {
  $.ajax({type: "POST", url: "/webserv/contact/send", data: request_data, dataType: "json",
    error: function(data) {
      window.location = '/feedback?mkey=server_error';
    },
    success: function(data) {
      if (data[0] == 'validation-ko') {
        str = '';
        str += '<ul>';
        for (var k in data[1]) {
          str += '<li>' + messages[data[1][k]] + '</li>';
        }
        str += '</ul>';
        $(form + ' .feedback').show();
        $(form + ' .feedback').html(str);
      
      } else if (data[0] == 'success') {
      
                $('#contact_form').hide();
                $('#mailconfirm').show();
              
      }
    }
  });
  return false;
}  

/* Ads description, from waw.resources.pubs */
var pubs = new Array();
pubs[0] = {
  'thumb' : "/images/pubs/3_m.jpg",
  'desc' : "En semaine de 7h à 10h, c'est Breakfast avec Fanny !<br/>Jamais une radio ne vous a si bien réveillé.",
  'title' : "Breakfast",
  'img' : "/images/pubs/3.jpg",
 last : 1
};
pubs[1] = {
  'thumb' : "/images/pubs/4_m.jpg",
  'desc' : "Désormais, retrouvez Gilles de 18h à 20h dans After Work",
  'title' : "After Work",
  'img' : "/images/pubs/4.jpg",
 last : 1
};
pubs[2] = {
  'thumb' : "/images/pubs/2_m.jpg",
  'desc' : "Retrouvez Geoffroy samedi & dimanche de 8h à 12h dans Breakfast week-end !",
  'title' : "Breakfast Week End",
  'img' : "/images/pubs/2.jpg",
 last : 1
};
pubs[3] = {
  'thumb' : "/images/pubs/1_m.jpg",
  'desc' : "Chaque samedi, 3 heures de set Electro de 20h à 23h.",
  'title' : "Electrolyse",
  'img' : "/images/pubs/1.jpg",
 last : 1
};
pubs[4] = {
  'thumb' : "/images/pubs/5_m.jpg",
  'desc' : "<p>50 fans supplémentaires sur facebook, c'est 5 membres qui gagnent un K-do! Plus d'infos sur <a target=\"_blank\" href='http://facebook.hit-radio.be'>http://facebook.hit-radio.be</a></p>",
  'title' : "50 fans = 5 k-dos",
  'img' : "/images/pubs/5.jpg",
 last : 1
};

$(function(){jQuery.preLoadImages('/images/pubs/3.jpg','/images/pubs/4.jpg','/images/pubs/2.jpg','/images/pubs/1.jpg','/images/pubs/5.jpg','');});

/* APE configuration */
var APEConfig = {"APE.Config.server":"ape.www.hit-radio.be:6969","APE.Config.domain":"auto","APE.Config.baseUrl":"http://ape.www.hit-radio.be/ape-jsf"};