/**
 * ------------------------------------------------------------------------
 *  Made by Jacques Bodin-Hullin
 *     Jardin <jacques@bodin-hullin.net>
 *
 *  Started on July 19, 2007
 *  Last update July 22, 2007
 *
 *  (C) Copyright 2007 - Jacques 'Jardin' Bodin-Hullin
 * ------------------------------------------------------------------------
 */

/**
 * getElementById
 *
 * @param str string ID
 */
function getId(str) {
   return document.getElementById(str);
}

/**
 * Return hour
 *
 * @param Id string block's id
 */
function getHour(Id) {
   var date = new Date();
   var content = '';
   var hours = date.getHours();
   var minutes = date.getMinutes();
   var seconds = date.getSeconds();
   if (hours < 10) {
      hours = '0' + hours;
   }
   if (minutes < 10) {
      minutes = '0' + minutes;
   }
   if (seconds < 10) {
      seconds = '0' + seconds;
   }
   content = hours + ':' + minutes + ':' + seconds;
   getId(Id).innerHTML = content;
}

/**
 * Reload the captcha image
 *
 * @param name string ID of the image
 * @param source string Source of the captcha
 */
function reloadCaptcha(name, source) {
   var rand = Math.random();
   document.getElementById(name).src = source + '?' + rand;
}

/**
 * For confirmed the action
 *
 * @param texte string The popup's text
 * @param url string The url to redirect
 */
function confirmation(texte, url)
{
	if(confirm(texte)) location.href = url;
}
