
function bouge() {
	senvoler();
	ellipser(); // ellipse.js
	largeur_fenetre = get_bodyWidth();
	hauteur_fenetre = get_bodyHeight();
}

window.onresize = function() {
	if(window.largeur_fenetre && largeur_fenetre != 0) {
		setTimeout("reconstruire()",3000);
	}
}
function reconstruire() {
	if(largeur_fenetre != get_bodyWidth()) {
	//	alert("largeur_fenetre : "+largeur_fenetre+" ; nouvelle largeur : "+get_bodyWidth()+" ; hauteur_fenetre : "+hauteur_fenetre+" ; nouvelle hauteur : "+get_bodyHeight());
		window.location.reload();
	}
}

////////////////////////
//utile
function get_bodyWidth() {
	var bodyWidth = 0;
	if(document.width) bodyWidth=document.width;
	if(document.body && document.body.offsetWidth) bodyWidth=document.body.offsetWidth;
	if(window.innerWidth)	bodywidth=window.innerWidth;
	return bodyWidth;
}
function get_bodyHeight() {
	var bodyHeight = 0;
	if(document.width) bodyHeight=document.height;
	if(document.body && document.body.offsetHeight) bodyHeight=document.body.offsetHeight;
	if(window.innerHeight)	bodyHeight=window.innerHeight;
	return bodyHeight;
}
function getTexte(el) {
  var texte = "";
  if (el != null) {
    if (el.childNodes) {
      for (var i = 0; i < el.childNodes.length; i++) {
        var noeudFils = el.childNodes[i];
        if (noeudFils.nodeValue != null) {
          texte = texte + noeudFils.nodeValue;
        }
      }
    }
  }
  return texte;
}
function setStyle(element, style) {
  for (directive in style) {
    element.style[directive] = style[directive];
  }
}

function makeHexa(thiscol) {
    var colhex_left = Math.floor(thiscol/16)
    var colhex_right= thiscol-(colhex_left*16)
    if (colhex_left == 10) {colhex_left="A";}
    if (colhex_left == 11) {colhex_left="B";}
    if (colhex_left == 12) {colhex_left="C";}
    if (colhex_left == 13) {colhex_left="D";}
    if (colhex_left == 14) {colhex_left="E";}
    if (colhex_left == 15) {colhex_left="F";}  
    if (colhex_right == 10) {colhex_right="A";}
    if (colhex_right == 11) {colhex_right="B";}
    if (colhex_right == 12) {colhex_right="C";}
    if (colhex_right == 13) {colhex_right="D";}
    if (colhex_right == 14) {colhex_right="E";}
    if (colhex_right == 15) {colhex_right="F";}
    var colhex =""+colhex_left+colhex_right;
    return colhex;
}

function string_to_array(divId) {
	var div_id = document.getElementById(divId);
	var string_div = getTexte(div_id);
	var array_div = string_div.split(',');

	return array_div ;
}
