
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 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));if(this.montreErreur==false){return true;}}},setUrlReport:function(urlReport){this.urlReport=urlReport;},printStackTrace:function(){var callstack=[];var isCallstackPopulated=false;try{i.dont.exist+=0;}catch(e){if(e.stack){var lines=e.stack.split("\n");for(var i=0,len=lines.length;i<len;i++){callstack.push(lines[i]);}
callstack.shift();isCallstackPopulated=true;}
else if(window.opera&&e.message){var lines=e.message.split("\n");for(var i=0,len=lines.length;i<len;i++){var entry=lines[i];if(lines[i+1]){entry+=" at "+lines[i+1];i++;}
callstack.push(entry);}
callstack.shift();isCallstackPopulated=true;}}
if(!isCallstackPopulated){var currentFunction=arguments.callee.caller;while(currentFunction){var fn=currentFunction.toString();var fname=fn.substring(fn.indexOf("function")+8,fn.indexOf("("))||"anonymous";callstack.push(fname);currentFunction=currentFunction.caller;}}
var callstack_chaine='';for(var i=0;i<callstack.length;i++){if(i>0){var reg=new RegExp("(.*)@(.*)","g");var reg2=new RegExp(":([0-9]+)","g");callstack_chaine+=callstack[i].replace(reg,"$2").replace(reg2," ligne $1")+"\r\n";}else{var reg=new RegExp('","',"g");var cur_call=callstack[i].replace(reg,'\r\n')
var reg2=new RegExp("(.*)@(.*)","g");var reg3=new RegExp(":([0-9]+)","g");cur_call=cur_call.replace(reg2,"$1\r\n$2").replace(reg3," ligne $1");callstack_chaine+=cur_call.replace(reg,'\r\n')+"\r\n";}}
return"\r\n\r\nPile d'exécution : \r\n"+callstack_chaine;}}
var ObjGestionErreur=benchmark.ObjGestionErreur;