// dev.js : developpement helpers 

/******************************************************************************
 * fonction getBrowserRender dépendant navigateur (codé le 17/02/2011S)
 * renvoie 'TRIDENT' de IE, 'GECKO' de firefox, 'WEBKIT' de Safari, 'OPERA' de Opéra, sinon 'UNKNOWN'
 ******************************************************************************/
function getBrowserRender(){
	var res="UNKNOWN";
	var nu=navigator.userAgent
	if(nu.match(/TRIDENT/i)){ res="TRIDENT"	}else 
	if(nu.match(/WEBKIT/i)){ res="WEBKIT" }else 
	if(nu.match(/GECKO/i)){ res="GECKO"  }else 
	if(nu.match(/OPERA/i)){ res="OPERA" }else
	if(nu.match(/MSIE/i)){ res="TRIDENT" } // IE6
	return res;
}

/******************************************************************************
 * fonction handleErr dépendant navigateur (codé le 25/10/2009)
 * signale les messages d'erreur directement en lançant une alert
 ******************************************************************************/   
function handleErr(msg,url,l){
  txtError="JS ERROR :\n\n";
  txtError+="Error: " + msg + "\n";
  txtError+="URL: " + url + "\n";
  txtError+="Line: " + l + "\n\n";
  alert(txtError);
  return true;
}
var txtError="";
onerror=handleErr;

/******************************************************************************
 * fonction alertVar dépendant navigateur (codé le 25/10/2009) 
 * affiche l'ensemble des propriétés d'une variable dans un alert
 * cette fonction dépanne bien sinon il existe JSexplorer dans /HELPERS/DBG 
 ******************************************************************************/
function alertVar(variable){
  var chAlertVar="";
  for(property in variable){
      chAlertVar+=property+':'+variable[property]+'\n';
  }
  alert(variable+" : "+chAlertVar);
} 
