/**
 * Ouvre l'url spécifiée en popup dans une fentre de la taille souhaitée
 */
function openWindow(url, width, height) {
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	var p = window.open(url, 'popup', 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',directories=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,closed=0,opener=0');
} // end of 'openWindow()'

/**
 * Verifie que la chaine passée n'est pas une chaine vide
 *
 * @param	string strSaisie	Chaine de caractère
 * @return	boolean				Retourne false si elle est vide, true dans la cas contraire
 */
function isBlank(strSaisie) {
	var iSaisie = 0;
	var strBlank = ""

	if (strSaisie != "") {
		for (i=0; i < strSaisie.length; i++)
			if (strSaisie.charAt(i) != ' ') iSaisie = 1;
		if (iSaisie == 1)
			return false;
	}
	return true;
}

/**
 * Verifie la validité d'une adresse email (presence d'un @ puis d'un .
 *
 * @param	string strSaisie	Adresse email à vérifier
 * @return	boolean				Retourne true si c'est une adresse email, false dans le cas contraire
 */
function isEmail(strSaisie) {
	a = strSaisie.indexOf("@");
	if ( a != -1 ) {
		p = strSaisie.indexOf(".", a);
		if ( p != -1 )
			return true;
	}
	return false;
}

/**
 * Verifie si un objet de type radio ou checkbox a au moins un element selectionné
 *
 * @param	object obj	Input de type radio ou checkbox d'un formulaire
 * @return	boolean		Retourne true si un element au moins est selectionné false dans le cas contraire
 * @author				David Duret
 * @created				2002-06-12
 */
function isChecked(obj) {
	for ( var i = 0; i < obj.length; i++ ) {
		if ( typeof(checked) == 'undefined' ) checked = false;
		checked = ( obj[i].checked || checked );
	}
	return checked
}
