// 2011 *** bridge interne pour masquer l'incompetence du precedent prestataire en attendant un vrai site...

var _cookie=
	{
  get:function(v)
  	{
		var n=v+"=";
		var a=document.cookie.split(';');
		for(var i=0;i<a.length;i++)
			{
			var c=a[i];
			while (c.charAt(0)==' ') c=c.substring(1,c.length);
			if (c.indexOf(n)==0) return unescape(c.substring(n.length,c.length));
			}
		return null;
  	},
  set:function(n,v,d,p)
  	{
		p=p||'/';var e='';
		if (d) { var x=new Date();x.setTime(x.getTime()+(d*24*60*60*1000));e=";expires="+oExp.toGMTString();	}
		document.cookie=n+"="+escape(v)+e+";path="+p;
  	},
	del:function(n)
		{
		_cookie.set(n,'',-1);
  	}
	};

function _ajax(a)
	{
	var r={};
	r.u=a.u||'';
	r.uid=a.uid||(new Date()).getTime();
	r.start=a.start||'';
	r.end=a.end||'';
	r.o=a.o||null;
	r.mode=a.mode||"POST";
	r.xhr=null;

	if (!r.u) return false;
	if (window.XMLHttpRequest) r.xhr=new XMLHttpRequest(); else if (window.ActiveXObject) { try { r.xhr=new ActiveXObject("Msxml2.XMLHTTP")	} catch (e) {	try	{	r.xhr=new ActiveXObject("Microsoft.XMLHTTP")	}	catch (e)	{} } } else return false;
	
	r.request=function()
		{		
		var o=this;
		if (o.xhr.readyState==4)
			{ 
			if ((o.xhr.status==200)||(window.location.href.indexOf("http")==-1))
				{ 
				o.content=o.xhr.getResponseHeader("content-type");
				o.response=o.xhr.responseText;
				}
			o.xhr.onreadystatechange=new Function();
			}
		};

	r.xhr.onreadystatechange=function() { r.request(); };

	if (r.mode=="POST")
		{
		var p='';for (var i in a.p) { p+=i+"="+encodeURIComponent(a.p[i])+"&";	}
		p+='_ajaxtime='+(new Date()).getTime();
		r.xhr.open("POST",r.u,true);
		r.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=iso-8859-15");
		r.xhr.setRequestHeader("Content-length",p.length);
	 	r.xhr.setRequestHeader("Connection","close");
		r.xhr.send(p);
		}
	else
		{
		r.u+='?'+_g.time();
		r.xhr.open("GET",r.u,true); 
		r.xhr.send(null); 
		}
	};

if (!_cookie.get("anon_stats")) { _ajax({u:"/cgi-bin/stats.pl",p:{js:(new Date()).getTime()}}); }

