// -------------------------------------------------------------------
// Bibliotheques de fonctions JAVASCRIPT
//
// Auteur : Diane TULPAN
// 
// Modification:
// ------------
//   Action                         Date               Auteur
// Création                      2010-01-22            DT
//

// Liste des fonctions:
//  checkInt

function checkInt(champ,valeur) 
{
var x = trimString(valeur);

if (x == "")	{return;}

var y = parseInt(x) ;

  if (isNaN(y) || y.toString() != x) {alert(x + " n'est pas une valeur numérique.");champ.select();return;}
  if (y<0)							 {alert(" La valeur saisie doit être positive.");champ.select();return;}
}


//###################################
function checkInt2(champ,valeur) 
{
var x = trimString(valeur);
	if (x == "")	{return;}
var y = parseInt(x) ;
  if (isNaN(y) || y.toString() != x) {alert(x + " n'est pas une valeur numérique.");champ.select();return;}
}


//###################################
function popup(urlDestination,w,h) 
{
props = 'toolbar=no,width='+w+',height='+h+',directories=no,status=no,scrollbars=yes,resizable=no,menubar=no';
window.open(urlDestination,'dgi',props);
}

// ######################
function trimString(str)
{
 str = this != window? this : str;
 return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

