
if(typeof benchmark=="undefined")var benchmark=new Object();benchmark.ObjGestionErreur=function(mode,montreErreur){this.montreErreur=montreErreur;this.ancienOnError=window.onerror;if(mode==benchmark.ObjGestionErreur.STANDARD_MODE){if(this.montreErreur==false){window.onerror=function(msg,url,line){if(typeof console=="object"){if(typeof console.error=="function"){console.error("Erreur : %s\r\nfichier : %s\r\nligne : %i",msg,url,line);}}
return true;}}}else if(mode==benchmark.ObjGestionErreur.REPORT_MODE){var refClass=this;window.onerror=function(msg,url,line){return refClass.gereErreur(msg,url,line);};}}
benchmark.ObjGestionErreur.STANDARD_MODE=1;benchmark.ObjGestionErreur.REPORT_MODE=2;benchmark.ObjGestionErreur.DEFAULT_URL_REPORT_LINTERNAUTE="http://www.linternaute.com/e/cgi/erreur/gestion_erreur.php";benchmark.ObjGestionErreur.DEFAULT_URL_REPORT_JOURNALDUNET="http://www.journaldunet.com/e/cgi/erreur/gestion_erreur.php";benchmark.ObjGestionErreur.DEFAULT_URL_REPORT_BENCHMARK="http://www.benchmark.fr/e/cgi/erreur/gestion_erreur.php";benchmark.ObjGestionErreur.prototype={gereErreur:function(msg,url,line){if(typeof console=="object"){if(typeof console.error=="function"){console.error("Erreur : %s\r\nfichier : %s\r\nligne : %i",msg,url,line);}}
var adresseCourante=new String(window.location);if(this.urlReport==null&&adresseCourante!=null&&adresseCourante!=""){if(adresseCourante.indexOf("www.linternaute.com")!=-1){this.urlReport=benchmark.ObjGestionErreur.DEFAULT_URL_REPORT_LINTERNAUTE;}else if(adresseCourante.indexOf("www.journaldunet.com")!=-1){this.urlReport=benchmark.ObjGestionErreur.DEFAULT_URL_REPORT_JOURNALDUNET;}else if(adresseCourante.indexOf("www.benchmark.fr")!=-1){this.urlReport=benchmark.ObjGestionErreur.DEFAULT_URL_REPORT_BENCHMARK;}}
if(this.urlReport!=null){var codeJs="";var tagJavascript=document.getElementsByTagName("script");for(var i=0;i<tagJavascript.length;i++){var tagCourant=tagJavascript[i];if(tagCourant.innerHTML!=null&&tagCourant.innerHTML!=""){codeJs+="\r\nCode dans la page : "+tagCourant.innerHTML;}else if(tagCourant.src!=null&&tagCourant.src!=""){codeJs+="\r\nSource externe : "+tagCourant.src;}}
var xhr;if(window.XMLHttpRequest){xhr=new XMLHttpRequest();}else if(window.ActiveXObject){xhr=new ActiveXObject("Microsoft.XMLHTTP");}
xhr.open("POST",this.urlReport,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send("f_message="+escape(msg)+"&f_url="+escape(url)+"&f_ligne="+line+"&f_url_courante="+escape(window.location)+"&f_referer"+escape(document.referrer)+"&f_code="+escape(codeJs));if(this.montreErreur==false){return true;}}},setUrlReport:function(urlReport){this.urlReport=urlReport;}}
var ObjGestionErreur=benchmark.ObjGestionErreur;