function getHTTPObject() {
  //prototype de création d'objet pour ajax
  if (window.ActiveXObject) {
    var handle = new ActiveXObject("Microsoft.XMLHTTP");
  } else if (window.XMLHttpRequest) {
    var handle = new XMLHttpRequest();
  } else {
    var handle = false;
  }
  return handle;
}
function precnumb(chif) {
  rezult = chif-1;
  if (rezult<1) rezult=rezult+limite;
  if (rezult>limite) rezult=rezult-limite;
  return rezult;
}

function suivnumb(chif) {
  rezult = chif-1+2;
  if (rezult>limite) rezult=rezult-limite;
  if (rezult<1) rezult=rezult+limite;
  return rezult;
}

function nz(s) {
  s = ""+s;
  if (s.length == 1) s="00"+s;
  if (s.length == 2) s="0"+s;
  return s;
}

function initools() {
  //fonction de démarage lancée onload
  kraft = self.location.search.substring(1,self.location.search.length);  
  kult = 0;
  if (kraft.length > 3) kult = 1;
  if (kraft.length > 3) kraft = kraft.substring (7,kraft.length);
  if (kraft > limite) kraft = limite;
  kraft = nz(kraft);
  if (self.location.search == "") {
    mainumb = limite;
  } else {
    mainumb = kraft-1+6;
  }  
  thumbs= new Array ();
  thumbs[9]=precnumb(mainumb);
  for (i=9; i>0; i--) {
    thumbs[i-1]=precnumb(thumbs[i]);
  }
  mainumb = mainumb -5;
  skunk();
  for (var i = 1; i<=9; i++) {
    imag = nz(thumbs[i]);
    document.getElementsByTagName("img")[i+3+premages].src="thumb/"+imag+".jpg";
    document.getElementsByTagName("img")[i+3+premages].setAttribute('alt','Click to enlarge');
    document.getElementsByTagName("img")[i+3+premages].setAttribute('title','Click to enlarge');
  }
  document.getElementsByTagName("h2")[0].firstChild.nodeValue="#"+mainumb;
  document.getElementById("mainstage").src="full/"+nz(mainumb)+".jpg?"+Math.random();
  trihtwo();
}

function trihtwo() {
  //trigger ajax de recherche titre
  murl= "/cgi-bin/pixinfo.cgi?img="+nz(mainumb);
  pixies.open("GET",murl,true);
  pixies.onreadystatechange = rehtwo;
  pixies.send(null);
}

function rehtwo() {
  //handler ajax MAJ h2
  if (!pixies) return true;
  if (pixies.readyState == 4) {
    var ninfo = pixies.responseXML;
    //set h2
    while (document.getElementsByTagName('h2')[0].firstChild) {
      document.getElementsByTagName('h2')[0].removeChild(document.getElementsByTagName('h2')[0].firstChild);
    }
    tito = ninfo.getElementsByTagName('tito')[0].firstChild.nodeValue;
    toti = ninfo.getElementsByTagName('toti')[0].firstChild.nodeValue;
    em = document.createElement('em');
    hh = document.createTextNode(tito);
    em.appendChild(hh);
    prise = document.createTextNode('#'+mainumb+' aka ');
    document.getElementsByTagName("h2")[0].appendChild(prise);
    document.getElementsByTagName("h2")[0].appendChild(em);
    document.getElementsByTagName("h2")[0].setAttribute('title',toti);
    document.getElementById('mainstage').setAttribute('title',toti);
    full = toti.replace(/\s/g,'');
    items = full.split(",");
    for (i=1; i<10; i++) {
      do {
        j = Math.round(Math.random()*items.length);
      } while ((items[j] == false) || (items[j] == undefined));
      k = items[j];
      items[j] = false;
      lien = document.createElement("a");
      lien.href = "javascript:nigger('"+k+"');";
      lien.setAttribute('title','Other items with "'+k+'" ?');
      lien.rel = "tag";
      textos = document.createTextNode(k);
      lien.appendChild(textos);
      document.getElementsByTagName("h3")[0].appendChild(lien);
      document.getElementsByTagName("h3")[0].removeChild(document.getElementsByTagName("h3")[0].firstChild);
    }
  }
}

function chmain() {
  //clic sur l'image mainstage
  mainumb = suivnumb(mainumb);
  thumbs[1] = precnumb(precnumb(precnumb(mainumb)));
  for (var i=2; i<=9; i++) {
    thumbs[i]=suivnumb(thumbs[i-1]);
  }
  document.getElementById('mainstage').src="thumb/"+nz(mainumb)+".jpg";
  for (var i = 1; i<=9; i++) {
    imag = nz(thumbs[i]);
    document.getElementsByTagName("img")[i+3+premages].src="thumb/"+imag+".jpg";
  }
  document.getElementById('mainstage').src="full/"+nz(mainumb)+".jpg?"+Math.random();
  skunk();
  trihtwo();
}

function thumbup(laquelle) {
  //clic sur une image du browser
  mainumb=thumbs[laquelle];
  quelle = nz(thumbs[laquelle]);
  document.getElementById('mainstage').src="thumb/"+quelle+".jpg";
  trihtwo();
  skunk();
  document.getElementById('mainstage').src="full/"+quelle+".jpg?"+Math.random();
}


function showtools() {
  for (var i = 1; i<=9; i++) {
    document.getElementsByTagName("img")[i+3+premages].src="thumb/"+nz(thumbs[i])+".jpg";
  }
}

function tup() {
  for (var j = 1; j<=8; j++) {
    thumbs[j]=thumbs[j+1];
  }
  thumbs[9]=suivnumb(thumbs[9]);
  showtools();
}

function tup8() {
  thumbs[1]=thumbs[9];
  for (var j=2; j<=9; j++) {
    thumbs[j]=suivnumb(thumbs[j-1]);
  }
  showtools();
}

function tdn() {
  for (var j = 9; j>=2; j--) {
    thumbs[j]=thumbs[j-1];
  }
  thumbs[1]=precnumb(thumbs[1]);
  showtools();
}

function tdn8() {
  thumbs[9]=thumbs[1];
  for (var j=8; j>=1; j--) {
    thumbs[j]=precnumb(thumbs[j+1]);
  }
  showtools();
}

function closer() {
  document.getElementById("exvoto").src="blank.html";
  document.getElementById("exvoto").style.display="none";
}

function midow() {
  document.getElementById("ondisplay").value = mainumb;
  if (document.getElementById("comments").value.length < 4) {
    document.getElementById("comments").focus();
    return false;
  } else {
    return true;
  }
}

function ntm(apo) {
  //effet visuel dock/rollover wave
  apo--;
  ctx = document.getElementById('dock').getElementsByTagName("img");
  for(i=0; i < ctx.length; i++) {
    ss = 50;
    if (i == apo) ss = 58;
    if (Math.abs(i-apo) == 1) ss=54;
    if (Math.abs(i-apo) == 3) ss= 46;
    if (Math.abs(i-apo) == 4) ss=42;
    if (Math.abs(i-apo) == 5) ss=46;
    if (Math.abs(i-apo) == 7) ss=54;
    if (apo < 0) ss = 50;
    ctx[i].style.width= ss+'px';
    ctx[i].style.height=ss+'px';
    ctx[i].style.marginLeft=(25-(ss/2))+'px';
  }
}

function bastia() {
  //handler ajax de réception de recherche
  if (!rek) return true;
  if (rek.readyState == 4) {
    while (document.getElementById('sss').firstChild) {
      document.getElementById('sss').removeChild(document.getElementById('sss').firstChild);
    }
    var mumu = rek.responseXML;
    tosh = mumu.getElementsByTagName('mess')[0].getElementsByTagName('ima');
    if (tosh.length > 0) document.getElementById("sss").style.display = 'block';
    k=0;
    for (j=0; j<tosh.length; j++) {
      i = tosh[j].getAttribute('srl');
      mage = document.createElement('img');
      mage.setAttribute('src','thumb/'+nz(i)+'.jpg');
      mage.setAttribute('alt','#'+i);
      ink = document.createElement('a');
      ink.href = "javascript:differ("+i+");";
      ink.appendChild(mage);
      document.getElementById('sss').appendChild(ink);
      k++;
    }
  }
  if (k < 10) {
    document.getElementById('sss').style.width = (50*k)+'px';
  } else {
    document.getElementById('sss').style.width = '500px';
  }
  return false;
}

function ajaccio() {
  //trigger ajax de recherche d'images
  targos = document.getElementById("kw").value;
  curl= "/cgi-bin/pixelox.cgi?kw="+escape(targos);
  if (window.XMLHttpRequest) {
    rek = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    rek = new ActiveXObject("Microsoft.XMLHTTP");
  }
  rek.open("GET",curl,true);
  rek.onreadystatechange = bastia;
  rek.send(null);
}

function decompte() {
  //mini notification du pré-décompte de pixelo
  document.getElementById('decoy').firstChild.nodeValue= '/...';
  targos = document.getElementById("kw").value;
  durl= "/cgi-bin/pixelox.cgi?kw="+escape(targos);
  if (window.XMLHttpRequest) {
    precast = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    precast = new ActiveXObject("Microsoft.XMLHTTP");
  }
  precast.open("GET",durl,true);
  precast.onreadystatechange = decris;
  precast.send(null);
}

function decris() {
  //handler ajax de pré-décompte de recherche
  if (precast.readyState == 4) {
    var xemele = precast.responseXML;
    if (xemele.getElementsByTagName('nada').length > 0) {
      document.getElementById('decoy').firstChild.nodeValue= '/000';
    } else {
      tosh = xemele.getElementsByTagName('mess')[0].getElementsByTagName('ima');
      document.getElementById('decoy').firstChild.nodeValue= '/'+nz(tosh.length);
    }
  }
  return true;
}

function astaluego() {
  //effet visuel post énumération
  ste = document.getElementById('enum');
  xx = parseInt(ste.style.top);
  xx-= Math.abs(xx*0.2)+1;
  ste.style.top = xx+'px';
  if (xx > -30) {
    setTimeout('astaluego()',50);
  } else {
    ste.style.display='none';
  }
}

function statos() {
  //fonction ajax de réception de l'énumération
  if (funky.readyState == 4) {
    ste = document.getElementById('enum');
    ste.style.display='block';
    ste.style.left='45%';
    ste.style.top='250px';
    var muse = funky.responseXML;
    damess = muse.getElementsByTagName('msg')[0].firstChild.nodeValue;
    elems = damess.split("|");
    id = elems[0];
    votes = elems[1];
    total = elems[2];
    lia = document.createTextNode('Avg ~ '+(Math.floor(100*total/votes)/100));
    liaa = document.createTextNode('Nb = '+votes);
    br = document.createElement('br');
    lee = document.createElement('p');
    lee.appendChild(lia);
    lee.appendChild(br);
    lee.appendChild(liaa);
    remains = ste.getElementsByTagName('*');
    for (i=0; i<remains.length; i++) {
      ste.removeChild(remains[i]);
    }
    ste.appendChild(lee);
    setTimeout('astaluego()',50);
    possee = Math.floor(((total/votes)+4)*450/8)+'px';
    hee = (Math.floor(votes/100)+1)+'px';
    document.getElementById('curses').style.top = possee;
    document.getElementById('curses').style.height = hee;
  }
}
 
function skunk() {
  //fonction ajax de trigger d'énumération
  url= "/cgi-bin/votn.cgi?img="+mainumb+"&rand="+Math.random();
  funky.open("GET",url,true);
  funky.onreadystatechange = statos;
  funky.send(null);
}

function johann() {
  // effet visuel post vote lancé par cruyff
  ste = document.getElementById('exvoto');
  xx = parseInt(ste.style.top);
  xx-= Math.abs(xx*0.2)+1;
  ste.style.top = xx+'px';
  if (xx > -100) {
    setTimeout('johann()',50);
  } else {
    ste.style.display='none';
  }
}

function cruyff() {
  // fonction ajax de réception de vote
  if ((ajaxvote.readyState == 4) && (ajaxvote.status == 200)) {
    ste = document.getElementById('exvoto');
    ste.style.display='block';
    ste.style.left='5px';
    ste.style.top='5px';
    var muse = ajaxvote.responseXML;
    damess = muse.getElementsByTagName('msg')[0].firstChild.nodeValue;
    elems = damess.split("|");
    nv = elems[0];
    nt = elems[1];
    moy = elems[2];
    bg = elems[3];
    poso = elems[4];
    hypo = elems[5];
    ste.style.backgroundColor = bg;
    la = document.createTextNode(nv+" votes");
    lm = document.createTextNode(' ('+hypo+')');
    lb = document.createTextNode(moy);
    h = document.createElement('h4');
    h.appendChild(lb);
    m = document.createElement('small');
    m.appendChild(lm);
    p = document.createElement('p');
    p.appendChild(la);
    p.appendChild(m);
    p.appendChild(h);
    hf = document.createElement('h5');
    boso = document.createTextNode('n°'+poso);
    hf.appendChild(boso);
    p.appendChild(hf);
    remains = ste.getElementsByTagName('*');
    for (i=0; i<remains.length; i++) {
      ste.removeChild(remains[i]);
    }
    ste.appendChild(p);
    setTimeout('johann()',2000);
    possee = Math.floor(((moy)*450/8)+225)+'px';
    hee = (Math.floor(nv/100)+1)+'px';
    document.getElementById('curses').style.top = possee;
    document.getElementById('curses').style.height = hee;
  }
}

function caster(nota) {
  //fonction ajax de trigger de vote
  if ((lasta == lastb) && (lastb == mainumb)) { 
    window.alert("Please pay respect to democracy even if it's fake");
  } else {
    zurl="/cgi-bin/votexml.cgi?img="+mainumb+"&note="+nota+"&rand="+Math.random();
    ajaxvote.open("GET",zurl,true);
    ajaxvote.onreadystatechange = cruyff;
    ajaxvote.send(null);
  }
  lasta = lastb;
  lastb = mainumb;
  promo++;
  if (promo > 5) {
    aa = document.createElement('a');
    aa.href = "/musique/free.html";
    aa.setAttribute('title','4real');
    ii = document.createElement('img');
    ii.src = "grafz/free.jpg";
    ii.alt = "You really may diserve a free CD !";
    ii.align = "center";
    aa.id = "offa";
    aa.appendChild(ii);
    document.getElementsByTagName('body')[0].appendChild(aa);
  }
}

function diffuse(kraft) {
  mainumb = kraft+5;
  thumbs= new Array ();
  thumbs[9]=precnumb(mainumb);
  for (i=9; i>0; i--) {
    thumbs[i-1]=precnumb(thumbs[i]);
  }
  mainumb = mainumb -5;
  skunk();
  for (var i = 1; i<=9; i++) {
    imag = nz(thumbs[i]);
    document.getElementsByTagName("img")[i+3+premages].src="thumb/"+imag+".jpg";
    document.getElementsByTagName("img")[i+3+premages].setAttribute('alt','Click to enlarge');
    document.getElementsByTagName("img")[i+3+premages].setAttribute('title','Click to enlarge');
  }
  document.getElementsByTagName("h2")[0].firstChild.nodeValue="#"+mainumb;
  document.getElementById("mainstage").src="full/"+nz(mainumb)+".jpg?"+Math.random();
  trihtwo();
  peel();
}

function differ(kraft) {
  //fonction de démarage lancée onload
  kult = 0;
  if (kraft.length > 3) kult = 1;
  if (kraft.length > 3) kraft = kraft.substring (7,kraft.length);
  if (kraft > limite) kraft = limite;
  kraft = nz(kraft);
  if (self.location.search == "") {
    mainumb = limite;
  } else {
    mainumb = kraft-1+6;
  }  
  thumbs= new Array ();
  thumbs[9]=precnumb(mainumb);
  for (i=9; i>0; i--) {
    thumbs[i-1]=precnumb(thumbs[i]);
  }
  mainumb = mainumb -5;
  skunk();
  for (var i = 1; i<=9; i++) {
    imag = nz(thumbs[i]);
    document.getElementsByTagName("img")[i+3+premages].src="thumb/"+imag+".jpg";
    document.getElementsByTagName("img")[i+3+premages].setAttribute('alt','Click to enlarge');
    document.getElementsByTagName("img")[i+3+premages].setAttribute('title','Click to enlarge');
  }
  document.getElementsByTagName("h2")[0].firstChild.nodeValue="#"+mainumb;
  document.getElementById("mainstage").src="full/"+nz(mainumb)+".jpg?"+Math.random();
  trihtwo();
  while (document.getElementById('sss').getElementsByTagName('a').length > 0) {
    document.getElementById('sss').removeChild(
      document.getElementById('sss').getElementsByTagName('a')[0]
    );
  }
}
function peel() {
  porto = document.getElementById('desk');
  if (porto.getElementsByTagName('h5')[0]) {
    porto.removeChild(porto.getElementsByTagName('h5')[0]);
  }
  if (porto.getElementsByTagName('h1')[0]) {
    porto.removeChild(porto.getElementsByTagName('h1')[0]);
  }
  unpeel();
}

function unpeel() {
  porto = document.getElementById('desk');
  if (porto.getElementsByTagName('a').length > 0) {
    sentence = porto.getElementsByTagName('a')[0];
    sentence.parentNode.removeChild(sentence);
    setTimeout("unpeel();",11);
  } else {
    document.getElementById('buroport').style.display = "none";
  }
}

var furni = getHTTPObject();
function burotik() {
  //trigger ajax classement
  document.getElementById('buroport').style.display = 'block';
  action = document.getElementById('action').value;
  uurl = "/cgi-bin/votxml.cgi?action="+action+"&force="+Math.random();
  furni.open("GET",uurl,true);
  furni.onreadystatechange = buritos;
  furni.send(null);
}
function buritos() {
  if ((furni.readyState == 4)) {
    bro = document.getElementById('desk');
    bro.style.display = "block";
    var xemele = furni.responseXML;
    hh = document.createElement('h5');
    tt = document.createTextNode(xemele.getElementsByTagName('meta')[0].getAttribute('name'));
    ttt = document.createTextNode(xemele.getElementsByTagName('meta')[0].getAttribute('legend'));
    aa = document.createElement('a');
    aa.href = "javascript:peel();";
    aa.appendChild(tt);
    hh.appendChild(aa);
    bro.appendChild(hh);
    canda = xemele.getElementsByTagName('img');
    for (b=0;b<canda.length;b++) {
      ii = document.createElement('img');
      ii.src = canda[b].getAttribute('src');
      ii.alt = canda[b].getAttribute('alt');
      aa = document.createElement('a');
      aa.href = canda[b].getAttribute('href');
      aa.title = canda[b].getAttribute('alt');
      aa.appendChild(ii);
      bro.appendChild(aa);
    }
    hd = document.createElement('h1');
    hd.appendChild(ttt);
    bro.appendChild(hd);
  }
}


function inigo() {
  //trigger ajax de matrix
  ntie = Math.random();
  transpo.open("GET","/cgi-bin/sms.cgi?toti="+ntie,true);
  transpo.onreadystatechange = matta;
  transpo.send(null);
}

function matta() {
  //handler ajax MAJ h2
  if (!transpo) return true;
  if (transpo.readyState == 4 && (transpo.status == 200)) {
    var ninfo = transpo.responseXML.getElementsByTagName('text')[0];
    rotor = document.createTextNode(ninfo.firstChild.nodeValue);
    aa = document.createElement('a');
    aa.href = ninfo.getAttribute('url');
    aa.appendChild(rotor);
    diva = document.createElement('div');
    diva.id = 'matta';
    diva.appendChild(aa);
    document.getElementById('doco').appendChild(diva);
    poso = 0;
    setTimeout("dement();",249);
  }
}

function dement() {
  document.getElementById('matta').style.display = 'none';
  document.getElementById('doco').removeChild(document.getElementById('matta'));
  setTimeout("inigo()",60000);
}

function cleanrss(leggo) {
  while (document.getElementById('rss').firstChild) {
      document.getElementById('rss').removeChild(document.getElementById('rss').firstChild);
    }
  legg = document.createTextNode(leggo);
  leg = document.createElement('legend');
  leg.appendChild(legg);
  document.getElementById('rss').appendChild(leg);
  
}
function showwor() {
  this.blur();
  cleanrss('The worsts from the votes');
  uurl = "/cgi-bin/votrss.cgi?action=Worst&force="+Math.random();
  furni.open("GET",uurl,true);
  furni.onreadystatechange = diswor;
  furni.send(null);
}
function showbes() {
  this.blur();
  cleanrss('The bests from the votes');
  uurl = "/cgi-bin/votrss.cgi?action=Top&force="+Math.random();
  furni.open("GET",uurl,true);
  furni.onreadystatechange = diswor;
  furni.send(null);
}
function showlea() {
  this.blur();
  cleanrss('The leasts voted for');
  uurl = "/cgi-bin/votrss.cgi?action=Least&force="+Math.random();
  furni.open("GET",uurl,true);
  furni.onreadystatechange = diswor;
  furni.send(null);
}
function showpop() {
  this.blur();
  cleanrss('The most popular from the votes');
  uurl = "/cgi-bin/votrss.cgi?action=Pop&force="+Math.random();
  furni.open("GET",uurl,true);
  furni.onreadystatechange = diswor;
  furni.send(null);
}
function showhyp() {
  this.blur();
  cleanrss('Don\'t believe the hype');
  uurl = "/cgi-bin/votrss.cgi?action=Hype&force="+Math.random();
  furni.open("GET",uurl,true);
  furni.onreadystatechange = diswor;
  furni.send(null);
}
function showrnd() {
  this.blur();
  cleanrss('A random selection');
  uurl = "/cgi-bin/votrss.cgi?action=Random&force="+Math.random();
  furni.open("GET",uurl,true);
  furni.onreadystatechange = diswor;
  furni.send(null);
}

function diswor() {
  if (!furni) return true;
  if (furni.readyState == 4 && (furni.status == 200)) {
    isin = document.getElementById('rss');
    var ussr = furni.responseXML;
    itemy = ussr.getElementsByTagName('item');
    for (g=0; g< itemy.length; g++) {
      another = document.createElement('a');
      strike = document.createElement('img');
      toto = itemy[g].getElementsByTagName('title')[0].firstChild.nodeValue;
      strike.setAttribute('alt',toto);
      sophos = itemy[g].getElementsByTagName('link')[0].firstChild.nodeValue;
      sophos = sophos.substring(31,34);
      strike.setAttribute('src','thumb/'+sophos+'.jpg?'+Math.random());
      sophos++;
      sophos--;
      leky = 'javascript:diffuse('+sophos+');';
      lenky= itemy[g].getElementsByTagName('link')[0].firstChild.nodeValue;
      another.setAttribute('href',leky);
      another.setAttribute('class','sorss');
      another.setAttribute('title',toto);
      another.appendChild(strike);
      isin.appendChild(another);
    }
  }
}

function showrss() {
  this.blur();
  cleanrss('The latests');
  ntie = Math.random();
  darss.open("GET","index.xml?toti="+ntie,true);
  darss.onreadystatechange = empire;
  darss.send(null);
}
function empire() {
  //handler rss
  if (!darss) return true;
  if (darss.readyState == 4 && (darss.status == 200)) {
    isin = document.getElementById('rss');
    var ussr = darss.responseXML;
    itemy = ussr.getElementsByTagName('item');
    for (g=0; g< itemy.length; g++) {
      another = document.createElement('a');
      strike = document.createElement('img');
      toto = itemy[g].getElementsByTagName('title')[0].firstChild.nodeValue;
      strike.setAttribute('alt',toto);
      sophos = itemy[g].getElementsByTagName('link')[0].firstChild.nodeValue;
      sophos = sophos.substring(31,34);
      strike.setAttribute('src','thumb/'+sophos+'.jpg?'+Math.random());
      sophos++;
      sophos--;
      leky = 'javascript:diffuse('+sophos+');';
      lenky= itemy[g].getElementsByTagName('link')[0].firstChild.nodeValue;
      another.setAttribute('href',leky);
      another.setAttribute('class','sorss');
      another.setAttribute('title',toto);
      another.appendChild(strike);
      isin.appendChild(another);
    }
  }
}

function isomap() {
  if (document.getElementById('promo')) {
    document.getElementById('promo').parentNode.removeChild(document.getElementById('promo'));
  }
  obo = document.getElementById('mapp');
  poso = (posy - obo.offsetTop)*8/450;
  poso = poso.toPrecision(3);
  if ((lasta == lastb) && (lastb == mainumb)) { 
    window.alert("Please pay respect to democracy even if it's fake");
  } else {
    zurl="/cgi-bin/votexml.cgi?img="+mainumb+"&note="+poso+"&rand="+Math.random();
    ajaxvote.open("GET",zurl,true);
    ajaxvote.onreadystatechange = cruyff;
    ajaxvote.send(null);
  }
  lasta = lastb;
  lastb = mainumb;
  promo++;
  if (promo == 5) {
    aa = document.createElement('a');
    aa.href = "/musique/free.html";
    aa.setAttribute('title','4real');
    ii = document.createElement('img');
    ii.src = "grafz/free.jpg";
    ii.alt = "You really may diserve a free CD !";
    ii.align = "center";
    aa.id = "offa";
    aa.appendChild(ii);
    document.body.appendChild(aa);
  }
}
	var posx = 0;
	var posy = 0;

function dees(e) {
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	// posx and posy contain the mouse position relative to the document
	// Do something with this information
}
function prenup() {
  curse = document.getElementById('mapp');
  obo = document.getElementById('mapp');
  poso = (posy - obo.offsetTop)*8/450;
  poso -= 4;
  poso = poso.toPrecision(3);
  curse.title = poso;
  return true;
}
function nigger(wht) {
  //clicked keywordz
  ntie = Math.random();
  darss.open("GET","/cgi-bin/pixelopp.cgi?kw="+wht,true);
  darss.onreadystatechange = niger;
  darss.send(null);
}
function niger() {
  //handler nigger
  if (!darss) return true;
  if (darss.readyState == 4 && (darss.status == 200)) {
    numer = darss.responseText;
    var nut = new Array();
    nut = numer.split('#');
    numer = nut[0];
    numer++;
    numer--;
    if (numer = mainumb) numer = nut[1];
    numer++;
    numer--;
    document.getElementById('mainstage').src = 'grafz/wait.jpg';
    diffuse(numer);
  }
}
function placepromo() {
  promo = document.getElementById('promo');
  maa = document.getElementById('mapp');
  promo.style.left = (maa.offsetLeft-150)+'px';
  promo.style.top = (Math.random()*400)+'px';
}
