if (typeof popUp == 'undefined') {
	/**
	 * Function: popUp
	 * 
	 * Parameters:
	 *  - String url a appeler
	 *  - String id de la fenetre
	 *  - Int largeur
	 *  - Int hauteur
	 *  - Int 1 pour afficher la scrollbar, sinon 0
	 */	 	 	
	var popUp = function(sUrl, sId, nLargeur, nHauteur, nScrollBar) {	
		var nX = (screen.availWidth) ? Math.round(screen.availWidth/2 - nLargeur/2) : 0;
	  	var nY = (screen.availHeight) ? Math.round(screen.availHeight/2 -nHauteur/2) : 0;
	  	var sOptions = 'width='+nLargeur+', height='+nHauteur+', left='+nX+', top='+nY+', scrollbars='+nScrollBar+', resizable=no';
	  	fenetreFocus = window.open(sUrl, sId, sOptions);
	  	try {
	  		if (fenetreFocus.window.focus) fenetreFocus.window.focus();
	  		return fenetreFocus;
		} catch(e) {} 
	};
}
/**
 * Extensions de la classe String
 */  
String.prototype.capitalize_all = function() {
	return this.replace(/(\w+)/g, function(word){
    	return word.capitalize();
  	});
};
String.prototype.capitalize = function() {
  	return this.replace(/\w/, function(first_letter){
  	  return first_letter.toUpperCase();
  	});
};
String.prototype.isEmail = function() {
	return this.match(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i) ? true : false;
};
String.prototype.trim = function() {
	return this.replace(/^\s*/,'').replace(/\s*$/,'');
};
