function init(){
	init2();
	increase=Math.floor(Math.random()*1000000);
	document.tools.onsubmit=submitForm;
	setTimeout('isThereNew();',1000);
}
function submitForm(){
	increase++;
	str='http://www.clickonthepixels.com/enreg.php?x='+document.tools.x.value+'&y='+document.tools.y.value+'&palette='+document.tools.palette.value+'&code='+document.tools.code.value+'&id='+document.tools.id.value+'&ip='+document.tools.ip.value+'&i='+increase;
	if(xhrList.length<1 || xhrList[xhrList.length-1]!=str){
		xhrList.push(str);
		if(xhrList.length<2) xhrDo(str);
	}
	return false;
}
var increase=0;
function reloadImage(r0){
	i0=document.body.getElementsByTagName('table');
	for(i1=0;i0[i1];i1++) if(i0[i1].className=='grille_curseur') break;
	i0=i0[i1];
	i1=i0.getElementsByTagName('img');
	increase++;
	i4=i1[r0];
	if(!i4.lien) i4.lien=i4.src;
	i5=new Image;
	i5.src=i4.lien+'&i='+increase;
	i5.to=i4;
	i5.onload=imageLoaded;
	imgs.push(i5);
}
var imgs=new Array();
function imageLoaded(){
	this.to.src='';
	this.to.src=this.src;
}
function obj(o0){
	if(document.getElementById(o0)) return document.getElementById(o0);
	return false;
}
function isThereNew(){
	increase++;
	str='http://www.clickonthepixels.com/new.php?lastid='+lastid+'&i='+increase;
	if(xhrList.length<1 || xhrList[xhrList.length-1]!=str){
		xhrList.push(str);
		if(xhrList.length<2) xhrDo(str);
	}
}
function thereIsNew(t0,t1){
	t2=0;
	lastid=t1;
	t0=t0.split('|');
	for(t1 in t0){
		if(t0[t1]!=''){
			reloadImage(parseInt(t0[t1]));
			t2++;
		}
	}
	if(t2>0){
		t0=obj('stat_pixels').getElementsByTagName('strong');
		t0[1].innerHTML=parseInt(t0[1].innerHTML)-25*t2;
		t0[2].innerHTML=parseInt(t0[2].innerHTML)+25*t2;
		t0=obj('stat_squares').getElementsByTagName('strong');
		t0[1].innerHTML=parseInt(t0[1].innerHTML)-t2;
		t0[2].innerHTML=parseInt(t0[2].innerHTML)+t2;
	}
	setTimeout('isThereNew();',1000);
}