+/***************************************************************************
+ * Copyright (C) 2003-2011 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+function xStateChange(box, baseurl)
+{
+ $('.details').toggle();
+ $('#search_result').updateHtml(baseurl + 'member/new/ajax?login=' + $('#email').val());
+}
+
+var nom;
+var prenom;
+var promo;
+function searchX(baseurl)
+{
+ if ($('#nom').val() == nom && $('#prenom').val() == prenom && $('#promo').val() == promo) {
+ return;
+ }
+ nom = $('#nom').val();
+ prenom = $('#prenom').val();
+ promo = $('#promo').val();
+ $('#search_result').updateHtml(baseurl + 'member/new/ajax?prenom=' + prenom + '&nom=' + nom + '&promo=' + promo,
+ function (data) {
+ updateSuggestions(baseurl, $('select:[name=userid]').val());
+ });
+}
+
+function updateSuggestions(baseurl, uid)
+{
+ $('#broken').hide();
+ $('#marketing').hide();
+ if (uid && uid != 0) {
+ $.xget(baseurl + 'member/reg/' + uid, function(data) {
+ if (data) {
+ $('#broken').show();
+ $('#broken').find('[name=broken]').attr('checked', 'checked');
+ } else {
+ $('#marketing').show();
+ $('#marketing').find('[name=marketing]').attr('checked', 'checked');
+ }
+ });
+ }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: