var root_path = "";

function set_root_path(project_root_path){
    root_path = project_root_path;
}

function generateUniqueString(){
    var today = new Date();    
    return today.getTime();
}

function show_announcement(position_id, language) {
  var unique_string = generateUniqueString();
  var parametars = 
  "?announcement_position_id="+position_id + 
  "&unique_string="+unique_string +
  "&language="+language;
  var url = root_path + "/modules/announcement/announcement_rendering/render_announcements.php"+parametars;
  var ajaxRequest = new AJAXRequest(url, response_handler_show_announcement);
  ajaxRequest.doGet();
}

function response_handler_show_announcement(req){
 if (req.readyState == 4) {
        if (req.status == 200) {
          document.getElementById("announcement_conainer").innerHTML =  req.responseText;
          document.getElementById("announcements").start();
          
        }
 }
}