<!--  
document.writeln('<body>');
document.writeln('<SCRIPT language="javascript" src="http://www.01net.com/ctjscript/xmlrpc.js"></SCRIPT>'); 
document.writeln('<SCRIPT language="javascript" src="http://www.01net.com/ctjscript/agents.js"></SCRIPT>'); 

if (! document.body)  document.write('<body>');
if (document.all){
	document.body.onload = init; 
	document.body.onunload = makeRPCCall; 
	}   
	else  {
	document.body.setAttribute('onload', 'javascript:init()'); 
	document.body.setAttribute('onunload', 'javascript:makeRPCCall()'); 
} 

var somethingtosend = 0;   
var dat = new Date(); 

function GIStatNet(){ 
	this.urlp = document.location.href; 
	if (document.referrer == "") 
		this.urlr = "http://"; 
	else 
		this.urlr = escape(document.referrer); 
	this.foc = 2500; 
	this.conts = new Array(); 
}
 
GIStatNet.prototype.addContenu = function(cont) { 
	this.conts[cont.getIdent()] = cont.toString();
}

GIStatNet.prototype.setFocus = function() { 
	this.foc = new Date() - dat; 
} 

function makeGIStat(){
	for (var c in contenus){
		gictstat.addContenu(contenus[c]); 
	}
	gictstat.setFocus(); 
}

function GIStatNetContenu(ident){
	this.id = ident 
	this.clic = 0; 
	this.foc = 0; 
	return this; 
}
  
GIStatNetContenu.prototype.addClick = function(){
	this.clic += 1; 
}
  
GIStatNetContenu.prototype.addFocus = function(focus){
	this.foc += focus; 
}
  
GIStatNetContenu.prototype.getIdent = function(){
	return this.id; 
}
  
GIStatNetContenu.prototype.toString = function(){
	return this.id + "--" + this.clic + "--" + this.foc; 
}

var contenus = new Array(); 
function addContenu(ident){
	contenus["NET"+ident] = new GIStatNetContenu(ident); 
}
  
function addClick(ident){
	contenus["NET"+ident].addClick(); 
}
  
function addFocus(ident, foc){
	contenus["NET"+ident].addFocus(foc); 
}


var idName = 'gi_ct_code'; 
var isOver = false; 
var codeOver = ''; 
dateOver = new Date(); 
   
function creerStatistiques(){
	var x; 
	var y = document.getElementsByTagName('DIV'); 
	var nbContenus = y.length; 
	 
	for (i=0 ; i < nbContenus ; i++){
		x = y[i]; 
		if(  x.getAttribute(idName)){
			addContenu(x.getAttribute(idName)); 
			x.onclick = fireClick; 
			x.onmouseover = fireMouseOver; 
			x.onmouseout = fireMouseOut; 
			somethingtosend++;
		}
	}
}

function fireClick(e){
	addClick(this.getAttribute(idName)); 
}
  
function fireMouseOver(e){
	var code = this.getAttribute(idName); 
	isOver = true; 
	codeOver = code; 
	dateOver = new Date(); 
}
  
function fireMouseOut(e){
	var code = this.getAttribute(idName); 
	   
	if ((isOver) && (code == codeOver)){
		  dateOut = new Date();
		  codeOver = '';
		  isOver = false;
		  addFocus(code, dateOut - dateOver); 
	}
}

var msg;
var gictstat;
function makeRPCCall(){   
	if (somethingtosend == 0) return;
	makeGIStat();
	msg.addParameter(gictstat);
	var param = msg.xml();
	POSTit(getUrlAgent(somethingtosend), param);
} 
 
function init(){
	msg = new XMLRPCMessage(); 
	gictstat = new GIStatNet();
	msg.setMethod("agent.postData");  
	creerStatistiques();
}

function POSTit(urlAgent, param){
	var d = new Date(); 
	var unique = d.getTime() + '' + Math.floor(1000 * Math.random());
	var bodyz = '<body><form name="postForm" method="post" target="" '
		+ 'action="' + urlAgent + '?U=' + unique + '">'
		+ '<textarea style="display:none" name="P0">[' + param + ']</textarea>'
		+ '</form>'
		+ '</body>';

	var scriptoz = '<script>document.forms["postForm"].submit();</script>'; 

	var sendoz = window.open('about:blank','','width=2,height=2,screenX=10000,screenY=10000,top=10000,left=10000,location=no,menubar=no,toolbar=no,scrollbars=no,status=no,directories=no');
	sendoz.document.write('<html><head></head>' + bodyz + scriptoz + '</html>');      
}

-->
