Date.prototype.addDay = function (day) {
  var a = new Date(this.getFullYear(),this.getMonth(),this.getDate());
  a.setDate(this.getDate()+day)
  return a;
}

Date.prototype.JJMMAAAA = function (separator) {
  return String(this.getDate()).fillPrevChar("0",2) + separator +
    String(this.getMonth()+1).fillPrevChar("0",2) + separator +
    this.getFullYear();
}

Array.prototype.clear = function () {
  while (this[0]) this.pop();
}

Array.prototype.is_in = function (obj) {
	var i = 0;
	var rep = false;
	while (this[i] != null && !rep) rep = (this[i++]==obj); 
	return rep;
}

String.prototype.is_style = function () {
	var regle = /^([a-zA-Z-]{3,}:[a-zA-Z0-9 -=,:.#%()\/']+[;]?)+$/;
	return regle.test(this);
}

String.prototype.is_class = function () {
	var regle = /^[a-zA-Z_]{1}[a-zA-Z0-9_]*$/;
	return regle.test(this);
}

String.prototype.RLtrim = function () {
	return this.replace(/(^\s*)|(\s*$)/g,"");
}

String.prototype.splitEns = function () {
  var tabReturn = new Array();
  var tab1 = this.split("^");
  var i = 0;
  while (tab1[i]) tabReturn.push(tab1[i++].split("&"));
	return tabReturn;
}

String.prototype.in_born = function (valeur) {
  var tabEns = this.splitEns();
  var nbr = Number(valeur.replace(",","."));
  var borneinf,bornesup;
  var i = 0,rep = false;
  while (tabEns[i] && !rep) {
    if (tabEns[i][0] == "-inf") borneinf = -Infinity;
    else borneinf = tabEns[i][0];
    if (tabEns[i][1] == "+inf") bornesup = Infinity;
    else bornesup = tabEns[i][1];
    rep = rep || (nbr >= borneinf && nbr <= bornesup);
    i++;
  }  
	return rep;
}

String.prototype.getFullYear = function  () {
  var anneenum = Number(this);
  if (anneenum >= 0 &&  anneenum <= 69) return (new String(Math.floor(((new Date).getFullYear())/100)))+this;
  else return (new String(Math.floor(((new Date).getFullYear())/100)-1))+this;
}

String.prototype.getNumMonth = function  () {
  if (this.toLowerCase() == "janvier") return "01"; 
  else if (this == "f&eacute;vrier" || this == "F&eacute;vrier" || this == "FEVRIER") return "02"; 
  else if (this.toLowerCase() == "mars") return "03"; 
  else if (this.toLowerCase() == "avril") return "04"; 
  else if (this.toLowerCase() == "mai") return "05"; 
  else if (this.toLowerCase() == "juin") return "06"; 
  else if (this.toLowerCase() == "juillet") return "07"; 
  else if (this == "ao&ucirc;t" || this == "Ao&ucirc;t" || this == "AOUT") return "08"; 
  else if (this.toLowerCase() == "septembre") return "09"; 
  else if (this.toLowerCase() == "octobre") return "10"; 
  else if (this.toLowerCase() == "novembre") return "11"; 
  else if (this == "d&eacute;cembre" || this == "D&eacute;cembre" || this == "DECEMBRE") return "12"; 
  else return "";
}

String.prototype.fillPrevChar = function  (caract,nbr) {
  return (this.length < nbr)?caract+this.fillPrevChar(caract,nbr-1):this;
}

String.prototype.fillLastChar = function  (caract,nbr) {
  return (this.length < nbr)?this.fillLastChar(caract,nbr-1)+caract:this;
}