diff -urN cahier-de-prepa5.1.0/agenda.php cahier-de-prepa6.0.0/agenda.php
--- cahier-de-prepa5.1.0/agenda.php	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/agenda.php	2016-08-30 17:00:12.228710776 +0200
@@ -0,0 +1,450 @@
+<?php
+// Sécurité
+define('OK',1);
+// Configuration
+include('config.php');
+// Fonctions
+include('fonctions.php');
+
+//////////////////////////////////////////////
+// Validation de la requête : jour et année //
+//////////////////////////////////////////////
+if ( isset($_REQUEST['mois']) && is_numeric($mois = $_REQUEST['mois']) && $mois > 1608 && $mois != date('ym') )  {
+  $debutmois = mktime(0,0,0,$mois%100,1,(int)($mois/100));
+  $auj = 0;
+}
+else  {
+  $debutmois = mktime(0,0,0,idate('n'),1);
+  $auj = idate('d');
+}
+$deb = date('Y-m-d',$debutmois);
+// Nombres de jour du mois demandé et du précédent
+$nbj = idate('t',$debutmois);
+$nbj_prec = idate('t',$debutmois-1);
+// Numéro dans la semaine du 1er du mois (0->lundi, 6->dimanche)
+$j1 = (idate('w',$debutmois)+6)%7;
+// Nombre de semaines à afficher
+$nbs = ceil(($j1+$nbj)/7);
+//$debutcal = $debutmois-86400*(idate('w',$debutmois)-1);
+
+/////////////////////////////
+// Vérification de l'accès //
+/////////////////////////////
+$mysqli = connectsql();
+$resultat = $mysqli->query('SELECT val FROM prefs WHERE nom=\'protection_agenda\'');
+$r = $resultat->fetch_row();
+$protection = $r[0];
+$resultat->free();
+if ( ( $protection > $autorisation ) && ( $autorisation > 0 ) )  {
+  debut($mysqli,'Agenda','Vous n\'avez pas accès à cette page.',$autorisation,'');
+  $mysqli->close();
+  fin();
+}
+// Connexion nécessaire si protection
+if ( $protection && !$autorisation )  {
+  $titre = 'Agenda';
+  $actuel = '';
+  include('login.php');
+}
+// Mode édition pour les professeurs
+$edition = ( $autorisation == 4 );
+
+////////////
+/// HTML ///
+////////////
+$mois = array('','Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre');
+debut($mysqli,'Agenda - '.$mois[idate('m',$debutmois)].' '.date('Y',$debutmois). ( ( $edition && $protection ) ? "<span class=\"icon-lock$protection\"></span>" : '' ),$message,$autorisation,'agenda',false,'datetimepicker');
+
+// Contrôles généraux, seulement en mode édition
+if ( $edition )  {
+?>
+  <a class="icon-aide general" data-id="page" title="Aide pour l'édition de l'agenda"></a>
+  <a class="icon-prefs general" data-id="prefs" title="Modifier les préférences de l'agenda"></a>
+  <a class="icon-ajoute general" data-id="evenement" title="Ajouter un nouvel événement à l'agenda"></a>
+  <a class="icon-ajout-colle general" data-id="deplacement-colle" title="Ajouter un nouveau déplacement de colle"></a>
+
+<?php
+}
+
+// MathJax désactivé par défaut
+$mathjax = false;
+
+// Stockage des identifiants des événements chaque jour
+// Le 1er est noté 1, le dernier jour du mois précédent est 0, le jour
+// précédent est -1... Il y a $nbs*7 jours à considérer.
+$ej = array_fill_keys(range(1-$j1,$nbs*7-$j1),[]);
+
+// Récupération des événements
+$resultat = $mysqli->query("SELECT a.id, m.nom AS matiere, t.nom AS type, IFNULL(m.id,0) as mid, t.id as tid, t.couleur, texte,
+                            DATE_FORMAT(debut,'%w%Y%m%e') AS d, DATE_FORMAT(fin,'%w%Y%m%e') AS f,
+                            DATE_FORMAT(debut,'%d/%m/%Y') AS jd, DATE_FORMAT(fin,'%d/%m/%Y') AS jf,
+                            DATE_FORMAT(debut,'%kh%i') AS hd, DATE_FORMAT(fin,'%kh%i') AS hf,
+                            DATEDIFF(debut,'$deb')+1 AS njd, DATEDIFF(fin,'$deb')+1 AS njf
+                            FROM agenda AS a JOIN `agenda-types` AS t ON a.type = t.id LEFT JOIN matieres AS m ON a.matiere = m.id
+                            WHERE debut < '$deb' + INTERVAL ".($j1+7*$nbs)." DAY AND fin >= '$deb' - INTERVAL $j1 DAY
+                            ORDER BY fin,debut");
+if ( $resultat->num_rows )  {
+  $evenements = array();
+  $couleurs = array();
+  while ( $r = $resultat->fetch_assoc() )  {
+    $id = $r['id'];
+    // Titres
+    if ( strlen($r['matiere']) )  {
+      $titre = "${r['matiere']} - ${r['type']}";
+      $titrebis = "${r['type']} en ${r['matiere']}";
+    }
+    else
+      $titre = $titrebis = $r['type'];
+    // Événement sur un seul jour
+    if ( ( $d = $r['d'] ) == ( $f = $r['f'] ) )  {
+      // Enregistrement sur le jour concerné
+      $ej[$r['njd']][] = $id;
+      // Date à afficher
+      if ( ( $hd = $r['hd'] ) == '0h00' )
+        $date = 'Le '.format_date($d);
+      else  {
+        $date = ( $hd == $r['hf'] ) ? 'Le '.format_date($d).' à '.str_replace('00','',$hd) : 'Le '.format_date($d).' de '.str_replace('00','',$hd).' à '.str_replace('00','',$r['hf']);
+        $titre = str_replace('00','',$hd)." : $titre";
+      }
+    }
+    // Événement sur plusieurs jours
+    else  {
+      // Enregistrement pour les jours concernés si événement sur plusieurs jours
+      foreach ( range($njd = $r['njd'], $njf = $r['njf']) as $i )
+        $ej[$i][] = ( ($i>$njd)?'_':'' ).$id.( ($i<$njf)?'_':'' );
+      // Date à afficher
+      if ( ( $hd = $r['hd'] ) == '0h00' )
+        $date = 'Du '.format_date($d).' au '.format_date($f);
+      else  {
+        $date = 'Du '.format_date($d).' à '.str_replace('00','',$r['hd']).' au '.format_date($f).' à '.str_replace('00','',$r['hf']);
+        $titre = str_replace('00','',$hd)." : $titre";
+      }
+    }
+    // Enregistrement, différent suivant le mode d'affichage (édition ou non)
+    $evenements[$id] = ( $edition ) ? array('date'=>$date,'titre'=>$titre,'texte'=>$r['texte'],'type'=>$r['tid'],'matiere'=>$r['mid'],'debut'=>"{$r['jd']} $hd",'fin'=>"{$r['jf']} {$r['hf']}",'je'=>( $hd == '0h00' ))
+                                    : array('date'=>$date,'titre'=>$titre,'titrebis'=>(( $r['matiere'] ) ? $r['type'].' en '.$r['matiere'] : $r['type']),'texte'=>$r['texte'],'type'=>$r['tid']);
+    // Couleurs
+    $couleurs[$r['tid']] = $r['couleur'];
+    // MathJax
+    $mathjax = ( $mathjax ) ? true : strpos($r['texte'],'$')+strpos($r['texte'],'\\');
+  }
+  $resultat->free();
+  // Écriture des données (événements, couleurs) en JavaScript
+  echo "<script>\n  \$( function() {\n";
+  foreach ( $couleurs as $tid => $couleur )
+    echo "    \$('.evnmt$tid').css('background-color','#$couleur');\n";
+  echo '    evenements = '.json_encode($evenements).";\n  });\n</script>\n";
+}
+
+// Calendrier
+?>
+
+  <p id="rechercheagenda" class="topbarre">
+    <a class="icon-precedent" href="?mois=<?php echo date('ym',$debutmois-1); ?>" title="Mois précédent"></a>
+    <a class="icon-suivant" href="?mois=<?php echo date('ym',$debutmois+2764800); ?>" title="Mois suivant"></a>
+  </p>
+
+  <div id="calendrier">
+    <table id="semaine">
+      <thead>
+        <tr>
+          <th>Lundi</th>
+          <th>Mardi</th>
+          <th>Mercredi</th>
+          <th>Jeudi</th>
+          <th>Vendredi</th>
+          <th>Samedi</th>
+          <th>Dimanche</th>
+        </tr>
+      </thead>
+    </table>
+<?php
+// Une ligne par semaine
+for ( $s = 0; $s < $nbs ; $s++ )  {
+  // Identifiant du jour de début de ligne
+  $d = 1-$j1+$s*7;
+  // Nombre maximal d'événements sur un jour de la semaine concernée
+  $nmax = max(count($ej[$d]),count($ej[$d+1]),count($ej[$d+2]),count($ej[$d+3]),count($ej[$d+4]),count($ej[$d+5]),count($ej[$d+6]));
+  $height = 2.5+max($nmax,3)*1.25;
+  // Fond, obligatoire pour les lignes de séparation des jours
+  echo <<<FIN
+    <div style="height: ${height}em">
+      <table class="semaine-bg" style="height: ${height}em">
+        <tbody>
+          <tr>
+
+FIN;
+  for ( $i = $d ; $i < $d+7 ; $i++ )
+    echo ( ( $i <= 0 ) || ( $i > $nbj ) ) ? "            <td class=\"autremois\"></td>\n" : "            <td></td>\n";
+  echo <<<FIN
+          </tr>
+        </tbody>
+      </table>
+      <table class="evenements">
+        <thead>
+          <tr>
+
+FIN;
+  // Numéros de jour
+  for ( $i = $d ; $i < $d+7 ; $i++ )
+    if ( $i <= 0 )
+      echo '            <th class="autremois">'.($nbj_prec+$i)."</th>\n";
+    elseif ( $i > $nbj )
+      echo '            <th class="autremois">'.($i-$nbj)."</th>\n" ;
+    elseif ( $i == $auj )
+      echo "            <th id=\"aujourdhui\">$i</th>\n" ;
+    else
+      echo "            <th>$i</th>\n" ;
+  echo <<<FIN
+          </tr>
+        </thead>
+        <tbody>
+
+FIN;
+  // Écriture de $nmax lignes d'événements
+  for ( $j = 0 ; $j < $nmax ; $j++ )  {
+    echo "          <tr>\n";
+    $evenement_deja_commence = false;
+    for ( $i = $d ; $i < $d+7 ; $i++ )  {
+      // Si pas d'événement, on passe au jour suivant
+      if ( empty($ej[$i]) )  {
+        echo "            <td></td>\n";
+        continue;
+      }
+      // Si on n'a pas affiché la veille un événement sur plusieurs jours
+      // (sauf en début de semaine)
+      if ( !$evenement_deja_commence )  {
+        $classe = '';
+        // Cas début de semaine
+        if ( $i == $d )  {
+          $id = array_shift($ej[$i]);
+          // Si événement commencé la semaine précédente, on continue
+          if ( $id[0] == '_' )  {
+            $classe = ' evnmt_suite';
+            $id = substr($id,1);
+          }
+        }
+        // Hors début de semaine : on cherche un événement non déjà commencé
+        else  {
+          foreach ( $ej[$i] as $k=>$id )
+            if ( $id[0] != '_' )  {
+              unset($ej[$i][$k]);
+              break;
+            }
+          // Si les seuls événements possibles sont déjà commencés, il ne
+          // faut rien afficher
+          if ( $id[0] == '_' )  {
+            echo "            <td></td>\n";
+            continue;
+          }
+        }
+        // Si l'id se termine par '_', événement sur plusieurs jours
+        if ( $id[strlen($id)-1] == '_' )  {
+          $evenement_deja_commence = true;
+          $classe .= ' evnmt_suivi';
+          $id = substr($id,0,-1);
+        }
+      }
+      // Si événément déjà commencé au moins la veille, qui termine ce jour
+      elseif ( ( $pos = array_search("_$id",$ej[$i]) ) !== false )  {
+        $evenement_deja_commence = false;
+        unset($ej[$i][$pos]);
+        $classe = ' evnmt_suite';
+      }
+      // Si événément déjà commencé au moins la veille, qui continue
+      else  {
+        unset($ej[$i][array_search("_${id}_",$ej[$i])]);
+        $classe = ' evnmt_suite evnmt_suivi';
+      }
+      // Affichage
+      echo "            <td><p id=\"e$id\" class=\"evnmt evnmt{$evenements[$id]['type']}$classe\">{$evenements[$id]['titre']}</p></td>\n";
+    }
+    echo "          </tr>\n";
+  }
+  echo <<<FIN
+        </tbody>
+      </table>
+    </div>
+
+FIN;
+}
+
+if ( $edition ) {
+  // Récupération des types d'événement
+  $resultat = $mysqli->query('SELECT id, nom FROM `agenda-types`');
+  $select_types = '';
+  //$types = array();
+  if ( $resultat->num_rows )  {
+    while ( $r = $resultat->fetch_assoc() )
+      $select_types .= "<option value=\"${r['id']}\">${r['nom']}</option>";
+    $resultat->free();
+  }
+  // Récupération des matières
+  $resultat = $mysqli->query('SELECT id, nom FROM matieres');
+  $select_matieres = '';
+  if ( $resultat->num_rows )  {
+    while ( $r = $resultat->fetch_assoc() )
+      $select_matieres .= "<option value=\"${r['id']}\">${r['nom']}</option>";
+    $resultat->free();
+  }
+  
+  // Select sur la protection
+  $select_protection = str_replace("\"$protection\"","\"$protection\" selected",'
+      <option value="0">Visible de tous</option>
+      <option value="1">Visible pour les connectés</option>
+      <option value="2">Visible pour les élèves, colleurs, profs</option>
+      <option value="3">Visible pour les colleurs et les profs</option>
+      <option value="4">Visible pour les profs uniquement</option>');
+
+  // Récupération du nombre d'événements affichés sur la page d'accueil
+  $resultat = $mysqli->query('SELECT val FROM prefs WHERE nom=\'nb_agenda_index\'');
+  $r = $resultat->fetch_row();
+  $n = $r[0];
+  $resultat->free();
+?>
+ 
+  <form id="form-evenement">
+    <h3 class="edition">Modification d'événement</h3>
+    <p class="ligne"><label for="type">Type&nbsp;:</label>
+      <select id="type" name="type"><?php echo $select_types; ?></select>
+      <a class="icon-edite" href="agenda-types">&nbsp;</a>
+    </p>
+    <p class="ligne"><label for="matiere">Matière&nbsp;:</label>
+      <select id="matiere" name="matiere"><option value="0">Pas de matière</option><?php echo $select_matieres; ?></select>
+    </p>
+    <p class="ligne"><label for="debut">Début&nbsp;: </label><input type="text" id="debut" name="debut" value="" size="15"></p>
+    <p class="ligne"><label for="fin">Fin&nbsp;: </label><input type="text" id="fin" name="fin" value="" size="15"></p>
+    <p class="ligne"><label for="jours">Date(s) seulement&nbsp;: </label><input type="checkbox" id="jours" name="jours" value="1"></p>
+    <textarea name="texte" class="edithtml" rows="10" cols="100" data-placeholder="Texte associé à l'événement (non obligatoire)"></textarea>
+    <input type="hidden" name="table" value="agenda">
+    <input type="hidden" name="id" value="">
+  </form>
+  
+  <form id="form-deplacement-colle">
+    <h3 class="edition">Nouveau déplacement de colle</h3>
+    <p>Ce formulaire spécial donne la possibilité de créer une annulation (si l'<i>ancien horaire</i> est le seul renseigné), un rattrapage (si le <i>nouvel horaire</i> est le seul renseigné) ou un déplacement (si les deux horaires sont renseignés) de colle de façon automatique. Dans le cas d'un déplacement, deux événements sont créés. La salle est facultative. Le(s) événement(s) créé(s) sont ensuite modifiables en éditant le texte. Pour chaque horaire, régler l'heure à «&nbsp;0h00&nbsp;» permet de n'afficher que la date.</p>
+    <p class="ligne"><label for="matiere">Matière&nbsp;:</label>
+      <select id="matiere" name="matiere"><?php echo $select_matieres; ?></select>
+    </p>
+    <p class="ligne"><label for="colleur">Colleur&nbsp;: </label><input type="text" data-placeholder="(obligatoire)" id="colleur" name="colleur" value="" size="20"></p>
+    <p class="ligne"><label for="groupe">Groupe&nbsp;: </label><input type="text" data-placeholder="(obligatoire)" id="groupe" name="groupe" value="" size="10"></p>
+    <p class="ligne"><label for="ancien">Ancien horaire&nbsp;: </label>
+      <input type="text" data-placeholder="(non obligatoire)" id="ancien" name="ancien" value="" size="15">
+      <a class="icon-ferme"></a>
+    </p>
+    <p class="ligne"><label for="ancien">Nouvel horaire&nbsp;: </label>
+      <input type="text" data-placeholder="(non obligatoire)" id="nouveau" name="nouveau" value="" size="15">
+      <a class="icon-ferme"></a>
+    </p>
+    <p class="ligne"><label for="salle">Salle de rattrapage&nbsp;: </label><input type="text" data-placeholder="(non obligatoire)" id="salle" name="salle" value="" size="10"></p>
+    <input type="hidden" name="table" value="deplcolle">
+  </form>
+
+  <form id="form-prefs">
+    <h3 class="edition">Modifier les préférences de l'agenda</h3>
+    <p class="ligne"><label for="protection_agenda">Accès&nbsp;: </label>
+      <select id="protection_agenda" name="protection_agenda"><?php echo $select_protection; ?>
+      </select>
+    </p>
+    <p class="ligne"><label for="nb_agenda_index">Nombre d'événements affichés sur la page d'accueil&nbsp;: </label></p>
+    <p class="ligne">&nbsp;
+      <input type="text" id="nb_agenda_index" name="nb_agenda_index" value="<?php echo $n; ?>" size="3">
+    </p>
+    <input type="hidden" name="table" value="prefs">
+  </form>
+  
+  <div id="aide-page">
+    <h3>Aide et explications</h3>
+    <p>Il est possible ici d'ajouter un événement dans l'agenda, de modifier les événements existants ou de modifier les préférences de l'agenda.</p>
+    <p>Pour modifier un événement existant, il faut cliquer dessus. Un formulaire de modification apparaîtra au-dessus du calendrier.</p>
+    <p>Les trois boutons généraux permettent de&nbsp;:</p>
+    <ul>
+      <li><span class="icon-ajout-colle"></span>&nbsp;: ouvrir un formulaire pour ajouter un nouveau déplacement de colle.</li>
+      <li><span class="icon-ajoute"></span>&nbsp;: ouvrir un formulaire pour ajouter un nouvel événement.</li>
+      <li><span class="icon-prefs"></span>&nbsp;: ouvrir un formulaire pour modifier les préférences globales de l'agenda.</li>
+    </ul>
+    <h4>Déplacement de colle</h4>
+    <p>L'ajout de déplacement de colle est en réalité un simple raccourci pratique qui conduit à l'ajout d'un ou deux événements, en fonction des dates données. Le texte sera généré automatiquement à partir des informations saisies. Le ou les deux événements seront ensuite modifiable comme tous les autres événements.</p>
+    <h4>Préférences globales de l'agenda</h4>
+    <p>Vous pouvez modifier&nbsp;:</p>
+    <ul>
+      <li>l'<em>accès</em> à l'agenda.</li>
+      <li>le <em>nombre d'événements affichés sur la page d'accueil</em></li>
+    </ul>
+    <p>Des détails sont donnés dans l'aide du formulaire de modification.</p>
+    <h4>Visibilité des événements</h4>
+    <p>Attention, contrairement aux informations, aux documents et aux programmes de colles, les événements sont obligatoirement visibles par tous ceux qui ont accès à l'agenda. Il n'est pas possible de cacher un événement pour le faire apparaître plus tard. Cette fonctionnalité est prévue pour la prochaine version, en cours d'année.</p>
+    <h4>Affichage sur la page d'accueil</h4>
+    <p>Si des événements sont disponibles dans les 7 jours qui viennent, ils sont automatiquement affichés en haut de la page d'accueil, avant toute information. Cette fonctionnalité est désactivable en réglant le <em>nombre d'événements affichés sur la page d'accueil</em> à zéro dans les préférences de l'agenda.</p>
+    <h4>Matières et droits</h4>
+    <p>Seuls les professeurs peuvent modifier l'agenda. Afin de faciliter les modifications, en particulier lors des changements d'emploi du temps concernant plusieurs matières, il n'y a pas d'impossibilité d'ajouter/modifier un événement concernant une autre matière. Par ailleurs, toute matière concernée doit avoir été créée à la page de gestion des <a href="matieres">matières</a>.</p>
+  </div>
+
+  <div id="aide-evenement">
+    <h3>Aide et explications</h3>
+    <p>Ce formulaire permet d'ajouter ou de modifier un événement de l'agenda. Il sera validé par un clic sur <span class="icon-ok"></span>, et abandonné (donc supprimé) par un clic sur <span class="icon-ferme"></span>.</p>
+    <h4>Type, matière</h4>
+    <p>Le <em>type</em> d'événement est associé à un titre (utilisé dans le calendrier et dans les informations récentes) et une couleur (utilisée dans le calendrier). Les types d'événements sont modifiables sur la page de modification des <a href="agenda-types">types d'événements</a>. Il est possible d'ajouter des types d'événements à ceux déjà définis.</p>
+    <p>La <em>matière</em> n'est pas obligatoire, mais permet de l'afficher dans le titre. Il est possible de créer une matière à la page de gestion des <a href="matieres">matières</a>, même si celle-ci ne sert à rien par ailleurs ou si le professeur de la matière ne participe pas&nbsp;: elle n'apparaîtra pas dans le menu tant qu'elle reste «&nbsp;vide&nbsp;».</p>
+    <h4>Horaires</h4>
+    <p>Le <em>début</em> et la <em>fin</em> sont les deux horaires définissant l'événement. Plusieurs cas sont possibles&nbsp;:</p>
+    <ul>
+      <li>si <em>début</em> et <em>fin</em> sont identiques, alors l'événement sera simplement caractérisé par une date unique.</li>
+      <li>si <em>début</em> et <em>fin</em> sont le même jour, alors l'événement sera caractérisé par une date et deux horaires, de début et de fin.</li>
+      <li>si <em>début</em> et <em>fin</em> sont sur deux jours différents, alors l'événement apparaîtra sur le calendrier sur l'ensemble de la durée définie.</li>
+    </ul>
+    <p>La case à cocher <em>Date(s) seulement</em> permet de supprimer les heures. Cela peut permettre de définir un événement sur toute une journée (si <em>début</em> et <em>fin</em> sont identiques), voire sur plusieurs jours (s'ils sont différents&nbsp;; <em>fin</em> est inclus dans l'intervalle).</p>
+    <h4>Texte optionnel</h4>
+    <p>Enfin, une case de saisie de texte est fournie pour ajouter une description plus longue à l'événement. Cette description n'est pas obligatoire mais sera utile la plupart du temps. En dehors du mode d'édition dans lequel vous êtes actuellement, ce texte sera affiché lors d'un clic sur l'événement, dans le calendrier.</p>
+    <p>Le texte doit être formaté en HTML&nbsp;: par exemple, chaque bloc de texte doit être encadré par &lt;p&gt; et &lt;/p&gt;. Il peut donc contenir des liens vers les autres pages du site, vers des documents du site, vers le web... Des boutons sont fournis pour aider au formattage (ainsi qu'une aide).</p>
+  </div>
+
+  <div id="aide-deplacement-colle">
+    <h3>Aide et explications</h3>
+    <p>Ce formulaire permet d'ajouter un déplacement de colle dans l'agenda. Il sera validé par un clic sur <span class="icon-ok"></span>, et abandonné (donc supprimé) par un clic sur <span class="icon-ferme"></span>.</p>
+    <p>L'ajout de déplacement de colle est en réalité un simple raccourci pratique qui conduit à l'ajout d'un ou deux événements, en fonction des dates données. Le texte sera généré automatiquement à partir des informations saisies. Le ou les deux événements seront ensuite modifiable comme tous les autres événements.</p>
+    <h4>Matière, colleur, groupe</h4>
+    <p>La <em>matière</em> est obligatoire. Il est possible de créer une matière à la page de gestion des <a href="matieres">matières</a>, même si celle-ci ne sert à rien par ailleurs ou si le professeur de la matière ne participe pas&nbsp;: elle n'apparaîtra pas dans le menu tant qu'elle reste «&nbsp;vide&nbsp;».</p>
+    <p>Le <em>colleur</em> et le <em>groupe</em> sont obligatoire. Ces données seront utilisées pour générer automatiquement le texte du déplacement de colle. Il convient d'ajouter la civilité du <em>colleur</em> (M., Mme). Le <em>groupe</em> est à renseigner uniquement avec le numéro, par exemple «&nbsp;8&nbsp;» pour le groupe 8 (le terme «&nbsp;groupe&nbsp;» sera ajouté).</p>
+    <h4>Horaires et salle</h4>
+    <p>L'<em>ancien horaire</em> et le <em>nouvel horaire</em> ne sont pas obligatoire tous les deux, mais au moins l'un des deux doit bien sûr être renseigné. Trois cas sont possibles&nbsp;:</p>
+    <ul>
+      <li><em>ancien horaire</em> seul&nbsp;: un seul événement créé, la colle est dite «&nbsp;annulée&nbsp;»</li>
+      <li><em>nouvel horaire</em> seul&nbsp;: un seul événement créé, la colle est dite «&nbsp;rattrapée&nbsp;»</li>
+      <li><em>ancien horaire</em> et <em>nouvel horaire</em>&nbsp;: deux événements créés, la colle est dite «&nbsp;déplacée&nbsp;».</li>
+    </ul>
+    <p>L'heure n'est pas obligatoire. Si un horaire est saisi sous la forme «&nbsp;XX/XX/XXXX 0h00&nbsp;», seule la date sera retenue. Il est par exemple autorisé de saisir l'heure de l'<em>ancien horaire</em>, mais pas celui du <em>nouvel horaire</em>, dans le cas où il n'est pas encore connu au moment de la saisie.</p>
+    <p>L'icône <span class="icon-ferme"></span> présente devant chaque horaire permet de le supprimer.</p>
+    <p>La <em>salle de rattrapage</em> n'est utilisée que si le <em>nouvel horaire</em> est saisi. Il faut renseigner uniquement le numéro/nom de la salle, par exemple «&nbsp;111&nbsp;» pour la salle 111 (le terme «&nbsp;salle&nbsp;» sera ajouté).</p>
+    <h4>Modification ultérieure</h4>
+    <p>Si deux événements sont créés, ils le sont avec le même texte, généré automatiquement à l'aide des données saisies. Ils deviennent automatiquement indépendants&nbsp;: modifier l'un (horaire ou texte) ne modifie pas l'autre. Attention à la modification d'horaire de rattrapage notamment&nbsp;: il faut bien penser à la faire sur le deuxième événement en priorité, et éventuellement sur le premier.</p>
+  </div>
+
+  <div id="aide-prefs">
+    <h3>Aide et explications</h3>
+    <p>Ce formulaire permet de modifier les préférences globales de l'agenda. Il sera validé par un clic sur <span class="icon-ok"></span>, et abandonné (donc supprimé) par un clic sur <span class="icon-ferme"></span>. On peut y modifier&nbsp;:</p>
+    <ul>
+      <li>l'<em>accès</em> à l'agenda (voir ci-dessous).</li>
+      <li>le <em>nombre d'événements affichés sur la page d'accueil</em>&nbsp;: les événements qui se situent dans les 7 jours prochains s'affichent automatiquement en haut de la page d'accueil du Cahier de Prépa, dans la limite du nombre égal à cette valeur. En particulier, mettre zéro supprime cet affichage automatique. La valeur par défaut est 10.</li>
+    </ul>
+    <p>L'<em>accès</em> à l'agenda peut être choisi parmi cinq possibilités&nbsp;:</p>
+    <ul>
+      <li><em>Visible de tous</em>&nbsp;: accessible de tout visiteur, sans identification.</li>
+      <li><em>Visible pour les connectés</em>&nbsp;: accessible de tout utilisateur mais uniquement après identification (utilisateurs de type invité, élève, colleur ou professeur).</li>
+      <li><em>Visible pour les élèves, colleurs, professeurs</em>&nbsp;: accessible uniquement par les utilisateurs de type élève, colleur ou professeur.</li>
+      <li><em>Visible pour les colleurs, professeurs</em>&nbsp;: accessible uniquement par les utilisateurs de type colleur ou professeur.</li>
+      <li><em>Visible pour les professeurs</em>&nbsp;: accessible uniquement par les utilisateurs de type professeur</li>
+    </ul>
+    <p>Les comptes utilisateurs sont à définir ou modifier sur la page de <a href="utilisateurs">gestion des utilisateurs</a>.</p>
+  </div>
+
+  <p id="log"></p>
+
+  <script type="text/javascript" src="js/datetimepicker.min.js"></script>
+
+<?php
+}
+
+$mysqli->close();
+fin($edition,$mathjax);
+?>
diff -urN cahier-de-prepa5.1.0/agenda-types.php cahier-de-prepa6.0.0/agenda-types.php
--- cahier-de-prepa5.1.0/agenda-types.php	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/agenda-types.php	2016-08-30 17:24:26.391152661 +0200
@@ -0,0 +1,147 @@
+<?php
+// Sécurité
+define('OK',1);
+// Configuration
+include('config.php');
+// Fonctions
+include('fonctions.php');
+
+//////////////////
+// Autorisation //
+//////////////////
+
+// Accès aux professeurs connectés uniquement
+$mysqli = connectsql();
+if ( !$autorisation )  {
+  $titre = 'Types d\'événements de l\'agenda';
+  $actuel = false;
+  include('login.php');
+}
+elseif ( $autorisation < 4 )  {
+  debut($mysqli,'Types d\'événements de l\'agenda','Vous n\'avez pas accès à cette page.',$autorisation,' ');
+  $mysqli->close();
+  fin();
+}
+
+//////////////
+//// HTML ////
+//////////////
+debut($mysqli,"Agenda - Types d'événements",$message,4,'agenda',false,'colpick');
+echo <<<FIN
+
+  <a class="icon-aide general" data-id="page" title="Aide pour les modifications des types d'événements"></a>
+  <a class="icon-annule general" onclick="history.back()" title="Retour à l'agenda"></a>
+  <a class="icon-ajoute general" data-id="ajoute" title="Ajouter un nouveau type d'événements"></a>
+
+  <h2 class="edition">Modifier les types d'événements</h2>
+
+FIN;
+
+// Récupération
+$resultat = $mysqli->query('SELECT t.id, ordre, nom, cle, couleur, COUNT(a.id) AS nb FROM `agenda-types` AS t LEFT JOIN agenda AS a ON type = t.id GROUP BY t.id ORDER BY ordre');
+$max = $resultat->num_rows;
+while ( $r = $resultat->fetch_assoc() )  {
+  $id = $r['id'];
+  $s = ( $r['nb'] > 1 ) ? 's' : '';
+  if ( $id < 3 )  {
+    $suppr = '';
+    $indication = ' Il n\'est pas supprimable car il est utilisé pour l\'ajout automatique des déplacements de colles.';
+  }
+  else  {
+    $suppr = "\n    <a class=\"icon-supprime\" title=\"Supprimer ce type d'événements\"></a>";
+    $indication = '';
+  }
+  // $monte = "\n    <a class=\"icon-monte\"".( ( $r['ordre'] < 4 ) ? ' style="display:none;"' : '' ).' title="Déplacer ce type d\'événements vers le haut"></a>';
+  // $descend = "\n    <a class=\"icon-descend\"".( ( $r['ordre'] == $max ) ? ' style="display:none;"' : '' ).' title="Déplacer ce type d\'événements vers le bas"></a>';
+  $monte = ( $r['ordre'] == 1 ) ? ' style="display:none;"' : '';
+  $descend = ( $r['ordre'] == $max ) ? ' style="display:none;"' : '';
+  echo <<<FIN
+
+  <article data-id="agenda-types|$id">
+    <a class="icon-aide" data-id="type" title="Aide pour l'édition de ce type d'événements"></a>
+    <a class="icon-monte"$monte title="Déplacer ce type d'événements vers le haut"></a>
+    <a class="icon-descend"$descend title="Déplacer ce type d'événements vers le bas"></a>$suppr
+    <form>
+      <a class="icon-ok" title="Valider les modifications"></a>
+      <h3 class="edition">${r['nom']}</h3>
+      <p>Ce type d'événements correspond à ${r['nb']} événement$s dans l'agenda.$indication</p>
+      <p class="ligne"><label for="nom$id">Nom&nbsp;: </label><input type="input" id="nom$id" name="nom" value="${r['nom']}" size="50"></p>
+      <p class="ligne"><label for="cle$id">Clé&nbsp;: </label><input type="input" id="cle$id" name="cle" value="${r['cle']}" size="50"></p>
+      <p class="ligne"><label for="couleur$id">Couleur&nbsp;: </label><input type="input" id="couleur$id" name="couleur" value="${r['couleur']}" size="6"></p>
+    </form>
+  </article>
+
+FIN;
+}
+$resultat->free();
+
+// Aide et formulaire d'ajout
+?>
+
+  <form id="form-ajoute">
+    <h3 class="edition">Ajouter un nouveau type d'événements</h3>
+    <div>
+      <input type="input" class="ligne" name="nom" value="" size="50" data-placeholder="Nom pour l'affichage (Commence par majuscule, singulier)">
+      <input type="input" class="ligne" name="cle" value="" size="50" data-placeholder="Clé pour les adresses web (Un seul mot, minuscules ou sigle, singulier)">
+      <input type="input" class="ligne" name="couleur" value="" size="6" data-placeholder="Couleur des événements (code RRGGBB)">
+    </div>
+    <input type="hidden" name="table" value="agenda-types">
+  </form>
+
+  <div id="aide-page">
+    <h3>Aide et explications</h3>
+    <p>Il est possible ici d'ajouter ou de modifier les types d'événements de l'agenda. Ces modifications sont propres à chaque matière.</p>
+    <p>Le <em>nom</em> sera affiché au début de chaque événement, dans le calendrier et dans les informations récentes. Il doit s'agit d'un nom singulier et commençant par une majuscule. Il peut être relativement long. Par exemple&nbsp;: «&nbsp;Annulation de cours&nbsp;», «&nbsp;Interrogation de cours&nbsp;» (si vous souhaitez les annoncer :-) )</p>
+    <p>La <em>clé</em> sera affichée dans le menu déroulant de recherche, précédé de «&nbsp;les&nbsp», ainsi que dans l'adresse des pages qui affichent ce type d'événements&nbsp;: il faut donc que ce soit un pluriel, pas trop long, en un mot, sans majucule au début (sauf s'il le faut). Par exemple, «&nbsp;annulations&nbsp;», «&nbsp;interros&nbsp;».</p>
+    <p>Remarque&nbsp;: les clés ne sont pas encore utilisées actuellement, mais le seront certainement dans la prochaine version, qui devrait arriver en cours d'année.</p>
+    <p>La <em>couleur</em> est celle qui sera affiché pour tous les événement du type concerné, dans le calendrier. Elle est codée sous la forme <code>RRGGBB</code>, un sélecteur de couleur apparaît au clic sur la case colorée.</p>
+    <h4>Suppression et gestion de l'ordre d'affichage</h4>
+    <p>Il est possible de supprimer la plupart des types d'événements en cliquant sur le bouton <span class="icon-supprime"></span> (une confirmation sera demandée).</p>
+    <p>Tous les types d'événements peuvent être déplacés les uns par rapport aux autres, à l'aide des boutons <span class="icon-monte"></span> et <span class="icon-descend"></span>. Cela modifie leur ordre d'affichage dans les menus de sélection, pour la création et la modification d'événements.</p>
+    <h4>Déplacement et rattrapage de colle</h4>
+    <p>Les types <em>Déplacement de colle</em> et <em>Rattrapage de colle</em> sont utilisé par la possibilité d'ajout automatique d'un déplacement de colle dans l'agenda. Il est donc impossible de les supprimer, mais l'on peut tout à fait les déplacer voire les renommer (ce qui n'est pas une bonne idée), et bien sûr modifier la couleur.</p>
+  </div>
+
+  <div id="aide-type">
+    <h3>Aide et explications</h3>
+    <p>Le <em>nom</em> sera affiché au début de chaque événement, dans le calendrier et dans les informations récentes. Il doit s'agit d'un nom singulier et commençant par une majuscule. Il peut être relativement long. Par exemple&nbsp;: «&nbsp;Annulation de cours&nbsp;», «&nbsp;Interrogation de cours&nbsp;» (si vous souhaitez les annoncer :-) )</p>
+    <p>La <em>clé</em> sera affichée dans le menu déroulant de recherche, précédé de «&nbsp;les&nbsp», ainsi que dans l'adresse des pages qui affichent ce type d'événements&nbsp;: il faut donc que ce soit un pluriel, pas trop long, en un mot, sans majucule au début (sauf s'il le faut). Par exemple, «&nbsp;annulations&nbsp;», «&nbsp;interros&nbsp;».</p>
+    <p>Remarque&nbsp;: les clés ne sont pas encore utilisées actuellement, mais le seront certainement dans la prochaine version, qui devrait arriver en cours d'année.</p>
+    <p>La <em>couleur</em> est celle qui sera affiché pour tous les événement du type concerné, dans le calendrier. Elle est codée sous la forme <code>RRGGBB</code>, un sélecteur de couleur apparaît au clic sur la case colorée.</p>
+    <p>Une fois les modifications faites, il faut les valider en cliquant sur le bouton <span class="icon-ok"></span>.</p>
+    <p>D'autres modifications sont possibles à l'aide des boutons disponibles pour chaque type d'événements&nbsp;:</p>
+    <ul>
+      <li><span class="icon-supprime"></span>&nbsp;: supprimer le type d'événements (une confirmation sera demandée)</li>
+      <li><span class="icon-monte"></span>&nbsp;: remonter le type d'événements d'un cran</li>
+      <li><span class="icon-descend"></span>&nbsp;: descendre le type d'événements d'un cran</li>
+    </ul>
+    <p>Attention&nbsp;: supprimer un type d'événements supprime aussi automatiquement tous les événements correspondant à ce type. Le nombre d'événements correspondant à un type est donné pour chaque type de séances.</p>
+  </div>
+
+  <div id="aide-ajoute">
+    <h3>Aide et explications</h3>
+    <p>Ce formulaire permet de créer un nouveau type d'événements. Il sera validé par un clic sur <span class="icon-ok"></span>, et abandonné (donc supprimé) par un clic sur <span class="icon-ferme"></span>.</p>
+    <p>Le <em>nom</em> sera affiché au début de chaque événement, dans le calendrier et dans les informations récentes. Il doit s'agit d'un nom singulier et commençant par une majuscule. Il peut être relativement long. Par exemple&nbsp;: «&nbsp;Annulation de cours&nbsp;», «&nbsp;Interrogation de cours&nbsp;» (si vous souhaitez les annoncer :-) )</p>
+    <p>La <em>clé</em> sera affichée dans le menu déroulant de recherche, précédé de «&nbsp;les&nbsp», ainsi que dans l'adresse des pages qui affichent ce type d'événements&nbsp;: il faut donc que ce soit un pluriel, pas trop long, en un mot, sans majucule au début (sauf s'il le faut). Par exemple, «&nbsp;annulations&nbsp;», «&nbsp;interros&nbsp;». La clé doit obligatoirement être unique (deux types d'événements ne peuvent pas avoir la même clé).</p>
+    <p>Remarque&nbsp;: les clés ne sont pas encore utilisées actuellement, mais le seront certainement dans la prochaine version, qui devrait arriver en cours d'année.</p>
+    <p>La <em>couleur</em> est celle qui sera affiché pour tous les événement du type concerné, dans le calendrier. Elle est codée sous la forme <code>RRGGBB</code>, un sélecteur de couleur apparaît au clic sur la case colorée.</p>
+  </div>
+
+  <p id="log"></p>
+
+  <script type="text/javascript" src="js/colpick.min.js"></script>
+  <script type="text/javascript">
+$( function() {
+  // Envoi par appui sur Entrée
+  $('input,select').on('keypress',function (e) {
+    if ( e.which == 13 )
+      $(this).parent().parent().children('a.icon-ok').click();
+  });
+});
+  </script>
+
+<?php
+
+$mysqli->close();
+fin(true);
+?>
diff -urN cahier-de-prepa5.1.0/ajax.php cahier-de-prepa6.0.0/ajax.php
--- cahier-de-prepa5.1.0/ajax.php	2015-10-24 02:45:29.896962640 +0200
+++ cahier-de-prepa6.0.0/ajax.php	2016-08-30 15:04:22.420328143 +0200
@@ -180,7 +180,7 @@
 //////////////////////////////////////////////////////////////////
 // Accès colleur et professeur : mailexp, mail (depuis mail.php)//
 //////////////////////////////////////////////////////////////////
-  elseif ( isset($_REQUEST['table']) and ( $_REQUEST['table'] == 'mailprefs' ) && isset($_REQUEST['champ']) && isset($_REQUEST['val']) )  {
+  elseif ( isset($_REQUEST['table']) && ( $_REQUEST['table'] == 'mailprefs' ) && isset($_REQUEST['champ']) && isset($_REQUEST['val']) )  {
     if ( !strlen($val = $_REQUEST['val']) )
       $message = '{"etat":"nok","message":"Cette valeur ne peut pas être vide."}';
     elseif ( $_REQUEST['champ'] == 'mailexp' )
@@ -437,9 +437,9 @@
             $message = '{"etat":"ok","message":"Information modifiée"}';
             if ( !$r['cache'] )  {
               if ( $champ == 'titre' )
-                recent($mysqli,1,$id,array('titre'=>"<span class=\"icon-infos\"></span> $valeur", 'lien'=>".?${r['cle']}", 'texte'=>$r['texte'], 'matiere'=>$r['mat'], 'protection'=>$r['protection']));
+                recent($mysqli,1,$id,$r['mat'],array('titre'=>( strlen($valeur) ? $valeur : 'Information')));
               else
-                recent($mysqli,1,$id,array('titre'=>"<span class=\"icon-infos\"></span> ${r['titre']}", 'lien'=>".?${r['cle']}", 'texte'=>$valeur, 'matiere'=>$r['mat'], 'protection'=>$r['protection']));
+                recent($mysqli,1,$id,array('texte'=>$valeur));
             }
           }
           else
@@ -462,7 +462,7 @@
         elseif ( isset($_REQUEST['montre']) )  {
           if ( requete('infos',"UPDATE infos SET cache = 0 WHERE id = $id",$mysqli) )  {
             $message = '{"etat":"ok","message":"L\'information apparaît désormais sur la partie publique."}';
-            recent($mysqli,1,$id,array('titre'=>"<span class=\"icon-infos\"></span> ${r['titre']}", 'lien'=>".?${r['cle']}", 'texte'=>$r['texte'], 'matiere'=>$r['mat'], 'protection'=>$r['protection']));
+            recent($mysqli,1,$id,$r['mat'],array('titre'=>( strlen($r['titre']) ? $r['titre'] : 'Information'), 'lien'=>".?${r['cle']}", 'texte'=>$r['texte'], 'matiere'=>$r['mat'], 'protection'=>$r['protection']));
           }
           else
             $message = '{"etat":"nok","message":"L\'information n\'a pas pu être diffusée. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
@@ -472,7 +472,7 @@
         elseif ( isset($_REQUEST['cache']) )  {
           if ( requete('infos',"UPDATE infos SET cache = 1 WHERE id = $id",$mysqli) )  {
             $message = '{"etat":"ok","message":"L\'information n\'apparaît plus sur la partie publique mais est toujours disponible ici pour modification ou diffusion."}';
-            recent($mysqli,1,$id);
+            recent($mysqli,1,$id,$r['mat']);
           }
           else
             $message = '{"etat":"nok","message":"L\'information n\'a pas pu être cachée. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
@@ -483,7 +483,7 @@
           if ( requete('infos',"DELETE FROM infos WHERE id = $id",$mysqli) 
             && requete('infos',"UPDATE infos SET ordre = (ordre-1) WHERE ordre > ${r['ordre']} AND page = ${r['page']}",$mysqli) )  {
             $message = '{"etat":"ok","message":"Suppression réalisée"}';
-            recent($mysqli,1,$id);
+            recent($mysqli,1,$id,$r['mat']);
           }
           else
             $message = '{"etat":"nok","message":"L\'information n\'a pas pu être supprimée. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
@@ -511,7 +511,7 @@
           && requete('infos',"INSERT INTO infos SET ordre = 1, page = $page, texte = '$texte', titre = '$titre', cache = $cache",$mysqli) )  {
           $message = $_SESSION['message'] = '{"etat":"ok","message":"Information ajoutée"}';
           if ( !$cache )
-            recent($mysqli,1,$mysqli->insert_id,array('titre'=>"<span class=\"icon-infos\"></span> $titre", 'lien'=>".?${r['cle']}", 'texte'=>$texte, 'matiere'=>$r['mat'], 'protection'=>$r['protection']));
+            recent($mysqli,1,$mysqli->insert_id,$r['mat'],array('titre'=>( strlen($titre) ? $titre : 'Information'), 'lien'=>".?${r['cle']}", 'texte'=>$texte, 'matiere'=>$r['mat'], 'protection'=>$r['protection']));
           $mysqli->query('ALTER TABLE infos ORDER BY page,ordre');
         }
         else
@@ -546,13 +546,8 @@
             $message = '{"etat":"nok","message":"Le programme de colle n\'a pas pu être modifié. Texte non vide nécessaire."}';
           elseif ( requete('colles',"UPDATE colles SET texte = '$valeur' WHERE id = ${r['id']}",$mysqli) )  {
             $message = '{"etat":"ok","message":"Programme de colles modifié"}';
-            if ( !$r['cache'] )  {
-              // Fabrication des données pour les informations récentes
-              $resultat = $mysqli->query("SELECT nom, cle, colles_protection FROM matieres WHERE id = $mid");
-              $s = $resultat->fetch_assoc();
-              $resultat->free();
-              recent($mysqli,2,$r['id'],array('titre'=>"<span class=\"icon-colles\"></span> Colles du ${r['debut']} en ${s['nom']}", 'lien'=>"colles?${s['cle']}&amp;n=$sid", 'texte'=>$valeur, 'matiere'=>$mid, 'protection'=>$s['colles_protection']));
-            }
+            if ( !$r['cache'] )
+              recent($mysqli,2,$r['id'],$mid,array('texte'=>$valeur));
           }
           else
             $message = '{"etat":"nok","message":"Le programme de colles n\'a pas pu être modifié. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
@@ -566,7 +561,7 @@
             $resultat = $mysqli->query("SELECT nom, cle, colles_protection FROM matieres WHERE id = $mid");
             $s = $resultat->fetch_assoc();
             $resultat->free();
-            recent($mysqli,2,$r['id'],array('titre'=>"<span class=\"icon-colles\"></span> Colles du ${r['debut']} en ${s['nom']}", 'lien'=>"colles?${s['cle']}&amp;n=$sid", 'texte'=>$r['texte'], 'matiere'=>$mid, 'protection'=>$s['colles_protection']));
+            recent($mysqli,2,$r['id'],$mid,array('titre'=>"Colles du ${r['debut']} en ${s['nom']}", 'lien'=>"colles?${s['cle']}&amp;n=$sid", 'texte'=>$r['texte'], 'matiere'=>$mid, 'protection'=>$s['colles_protection']));
           }
           else
             $message = '{"etat":"nok","message":"Le programme de colles n\'a pas pu être diffusé. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
@@ -576,7 +571,7 @@
         elseif ( isset($_REQUEST['cache']) )  {
           if ( requete('colles',"UPDATE colles SET cache = 1 WHERE id = ${r['id']}",$mysqli) )  {
             $message = '{"etat":"ok","message":"Le programme de colles n\'apparaît plus sur la partie publique mais est toujours disponible ici pour modification ou diffusion."}';
-            recent($mysqli,2,$r['id']);
+            recent($mysqli,2,$r['id'],$mid);
           }
           else
             $message = '{"etat":"nok","message":"Le programme de colles n\'a pas pu être caché. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
@@ -586,7 +581,7 @@
         elseif ( isset($_REQUEST['supprime']) )  {
           if ( requete('colles',"DELETE FROM colles WHERE id = ${r['id']}",$mysqli) )  {
             $message = '{"etat":"ok","message":"Suppression réalisée"}';
-            recent($mysqli,2,$r['id']);
+            recent($mysqli,2,$r['id'],$mid);
           }
           else
             $message = '{"etat":"nok","message":"Le programme de colles n\'a pas pu être supprimé. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
@@ -611,7 +606,7 @@
             $resultat = $mysqli->query("SELECT nom, cle, colles_protection FROM matieres WHERE id = $mid");
             $s = $resultat->fetch_assoc();
             $resultat->free();
-            recent($mysqli,2,$id,array('titre'=>"<span class=\"icon-colles\"></span> Colles du ${r['debut']} en ${s['nom']}", 'lien'=>"colles?${s['cle']}&amp;n=$sid", 'texte'=>$texte, 'matiere'=>$mid, 'protection'=>$s['colles_protection']));
+            recent($mysqli,2,$id,$mid,array('titre'=>"Colles du ${r['debut']} en ${s['nom']}", 'lien'=>"colles?${s['cle']}&amp;n=$sid", 'texte'=>$texte, 'matiere'=>$mid, 'protection'=>$s['colles_protection']));
           }
         }
         else
@@ -1036,6 +1031,7 @@
                 && requete('reps',"UPDATE reps SET matiere = 0 WHERE matiere = $id",$mysqli)
                 && requete('docs',"UPDATE docs SET matiere = 0 WHERE matiere = $id",$mysqli)
                 && requete('pages',"UPDATE pages SET mat = 0 WHERE mat = $id",$mysqli)
+                && requete('agenda',"UPDATE agenda SET matiere = 0 WHERE matiere = $id",$mysqli)
                 && requete('utilisateurs',"UPDATE utilisateurs SET matieres = TRIM(TRAILING ',' FROM REPLACE(CONCAT(matieres,','),',$id,',',')) ",$mysqli) )
             $message = '{"etat":"ok","message":"Matière '.$r['nom'].' supprimée&nbsp;: programmes de colles, cahier de texte, notes supprimées&nbsp;; répertoires et documents passés dans le répertoire général."}';
           else
@@ -1535,7 +1531,7 @@
 
     // Vérification que l'identifiant est valide
     if ( isset($_REQUEST['id']) && ctype_digit($id = $_REQUEST['id']) )  {
-      $resultat = $mysqli->query("SELECT nom, protection, ext, lien, parent FROM docs WHERE id = $id AND FIND_IN_SET(matiere,'${_SESSION['matieres']}')");
+      $resultat = $mysqli->query("SELECT nom, protection, ext, lien, parent, matiere FROM docs WHERE id = $id AND FIND_IN_SET(matiere,'${_SESSION['matieres']}')");
       if ( $resultat->num_rows )  {
         $r = $resultat->fetch_assoc();
         $resultat->free();
@@ -1548,13 +1544,17 @@
             setlocale(LC_CTYPE, "fr_FR.UTF-8");
             $nom = substr((str_replace(array($r['ext'],'\\','/'),array('','-','-'),$valeur)),0,100);
             // real_escape_string seulement pour la requête SQL
-            if ( requete('docs','UPDATE docs SET nom = \''.$mysqli->real_escape_string($nom).'\', nom_nat = \''.zpad($mysqli->real_escape_string($nom))."' WHERE id = $id",$mysqli) )  {
+            $nouveau_nom = $mysqli->real_escape_string($nom);
+            if ( requete('docs',"UPDATE docs SET nom = '$nouveau_nom', nom_nat = \'".zpad($nouveau_nom)."' WHERE id = $id",$mysqli) )  {
               exec('mv documents/'.escapeshellarg("${r['lien']}/${r['nom']}${r['ext']}").' documents/'.escapeshellarg("${r['lien']}/$nom${r['ext']}"));
-              $message = '{"etat":"ok","message":"Document modifié"}';
+              $message = '{"etat":"ok","message":"Nom du document modifié"}';
               $mysqli->query('ALTER TABLE docs ORDER BY parents,nom_nat');
+              // Modification de l'éventuelle information récente
+              if ( $r['protection'] < 5 )
+                recent($mysqli,3,$id,$r['matiere'],array('nom'=>$nouveau_nom,'ancien_nom'=>$r['nom']));
             }
             else
-              $message = '{"etat":"nok","message":"Le document n\'a pas pu être modifié. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+              $message = '{"etat":"nok","message":"Le nom du document n\'a pas pu être modifié. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
           }
         }
 
@@ -1562,27 +1562,46 @@
         elseif ( isset($_REQUEST['nom']) && isset($_REQUEST['parent']) && isset($_REQUEST['protection']) && strlen($nom = trim($_REQUEST['nom'])) )  {
           $requete = $message = array();
           $etat = 'ok';
-          // Modification du nom et de la protection
+          // Modification du nom
           setlocale(LC_CTYPE, "fr_FR.UTF-8");
           $nom = substr(basename(str_replace(array($r['ext'],'\\'),array('','/'),$nom)),0,100);
-          $protection = ( in_array($_REQUEST['protection'],array(0,1,2,3,4,5)) ) ? $_REQUEST['protection'] : 0;
           if ( $nom != $r['nom'] )  {
             // real_escape_string seulement pour la requête SQL
-            if ( requete('docs','UPDATE docs SET nom = \''.$mysqli->real_escape_string($nom).'\', nom_nat = \''.zpad($mysqli->real_escape_string($nom))."', protection = $protection WHERE id = $id",$mysqli) )  {
+            $nouveau_nom = $mysqli->real_escape_string($nom);
+            if ( requete('docs',"UPDATE docs SET nom = '$nouveau_nom', nom_nat = \'".zpad($nouveau_nom)."' WHERE id = $id",$mysqli) )  {
               exec('mv documents/'.escapeshellarg("${r['lien']}/${r['nom']}${r['ext']}").' documents/'.escapeshellarg("${r['lien']}/$nom${r['ext']}"));
-              $message[] = 'Document modifié';
+              $message[] = 'Nom du document modifié';
+              // Modification de l'éventuelle information récente
+              if ( $r['protection'] < 5 )
+                recent($mysqli,3,$id,$r['matiere'],array('nom'=>$nouveau_nom,'ancien_nom'=>$r['nom']));
             }
             else  {
-              $message[] = 'Le document n\'a pas pu être modifié. (Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»)';
+              $message[] = 'Le nom du document n\'a pas pu être modifié. (Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»)';
               $etat = 'nok';
             }
           }
-          elseif ( $protection != $r['protection'] )  {
-            if ( requete('docs',"UPDATE docs SET protection = $protection WHERE id = $id",$mysqli) )
-              $message[] = 'Document modifié';
+          // Modification de la protection
+          $protection = ( in_array($_REQUEST['protection'],array(0,1,2,3,4,5)) ) ? $_REQUEST['protection'] : 0;
+          if ( $protection != $r['protection'] )  {
+            if ( requete('docs',"UPDATE docs SET protection = $protection WHERE id = $id",$mysqli) )  {
+              $message[] = 'Accès du document modifié';
+              // Si $protection = 5, on cherche à supprimer l'info récente
+              if ( $protection == 5 )
+                recent($mysqli,3,$id,$r['matiere']);
+              // Si doc avant protégé, on crée une info récente de nouveau doc
+              elseif ( $r['protection'] == 5 )  {
+                $resultat = $mysqli->query("SELECT GROUP_CONCAT( reps.nom ORDER BY FIND_IN_SET(reps.id,docs.parents) SEPARATOR '/' ) AS path, docs.nom
+                                            FROM docs LEFT JOIN reps ON FIND_IN_SET(reps.id,docs.parents) WHERE docs.id = $id");
+                $s = $resultat->fetch_assoc();
+                $resultat->free();
+                $path = $mysqli->real_escape_string("${s['path']}/${s['nom']}");
+                recent($mysqli,3,$id,$r['matiere'],array('titre'=>$path, 'lien'=>"download?id=$id", 'texte'=>"<p>Nouveau document&nbsp;: <a href=\"download?id=$id\">$path</a></p>", 'matiere'=>$r['matiere'], 'protection'=>$protection),$r['ext']);
+              }
+            }
             else  {
-              $message[] = 'Le document n\'a pas pu être modifié. (Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»)';
+              $message[] = 'L\'accès du document n\'a pas pu être modifié. (Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»)';
               $etat = 'nok';
+              $protection = $r['protection'];
             }
           }
 
@@ -1593,8 +1612,17 @@
             if ( $resultat->num_rows )  {
               $s = $resultat->fetch_assoc();
               $resultat->free();
-              if ( requete('docs',"UPDATE docs SET parent = '$parent', parents = '${s['parents']},$parent', matiere = ${s['matiere']} WHERE id = $id",$mysqli) )
+              if ( requete('docs',"UPDATE docs SET parent = '$parent', parents = '${s['parents']},$parent', matiere = ${s['matiere']} WHERE id = $id",$mysqli) )  {
                 $message[] = 'Document déplacé';
+                // Modification de l'information récente si document visible
+                if ( $protection < 5 )  {
+                  $resultat = $mysqli->query("SELECT GROUP_CONCAT( reps.nom ORDER BY FIND_IN_SET(reps.id,docs.parents) SEPARATOR '/' ) AS path, docs.nom, docs.matiere
+                                              FROM docs LEFT JOIN reps ON FIND_IN_SET(reps.id,docs.parents) WHERE docs.id = $id");
+                  $s = $resultat->fetch_assoc();
+                  $resultat->free();
+                  recent($mysqli,3,$id,$r['matiere'],array('chemin'=>$mysqli->real_escape_string("${s['path']}/${s['nom']}"), 'matiere'=>$s['matiere']));
+                }
+              }
               else  {
                 $message[] = 'Le document n\'a pas pu être déplacé. (Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»)';
                 $etat = 'nok';
@@ -1605,40 +1633,10 @@
               $etat = 'nok';
             }
           }
-                    
-          // Si modification(s), on met à jour les informations récentes éventuelles
-          if ( $message && ( $etat = 'ok' ) )  {
-            if ( $protection < 5 )  {
-              // Fabrication des données pour les informations récentes
-              $resultat = $mysqli->query("SELECT GROUP_CONCAT( reps.nom ORDER BY FIND_IN_SET(reps.id,docs.parents) SEPARATOR '/' ) AS path, docs.matiere, docs.nom, docs.protection
-                                          FROM docs LEFT JOIN reps ON FIND_IN_SET(reps.id,docs.parents) WHERE docs.id = $id");
-              $s = $resultat->fetch_assoc();
-              $resultat->free();
-              $path = $mysqli->real_escape_string("${s['path']}/${s['nom']}");
-              // Liste des icônes pour affichage
-              $icones = array(
-                '.pdf' => '-pdf',
-                '.doc' => '-doc', '.odt' => '-doc', '.docx' => '-doc',
-                '.xls' => '-xls', '.ods' => '-xls', '.xlsx' => '-xls',
-                '.ppt' => '-ppt', '.odp' => '-ppt', '.pptx' => '-ppt',
-                '.jpg' => '-jpg', '.jpeg' => '-jpg', '.png' => '-jpg', '.gif' => '-jpg', '.svg' => '-jpg', '.tif' => '-jpg', '.tiff' => '-jpg', '.bmp' => '-jpg', '.ps' => '-jpg', '.eps' => '-jpg',
-                '.mp3' => '-mp3', '.ogg' => '-mp3', '.oga' => '-mp3', '.wma' => '-mp3', '.wav' => '-mp3', '.ra' => '-mp3', '.rm' => '-mp3',
-                '.mp4' => '-mp4', '.avi' => '-mp4', '.mpeg' => '-mp4', '.mpg' => '-mp4', '.wmv' => '-mp4', '.mp4' => '-mp4', '.ogv' => '-mp4', '.qt' => '-mp4', '.mov' => '-mp4', '.mkv' => '-mp4', '.flv' => '-mp4',
-                '.zip' => '-zip', '.rar' => '-zip', '.7z' => '-zip',
-                '.py' => '-pyt', '.exe' => '-pyt', '.sh' => '-pyt', '.ml' => '-pyt', '.mw' => '-pyt',
-                '.txt' => '-txt', '.rtf' => '-txt', '' => '-txt'
-              );
-              $icone = ( isset($icones[$ext=strtolower($r['ext'])]) ) ? $icones[$ext] : '-txt';
-              recent($mysqli,3,$id,array('titre'=>"<span class=\"icon-doc$icone\"></span> $path", 'lien'=>"download?id=$id", 'texte'=>"<p>Modification du document&nbsp;: <a href=\"download?id=$id\">$path</a></p>", 'matiere'=>$s['matiere'], 'protection'=>$s['protection']));
-            }
-            // Si $protection = 5, on cherche à supprimer.
-            else
-              recent($mysqli,3,$id);
-          }
 
           // Mise à jour d'un document
           if ( isset($_FILES['fichier']['tmp_name']) && is_uploaded_file($_FILES['fichier']['tmp_name']) )  {
-            // Changement d'extension suspect donc interdit
+            // Changement d'extension interdit
             $ext = ( strpos($_FILES['fichier']['name'],'.') ) ? strrchr($_FILES['fichier']['name'],'.') : '';
             if ( $ext != $r['ext'] )  {
               $message[] = 'Document non mis à jour (extension du fichier envoyé non conforme)';
@@ -1651,28 +1649,14 @@
               $taille = ( $taille < 1024 ) ? "$taille&nbsp;ko" : intval($taille/1024).'&nbsp;Mo';
               // Modifications dans la base de données
               requete('docs',"UPDATE docs SET upload = DATE(NOW()), taille = '$taille' WHERE id = $id",$mysqli);
-              // Information récente si document visible
-              if ( $r['protection'] < 5 )  {
-                $resultat = $mysqli->query("SELECT GROUP_CONCAT( reps.nom ORDER BY FIND_IN_SET(reps.id,docs.parents) SEPARATOR '/' ) AS path, docs.matiere, docs.nom, docs.protection
+              // Info récente si document visible (éventuellement nouvelle)
+              if ( $protection < 5 )  {
+                // Besoin du chemin si pas d'info récente liée au document
+                $resultat = $mysqli->query("SELECT GROUP_CONCAT( reps.nom ORDER BY FIND_IN_SET(reps.id,docs.parents) SEPARATOR '/' ) AS path, docs.nom
                                             FROM docs LEFT JOIN reps ON FIND_IN_SET(reps.id,docs.parents) WHERE docs.id = $id");
                 $s = $resultat->fetch_assoc();
                 $resultat->free();
-                $path = $mysqli->real_escape_string("${s['path']}/${s['nom']}");
-                // Liste des icônes pour affichage
-                $icones = array(
-                  '.pdf' => '-pdf',
-                  '.doc' => '-doc', '.odt' => '-doc', '.docx' => '-doc',
-                  '.xls' => '-xls', '.ods' => '-xls', '.xlsx' => '-xls',
-                  '.ppt' => '-ppt', '.odp' => '-ppt', '.pptx' => '-ppt',
-                  '.jpg' => '-jpg', '.jpeg' => '-jpg', '.png' => '-jpg', '.gif' => '-jpg', '.svg' => '-jpg', '.tif' => '-jpg', '.tiff' => '-jpg', '.bmp' => '-jpg', '.ps' => '-jpg', '.eps' => '-jpg',
-                  '.mp3' => '-mp3', '.ogg' => '-mp3', '.oga' => '-mp3', '.wma' => '-mp3', '.wav' => '-mp3', '.ra' => '-mp3', '.rm' => '-mp3',
-                  '.mp4' => '-mp4', '.avi' => '-mp4', '.mpeg' => '-mp4', '.mpg' => '-mp4', '.wmv' => '-mp4', '.mp4' => '-mp4', '.ogv' => '-mp4', '.qt' => '-mp4', '.mov' => '-mp4', '.mkv' => '-mp4', '.flv' => '-mp4',
-                  '.zip' => '-zip', '.rar' => '-zip', '.7z' => '-zip',
-                  '.py' => '-pyt', '.exe' => '-pyt', '.sh' => '-pyt', '.ml' => '-pyt', '.mw' => '-pyt',
-                  '.txt' => '-txt', '.rtf' => '-txt', '' => '-txt'
-                );
-                $icone = ( isset($icones[$ext=strtolower($r['ext'])]) ) ? $icones[$ext] : '-txt';
-                recent($mysqli,3,$id,array('titre'=>"<span class=\"icon-doc$icone\"></span> $path", 'lien'=>"download?id=$id", 'texte'=>"<p>Mise à jour du document&nbsp;: <a href=\"download?id=$id\">$path</a></p>", 'matiere'=>$s['matiere'], 'protection'=>$s['protection']));
+                recent($mysqli,3,$id,$r['matiere'],array('maj'=>$mysqli->real_escape_string("${s['path']}/${s['nom']}"),'p'=>$protection,'e'=>$ext));
               }
               $message[] = 'Document mis à jour';
             }
@@ -1691,7 +1675,7 @@
             // Suppression physique
             exec("rm -rf documents/${r['lien']}");
             $message = '{"etat":"ok","message":"Document supprimé"}';
-            recent($mysqli,3,$id);
+            recent($mysqli,3,$id,$r['matiere']);
           }
           else
             $message = '{"etat":"nok","message":"Le document n\'a pas pu être supprimé. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
@@ -1706,7 +1690,7 @@
       // Vérification du répertoire parent
       $resultat = $mysqli->query("SELECT parents, matiere FROM reps WHERE id = $parent AND FIND_IN_SET(matiere,'${_SESSION['matieres']}')");
       if ( $resultat->num_rows)  {
-        $s = $resultat->fetch_assoc();
+        $r = $resultat->fetch_assoc();
         $resultat->free();
         // Vérifications des données envoyées (on fait confiance aux utilisateurs connectés pour ne pas envoyer de scripts malsains)
         $nom = $_FILES['fichier']['name'];
@@ -1726,33 +1710,19 @@
         // Déplacement du document uploadé au bon endroit
         if ( move_uploaded_file($_FILES['fichier']['tmp_name'],"documents/$lien/$nom$ext") )  {
           // Écriture MySQL
-          if ( requete('docs',"INSERT INTO docs SET parent = $parent, parents = '${s['parents']},$parent',
-                               matiere = ${s['matiere']}, nom = '".$mysqli->real_escape_string($nom).'\', nom_nat = \''.zpad($mysqli->real_escape_string($nom))."', upload = DATE(NOW()),
+          if ( requete('docs',"INSERT INTO docs SET parent = $parent, parents = '${r['parents']},$parent',
+                               matiere = ${r['matiere']}, nom = '".$mysqli->real_escape_string($nom).'\', nom_nat = \''.zpad($mysqli->real_escape_string($nom))."', upload = DATE(NOW()),
                                taille = '$taille', lien = '$lien', ext='".$mysqli->real_escape_string($ext)."', protection = $protection",$mysqli) )  {
             $id = $mysqli->insert_id;
             $message = $_SESSION['message'] = '{"etat":"ok","message":"Document ajouté"}';
             // Mise à jour des informations récentes
             if ( $protection < 5 )  {
-              $resultat = $mysqli->query("SELECT GROUP_CONCAT( reps.nom ORDER BY FIND_IN_SET(reps.id,docs.parents) SEPARATOR '/' ) AS path, docs.protection, docs.matiere
+              $resultat = $mysqli->query("SELECT GROUP_CONCAT( reps.nom ORDER BY FIND_IN_SET(reps.id,docs.parents) SEPARATOR '/' ) AS path
                                           FROM docs LEFT JOIN reps ON FIND_IN_SET(reps.id,docs.parents) WHERE docs.id = $id");
               $s = $resultat->fetch_assoc();
               $resultat->free();
               $path = $mysqli->real_escape_string("${s['path']}/$nom");
-              // Liste des icônes pour affichage
-              $icones = array(
-                '.pdf' => '-pdf',
-                '.doc' => '-doc', '.odt' => '-doc', '.docx' => '-doc',
-                '.xls' => '-xls', '.ods' => '-xls', '.xlsx' => '-xls',
-                '.ppt' => '-ppt', '.odp' => '-ppt', '.pptx' => '-ppt',
-                '.jpg' => '-jpg', '.jpeg' => '-jpg', '.png' => '-jpg', '.gif' => '-jpg', '.svg' => '-jpg', '.tif' => '-jpg', '.tiff' => '-jpg', '.bmp' => '-jpg', '.ps' => '-jpg', '.eps' => '-jpg',
-                '.mp3' => '-mp3', '.ogg' => '-mp3', '.oga' => '-mp3', '.wma' => '-mp3', '.wav' => '-mp3', '.ra' => '-mp3', '.rm' => '-mp3',
-                '.mp4' => '-mp4', '.avi' => '-mp4', '.mpeg' => '-mp4', '.mpg' => '-mp4', '.wmv' => '-mp4', '.mp4' => '-mp4', '.ogv' => '-mp4', '.qt' => '-mp4', '.mov' => '-mp4', '.mkv' => '-mp4', '.flv' => '-mp4',
-                '.zip' => '-zip', '.rar' => '-zip', '.7z' => '-zip',
-                '.py' => '-pyt', '.exe' => '-pyt', '.sh' => '-pyt', '.ml' => '-pyt', '.mw' => '-pyt',
-                '.txt' => '-txt', '.rtf' => '-txt', '' => '-txt'
-              );
-              $icone = ( isset($icones[$ext]) ) ? $icones[$ext] : '-txt';
-              recent($mysqli,3,$id,array('titre'=>"<span class=\"icon-doc$icone\"></span> $path", 'lien'=>"download?id=$id", 'texte'=>"<p>Nouveau document&nbsp;: <a href=\"download?id=$id\">$path</a></p>", 'matiere'=>$s['matiere'], 'protection'=>$s['protection']));
+              recent($mysqli,3,$id,$r['matiere'],array('titre'=>$path, 'lien'=>"download?id=$id", 'texte'=>"<p>Nouveau document&nbsp;: <a href=\"download?id=$id\">$path</a></p>", 'matiere'=>$r['matiere'], 'protection'=>$protection),$ext);
             }
           }
           else  {
@@ -1884,6 +1854,308 @@
       }
     }
     break;
+
+//////////////////////////////
+// Modification de l'agenda //
+//////////////////////////////
+  case 'agenda':
+    // Traitement d'une suppression
+    if ( isset($_REQUEST['supprime']) && isset($_REQUEST['id']) && ctype_digit($id = $_REQUEST['id']) )  {
+      $resultat = $mysqli->query("SELECT matiere FROM agenda WHERE id = $id");
+      if ( $resultat->num_rows )  {
+        $r = $resultat->fetch_row();
+        $resultat->free();
+        if ( requete('agenda',"DELETE FROM agenda WHERE id = $id",$mysqli) )  {
+          $message = '{"etat":"ok","message":"Suppression réalisée"}';
+          recent($mysqli,5,$id,$r[0]);
+        }
+        else
+          $message = '{"etat":"nok","message":"L\'événement n\'a pas pu être supprimé. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+      }
+      else
+        $message = '{"etat":"nok","message":"Identifiant non valide"}';
+    }
+  
+    // Traitement d'une modification/d'un ajout d'événement :
+    // validation préliminaire
+    elseif ( isset($_REQUEST['type']) && isset($_REQUEST['matiere']) && isset($_REQUEST['debut']) && isset($_REQUEST['fin']) && ( ctype_digit($tid = $_REQUEST['type']) ) && ( ctype_digit($mid = $_REQUEST['matiere']) ) )  {
+      // Validation des dates
+      $debut = preg_filter('/(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2})h(\d{2})/','$3-$2-$1 $4:$5',( strlen($_REQUEST['debut']) > 14 ) ? $_REQUEST['debut'] : $_REQUEST['debut'].' 0h00');
+      $fin = preg_filter('/(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2})h(\d{2})/','$3-$2-$1 $4:$5',( strlen($_REQUEST['fin']) > 14 ) ? $_REQUEST['fin'] : $_REQUEST['fin'].' 0h00');
+      if ( is_null($debut) || is_null($fin) || ( $debut > $fin ) )
+        $message = '{"etat":"nok","message":"Les dates/heures choisies ne sont pas valables."}';
+      else  {
+        // Validation des dates : l'événement doit se trouver en partie dans
+        // l'année scolaire
+        $resultat = $mysqli->query("SELECT id FROM semaines WHERE debut <= '$fin' AND ADDDATE(debut,80) >= '$debut' LIMIT 1");
+        if ( !$resultat->num_rows )
+          $message = '{"etat":"nok","message":"Les dates de l\'événement le placent hors de l\'année scolaire."}';
+        else  {
+          $resultat->free();
+          // Pour les informations récentes : jour et mois
+          $jour = substr($debut,8,2);
+          $mois = substr($debut,5,2);
+          $annee = substr($debut,2,2);
+          // Validation du type d'événement
+          $resultat = $mysqli->query("SELECT nom FROM `agenda-types` WHERE id = $tid");
+          if ( !$resultat->num_rows )
+            $message = '{"etat":"nok","message":"Type d\'événement non valide."}';
+          else  {
+            // Besoin du nom pour les informations récentes
+            $r = $resultat->fetch_row();
+            $resultat->free();
+            $type = $r[0];
+            if ( $mid )  {
+              // Validation de la matière si non nulle
+              $resultat = $mysqli->query("SELECT nom FROM matieres WHERE id = $mid");
+              if ( !$resultat->num_rows )
+                $message = '{"etat":"nok","message":"Matière non valide."}';
+              else  {
+                // Besoin du nom pour les informations récentes
+                $r = $resultat->fetch_row();
+                $resultat->free();
+                $matiere = $r[0];
+              }
+            }
+            else
+              $matiere = '';
+          }
+        }
+      }
+      // Sortie prématurée si message d'erreur
+      if ( strlen($message) )
+        break;
+      $texte = $mysqli->real_escape_string($_REQUEST['texte']);
+
+      // Vérification que l'identifiant est valide
+      if ( isset($_REQUEST['id']) && ctype_digit($id = $_REQUEST['id']) )  {
+        $resultat = $mysqli->query("SELECT id FROM agenda WHERE id = $id");
+        if ( $resultat->num_rows )  {
+          $resultat->free();
+          // Écriture dans la base de données
+          if ( requete('agenda',"UPDATE agenda SET matiere = $mid, type = $tid, debut = '$debut', fin = '$fin', texte = '$texte' WHERE id = $id", $mysqli) )  {
+            $message = '{"etat":"ok","message":"Événement modifié"}';
+            recent($mysqli,5,$id,$mid,array('titre'=>"$jour/$mois - $type ".( strlen($matiere) ? "en $matiere " : '').'(mise à jour)', 'lien'=>"agenda?mois=$annee$mois", 'texte'=>$texte, 'matiere'=>$mid, 'protection'=>0));
+            $mysqli->query('ALTER TABLE agenda ORDER BY fin, debut');
+          }
+          else
+            $message = '{"etat":"nok","message":"L\'événement n\'a pas pu être modifié. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+        }
+        else
+          $message = '{"etat":"nok","message":"Identifiant non valide"}';
+      }
+      // Nouvel événement
+      elseif ( requete('agenda',"INSERT INTO agenda SET matiere = $mid, type = $tid, debut = '$debut', fin = '$fin', texte = '$texte'", $mysqli) )  {
+        $message = '{"etat":"ok","message":"Événement ajouté"}';
+        recent($mysqli,5,$mysqli->insert_id,$mid,array('titre'=>"$jour/$mois - $type ".( strlen($matiere) ? "en $matiere " : ''), 'lien'=>"agenda?mois=$annee$mois", 'texte'=>$texte, 'matiere'=>$mid, 'protection'=>0));
+        $mysqli->query('ALTER TABLE agenda ORDER BY fin, debut');
+      }
+      else
+        $message = '{"etat":"nok","message":"L\'événement n\'a pas pu être ajouté. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+    }
+    // Rechargement systématique
+    $_SESSION['message'] = $message;
+    break;
+
+//////////////////////////////////////////////////////////////
+// Modification de l'agenda : cas des déplacements de colle //
+//////////////////////////////////////////////////////////////
+  case 'deplcolle':
+    // On ne réalise ici que des ajouts d'événements. Pas de suppression, pas de
+    // modification. Événements simultanés si deux dates renseignées.
+
+    // Validation préliminaire
+    if ( !isset($_REQUEST['matiere']) || !isset($_REQUEST['colleur']) || !isset($_REQUEST['groupe']) || !ctype_digit($matiere = $_REQUEST['matiere']) || !strlen($colleur = $_REQUEST['colleur']) || !strlen($groupe = $_REQUEST['groupe']) )
+      $message = '{"etat":"nok","message":"La matière, le colleur et le groupe sont obligatoires."}';
+    else  {
+      // Validation des dates
+      $mois = array('','janvier','février','mars','avril','mai','juin','juillet','août','septembre','octobre','novembre','décembre');
+      switch ( strlen($_REQUEST['ancien']) )  {
+        case 0: $ancien_sql = ''; break;
+        case 10:
+          $ancien_sql = preg_filter('/(\d{2})\/(\d{2})\/(\d{4})/','$3-$2-$1',$_REQUEST['ancien'].' 00:00');
+          $ancien = substr($ancien_sql,8,2);
+          $ancien = (( $ancien == '01' ) ? '1er' : ltrim($ancien,'0')).' '.$mois[(int)substr($ancien_sql,5,2)];
+          break;
+        case 15: 
+        case 16:
+          $ancien_sql = preg_filter('/^(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2})h(\d{2})$/','$3-$2-$1 $4:$5',$_REQUEST['ancien']);
+          $ancien = substr($ancien_sql,8,2);
+          $ancien = (( $ancien == '01' ) ? '1er' : ltrim($ancien,'0')).' '.$mois[(int)substr($ancien_sql,5,2)].' à'.str_replace(':','h',strstr($ancien_sql,' '));
+          break;
+        default: $ancien_sql = null;
+      }
+      switch ( strlen($_REQUEST['nouveau']) )  {
+        case 0: $nouveau_sql = ''; break;
+        case 10:
+          $nouveau_sql = preg_filter('/(\d{2})\/(\d{2})\/(\d{4})/','$3-$2-$1',$_REQUEST['nouveau'].' 00:00');
+          $nouveau = substr($nouveau_sql,8,2);
+          $nouveau = (( $nouveau == '01' ) ? '1er' : ltrim($nouveau,'0')).' '.$mois[(int)substr($nouveau_sql,5,2)];
+          break;
+        case 15: 
+        case 16:
+          $nouveau_sql = preg_filter('/^(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2})h(\d{2})$/','$3-$2-$1 $4:$5',$_REQUEST['nouveau']);
+          $nouveau = substr($nouveau_sql,8,2);
+          $nouveau = (( $nouveau == '01' ) ? '1er' : ltrim($nouveau,'0')).' '.$mois[(int)substr($nouveau_sql,5,2)].' à'.str_replace(':','h',strstr($nouveau_sql,' '));
+          break;
+        default: $nouveau_sql = null;
+      }
+      if ( is_null($ancien_sql) || is_null($nouveau_sql) )
+        $message = '{"etat":"nok","message":"Les dates/heures choisies ne sont pas valables."}';
+      else  {
+        // Validation de la matière
+        $resultat = $mysqli->query("SELECT nom FROM matieres WHERE id = $matiere");
+        if ( !$resultat->num_rows )
+          $message = '{"etat":"nok","message":"Matière non valide."}';
+        else  {
+          $r = $resultat->fetch_row();
+          $resultat->free();
+          // Début du texte des événements
+          $texte = 'La colle du groupe '.$mysqli->real_escape_string($groupe)." en {$r[0]} avec ".$mysqli->real_escape_string($colleur);
+          // Seulement ancien horaire : annulation de colle
+          if ( strlen($ancien_sql) && !strlen($nouveau_sql) )  {
+            $validation = " '$ancien_sql' BETWEEN debut AND ADDDATE(debut,60)";
+            $texte .= " prévue le $ancien est annulée.";
+            $insertion = "($matiere,1,'$ancien_sql','$ancien_sql','<p>$texte</p>')";
+          }
+          // Seulement nouvel horaire : rattrapage de colle
+          elseif ( !strlen($ancien_sql) && strlen($nouveau_sql) )  {
+            $validation = " '$nouveau_sql' BETWEEN debut AND ADDDATE(debut,60)";
+            $texte .= " est rattrapée le $nouveau".(( strlen($_REQUEST['salle']) ) ? ' en salle '.$mysqli->real_escape_string($_REQUEST['salle']) : '').'.';
+            $insertion = "($matiere,2,'$nouveau_sql','$nouveau_sql','<p>$texte</p>')";
+          }
+          // Ancien et nouvel horaires : déplacement de colle
+          else  {
+            $validation = " '$ancien_sql' BETWEEN debut AND ADDDATE(debut,60) AND '$nouveau_sql' BETWEEN debut AND ADDDATE(debut,60)";
+            $texte .= " est déplacée du $ancien au $nouveau".(( strlen($_REQUEST['salle']) ) ? ' en salle '.$mysqli->real_escape_string($_REQUEST['salle']) : '').'.';
+            $insertion = "($matiere,1,'$ancien_sql','$ancien_sql','<p>$texte</p>'),($matiere,2,'$nouveau_sql','$nouveau_sql','<p>$texte</p>')";
+          }
+          // Validation des dates : chaque horaire doit se trouver dans l'année scolaire
+          $resultat = $mysqli->query("SELECT id FROM semaines WHERE $validation LIMIT 1");
+          if ( !$resultat->num_rows )
+            $message = '{"etat":"nok","message":"Le(s) horaire(s) fourni(s) se trouve(nt) hors de l\'année scolaire."}';
+          else  {
+            $resultat->free();
+            if ( requete('agenda',"INSERT INTO agenda (matiere,type,debut,fin,texte) VALUES $insertion", $mysqli) )  {
+              $mysqli->query('ALTER TABLE agenda ORDER BY fin, debut');
+              $message = '{"etat":"ok","message":"Déplacement de colle ajouté"}';
+              $debut = ( strlen($ancien_sql) ) ? $ancien_sql : $nouveau_sql;
+              recent($mysqli,5,$mysqli->insert_id,$matiere,array('titre'=>substr($debut,8,2).'/'.substr($debut,5,2)." - Déplacement de colle en ${r[0]}, groupe ".$mysqli->real_escape_string($groupe), 'lien'=>'agenda?mois='.substr($debut,2,2).substr($debut,5,2), 'texte'=>$texte, 'matiere'=>$mid, 'protection'=>0));
+            }
+            else
+              $message = '{"etat":"nok","message":"Le déplacement de colle n\'a pas pu être ajouté. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+          }
+        }
+      }
+    }
+    // Rechargement systématique
+    $_SESSION['message'] = $message;
+    break;
+
+/////////////////////////////////////////////////////
+// Modification des types d'événements de l'agenda //
+/////////////////////////////////////////////////////
+  case 'agenda-types':
+  
+    // Vérification que l'identifiant est valide
+    if ( isset($_REQUEST['id']) && ctype_digit($id = $_REQUEST['id']) )  {
+      $resultat = $mysqli->query("SELECT ordre, nom, cle, couleur, (SELECT COUNT(*) FROM `agenda-types`) AS max FROM `agenda-types` WHERE id = $id");
+      if ( $resultat->num_rows )  {
+        $r = $resultat->fetch_assoc();
+        $resultat->free();
+
+        // Traitement d'une modification
+        if ( isset($_REQUEST['nom']) && isset($_REQUEST['cle']) && isset($_REQUEST['couleur']) )  {
+          $nom = ucfirst($mysqli->real_escape_string($_REQUEST['nom']));
+          $cle = str_replace(' ','_',trim($mysqli->real_escape_string($_REQUEST['cle'])));
+          $couleur =  preg_filter('/^([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/','$1',$_REQUEST['couleur']);
+          if ( !strlen($nom) || !strlen($cle) || !$couleur )
+            $message = '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être modifié. Nom, clé et couleur non vides nécessaires."}';
+          elseif ( $cle != $r['cle'] )  {
+            // Vérification que la clé n'existe pas déjà
+            $resultat = $mysqli->query("SELECT cle FROM `agenda-types` WHERE id != $id");
+            if ( $resultat->num_rows )  {
+              while ( $r = $resultat->fetch_assoc() )
+                if ( $r['cle'] == $cle )  {
+                  $message = '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être modifié. Cette clé existe déjà et doit être unique."}';
+                  break;
+                }
+              $resultat->free();
+            }
+          }
+          if ( !strlen($message) )  {
+            if ( requete('agenda-types',"UPDATE `agenda-types` SET nom = '$nom', cle = '$cle', couleur = '$couleur' WHERE id = $id",$mysqli) )
+              $message = $_SESSION['message'] = '{"etat":"ok","message":"Type d\'événements modifié"}';
+            else
+              $message = '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être modifié. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+          }
+        }
+        
+        // Déplacement vers le haut
+        elseif ( isset($_REQUEST['monte']) && ( $r['ordre'] > 1 ) )
+          $message = ( requete('agenda-types',"UPDATE `agenda-types` SET ordre = (2*${r['ordre']}-1-ordre) WHERE ( ordre = ${r['ordre']} OR ordre = (${r['ordre']}-1) )",$mysqli)
+                    && $mysqli->query('ALTER TABLE `agenda-types` ORDER BY ordre')
+          ) ? '{"etat":"ok","message":"Déplacement réalisé"}' : '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être déplacé. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+
+        // Déplacement vers le bas
+        elseif ( isset($_REQUEST['descend']) && ( $r['ordre'] < $r['max'] ) )
+          $message = ( requete('agenda-types',"UPDATE `agenda-types` SET ordre = (2*${r['ordre']}+1-ordre) WHERE ( ordre = ${r['ordre']} OR ordre = (${r['ordre']}+1) )",$mysqli)
+                    && $mysqli->query('ALTER TABLE `agenda-types` ORDER BY ordre')
+          ) ? '{"etat":"ok","message":"Déplacement réalisé"}' : '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être déplacé. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+
+        // Suppression
+        elseif ( isset($_REQUEST['supprime']) )
+          $message =  ( requete('agenda',"DELETE FROM agenda WHERE type = $id",$mysqli)
+                     && requete('agenda-types',"DELETE FROM `agenda-types` WHERE id = $id",$mysqli) 
+                     && requete('agenda-types',"UPDATE `agenda-types` SET ordre = (ordre-1) WHERE ordre > ${r['ordre']} AND matiere = ${r['matiere']}",$mysqli)
+          ) ? '{"etat":"ok","message":"Suppression réalisée"}' : '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être supprimé. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+      }
+      else
+        $message = '{"etat":"nok","message":"Identifiant non valide"}';
+    }
+    
+    // Nouveau type d'événements
+    elseif ( isset($_REQUEST['nom']) && isset($_REQUEST['cle']) && isset($_REQUEST['couleur']) )  {
+      $nom = ucfirst($mysqli->real_escape_string($_REQUEST['nom']));
+      $cle = str_replace(' ','_',trim($mysqli->real_escape_string($_REQUEST['cle'])));
+      $couleur =  preg_filter('/^([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/','$1',$_REQUEST['couleur']);
+      if ( !strlen($nom) || !strlen($cle) || !$couleur )
+        $message = '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être ajouté. Nom, clé et couleur non vides nécessaires."}';
+      else  {
+        // Vérification que la clé n'existe pas déjà
+        $resultat = $mysqli->query('SELECT cle FROM `agenda-types`');
+        if ( $resultat->num_rows )  {
+          while ( $r = $resultat->fetch_assoc() )
+            if ( $r['cle'] == $cle )  {
+              $message = '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être ajouté. Cette clé existe déjà et doit être unique."}';
+              break;
+            }
+          $resultat->free();
+        }
+      }
+      if ( !strlen($message) )  {
+        if ( requete('agenda-types',"INSERT INTO `agenda-types` SET nom = '$nom', cle = '$cle', couleur = '$couleur',
+                                     ordre = (SELECT max(t.ordre)+1 FROM `agenda-types` AS t)",$mysqli) )
+          $message = $_SESSION['message'] = '{"etat":"ok","message":"Type d\'événements ajouté"}';
+        else
+          $message = '{"etat":"nok","message":"Le type d\'événements n\'a pas pu être ajouté. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+      }
+    }
+    break;
+
+///////////////////////////////////////////
+// Modification des préférences globales //
+///////////////////////////////////////////
+  case 'prefs':
+
+    // Préférences de l'agenda : protection globale et nombre d'événements sur 
+    // la page d'accueil
+    if ( isset($_REQUEST['protection_agenda']) && isset($_REQUEST['nb_agenda_index']) && in_array($protection_agenda = $_REQUEST['protection_agenda'],array(0,1,2,3,4)) && ctype_digit($nb_agenda_index = $_REQUEST['nb_agenda_index']) )
+      $message = $_SESSION['message'] = ( requete('prefs',"UPDATE prefs SET val = $protection_agenda WHERE nom='protection_agenda'",$mysqli)
+                                       && requete('prefs',"UPDATE prefs SET val = $nb_agenda_index WHERE nom='nb_agenda_index'",$mysqli)
+      ) ? '{"etat":"ok","message":"Préférences de l\'agenda modifiées"}' : '{"etat":"nok","message":"Les préférences globales de l\'agenda n\'ont pas pu être modifiées. Erreur MySQL n°'.$mysqli->errno.', «'.$mysqli->error.'»."}';
+    break;
+
 }
 }
 
diff -urN cahier-de-prepa5.1.0/cdt.php cahier-de-prepa6.0.0/cdt.php
--- cahier-de-prepa5.1.0/cdt.php	2015-10-27 12:54:29.325706838 +0100
+++ cahier-de-prepa6.0.0/cdt.php	2016-08-30 16:51:33.187629752 +0200
@@ -21,6 +21,7 @@
 
 // Recherche de la matière concernée, variable $matiere
 // Si $_REQUEST['cle'] existe, on la cherche dans les matières disponibles.
+// Si $_REQUEST['cle'] existe, on la cherche dans les matières disponibles.
 $mysqli = connectsql();
 $resultat = $mysqli->query('SELECT id, cle, nom, cdt_protection AS protection FROM matieres WHERE cdt'.( ( $autorisation == 4 ) ? " OR  FIND_IN_SET(id,'${_SESSION['matieres']}')" : '' ));
 if ( $resultat->num_rows )  {
@@ -154,7 +155,7 @@
 ////////////
 /// HTML ///
 ////////////
-debut($mysqli,"Cahier de texte - ${matiere['nom']}". ( ( $edition && $matiere['protection'] ) ? "<span class=\"icon-lock${matiere['protection']}\"></span>" : '' ),$message,$autorisation,"cdt?${matiere['cle']}",$matiere['id']);
+debut($mysqli,"Cahier de texte - ${matiere['nom']}". ( ( $edition && $matiere['protection'] ) ? "<span class=\"icon-lock${matiere['protection']}\"></span>" : '' ),$message,$autorisation,"cdt?${matiere['cle']}",$matiere['id'],'datetimepicker');
 
 // MathJax désactivé par défaut
 $mathjax = false;
@@ -250,7 +251,7 @@
   echo <<<FIN
   
   <a class="icon-aide general" data-id="page" title="Aide pour l'édition du cahier de texte"></a>
-  <a class="icon-ajoute general" data-id="ajoute" title="Ajouter un nouvel élément du cahier de texte"></a>
+  <a class="icon-ajoute general" data-id="ajoute-cdt" title="Ajouter un nouvel élément du cahier de texte"></a>
 $boutons
 FIN;
   if ( $n !== false )  {
@@ -323,7 +324,7 @@
     echo "\n  <article><h2>L'année est terminée... Bonnes vacances&nbsp;!</h2>\n  <p><a href=\"?${matiere['cle']}&amp;tout\">Revoir tout le cahier de texte</a></p></article>\n";
 
   // Récupération des boutons
-  $resultat = $mysqli->query("SELECT id, nom, jour, TIME_FORMAT(h_debut,'%Hh%i') AS h_debut, TIME_FORMAT(h_fin,'%Hh%i') AS h_fin,
+  $resultat = $mysqli->query("SELECT id, nom, jour, TIME_FORMAT(h_debut,'%kh%i') AS h_debut, TIME_FORMAT(h_fin,'%kh%i') AS h_fin,
                               type, demigroupe FROM `cdt-seances` WHERE matiere = ${matiere['id']}");
   $select_raccourcis = '';
   $raccourcis = array();
@@ -361,16 +362,16 @@
       <select id="tid" name="tid"><?php echo $select_seances; ?></select>
       <a class="icon-edite" href="cdt-seances?<?php echo $matiere['cle']; ?>">&nbsp;</a>
     </p>
-    <p class="ligne"><label for="jour">Jour&nbsp;: </label><input type="text" class="date" id="jour" name="jour" value="" size="8"></p>
-    <p class="ligne"><label for="h_debut">Heure de début&nbsp;: </label><input type="text" class="heure" id="h_debut" name="h_debut" value="" size="5"></p>
-    <p class="ligne"><label for="h_fin">Heure de fin&nbsp;: </label><input type="text" class="heure" id="h_fin" name="h_fin" value="" size="5"></p>
-    <p class="ligne"><label for="pour">Pour le&nbsp;: </label><input type="text" class="date" id="pour" name="pour" value="" size="8"></p>
+    <p class="ligne"><label for="jour">Jour&nbsp;: </label><input type="text" id="jour" name="jour" value="" size="8"></p>
+    <p class="ligne"><label for="h_debut">Heure de début&nbsp;: </label><input type="text" id="h_debut" name="h_debut" value="" size="5"></p>
+    <p class="ligne"><label for="h_fin">Heure de fin&nbsp;: </label><input type="text" id="h_fin" name="h_fin" value="" size="5"></p>
+    <p class="ligne"><label for="pour">Pour le&nbsp;: </label><input type="text" id="pour" name="pour" value="" size="8"></p>
     <p class="ligne"><label for="demigroupe">Séance en demi-groupe&nbsp;: </label>
       <select id="demigroupe" name="demigroupe"><option value="0">Classe entière</option><option value="1">Demi-groupe</option></select>
     </p>
   </form>
   
-  <form id="form-ajoute">
+  <form id="form-ajoute-cdt">
     <h3 class="edition">Nouvel élément du cahier de texte</h3>
     <p class="ligne"><label for="racourci">Raccourci&nbsp;:</label>
       <select id="raccourci" name="raccourci"><?php echo $select_raccourcis; ?></select>
@@ -380,10 +381,10 @@
       <select id="tid" name="tid"><?php echo $select_seances; ?></select>
       <a class="icon-edite" href="cdt-seances?<?php echo $matiere['cle']; ?>">&nbsp;</a>
     </p>
-    <p class="ligne"><label for="jour">Jour&nbsp;: </label><input type="text" class="date" id="jour" name="jour" value="" size="8"></p>
-    <p class="ligne"><label for="h_debut">Heure de début&nbsp;: </label><input type="text" class="heure" id="h_debut" name="h_debut" value="" size="5"></p>
-    <p class="ligne"><label for="h_fin">Heure de fin&nbsp;: </label><input type="text" class="heure" id="h_fin" name="h_fin" value="" size="5"></p>
-    <p class="ligne"><label for="pour">Pour le&nbsp;: </label><input type="text" class="date" id="pour" name="pour" value="" size="8"></p>
+    <p class="ligne"><label for="jour">Jour&nbsp;: </label><input type="text" id="jour" name="jour" value="" size="8"></p>
+    <p class="ligne"><label for="h_debut">Heure de début&nbsp;: </label><input type="text" id="h_debut" name="h_debut" value="" size="5"></p>
+    <p class="ligne"><label for="h_fin">Heure de fin&nbsp;: </label><input type="text" id="h_fin" name="h_fin" value="" size="5"></p>
+    <p class="ligne"><label for="pour">Pour le&nbsp;: </label><input type="text" id="pour" name="pour" value="" size="8"></p>
     <p class="ligne"><label for="demigroupe">Séance en demi-groupe&nbsp;: </label>
       <select id="demigroupe" name="demigroupe"><option value="0">Classe entière</option><option value="1">Demi-groupe</option></select>
     </p>
@@ -394,9 +395,9 @@
   </form>
 
   <script type="text/javascript">
-    seances = $.parseJSON('<?php echo json_encode($seances); ?>');
-    raccourcis = $.parseJSON('<?php echo json_encode($raccourcis); ?>');
-    jours = ['','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'];
+    seances = <?php echo json_encode($seances); ?>;
+    raccourcis = <?php echo json_encode($raccourcis); ?>;
+    jours = ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'];
   </script>
 
   <div id="aide-page">
@@ -431,18 +432,16 @@
     <p>Il est possible de spécifier des types de séances du genre "Entrée quotidienne" ou "Entrée hebdomadaire". Cela se modifie sur la page de modification des <a href="cdt-seances?<?php echo $matiere['cle']; ?>">types de séances</a>.</p>
     <h4>Modification du type de séance/des horaires</h4>
     <p>La <em>séance</em> correspond au type de séance. Modifier la séance peut modifier immédiatement l'affichage ou non des champs suivants, selon les réglages effectués sur la page de modification des <a href="cdt-seances?<?php echo $matiere['cle']; ?>">types de séances</a>.</p>
-    <p>Les heures sont modifiables par tranches de 15 minutes. Il est possible d'utiliser les flèches du clavier pour les modifier.</p>
     <h4>Raccourcis</h4>
     <p>Il est possible de régler des <em>raccourcis</em> (propres à chaque matière) qui pré-rempliront les champs séances, jour, heures et demi-groupe. On peut par exemple disposer d'un raccourci &laquo;&nbsp;Cours du lundi&nbsp;&raquo; qui permettra de régler automatiquement le type de séance à Cours, le jour de la semaine au lundi de la semaine en cours, les heures de début et fin à 8h et 10h. Ces raccourcis sont modifiables sur la <a href="cdt-raccourcis?<?php echo $matiere['cle']; ?>">page correspondante</a> et apparaitront au début du formulaire de modification du type de séance/des horaires.</p>
     <h4>Modification du texte</h4>
     <p>Le texte doit être formaté en HTML&nbsp;: par exemple, chaque bloc de texte doit être encadré par &lt;p&gt; et &lt;/p&gt;. Il peut donc contenir des liens vers les autres pages du site, vers des documents du site, vers le web... Des boutons sont fournis pour aider au formattage (ainsi qu'une aide).</p>
   </div>
 
-  <div id="aide-ajoute">
+  <div id="aide-ajoute-cdt">
     <h3>Aide et explications</h3>
     <p>Ce formulaire permet de créer un nouvel élément du cahier de texte. Il sera validé par un clic sur <span class="icon-ok"></span>, et abandonné (donc supprimé) par un clic sur <span class="icon-annule"></span>.</p>
     <p>La <em>séance</em> correspond au type de séance. Modifier la séance peut modifier immédiatement l'affichage ou non des champs suivants, selon les réglages effectués sur la page de modification des <a href="cdt-seances?<?php echo $matiere['cle']; ?>">types de séances</a>.</p>
-    <p>Les heures sont modifiables par tranches de 15 minutes. Il est possible d'utiliser les flèches du clavier pour les modifier.</p>
     <p>Le texte doit être formaté en HTML&nbsp;: par exemple, chaque bloc de texte doit être encadré par &lt;p&gt; et &lt;/p&gt;. Il peut donc contenir des liens vers les autres pages du site, vers des documents du site, vers le web... Des boutons sont fournis pour aider au formattage (ainsi qu'une aide).</p>
     <p>La case à cocher <em>Ne pas diffuser sur la partie publique</em> permet de cacher temporairement cet élément du cahier de texte, par exemple pour le diffuser ultérieurement. Si la case est cochée, l'élément du cahier de texte ne sera pas diffusé et pourra être affiché à l'aide du bouton <span class="icon-montre"></span>. Si la case est décochée, l'élément du cahier de texte sera immédiatement visible et pourra être rendu invisible à l'aide du bouton <span class="icon-cache"></span>.</p>
     <h4>Types de séances</h4>
@@ -459,11 +458,7 @@
 
   <p id="log"></p>
   
-  <script type="text/javascript" src="js/jquery.plugin.js"></script>
-  <script type="text/javascript" src="js/jquery.datepick.js"></script>
-  <script type="text/javascript" src="js/jquery.datepick-fr.js"></script>
-  <script type="text/javascript" src="js/jquery.timeentry.js"></script>
-  <script type="text/javascript" src="js/jquery.timeentry-fr.js"></script>
+  <script type="text/javascript" src="js/datetimepicker.min.js"></script>
 <?php
 }
 
diff -urN cahier-de-prepa5.1.0/cdt-raccourcis.php cahier-de-prepa6.0.0/cdt-raccourcis.php
--- cahier-de-prepa5.1.0/cdt-raccourcis.php	2015-10-27 13:03:22.640827782 +0100
+++ cahier-de-prepa6.0.0/cdt-raccourcis.php	2016-08-25 01:59:51.623607008 +0200
@@ -71,19 +71,19 @@
 //////////////
 //// HTML ////
 //////////////
-debut($mysqli,"Cahier de texte - ${matiere['nom']}",$message,4,"cdt-raccourcis?${matiere['cle']}");
+debut($mysqli,"Cahier de texte - ${matiere['nom']}",$message,4,"cdt-raccourcis?${matiere['cle']}",false,'datetimepicker');
 echo <<<FIN
 
   <a class="icon-aide general" data-id="page" title="Aide pour les modifications des raccourcis de séance"></a>
   <a class="icon-annule general" onclick="history.back()" title="Retour au cahier de texte"></a>
-  <a class="icon-ajoute general" data-id="ajoute" title="Ajouter un nouveau raccourci de séance"></a>
+  <a class="icon-ajoute general" data-id="ajoute-cdt-raccourci" title="Ajouter un nouveau raccourci de séance"></a>
 
   <h2 class="edition">Modifier les raccourcis de séance</h2>
 
 FIN;
 
 // Récupération
-$resultat = $mysqli->query("SELECT id, ordre, nom, jour, type, demigroupe, TIME_FORMAT(h_debut,'%Hh%i') AS h_debut, TIME_FORMAT(h_fin,'%Hh%i') AS h_fin
+$resultat = $mysqli->query("SELECT id, ordre, nom, jour, type, demigroupe, TIME_FORMAT(h_debut,'%kh%i') AS h_debut, TIME_FORMAT(h_fin,'%kh%i') AS h_fin
                             FROM `cdt-seances` WHERE matiere = ${matiere['id']}");
 if ( $max = $resultat->num_rows )  {
   while ( $r = $resultat->fetch_assoc() )  {
@@ -111,8 +111,8 @@
       <p class="ligne"><label for="jour0">Jour&nbsp;:</label>
         <select id="jour0" name="jour">$sel_jours</select>
       </p>
-      <p class="ligne"><label for="h_debut$id">Heure de début&nbsp;: </label><input type="text" class="heure" id="h_debut$id" name="h_debut" value="${r['h_debut']}" size="5"></p>
-      <p class="ligne"><label for="h_fin$id">Heure de fin&nbsp;: </label><input type="text" class="heure" id="h_fin$id" name="h_fin" value="${r['h_fin']}" size="5"></p>
+      <p class="ligne"><label for="h_debut$id">Heure de début&nbsp;: </label><input type="text" id="h_debut$id" name="h_debut" value="${r['h_debut']}" size="5"></p>
+      <p class="ligne"><label for="h_fin$id">Heure de fin&nbsp;: </label><input type="text" id="h_fin$id" name="h_fin" value="${r['h_fin']}" size="5"></p>
       <p class="ligne"><label for="demigroupe$id">Séance en demi-groupe&nbsp;: </label>
         <select id="demigroupe$id" name="demigroupe">$sel_dg</select>
       </p>
@@ -129,7 +129,7 @@
 // Aide et formulaire d'ajout
 ?>
 
-  <form id="form-ajoute">
+  <form id="form-ajoute-cdt-raccourci">
     <h3 class="edition">Ajouter un nouveau raccourci de séances</h3>
     <div>
       <p class="ligne"><label for="nom0">Nom&nbsp;: </label><input type="input" id="nom0" name="nom" value="" size="50"></p>
@@ -139,8 +139,8 @@
       <p class="ligne"><label for="jour0">Jour&nbsp;:</label>
         <select id="jour0" name="jour"><?php echo $select_jours; ?></select>
       </p>
-      <p class="ligne"><label for="h_debut0">Heure de début&nbsp;: </label><input type="text" class="heure" id="h_debut0" name="h_debut" value="08h00" size="5"></p>
-      <p class="ligne"><label for="h_fin0">Heure de fin&nbsp;: </label><input type="text" class="heure" id="h_fin0" name="h_fin" value="10h00" size="5"></p>
+      <p class="ligne"><label for="h_debut0">Heure de début&nbsp;: </label><input type="text" id="h_debut0" name="h_debut" value="" size="5"></p>
+      <p class="ligne"><label for="h_fin0">Heure de fin&nbsp;: </label><input type="text" id="h_fin0" name="h_fin" value="" size="5"></p>
       <p class="ligne"><label for="demigroupe0">Séance en demi-groupe&nbsp;: </label>
         <select id="demigroupe0" name="demigroupe"><?php echo $select_dg; ?></select>
       </p>
@@ -173,7 +173,7 @@
     <p>Supprimer un raccourci de séance n'a strictement aucun impact sur les éléments du cahier de texte.</p>
   </div>
 
-  <div id="aide-ajoute">
+  <div id="aide-ajoute-cdt-raccourci">
     <h3>Aide et explications</h3>
     <p>Ce formulaire permet de créer un nouveau raccourci de séance. Il sera validé par un clic sur <span class="icon-ok"></span>, et abandonné (donc supprimé) par un clic sur <span class="icon-ferme"></span>.</p>
     <p>Chaque raccourci de séance ne concerne qu'une matière à la fois.</p>
@@ -184,11 +184,10 @@
   <p id="log"></p>
   
   <script type="text/javascript">
-    seances = $.parseJSON('<?php echo json_encode($seances); ?>');
+    seances = <?php echo json_encode($seances); ?>;
   </script>
-  <script type="text/javascript" src="js/jquery.plugin.js"></script>
-  <script type="text/javascript" src="js/jquery.timeentry.js"></script>
-  <script type="text/javascript" src="js/jquery.timeentry-fr.js"></script>
+  <script type="text/javascript" src="js/datetimepicker.min.js"></script>
+  
 <?php
 
 $mysqli->close();
diff -urN cahier-de-prepa5.1.0/cdt-seances.php cahier-de-prepa6.0.0/cdt-seances.php
--- cahier-de-prepa5.1.0/cdt-seances.php	2015-10-27 12:58:04.182131621 +0100
+++ cahier-de-prepa6.0.0/cdt-seances.php	2016-08-23 00:29:01.217875511 +0200
@@ -7,7 +7,7 @@
 include('fonctions.php');
 
 // Note : l'affichage des heures de début/fin est conditionné par le champ
-// deb_fin_pour de la table cdt-types (donc du type de séance choisi) :
+// deb_fin_pour de la table cdt-types (donc du type de séances choisi) :
 // 0 : Début seulement (jour date à debut : type (demigroupe))
 // 1 : Début et fin (jour date de debut à fin : type (demigroupe))
 // 2 : Pas d'horaire mais date d'échéance (jour date : type pour (demigroupe))
@@ -59,9 +59,9 @@
 debut($mysqli,"Cahier de texte - ${matiere['nom']}",$message,4,"cdt-seances?${matiere['cle']}");
 echo <<<FIN
 
-  <a class="icon-aide general" data-id="page" title="Aide pour les modifications des types de séance"></a>
+  <a class="icon-aide general" data-id="page" title="Aide pour les modifications des types de séances"></a>
   <a class="icon-annule general" onclick="history.back()" title="Retour au cahier de texte"></a>
-  <a class="icon-ajoute general" data-id="ajoute" title="Ajouter un nouveau type de séance"></a>
+  <a class="icon-ajoute general" data-id="ajoute" title="Ajouter un nouveau type de séances"></a>
 
   <h2 class="edition">Modifier les types de séances</h2>
 
@@ -87,13 +87,13 @@
 
   <article data-id="cdt-types|$id">
     <a class="icon-aide" data-id="seance" title="Aide pour l'édition de ce type de séances"></a>
-    <a class="icon-monte"$monte title="Déplacer ce type de séance vers le haut"></a>
-    <a class="icon-descend"$descend title="Déplacer ce type de séance vers le bas"></a>
-    <a class="icon-supprime" title="Supprimer ce type de séance"></a>
+    <a class="icon-monte"$monte title="Déplacer ce type de séances vers le haut"></a>
+    <a class="icon-descend"$descend title="Déplacer ce type de séances vers le bas"></a>
+    <a class="icon-supprime" title="Supprimer ce type de séances"></a>
     <form>
       <a class="icon-ok" title="Valider les modifications"></a>
       <h3 class="edition">${r['titre']}</h3>
-      <p>Ce type de séance correspond à ${r['nb']} élément$s du cahier de texte.</p>
+      <p>Ce type de séances correspond à ${r['nb']} élément$s du cahier de texte.</p>
       <p class="ligne"><label for="titre$id">Titre&nbsp;: </label><input type="input" id="titre$id" name="titre" value="${r['titre']}" size="50"></p>
       <p class="ligne"><label for="cle$id">Clé&nbsp;: </label><input type="input" id="cle$id" name="cle" value="${r['cle']}" size="50"></p>
       <p class="ligne"><label for="deb_fin_pour$id">Affichage d'horaires&nbsp;:</label>
@@ -110,7 +110,7 @@
 ?>
 
   <form id="form-ajoute">
-    <h3 class="edition">Ajouter une nouveau type de séances</h3>
+    <h3 class="edition">Ajouter un nouveau type de séances</h3>
     <div>
       <input type="input" class="ligne" name="titre" value="" size="50" data-placeholder="Titre pour l'affichage (Commence par majuscule, singulier)">
       <input type="input" class="ligne" name="cle" value="" size="50" data-placeholder="Clé pour les adresses web (Un seul mot, pluriel)">
diff -urN cahier-de-prepa5.1.0/CHANGELOG.php cahier-de-prepa6.0.0/CHANGELOG.php
--- cahier-de-prepa5.1.0/CHANGELOG.php	2015-10-27 14:49:55.059036415 +0100
+++ cahier-de-prepa6.0.0/CHANGELOG.php	2016-08-30 18:32:07.947297752 +0200
@@ -1,4 +1,4 @@
-Version actuelle : 5.1.0 (28/10/15)
+Version actuelle : 6.0.0 (30/08/16)
 ===================
 Changements :
 1.0   31/08/11 Première version
@@ -187,35 +187,54 @@
   * Retour des documentations des pages : utilisateurs, mail, docs, pages, notes
   * Nouvelles couleurs
   * Amélioration de la lisibilité des tableaux, choix des destinataires
+6.0.0 30/08/16 Nouvelles fonctionnalités :
+  * Agenda (merci O. Bouverot pour avoir insisté :-) )
+  * Récupération des noms et adresses des utilisateurs en fichier excel
+  * Flux RSS multiples et personnalisés
+  * Améliorations des enregistrements des informations récentes
+  * Améliorations et uniformisations d'affichage
 
 ===================
 
 Todo :
 
-[ 5.2 ] Février ou avril 2016
-  * Flux RSS séparés par matières ; flux RSS correspondant aux accès de chacun
-  * Récupération des documents en .zip
-  * Récupération des données de la base (via la sauvegarde)
-  * Validation/Suppression multiple d'utilisateurs
-  * Correction des mises à jour multiples vers les informations récentes
+[ 6.1 ] Novembre 2016
+  * FAQ
+  * Affichage des événements uniquement si la matière concerne le visiteur
+  * Protection individuelle des événements, possibilité de cacher/montrer
+  * Mails : ajouts de liens
+  * Validations/suppressions multiples d'utilisateurs
+  * Protection individuelle des informations
+  * Recherche dans les événements
+  * Agenda : vue sous forme de liste d'événements
+  * Raccourcis cdt : texte pré-défini
+  * Types cdt : suppression massive (idem pages)
 
-[ 6.0 ] Août 2016
-  * Agenda
-  * Suppression multiple de documents
-  * Gestion des informations récentes : suppression/modification
-  * Flux RSS multiples et paramétrables
+[ 6.2 ] Février 2017
+  * Récupération des documents/données
   * Paramétrage des styles pour les titres, des couleurs
+  * Assouplissement de la correction automatique des textarea
+  * Notes : gestions de modifications de personnes, matières
+
+Autres remarques / propositions :
+  * Préférences globales : création de compte, protection globale, 
+  * Suppressions (modifications ?) multiples de documents/informations
   * Tags dans les cahiers de texte
   * Modifier les matières des utilisateurs depuis utilisateurs.php
-  * Protection individuelle des informations (possibilité de régler pour chaque
-  information si les invités/élèves/colleurs peuvent la voir)
   * Programme de colles par quinzaine
   * Bug : suppression des notes lorsque suppression d'un compte élève/colleur
-
-Autres remarques :
-  * revenir à un choix de répertoire unique plutot que choix matière + choix
-  répertoire (ajout de document)
+  * Correction des mises à jour multiples vers les informations récentes
   * agrandir les icônes
-  * assouplir la correction automatique des textarea
-  * mail : liens notamment
   * ajouter la durée des séances dans le cahier de texte
+  * bug : interdire les "." dans les clés
+  * crayon matière dans menu -> modification de la matière
+  * meilleure compréhension des visibilités dans le menu
+  * notes : garder des notes malgré suppression de l'association colleur/matière ou élève/matière (changement de matière, Y PCSI)
+  * notes : savoir combien de notes sont attribuées à un compte avant suppression (gestion des doublons)
+  * mail : possibilité d'envoi par les élèves ; paramétrage côté prof/colleurs pour ne pas recevoir
+  * news : date de création, date de mise à jour ?
+  * modification de docs par les élèves
+  * modification d'items de l'agenda par les élèves
+  * ajout de la possibilité d'envoi de notification à chaque saisie de document/information/programme de colle
+  * prévention javascript de changement de page en cours d'édition
+
diff -urN cahier-de-prepa5.1.0/config.php cahier-de-prepa6.0.0/config.php
--- cahier-de-prepa5.1.0/config.php	2015-07-11 17:51:38.750593187 +0200
+++ cahier-de-prepa6.0.0/config.php	2015-09-20 22:00:18.811329075 +0200
@@ -1,21 +1,26 @@
 <?php
-// Fichier de configuration de Cahier de Prépa //
+// Fichier de configuration de Cahier de Prépa
 
 // Adresse web
 // Ne pas mettre le protocole ("http://" ou "https://") ni de "/" final
 $site = '';
 
-// Forçage du https pour toute authentification
+// Forçage du https
 $https = true;
 
 // Accès à la base de données MySQL
 /* $serveur est le nom du serveur. localhost est la valeur par défaut.
  * $base est le nom de la base de données utilisée. 12 caractères maximum.
  * $mdp est le mot de passe qui sera utilisé en interne uniquement, et demandé
-une fois unique par le script d'installation que vous devez à lancer pour
+une fois unique par le script d'installation que vous devez lancer pour
 terminer l'installation. */
 $serveur = 'localhost';
 $base = '';
 $mdp = '';
+
+// Mail administrateur
+// Adresse dont proviendront les mails envoyés par l'interface et où seront
+// redirigées l'ensemble des erreurs
+$mailadmin = 'admin@cahier-de-prepa.fr';
 
 ?>
diff -urN cahier-de-prepa5.1.0/connexion.php cahier-de-prepa6.0.0/connexion.php
--- cahier-de-prepa5.1.0/connexion.php	2015-10-22 01:00:05.301956983 +0200
+++ cahier-de-prepa6.0.0/connexion.php	2016-07-21 23:13:31.397494588 +0200
@@ -285,7 +285,7 @@
   // Envoi
   $('a.icon-ok').on("click",function () {
     $.ajax({url: 'connexion.php', method: "post", data: 'oublimdp=&'+$('form').serialize(), dataType: 'json'})
-    .success( function(data) {
+    .done( function(data) {
       if ( data['etat'] == 'ok_' ) {
         $('p').html(data['message']).removeClass('warning');
         $('a.icon-ok, input').remove();
@@ -371,7 +371,7 @@
   // Envoi
   $('a.icon-ok').on("click",function () {
     $.ajax({url: 'connexion.php', method: "post", data: 'creationcompte=&'+$('form').serialize(), dataType: 'json'})
-    .success( function(data) {
+    .done( function(data) {
       if ( data['etat'] == 'ok_' )  {
         $('p:first').html(data['message']).removeClass('warning');
         $('a.icon-ok, p+p, .ligne').remove();
@@ -428,7 +428,7 @@
   // Envoi
   $('a.icon-ok').on("click",function () {
     $.ajax({url: 'connexion.php', method: "post", data: 'reponseinvitation=&'+$('form').serialize(), dataType: 'json'})
-    .success( function(data) {
+    .done( function(data) {
       if ( data['etat'] == 'ok_' )  {
         $('form').html('<p>'+data['message']+'</p>');
       }
diff -urN cahier-de-prepa5.1.0/css/colpick.css cahier-de-prepa6.0.0/css/colpick.css
--- cahier-de-prepa5.1.0/css/colpick.css	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/css/colpick.css	2016-08-24 00:59:36.277450577 +0200
@@ -0,0 +1,422 @@
+/*
+colpick Color Picker / colpick.com
+*/
+
+/*Main container*/
+.colpick {
+  z-index: 10;
+	position: absolute;
+	width: 346px;
+	height: 170px;
+	overflow: hidden;
+	display: none;
+	font-family: Arial, Helvetica, sans-serif;
+	background:#ebebeb;
+	border: 1px solid #bbb;
+	-webkit-border-radius: 5px;
+	-moz-border-radius: 5px;
+	border-radius: 5px;
+	
+	/*Prevents selecting text when dragging the selectors*/
+	-webkit-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	-o-user-select: none;
+	user-select: none;
+}
+/*Color selection box with gradients*/
+.colpick_color {
+	position: absolute;
+	left: 7px;
+	top: 7px;
+	width: 156px;
+	height: 156px;
+	overflow: hidden;
+	outline: 1px solid #aaa;
+	cursor: crosshair;
+}
+.colpick_color_overlay1 {
+	position: absolute;
+	left:0;
+	top:0;
+	width: 156px;
+	height: 156px;
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')"; /* IE8 */
+	background: -moz-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
+	background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
+	background: -ms-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
+	background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
+	filter:  progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff'); /* IE6 & IE7 */
+}
+.colpick_color_overlay2 {
+	position: absolute;
+	left:0;
+	top:0;
+	width: 156px;
+	height: 156px;
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')"; /* IE8 */
+	background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
+	background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
+	background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
+}
+/*Circular color selector*/
+.colpick_selector_outer {
+	background:none;
+	position: absolute;
+	width: 11px;
+	height: 11px;
+	margin: -6px 0 0 -6px;
+	border: 1px solid black;
+	border-radius: 50%;
+}
+.colpick_selector_inner{
+	position: absolute;
+	width: 9px;
+	height: 9px;
+	border: 1px solid white;
+	border-radius: 50%;
+}
+/*Vertical hue bar*/
+.colpick_hue {
+	position: absolute;
+	top: 6px;
+	left: 175px;
+	width: 19px;
+	height: 156px;
+	border: 1px solid #aaa;
+	cursor: n-resize;
+}
+/*Hue bar sliding indicator*/
+.colpick_hue_arrs {
+	position: absolute;
+	left: -8px;
+	width: 35px;
+	height: 7px;
+	margin: -7px 0 0 0;
+}
+.colpick_hue_larr {
+	position:absolute;
+	width: 0; 
+	height: 0; 
+	border-top: 6px solid transparent;
+	border-bottom: 6px solid transparent;
+	border-left: 7px solid #858585;
+}
+.colpick_hue_rarr {
+	position:absolute;
+	right:0;
+	width: 0; 
+	height: 0; 
+	border-top: 6px solid transparent;
+	border-bottom: 6px solid transparent; 
+	border-right: 7px solid #858585; 
+}
+/*New color box*/
+.colpick_new_color {
+	position: absolute;
+	left: 207px;
+	top: 6px;
+	width: 60px;
+	height: 27px;
+	background: #f00;
+	border: 1px solid #8f8f8f;
+}
+/*Current color box*/
+.colpick_current_color {
+	position: absolute;
+	left: 277px;
+	top: 6px;
+	width: 60px;
+	height: 27px;
+	background: #f00;
+	border: 1px solid #8f8f8f;
+}
+/*Input field containers*/
+.colpick_field, .colpick_hex_field  {
+	position: absolute;
+	height: 20px;
+	width: 60px;
+	overflow:hidden;
+	background:#f3f3f3;
+	color:#b8b8b8;
+	font-size:12px;
+	border:1px solid #bdbdbd;
+	-webkit-border-radius: 3px;
+	-moz-border-radius: 3px;
+	border-radius: 3px;
+}
+.colpick_rgb_r {
+	top: 40px;
+	left: 207px;
+}
+.colpick_rgb_g {
+	top: 67px;
+	left: 207px;
+}
+.colpick_rgb_b {
+	top: 94px;
+	left: 207px;
+}
+.colpick_hsb_h {
+	top: 40px;
+	left: 277px;
+}
+.colpick_hsb_s {
+	top: 67px;
+	left: 277px;
+}
+.colpick_hsb_b {
+	top: 94px;
+	left: 277px;
+}
+.colpick_hex_field {
+	width: 68px;
+	left: 207px;
+	top: 121px;
+}
+/*Text field container on focus*/
+.colpick_focus {
+	border-color: #999;
+}
+/*Field label container*/
+.colpick_field_letter {
+	position: absolute;
+	width: 12px;
+	height: 20px;
+	line-height: 20px;
+	padding-left: 4px;
+	background: #efefef;
+	border-right: 1px solid #bdbdbd;
+	font-weight: bold;
+	color:#777;
+}
+/*Text inputs*/
+.colpick_field input, .colpick_hex_field input {
+	position: absolute;
+	right: 11px;
+	margin: 0;
+	padding: 0;
+	height: 20px;
+	line-height: 20px;
+	background: transparent;
+	border: none;
+	font-size: 12px;
+	font-family: Arial, Helvetica, sans-serif;
+	color: #555;
+	text-align: right;
+	outline: none;
+}
+.colpick_hex_field input {
+	right: 4px;
+}
+/*Field up/down arrows*/
+.colpick_field_arrs {
+	position: absolute;
+	top: 0;
+	right: 0;
+	width: 9px;
+	height: 21px;
+	cursor: n-resize;
+}
+.colpick_field_uarr {
+	position: absolute;
+	top: 5px;
+	width: 0; 
+	height: 0; 
+	border-left: 4px solid transparent;
+	border-right: 4px solid transparent;
+	border-bottom: 4px solid #959595;
+}
+.colpick_field_darr {
+	position: absolute;
+	bottom:5px;
+	width: 0; 
+	height: 0; 
+	border-left: 4px solid transparent;
+	border-right: 4px solid transparent;
+	border-top: 4px solid #959595;
+}
+/*Submit/Select button
+.colpick_submit {
+	position: absolute;
+	left: 207px;
+	top: 149px;
+	width: 130px;
+	height: 22px;
+	line-height:22px;
+	background: #efefef;
+	text-align: center;
+	color: #555;
+	font-size: 12px;
+	font-weight:bold;
+	border: 1px solid #bdbdbd;
+	-webkit-border-radius: 3px;
+	-moz-border-radius: 3px;
+	border-radius: 3px;
+}
+.colpick_submit:hover {
+	background:#f3f3f3;
+	border-color:#999;
+	cursor: pointer;
+}
+
+/*full layout with no submit button
+.colpick_full_ns  .colpick_submit, .colpick_full_ns .colpick_current_color{
+	display:none;
+}
+.colpick_full_ns .colpick_new_color {
+	width: 130px;
+	height: 25px;
+}
+.colpick_full_ns .colpick_rgb_r, .colpick_full_ns .colpick_hsb_h {
+	top: 42px;
+}
+.colpick_full_ns .colpick_rgb_g, .colpick_full_ns .colpick_hsb_s {
+	top: 73px;
+}
+.colpick_full_ns .colpick_rgb_b, .colpick_full_ns .colpick_hsb_b {
+	top: 104px;
+}
+.colpick_full_ns .colpick_hex_field {
+	top: 135px;
+}
+
+/*rgbhex layout*/
+.colpick_rgbhex .colpick_hsb_h, .colpick_rgbhex .colpick_hsb_s, .colpick_rgbhex .colpick_hsb_b {
+	display:none;
+}
+.colpick_rgbhex {
+	width:282px;
+}
+.colpick_rgbhex .colpick_field, .colpick_rgbhex .colpick_submit {
+	width:68px;
+}
+.colpick_rgbhex .colpick_new_color {
+	width:34px;
+	border-right:none;
+}
+.colpick_rgbhex .colpick_current_color {
+	width:34px;
+	left:240px;
+	border-left:none;
+}
+
+/*rgbhex layout, no submit button*/
+.colpick_rgbhex_ns  .colpick_submit, .colpick_rgbhex_ns .colpick_current_color{
+	display:none;
+}
+.colpick_rgbhex_ns .colpick_new_color{
+	width:68px;
+	border: 1px solid #8f8f8f;
+}
+.colpick_rgbhex_ns .colpick_rgb_r {
+	top: 42px;
+}
+.colpick_rgbhex_ns .colpick_rgb_g {
+	top: 73px;
+}
+.colpick_rgbhex_ns .colpick_rgb_b {
+	top: 104px;
+}
+.colpick_rgbhex_ns .colpick_hex_field {
+	top: 135px;
+}
+
+/*hex layout
+.colpick_hex .colpick_hsb_h, .colpick_hex .colpick_hsb_s, .colpick_hex .colpick_hsb_b, .colpick_hex .colpick_rgb_r, .colpick_hex .colpick_rgb_g, .colpick_hex .colpick_rgb_b {
+	display:none;
+}
+.colpick_hex {
+	width:206px;
+	height:201px;
+}
+.colpick_hex .colpick_hex_field {
+	width:72px;
+	height:25px;
+	top:168px;
+	left:80px;
+}
+.colpick_hex .colpick_hex_field div, .colpick_hex .colpick_hex_field input {
+	height: 25px;
+	line-height: 25px;
+}
+.colpick_hex .colpick_new_color {
+	left:9px;
+	top:168px;
+	width:30px;
+	border-right:none;
+}
+.colpick_hex .colpick_current_color {
+	left:39px;
+	top:168px;
+	width:30px;
+	border-left:none;
+}
+.colpick_hex .colpick_submit {
+	left:164px;
+	top: 168px;
+	width:30px;
+	height:25px;
+	line-height: 25px;
+}
+
+/*hex layout, no submit button
+.colpick_hex_ns  .colpick_submit, .colpick_hex_ns .colpick_current_color {
+	display:none;
+}
+.colpick_hex_ns .colpick_hex_field {
+	width:80px;
+}
+.colpick_hex_ns .colpick_new_color{
+	width:60px;
+	border: 1px solid #8f8f8f;
+}
+
+/*Dark color scheme
+.colpick_dark {
+	background: #161616;
+	border-color: #2a2a2a;
+}
+.colpick_dark .colpick_color {
+	outline-color: #333;
+}
+.colpick_dark .colpick_hue {
+	border-color: #555;
+}
+.colpick_dark .colpick_field, .colpick_dark .colpick_hex_field {
+	background: #101010;
+	border-color: #2d2d2d;
+}
+.colpick_dark .colpick_field_letter {
+	background: #131313;
+	border-color: #2d2d2d;
+	color: #696969;
+}
+.colpick_dark .colpick_field input, .colpick_dark .colpick_hex_field input {
+	color: #7a7a7a;
+}
+.colpick_dark .colpick_field_uarr {
+	border-bottom-color:#696969;
+}
+.colpick_dark .colpick_field_darr {
+	border-top-color:#696969;
+}
+.colpick_dark .colpick_focus {
+	border-color:#444;
+}
+.colpick_dark .colpick_submit {
+	background: #131313;
+	border-color:#2d2d2d;
+	color:#7a7a7a;
+}
+.colpick_dark .colpick_submit:hover {
+	background-color:#101010;
+	border-color:#444;
+}
+*/
diff -urN cahier-de-prepa5.1.0/css/colpick.min.css cahier-de-prepa6.0.0/css/colpick.min.css
--- cahier-de-prepa5.1.0/css/colpick.min.css	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/css/colpick.min.css	2016-08-24 00:59:46.145551413 +0200
@@ -0,0 +1 @@
+.colpick{z-index:10;position:absolute;width:346px;height:170px;overflow:hidden;display:none;font-family:Arial,Helvetica,sans-serif;background:#ebebeb;border:1px solid #bbb;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.colpick_color{position:absolute;left:7px;top:7px;width:156px;height:156px;overflow:hidden;outline:1px solid #aaa;cursor:crosshair}.colpick_color_overlay1{position:absolute;left:0;top:0;width:156px;height:156px;-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0%,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff',endColorstr='#00ffffff')}.colpick_color_overlay2{position:absolute;left:0;top:0;width:156px;height:156px;-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:-moz-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(0,0,0,0)),color-stop(100%,rgba(0,0,0,1)));background:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,1) 100%);background:-o-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,1) 100%);background:-ms-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,1) 100%);background:linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#000000',GradientType=0)}.colpick_selector_outer{background:0;position:absolute;width:11px;height:11px;margin:-6px 0 0 -6px;border:1px solid black;border-radius:50%}.colpick_selector_inner{position:absolute;width:9px;height:9px;border:1px solid white;border-radius:50%}.colpick_hue{position:absolute;top:6px;left:175px;width:19px;height:156px;border:1px solid #aaa;cursor:n-resize}.colpick_hue_arrs{position:absolute;left:-8px;width:35px;height:7px;margin:-7px 0 0 0}.colpick_hue_larr{position:absolute;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:7px solid #858585}.colpick_hue_rarr{position:absolute;right:0;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:7px solid #858585}.colpick_new_color{position:absolute;left:207px;top:6px;width:60px;height:27px;background:#f00;border:1px solid #8f8f8f}.colpick_current_color{position:absolute;left:277px;top:6px;width:60px;height:27px;background:#f00;border:1px solid #8f8f8f}.colpick_field,.colpick_hex_field{position:absolute;height:20px;width:60px;overflow:hidden;background:#f3f3f3;color:#b8b8b8;font-size:12px;border:1px solid #bdbdbd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.colpick_rgb_r{top:40px;left:207px}.colpick_rgb_g{top:67px;left:207px}.colpick_rgb_b{top:94px;left:207px}.colpick_hsb_h{top:40px;left:277px}.colpick_hsb_s{top:67px;left:277px}.colpick_hsb_b{top:94px;left:277px}.colpick_hex_field{width:68px;left:207px;top:121px}.colpick_focus{border-color:#999}.colpick_field_letter{position:absolute;width:12px;height:20px;line-height:20px;padding-left:4px;background:#efefef;border-right:1px solid #bdbdbd;font-weight:bold;color:#777}.colpick_field input,.colpick_hex_field input{position:absolute;right:11px;margin:0;padding:0;height:20px;line-height:20px;background:transparent;border:0;font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#555;text-align:right;outline:0}.colpick_hex_field input{right:4px}.colpick_field_arrs{position:absolute;top:0;right:0;width:9px;height:21px;cursor:n-resize}.colpick_field_uarr{position:absolute;top:5px;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid #959595}.colpick_field_darr{position:absolute;bottom:5px;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #959595}.colpick_rgbhex .colpick_hsb_h,.colpick_rgbhex .colpick_hsb_s,.colpick_rgbhex .colpick_hsb_b{display:none}.colpick_rgbhex{width:282px}.colpick_rgbhex .colpick_field,.colpick_rgbhex .colpick_submit{width:68px}.colpick_rgbhex .colpick_new_color{width:34px;border-right:0}.colpick_rgbhex .colpick_current_color{width:34px;left:240px;border-left:none}.colpick_rgbhex_ns .colpick_submit,.colpick_rgbhex_ns .colpick_current_color{display:none}.colpick_rgbhex_ns .colpick_new_color{width:68px;border:1px solid #8f8f8f}.colpick_rgbhex_ns .colpick_rgb_r{top:42px}.colpick_rgbhex_ns .colpick_rgb_g{top:73px}.colpick_rgbhex_ns .colpick_rgb_b{top:104px}.colpick_rgbhex_ns .colpick_hex_field{top:135px}
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/css/colpick.orig.css cahier-de-prepa6.0.0/css/colpick.orig.css
--- cahier-de-prepa5.1.0/css/colpick.orig.css	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/css/colpick.orig.css	2016-08-24 00:34:45.674380467 +0200
@@ -0,0 +1,420 @@
+/*
+colpick Color Picker / colpick.com
+*/
+
+/*Main container*/
+.colpick {
+	position: absolute;
+	width: 346px;
+	height: 170px;
+	overflow: hidden;
+	display: none;
+	font-family: Arial, Helvetica, sans-serif;
+	background:#ebebeb;
+	border: 1px solid #bbb;
+	-webkit-border-radius: 5px;
+	-moz-border-radius: 5px;
+	border-radius: 5px;
+	
+	/*Prevents selecting text when dragging the selectors*/
+	-webkit-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	-o-user-select: none;
+	user-select: none;
+}
+/*Color selection box with gradients*/
+.colpick_color {
+	position: absolute;
+	left: 7px;
+	top: 7px;
+	width: 156px;
+	height: 156px;
+	overflow: hidden;
+	outline: 1px solid #aaa;
+	cursor: crosshair;
+}
+.colpick_color_overlay1 {
+	position: absolute;
+	left:0;
+	top:0;
+	width: 156px;
+	height: 156px;
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')"; /* IE8 */
+	background: -moz-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
+	background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
+	background: -ms-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
+	background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
+	filter:  progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff'); /* IE6 & IE7 */
+}
+.colpick_color_overlay2 {
+	position: absolute;
+	left:0;
+	top:0;
+	width: 156px;
+	height: 156px;
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')"; /* IE8 */
+	background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
+	background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
+	background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
+}
+/*Circular color selector*/
+.colpick_selector_outer {
+	background:none;
+	position: absolute;
+	width: 11px;
+	height: 11px;
+	margin: -6px 0 0 -6px;
+	border: 1px solid black;
+	border-radius: 50%;
+}
+.colpick_selector_inner{
+	position: absolute;
+	width: 9px;
+	height: 9px;
+	border: 1px solid white;
+	border-radius: 50%;
+}
+/*Vertical hue bar*/
+.colpick_hue {
+	position: absolute;
+	top: 6px;
+	left: 175px;
+	width: 19px;
+	height: 156px;
+	border: 1px solid #aaa;
+	cursor: n-resize;
+}
+/*Hue bar sliding indicator*/
+.colpick_hue_arrs {
+	position: absolute;
+	left: -8px;
+	width: 35px;
+	height: 7px;
+	margin: -7px 0 0 0;
+}
+.colpick_hue_larr {
+	position:absolute;
+	width: 0; 
+	height: 0; 
+	border-top: 6px solid transparent;
+	border-bottom: 6px solid transparent;
+	border-left: 7px solid #858585;
+}
+.colpick_hue_rarr {
+	position:absolute;
+	right:0;
+	width: 0; 
+	height: 0; 
+	border-top: 6px solid transparent;
+	border-bottom: 6px solid transparent; 
+	border-right: 7px solid #858585; 
+}
+/*New color box*/
+.colpick_new_color {
+	position: absolute;
+	left: 207px;
+	top: 6px;
+	width: 60px;
+	height: 27px;
+	background: #f00;
+	border: 1px solid #8f8f8f;
+}
+/*Current color box*/
+.colpick_current_color {
+	position: absolute;
+	left: 277px;
+	top: 6px;
+	width: 60px;
+	height: 27px;
+	background: #f00;
+	border: 1px solid #8f8f8f;
+}
+/*Input field containers*/
+.colpick_field, .colpick_hex_field  {
+	position: absolute;
+	height: 20px;
+	width: 60px;
+	overflow:hidden;
+	background:#f3f3f3;
+	color:#b8b8b8;
+	font-size:12px;
+	border:1px solid #bdbdbd;
+	-webkit-border-radius: 3px;
+	-moz-border-radius: 3px;
+	border-radius: 3px;
+}
+.colpick_rgb_r {
+	top: 40px;
+	left: 207px;
+}
+.colpick_rgb_g {
+	top: 67px;
+	left: 207px;
+}
+.colpick_rgb_b {
+	top: 94px;
+	left: 207px;
+}
+.colpick_hsb_h {
+	top: 40px;
+	left: 277px;
+}
+.colpick_hsb_s {
+	top: 67px;
+	left: 277px;
+}
+.colpick_hsb_b {
+	top: 94px;
+	left: 277px;
+}
+.colpick_hex_field {
+	width: 68px;
+	left: 207px;
+	top: 121px;
+}
+/*Text field container on focus*/
+.colpick_focus {
+	border-color: #999;
+}
+/*Field label container*/
+.colpick_field_letter {
+	position: absolute;
+	width: 12px;
+	height: 20px;
+	line-height: 20px;
+	padding-left: 4px;
+	background: #efefef;
+	border-right: 1px solid #bdbdbd;
+	font-weight: bold;
+	color:#777;
+}
+/*Text inputs*/
+.colpick_field input, .colpick_hex_field input {
+	position: absolute;
+	right: 11px;
+	margin: 0;
+	padding: 0;
+	height: 20px;
+	line-height: 20px;
+	background: transparent;
+	border: none;
+	font-size: 12px;
+	font-family: Arial, Helvetica, sans-serif;
+	color: #555;
+	text-align: right;
+	outline: none;
+}
+.colpick_hex_field input {
+	right: 4px;
+}
+/*Field up/down arrows*/
+.colpick_field_arrs {
+	position: absolute;
+	top: 0;
+	right: 0;
+	width: 9px;
+	height: 21px;
+	cursor: n-resize;
+}
+.colpick_field_uarr {
+	position: absolute;
+	top: 5px;
+	width: 0; 
+	height: 0; 
+	border-left: 4px solid transparent;
+	border-right: 4px solid transparent;
+	border-bottom: 4px solid #959595;
+}
+.colpick_field_darr {
+	position: absolute;
+	bottom:5px;
+	width: 0; 
+	height: 0; 
+	border-left: 4px solid transparent;
+	border-right: 4px solid transparent;
+	border-top: 4px solid #959595;
+}
+/*Submit/Select button*/
+.colpick_submit {
+	position: absolute;
+	left: 207px;
+	top: 149px;
+	width: 130px;
+	height: 22px;
+	line-height:22px;
+	background: #efefef;
+	text-align: center;
+	color: #555;
+	font-size: 12px;
+	font-weight:bold;
+	border: 1px solid #bdbdbd;
+	-webkit-border-radius: 3px;
+	-moz-border-radius: 3px;
+	border-radius: 3px;
+}
+.colpick_submit:hover {
+	background:#f3f3f3;
+	border-color:#999;
+	cursor: pointer;
+}
+
+/*full layout with no submit button*/
+.colpick_full_ns  .colpick_submit, .colpick_full_ns .colpick_current_color{
+	display:none;
+}
+.colpick_full_ns .colpick_new_color {
+	width: 130px;
+	height: 25px;
+}
+.colpick_full_ns .colpick_rgb_r, .colpick_full_ns .colpick_hsb_h {
+	top: 42px;
+}
+.colpick_full_ns .colpick_rgb_g, .colpick_full_ns .colpick_hsb_s {
+	top: 73px;
+}
+.colpick_full_ns .colpick_rgb_b, .colpick_full_ns .colpick_hsb_b {
+	top: 104px;
+}
+.colpick_full_ns .colpick_hex_field {
+	top: 135px;
+}
+
+/*rgbhex layout*/
+.colpick_rgbhex .colpick_hsb_h, .colpick_rgbhex .colpick_hsb_s, .colpick_rgbhex .colpick_hsb_b {
+	display:none;
+}
+.colpick_rgbhex {
+	width:282px;
+}
+.colpick_rgbhex .colpick_field, .colpick_rgbhex .colpick_submit {
+	width:68px;
+}
+.colpick_rgbhex .colpick_new_color {
+	width:34px;
+	border-right:none;
+}
+.colpick_rgbhex .colpick_current_color {
+	width:34px;
+	left:240px;
+	border-left:none;
+}
+
+/*rgbhex layout, no submit button*/
+.colpick_rgbhex_ns  .colpick_submit, .colpick_rgbhex_ns .colpick_current_color{
+	display:none;
+}
+.colpick_rgbhex_ns .colpick_new_color{
+	width:68px;
+	border: 1px solid #8f8f8f;
+}
+.colpick_rgbhex_ns .colpick_rgb_r {
+	top: 42px;
+}
+.colpick_rgbhex_ns .colpick_rgb_g {
+	top: 73px;
+}
+.colpick_rgbhex_ns .colpick_rgb_b {
+	top: 104px;
+}
+.colpick_rgbhex_ns .colpick_hex_field {
+	top: 135px;
+}
+
+/*hex layout*/
+.colpick_hex .colpick_hsb_h, .colpick_hex .colpick_hsb_s, .colpick_hex .colpick_hsb_b, .colpick_hex .colpick_rgb_r, .colpick_hex .colpick_rgb_g, .colpick_hex .colpick_rgb_b {
+	display:none;
+}
+.colpick_hex {
+	width:206px;
+	height:201px;
+}
+.colpick_hex .colpick_hex_field {
+	width:72px;
+	height:25px;
+	top:168px;
+	left:80px;
+}
+.colpick_hex .colpick_hex_field div, .colpick_hex .colpick_hex_field input {
+	height: 25px;
+	line-height: 25px;
+}
+.colpick_hex .colpick_new_color {
+	left:9px;
+	top:168px;
+	width:30px;
+	border-right:none;
+}
+.colpick_hex .colpick_current_color {
+	left:39px;
+	top:168px;
+	width:30px;
+	border-left:none;
+}
+.colpick_hex .colpick_submit {
+	left:164px;
+	top: 168px;
+	width:30px;
+	height:25px;
+	line-height: 25px;
+}
+
+/*hex layout, no submit button*/
+.colpick_hex_ns  .colpick_submit, .colpick_hex_ns .colpick_current_color {
+	display:none;
+}
+.colpick_hex_ns .colpick_hex_field {
+	width:80px;
+}
+.colpick_hex_ns .colpick_new_color{
+	width:60px;
+	border: 1px solid #8f8f8f;
+}
+
+/*Dark color scheme*/
+.colpick_dark {
+	background: #161616;
+	border-color: #2a2a2a;
+}
+.colpick_dark .colpick_color {
+	outline-color: #333;
+}
+.colpick_dark .colpick_hue {
+	border-color: #555;
+}
+.colpick_dark .colpick_field, .colpick_dark .colpick_hex_field {
+	background: #101010;
+	border-color: #2d2d2d;
+}
+.colpick_dark .colpick_field_letter {
+	background: #131313;
+	border-color: #2d2d2d;
+	color: #696969;
+}
+.colpick_dark .colpick_field input, .colpick_dark .colpick_hex_field input {
+	color: #7a7a7a;
+}
+.colpick_dark .colpick_field_uarr {
+	border-bottom-color:#696969;
+}
+.colpick_dark .colpick_field_darr {
+	border-top-color:#696969;
+}
+.colpick_dark .colpick_focus {
+	border-color:#444;
+}
+.colpick_dark .colpick_submit {
+	background: #131313;
+	border-color:#2d2d2d;
+	color:#7a7a7a;
+}
+.colpick_dark .colpick_submit:hover {
+	background-color:#101010;
+	border-color:#444;
+}
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/css/datetimepicker.css cahier-de-prepa6.0.0/css/datetimepicker.css
--- cahier-de-prepa5.1.0/css/datetimepicker.css	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/css/datetimepicker.css	2016-08-23 22:50:52.533053132 +0200
@@ -0,0 +1,388 @@
+.xdsoft_datetimepicker {
+	box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506);
+	background: #fff;
+	border-bottom: 1px solid #bbb;
+	border-left: 1px solid #ccc;
+	border-right: 1px solid #ccc;
+	border-top: 1px solid #ccc;
+	color: #333;
+	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+	padding: 8px;
+	padding-left: 0;
+	padding-top: 2px;
+	position: absolute;
+	z-index: 9999;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	display: none;
+}
+
+.xdsoft_datetimepicker iframe {
+	position: absolute;
+	left: 0;
+	top: 0;
+	width: 75px;
+	height: 210px;
+	background: transparent;
+	border: none;
+}
+
+/*For IE8 or lower*/
+.xdsoft_datetimepicker button {
+	border: none !important;
+}
+
+.xdsoft_noselect {
+	-webkit-touch-callout: none;
+	-webkit-user-select: none;
+	-khtml-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	-o-user-select: none;
+	user-select: none;
+}
+
+.xdsoft_noselect::selection { background: transparent }
+.xdsoft_noselect::-moz-selection { background: transparent }
+
+.xdsoft_datetimepicker.xdsoft_inline {
+	display: inline-block;
+	position: static;
+	box-shadow: none;
+}
+
+.xdsoft_datetimepicker * {
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	padding: 0;
+	margin: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker {
+	display: none;
+}
+
+.xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active {
+	display: block;
+}
+
+.xdsoft_datetimepicker .xdsoft_datepicker {
+	width: 224px;
+	float: left;
+	margin-left: 8px;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker {
+	width: 58px;
+	float: left;
+	text-align: center;
+	margin-left: 8px;
+	margin-top: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker {
+	margin-top: 8px;
+	margin-bottom: 3px
+}
+
+.xdsoft_datetimepicker .xdsoft_monthpicker {
+	position: relative;
+	text-align: center;
+}
+
+.xdsoft_datetimepicker .xdsoft_label i,
+.xdsoft_datetimepicker .xdsoft_prev,
+.xdsoft_datetimepicker .xdsoft_next,
+.xdsoft_datetimepicker .xdsoft_today_button {
+	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC);
+}
+
+.xdsoft_datetimepicker .xdsoft_label i {
+	opacity: 0.5;
+	background-position: -92px -19px;
+	display: inline-block;
+	width: 9px;
+	height: 20px;
+	vertical-align: middle;
+}
+
+.xdsoft_datetimepicker .xdsoft_prev {
+	float: left;
+	background-position: -20px 0;
+}
+.xdsoft_datetimepicker .xdsoft_today_button {
+	float: left;
+	background-position: -70px 0;
+	margin-left: 5px;
+}
+
+.xdsoft_datetimepicker .xdsoft_next {
+	float: right;
+	background-position: 0 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_next,
+.xdsoft_datetimepicker .xdsoft_prev ,
+.xdsoft_datetimepicker .xdsoft_today_button {
+	background-color: transparent;
+	background-repeat: no-repeat;
+	border: 0 none;
+	cursor: pointer;
+	display: block;
+	height: 30px;
+	opacity: 0.5;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+	outline: medium none;
+	overflow: hidden;
+	padding: 0;
+	position: relative;
+	text-indent: 100%;
+	white-space: nowrap;
+	width: 20px;
+	min-width: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next {
+	float: none;
+	background-position: -40px -15px;
+	height: 15px;
+	width: 30px;
+	display: block;
+	margin-left: 14px;
+	margin-top: 7px;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev {
+	background-position: -40px 0;
+	margin-bottom: 7px;
+	margin-top: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box {
+	height: 151px;
+	overflow: hidden;
+	border-bottom: 1px solid #ddd;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div {
+	background: #f5f5f5;
+	border-top: 1px solid #ddd;
+	color: #666;
+	font-size: 12px;
+	text-align: center;
+	border-collapse: collapse;
+	cursor: pointer;
+	border-bottom-width: 0;
+	height: 25px;
+	line-height: 25px;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child {
+	border-top-width: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_today_button:hover,
+.xdsoft_datetimepicker .xdsoft_next:hover,
+.xdsoft_datetimepicker .xdsoft_prev:hover {
+	opacity: 1;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+}
+
+.xdsoft_datetimepicker .xdsoft_label {
+	display: inline;
+	position: relative;
+	z-index: 9999;
+	margin: 0;
+	padding: 5px 3px;
+	font-size: 14px;
+	line-height: 20px;
+	font-weight: bold;
+	background-color: #fff;
+	float: left;
+	width: 182px;
+	text-align: center;
+	cursor: pointer;
+}
+
+.xdsoft_datetimepicker .xdsoft_label:hover>span {
+	text-decoration: underline;
+}
+
+.xdsoft_datetimepicker .xdsoft_label:hover i {
+	opacity: 1.0;
+}
+
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select {
+	border: 1px solid #ccc;
+	position: absolute;
+	right: 0;
+	top: 30px;
+	z-index: 101;
+	display: none;
+	background: #fff;
+	max-height: 160px;
+	overflow-y: hidden;
+}
+
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{ right: -7px }
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{ right: 2px }
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
+	color: #fff;
+	background: #ff8000;
+}
+
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option {
+	padding: 2px 10px 2px 5px;
+	text-decoration: none !important;
+}
+
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
+	background: #33aaff;
+	box-shadow: #178fe5 0 1px 3px 0 inset;
+	color: #fff;
+	font-weight: 700;
+}
+
+.xdsoft_datetimepicker .xdsoft_month {
+	width: 100px;
+	text-align: right;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar {
+	clear: both;
+}
+
+.xdsoft_datetimepicker .xdsoft_year{
+	width: 48px;
+	margin-left: 5px;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar table {
+	border-collapse: collapse;
+	width: 100%;
+
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td > div {
+	padding-right: 5px;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar th {
+	height: 25px;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th {
+	width: 14.2857142%;
+	background: #f5f5f5;
+	border: 1px solid #ddd;
+	color: #666;
+	font-size: 12px;
+	text-align: right;
+	vertical-align: middle;
+	padding: 0;
+	border-collapse: collapse;
+	cursor: pointer;
+	height: 25px;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar th {
+	background: #f1f1f1;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today {
+	color: #33aaff;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default {
+	background: #ffe9d2;
+	box-shadow: #ffb871 0 1px 4px 0 inset;
+	color: #000;
+}
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint {
+	background: #c1ffc9;
+	box-shadow: #00dd1c 0 1px 4px 0 inset;
+	color: #000;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
+	background: #33aaff;
+	box-shadow: #178fe5 0 1px 3px 0 inset;
+	color: #fff;
+	font-weight: 700;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,
+.xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled {
+	opacity: 0.5;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+	cursor: default;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled {
+	opacity: 0.2;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td:hover,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
+	color: #fff !important;
+	background: #ff8000 !important;
+	box-shadow: none !important;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover {
+	background: #33aaff !important;
+	box-shadow: #178fe5 0 1px 3px 0 inset !important;
+	color: #fff !important;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover {
+	color: inherit	!important;
+	background: inherit !important;
+	box-shadow: inherit !important;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar th {
+	font-weight: 700;
+	text-align: center;
+	color: #999;
+	cursor: default;
+}
+
+.xdsoft_datetimepicker .xdsoft_copyright {
+	color: #ccc !important;
+	font-size: 10px;
+	clear: both;
+	float: none;
+	margin-left: 8px;
+}
+
+.xdsoft_datetimepicker .xdsoft_copyright a { color: #eee !important }
+.xdsoft_datetimepicker .xdsoft_copyright a:hover { color: #aaa !important }
+
+.xdsoft_time_box {
+	position: relative;
+	border: 1px solid #ccc;
+}
+.xdsoft_scrollbar >.xdsoft_scroller {
+	background: #ccc !important;
+	height: 20px;
+	border-radius: 3px;
+}
+.xdsoft_scrollbar {
+	position: absolute;
+	width: 7px;
+	right: 0;
+	top: 0;
+	bottom: 0;
+	cursor: pointer;
+}
+.xdsoft_scroller_box {
+	position: relative;
+}
diff -urN cahier-de-prepa5.1.0/css/datetimepicker.min.css cahier-de-prepa6.0.0/css/datetimepicker.min.css
--- cahier-de-prepa5.1.0/css/datetimepicker.min.css	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/css/datetimepicker.min.css	2016-08-23 22:51:31.977434963 +0200
@@ -0,0 +1 @@
+.xdsoft_datetimepicker{box-shadow:0 5px 15px -5px rgba(0,0,0,0.506);background:#fff;border-bottom:1px solid #bbb;border-left:1px solid #ccc;border-right:1px solid #ccc;border-top:1px solid #ccc;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;padding:8px;padding-left:0;padding-top:2px;position:absolute;z-index:9999;-moz-box-sizing:border-box;box-sizing:border-box;display:none}.xdsoft_datetimepicker iframe{position:absolute;left:0;top:0;width:75px;height:210px;background:transparent;border:0}.xdsoft_datetimepicker button{border:none!important}.xdsoft_noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.xdsoft_noselect::selection{background:transparent}.xdsoft_noselect::-moz-selection{background:transparent}.xdsoft_datetimepicker.xdsoft_inline{display:inline-block;position:static;box-shadow:none}.xdsoft_datetimepicker *{-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin:0}.xdsoft_datetimepicker .xdsoft_datepicker,.xdsoft_datetimepicker .xdsoft_timepicker{display:none}.xdsoft_datetimepicker .xdsoft_datepicker.active,.xdsoft_datetimepicker .xdsoft_timepicker.active{display:block}.xdsoft_datetimepicker .xdsoft_datepicker{width:224px;float:left;margin-left:8px}.xdsoft_datetimepicker .xdsoft_timepicker{width:58px;float:left;text-align:center;margin-left:8px;margin-top:0}.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker{margin-top:8px;margin-bottom:3px}.xdsoft_datetimepicker .xdsoft_monthpicker{position:relative;text-align:center}.xdsoft_datetimepicker .xdsoft_label i,.xdsoft_datetimepicker .xdsoft_prev,.xdsoft_datetimepicker .xdsoft_next,.xdsoft_datetimepicker .xdsoft_today_button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC)}.xdsoft_datetimepicker .xdsoft_label i{opacity:.5;background-position:-92px -19px;display:inline-block;width:9px;height:20px;vertical-align:middle}.xdsoft_datetimepicker .xdsoft_prev{float:left;background-position:-20px 0}.xdsoft_datetimepicker .xdsoft_today_button{float:left;background-position:-70px 0;margin-left:5px}.xdsoft_datetimepicker .xdsoft_next{float:right;background-position:0 0}.xdsoft_datetimepicker .xdsoft_next,.xdsoft_datetimepicker .xdsoft_prev,.xdsoft_datetimepicker .xdsoft_today_button{background-color:transparent;background-repeat:no-repeat;border:0 none;cursor:pointer;display:block;height:30px;opacity:.5;-ms-filter:"alpha(opacity=50)";outline:medium none;overflow:hidden;padding:0;position:relative;text-indent:100%;white-space:nowrap;width:20px;min-width:0}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next{float:none;background-position:-40px -15px;height:15px;width:30px;display:block;margin-left:14px;margin-top:7px}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{background-position:-40px 0;margin-bottom:7px;margin-top:0}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box{height:151px;overflow:hidden;border-bottom:1px solid #ddd}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div{background:#f5f5f5;border-top:1px solid #ddd;color:#666;font-size:12px;text-align:center;border-collapse:collapse;cursor:pointer;border-bottom-width:0;height:25px;line-height:25px}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:first-child{border-top-width:0}.xdsoft_datetimepicker .xdsoft_today_button:hover,.xdsoft_datetimepicker .xdsoft_next:hover,.xdsoft_datetimepicker .xdsoft_prev:hover{opacity:1;-ms-filter:"alpha(opacity=100)"}.xdsoft_datetimepicker .xdsoft_label{display:inline;position:relative;z-index:9999;margin:0;padding:5px 3px;font-size:14px;line-height:20px;font-weight:bold;background-color:#fff;float:left;width:182px;text-align:center;cursor:pointer}.xdsoft_datetimepicker .xdsoft_label:hover>span{text-decoration:underline}.xdsoft_datetimepicker .xdsoft_label:hover i{opacity:1.0}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select{border:1px solid #ccc;position:absolute;right:0;top:30px;z-index:101;display:none;background:#fff;max-height:160px;overflow-y:hidden}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select.xdsoft_monthselect{right:-7px}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select.xdsoft_yearselect{right:2px}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option:hover{color:#fff;background:#ff8000}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option{padding:2px 10px 2px 5px;text-decoration:none!important}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option.xdsoft_current{background:#3af;box-shadow:#178fe5 0 1px 3px 0 inset;color:#fff;font-weight:700}.xdsoft_datetimepicker .xdsoft_month{width:100px;text-align:right}.xdsoft_datetimepicker .xdsoft_calendar{clear:both}.xdsoft_datetimepicker .xdsoft_year{width:48px;margin-left:5px}.xdsoft_datetimepicker .xdsoft_calendar table{border-collapse:collapse;width:100%}.xdsoft_datetimepicker .xdsoft_calendar td>div{padding-right:5px}.xdsoft_datetimepicker .xdsoft_calendar th{height:25px}.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th{width:14.2857142%;background:#f5f5f5;border:1px solid #ddd;color:#666;font-size:12px;text-align:right;vertical-align:middle;padding:0;border-collapse:collapse;cursor:pointer;height:25px}.xdsoft_datetimepicker .xdsoft_calendar th{background:#f1f1f1}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today{color:#3af}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default{background:#ffe9d2;box-shadow:#ffb871 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint{background:#c1ffc9;box-shadow:#00dd1c 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current{background:#3af;box-shadow:#178fe5 0 1px 3px 0 inset;color:#fff;font-weight:700}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,.xdsoft_datetimepicker .xdsoft_time_box>div>div.xdsoft_disabled{opacity:.5;-ms-filter:"alpha(opacity=50)";cursor:default}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled{opacity:.2;-ms-filter:"alpha(opacity=20)"}.xdsoft_datetimepicker .xdsoft_calendar td:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:hover{color:#fff!important;background:#ff8000!important;box-shadow:none!important}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover{background:#3af!important;box-shadow:#178fe5 0 1px 3px 0 inset!important;color:#fff!important}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_disabled:hover{color:inherit!important;background:inherit!important;box-shadow:inherit!important}.xdsoft_datetimepicker .xdsoft_calendar th{font-weight:700;text-align:center;color:#999;cursor:default}.xdsoft_datetimepicker .xdsoft_copyright{color:#ccc!important;font-size:10px;clear:both;float:none;margin-left:8px}.xdsoft_datetimepicker .xdsoft_copyright a{color:#eee!important}.xdsoft_datetimepicker .xdsoft_copyright a:hover{color:#aaa!important}.xdsoft_time_box{position:relative;border:1px solid #ccc}.xdsoft_scrollbar>.xdsoft_scroller{background:#ccc!important;height:20px;border-radius:3px}.xdsoft_scrollbar{position:absolute;width:7px;right:0;top:0;bottom:0;cursor:pointer}.xdsoft_scroller_box{position:relative}
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/css/datetimepicker.orig.css cahier-de-prepa6.0.0/css/datetimepicker.orig.css
--- cahier-de-prepa5.1.0/css/datetimepicker.orig.css	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/css/datetimepicker.orig.css	2016-08-23 22:33:27.494962623 +0200
@@ -0,0 +1,568 @@
+.xdsoft_datetimepicker {
+	box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506);
+	background: #fff;
+	border-bottom: 1px solid #bbb;
+	border-left: 1px solid #ccc;
+	border-right: 1px solid #ccc;
+	border-top: 1px solid #ccc;
+	color: #333;
+	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+	padding: 8px;
+	padding-left: 0;
+	padding-top: 2px;
+	position: absolute;
+	z-index: 9999;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	display: none;
+}
+.xdsoft_datetimepicker.xdsoft_rtl {
+	padding: 8px 0 8px 8px;
+}
+
+.xdsoft_datetimepicker iframe {
+	position: absolute;
+	left: 0;
+	top: 0;
+	width: 75px;
+	height: 210px;
+	background: transparent;
+	border: none;
+}
+
+/*For IE8 or lower*/
+.xdsoft_datetimepicker button {
+	border: none !important;
+}
+
+.xdsoft_noselect {
+	-webkit-touch-callout: none;
+	-webkit-user-select: none;
+	-khtml-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	-o-user-select: none;
+	user-select: none;
+}
+
+.xdsoft_noselect::selection { background: transparent }
+.xdsoft_noselect::-moz-selection { background: transparent }
+
+.xdsoft_datetimepicker.xdsoft_inline {
+	display: inline-block;
+	position: static;
+	box-shadow: none;
+}
+
+.xdsoft_datetimepicker * {
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	padding: 0;
+	margin: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker {
+	display: none;
+}
+
+.xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active {
+	display: block;
+}
+
+.xdsoft_datetimepicker .xdsoft_datepicker {
+	width: 224px;
+	float: left;
+	margin-left: 8px;
+}
+.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_datepicker {
+	float: right;
+	margin-right: 8px;
+	margin-left: 0;
+}
+
+.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker {
+	width: 256px;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker {
+	width: 58px;
+	float: left;
+	text-align: center;
+	margin-left: 8px;
+	margin-top: 0;
+}
+.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker {
+	float: right;
+	margin-right: 8px;
+	margin-left: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker {
+	margin-top: 8px;
+	margin-bottom: 3px
+}
+
+.xdsoft_datetimepicker .xdsoft_monthpicker {
+	position: relative;
+	text-align: center;
+}
+
+.xdsoft_datetimepicker .xdsoft_label i,
+.xdsoft_datetimepicker .xdsoft_prev,
+.xdsoft_datetimepicker .xdsoft_next,
+.xdsoft_datetimepicker .xdsoft_today_button {
+	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC);
+}
+
+.xdsoft_datetimepicker .xdsoft_label i {
+	opacity: 0.5;
+	background-position: -92px -19px;
+	display: inline-block;
+	width: 9px;
+	height: 20px;
+	vertical-align: middle;
+}
+
+.xdsoft_datetimepicker .xdsoft_prev {
+	float: left;
+	background-position: -20px 0;
+}
+.xdsoft_datetimepicker .xdsoft_today_button {
+	float: left;
+	background-position: -70px 0;
+	margin-left: 5px;
+}
+
+.xdsoft_datetimepicker .xdsoft_next {
+	float: right;
+	background-position: 0 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_next,
+.xdsoft_datetimepicker .xdsoft_prev ,
+.xdsoft_datetimepicker .xdsoft_today_button {
+	background-color: transparent;
+	background-repeat: no-repeat;
+	border: 0 none;
+	cursor: pointer;
+	display: block;
+	height: 30px;
+	opacity: 0.5;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+	outline: medium none;
+	overflow: hidden;
+	padding: 0;
+	position: relative;
+	text-indent: 100%;
+	white-space: nowrap;
+	width: 20px;
+	min-width: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next {
+	float: none;
+	background-position: -40px -15px;
+	height: 15px;
+	width: 30px;
+	display: block;
+	margin-left: 14px;
+	margin-top: 7px;
+}
+.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_prev,
+.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_next {
+	float: none;
+	margin-left: 0;
+	margin-right: 14px;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev {
+	background-position: -40px 0;
+	margin-bottom: 7px;
+	margin-top: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box {
+	height: 151px;
+	overflow: hidden;
+	border-bottom: 1px solid #ddd;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div {
+	background: #f5f5f5;
+	border-top: 1px solid #ddd;
+	color: #666;
+	font-size: 12px;
+	text-align: center;
+	border-collapse: collapse;
+	cursor: pointer;
+	border-bottom-width: 0;
+	height: 25px;
+	line-height: 25px;
+}
+
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child {
+	border-top-width: 0;
+}
+
+.xdsoft_datetimepicker .xdsoft_today_button:hover,
+.xdsoft_datetimepicker .xdsoft_next:hover,
+.xdsoft_datetimepicker .xdsoft_prev:hover {
+	opacity: 1;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+}
+
+.xdsoft_datetimepicker .xdsoft_label {
+	display: inline;
+	position: relative;
+	z-index: 9999;
+	margin: 0;
+	padding: 5px 3px;
+	font-size: 14px;
+	line-height: 20px;
+	font-weight: bold;
+	background-color: #fff;
+	float: left;
+	width: 182px;
+	text-align: center;
+	cursor: pointer;
+}
+
+.xdsoft_datetimepicker .xdsoft_label:hover>span {
+	text-decoration: underline;
+}
+
+.xdsoft_datetimepicker .xdsoft_label:hover i {
+	opacity: 1.0;
+}
+
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select {
+	border: 1px solid #ccc;
+	position: absolute;
+	right: 0;
+	top: 30px;
+	z-index: 101;
+	display: none;
+	background: #fff;
+	max-height: 160px;
+	overflow-y: hidden;
+}
+
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{ right: -7px }
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{ right: 2px }
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
+	color: #fff;
+	background: #ff8000;
+}
+
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option {
+	padding: 2px 10px 2px 5px;
+	text-decoration: none !important;
+}
+
+.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
+	background: #33aaff;
+	box-shadow: #178fe5 0 1px 3px 0 inset;
+	color: #fff;
+	font-weight: 700;
+}
+
+.xdsoft_datetimepicker .xdsoft_month {
+	width: 100px;
+	text-align: right;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar {
+	clear: both;
+}
+
+.xdsoft_datetimepicker .xdsoft_year{
+	width: 48px;
+	margin-left: 5px;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar table {
+	border-collapse: collapse;
+	width: 100%;
+
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td > div {
+	padding-right: 5px;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar th {
+	height: 25px;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th {
+	width: 14.2857142%;
+	background: #f5f5f5;
+	border: 1px solid #ddd;
+	color: #666;
+	font-size: 12px;
+	text-align: right;
+	vertical-align: middle;
+	padding: 0;
+	border-collapse: collapse;
+	cursor: pointer;
+	height: 25px;
+}
+.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th {
+	width: 12.5%;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar th {
+	background: #f1f1f1;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today {
+	color: #33aaff;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default {
+	background: #ffe9d2;
+	box-shadow: #ffb871 0 1px 4px 0 inset;
+	color: #000;
+}
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint {
+	background: #c1ffc9;
+	box-shadow: #00dd1c 0 1px 4px 0 inset;
+	color: #000;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
+	background: #33aaff;
+	box-shadow: #178fe5 0 1px 3px 0 inset;
+	color: #fff;
+	font-weight: 700;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,
+.xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled {
+	opacity: 0.5;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+	cursor: default;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled {
+	opacity: 0.2;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td:hover,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
+	color: #fff !important;
+	background: #ff8000 !important;
+	box-shadow: none !important;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover {
+	background: #33aaff !important;
+	box-shadow: #178fe5 0 1px 3px 0 inset !important;
+	color: #fff !important;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,
+.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover {
+	color: inherit	!important;
+	background: inherit !important;
+	box-shadow: inherit !important;
+}
+
+.xdsoft_datetimepicker .xdsoft_calendar th {
+	font-weight: 700;
+	text-align: center;
+	color: #999;
+	cursor: default;
+}
+
+.xdsoft_datetimepicker .xdsoft_copyright {
+	color: #ccc !important;
+	font-size: 10px;
+	clear: both;
+	float: none;
+	margin-left: 8px;
+}
+
+.xdsoft_datetimepicker .xdsoft_copyright a { color: #eee !important }
+.xdsoft_datetimepicker .xdsoft_copyright a:hover { color: #aaa !important }
+
+.xdsoft_time_box {
+	position: relative;
+	border: 1px solid #ccc;
+}
+.xdsoft_scrollbar >.xdsoft_scroller {
+	background: #ccc !important;
+	height: 20px;
+	border-radius: 3px;
+}
+.xdsoft_scrollbar {
+	position: absolute;
+	width: 7px;
+	right: 0;
+	top: 0;
+	bottom: 0;
+	cursor: pointer;
+}
+.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_scrollbar {
+	left: 0;
+	right: auto;
+}
+.xdsoft_scroller_box {
+	position: relative;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark {
+	box-shadow: 0 5px 15px -5px rgba(255, 255, 255, 0.506);
+	background: #000;
+	border-bottom: 1px solid #444;
+	border-left: 1px solid #333;
+	border-right: 1px solid #333;
+	border-top: 1px solid #333;
+	color: #ccc;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box {
+	border-bottom: 1px solid #222;
+}
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div {
+	background: #0a0a0a;
+	border-top: 1px solid #222;
+	color: #999;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label {
+	background-color: #000;
+}
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select {
+	border: 1px solid #333;
+	background: #000;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
+	color: #000;
+	background: #007fff;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
+	background: #cc5500;
+	box-shadow: #b03e00 0 1px 3px 0 inset;
+	color: #000;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i,
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev,
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next,
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button {
+	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==);
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td,
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
+	background: #0a0a0a;
+	border: 1px solid #222;
+	color: #999;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
+	background: #0e0e0e;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today {
+	color: #cc5500;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default {
+	background: #ffe9d2;
+	box-shadow: #ffb871 0 1px 4px 0 inset;
+	color:#000;
+}
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint {
+	background: #c1ffc9;
+	box-shadow: #00dd1c 0 1px 4px 0 inset;
+	color:#000;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default,
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current,
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
+	background: #cc5500;
+	box-shadow: #b03e00 0 1px 3px 0 inset;
+	color: #000;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover,
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
+	color: #000 !important;
+	background: #007fff !important;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
+	color: #666;
+}
+
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright { color: #333 !important }
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a { color: #111 !important }
+.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover { color: #555 !important }
+
+.xdsoft_dark .xdsoft_time_box {
+	border: 1px solid #333;
+}
+
+.xdsoft_dark .xdsoft_scrollbar >.xdsoft_scroller {
+	background: #333 !important;
+}
+.xdsoft_datetimepicker .xdsoft_save_selected {
+    display: block;
+    border: 1px solid #dddddd !important;
+    margin-top: 5px;
+    width: 100%;
+    color: #454551;
+    font-size: 13px;
+}
+.xdsoft_datetimepicker .blue-gradient-button {
+	font-family: "museo-sans", "Book Antiqua", sans-serif;
+	font-size: 12px;
+	font-weight: 300;
+	color: #82878c;
+	height: 28px;
+	position: relative;
+	padding: 4px 17px 4px 33px;
+	border: 1px solid #d7d8da;
+	background: -moz-linear-gradient(top, #fff 0%, #f4f8fa 73%);
+	/* FF3.6+ */
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(73%, #f4f8fa));
+	/* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(top, #fff 0%, #f4f8fa 73%);
+	/* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(top, #fff 0%, #f4f8fa 73%);
+	/* Opera 11.10+ */
+	background: -ms-linear-gradient(top, #fff 0%, #f4f8fa 73%);
+	/* IE10+ */
+	background: linear-gradient(to bottom, #fff 0%, #f4f8fa 73%);
+	/* W3C */
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#f4f8fa',GradientType=0 );
+/* IE6-9 */
+}
+.xdsoft_datetimepicker .blue-gradient-button:hover, .xdsoft_datetimepicker .blue-gradient-button:focus, .xdsoft_datetimepicker .blue-gradient-button:hover span, .xdsoft_datetimepicker .blue-gradient-button:focus span {
+  color: #454551;
+  background: -moz-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
+  /* FF3.6+ */
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f8fa), color-stop(73%, #FFF));
+  /* Chrome,Safari4+ */
+  background: -webkit-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
+  /* Chrome10+,Safari5.1+ */
+  background: -o-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
+  /* Opera 11.10+ */
+  background: -ms-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
+  /* IE10+ */
+  background: linear-gradient(to bottom, #f4f8fa 0%, #FFF 73%);
+  /* W3C */
+  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f8fa', endColorstr='#FFF',GradientType=0 );
+  /* IE6-9 */
+}
diff -urN cahier-de-prepa5.1.0/css/icones.css cahier-de-prepa6.0.0/css/icones.css
--- cahier-de-prepa5.1.0/css/icones.css	2015-10-21 01:50:05.429884698 +0200
+++ cahier-de-prepa6.0.0/css/icones.css	2016-07-25 23:24:21.557674925 +0200
@@ -254,3 +254,9 @@
 	content: "\e648";
   color: #C00;
 }
+.icon-agenda:before {
+  content: "\e649";
+}
+.icon-ajout-colle:before {
+  content: "\e64a";
+}
diff -urN cahier-de-prepa5.1.0/css/icones-min.css cahier-de-prepa6.0.0/css/icones-min.css
--- cahier-de-prepa5.1.0/css/icones-min.css	2015-10-21 01:50:29.209475002 +0200
+++ cahier-de-prepa6.0.0/css/icones-min.css	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-@font-face{font-family:'icomoon';src:url('../fonts/icomoon.eot?13');src:url('../fonts/icomoon.eot?#iefix13') format('embedded-opentype'),url('../fonts/icomoon.ttf?13') format('truetype'),url('../fonts/icomoon.woff?13') format('woff'),url('../fonts/icomoon.svg?13#icomoon') format('svg');font-weight:normal;font-style:normal}[class^="icon-"],[class*=" icon-"]{font-family:'icomoon';color:black;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a[class^="icon-"]{cursor:pointer;float:right;margin-left:5px;padding-top:.2em;text-decoration:none;font-weight:500}span.icon-lock{position:relative!important;left:-0.3em;top:.1em;color:#777;margin-right:-0.5em}.icon-montre:before{content:"\e600"}.icon-cache:before{content:"\e601"}.icon-aide:before{content:"\e602"}.icon-ajoute:before{content:"\e603"}.icon-supprime:before{content:"\e604"}.icon-annule:before{content:"\e605"}.icon-ok:before{content:"\e606"}.icon-prefs:before{content:"\e607"}.icon-monte:before{content:"\e608"}.icon-descend:before{content:"\e609"}.icon-ferme:before{content:"\e60a"}.icon-epingle:before{content:"\e60b"}.icon-par1:before{content:"\e60c"}.icon-par2:before{content:"\e60d"}.icon-par3:before{content:"\e60e"}.icon-gras:before{content:"\e60f"}.icon-italique:before{content:"\e610"}.icon-souligne:before{content:"\e611"}.icon-omega:before{content:"\e612"}.icon-sigma:before{content:"\e613"}.icon-exp:before{content:"\e614"}.icon-ind:before{content:"\e615"}.icon-ol:before{content:"\e616"}.icon-ul:before{content:"\e617"}.icon-lien1:before{content:"\e618"}.icon-lien2:before{content:"\e619"}.icon-retour:before{content:"\e61a"}.icon-source:before{content:"\e61b"}.icon-nosource:before{content:"\e61c"}.icon-tex:before{content:"\e61d"}.icon-titres:before{content:"\e61e"}.icon-edite:before{content:"\e61f"}.icon-precedent:before{content:"\e620"}.icon-suivant:before{content:"\e621"}.icon-recherche:before{content:"\e622"}.icon-voirtout:before{content:"\e623"}.icon-accueil:before{content:"\e624"}.icon-imprime:before{content:"\e625"}.icon-connexion:before{content:"\e626"}.icon-deconnexion:before{content:"\e627"}.icon-mail:before{content:"\e628"}.icon-menu:before{content:"\e629"}.icon-cocher:before{content:"\e62a"}.icon-decocher:before{content:"\e62b"}.icon-rep:before{content:"\e62c"}.icon-rep-open:before{content:"\e62d"}.icon-download:before{content:"\e62e"}.icon-lock:before{content:"\e62f"}.icon-alphaasc:before{content:"\e630"}.icon-alphadesc:before{content:"\e631"}.icon-chronoasc:before{content:"\e632"}.icon-chronodesc:before{content:"\e633"}.icon-ajouterep:before{content:"\e634"}.icon-ajoutedoc:before{content:"\e635"}.icon-doc:before{content:"\e636"}.icon-doc-txt:before{content:"\e636"}.icon-doc-pdf:before{content:"\e637"}.icon-doc-doc:before{content:"\e638"}.icon-doc-xls:before{content:"\e639"}.icon-doc-ppt:before{content:"\e63a"}.icon-doc-jpg:before{content:"\e63b"}.icon-doc-zip:before{content:"\e63c"}.icon-doc-mp3:before{content:"\e63d"}.icon-doc-mp4:before{content:"\e63e"}.icon-doc-pyt:before{content:"\e63f"}.icon-rss:before{content:"\e640"}.icon-infos:before{content:"\e641"}.icon-colles:before{content:"\e642"}.icon-recent:before{content:"\e643"}.icon-lock1:before{content:"\e644"}.icon-lock2:before{content:"\e645"}.icon-lock3:before{content:"\e646"}.icon-lock4:before{content:"\e647"}.icon-lock5:before{content:"\e648";color:#C00}
diff -urN cahier-de-prepa5.1.0/css/icones.min.css cahier-de-prepa6.0.0/css/icones.min.css
--- cahier-de-prepa5.1.0/css/icones.min.css	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/css/icones.min.css	2016-08-30 18:10:42.106670849 +0200
@@ -0,0 +1 @@
+@font-face{font-family:'icomoon';src:url('../fonts/icomoon.eot?13');src:url('../fonts/icomoon.eot?#iefix13') format('embedded-opentype'),url('../fonts/icomoon.ttf?13') format('truetype'),url('../fonts/icomoon.woff?13') format('woff'),url('../fonts/icomoon.svg?13#icomoon') format('svg');font-weight:normal;font-style:normal}[class^="icon-"],[class*=" icon-"]{font-family:'icomoon';color:black;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a[class^="icon-"]{cursor:pointer;float:right;margin-left:5px;padding-top:.2em;text-decoration:none;font-weight:500}span.icon-lock{position:relative!important;left:-0.3em;top:.1em;color:#777;margin-right:-0.5em}.icon-montre:before{content:"\e600"}.icon-cache:before{content:"\e601"}.icon-aide:before{content:"\e602"}.icon-ajoute:before{content:"\e603"}.icon-supprime:before{content:"\e604"}.icon-annule:before{content:"\e605"}.icon-ok:before{content:"\e606"}.icon-prefs:before{content:"\e607"}.icon-monte:before{content:"\e608"}.icon-descend:before{content:"\e609"}.icon-ferme:before{content:"\e60a"}.icon-epingle:before{content:"\e60b"}.icon-par1:before{content:"\e60c"}.icon-par2:before{content:"\e60d"}.icon-par3:before{content:"\e60e"}.icon-gras:before{content:"\e60f"}.icon-italique:before{content:"\e610"}.icon-souligne:before{content:"\e611"}.icon-omega:before{content:"\e612"}.icon-sigma:before{content:"\e613"}.icon-exp:before{content:"\e614"}.icon-ind:before{content:"\e615"}.icon-ol:before{content:"\e616"}.icon-ul:before{content:"\e617"}.icon-lien1:before{content:"\e618"}.icon-lien2:before{content:"\e619"}.icon-retour:before{content:"\e61a"}.icon-source:before{content:"\e61b"}.icon-nosource:before{content:"\e61c"}.icon-tex:before{content:"\e61d"}.icon-titres:before{content:"\e61e"}.icon-edite:before{content:"\e61f"}.icon-precedent:before{content:"\e620"}.icon-suivant:before{content:"\e621"}.icon-recherche:before{content:"\e622"}.icon-voirtout:before{content:"\e623"}.icon-accueil:before{content:"\e624"}.icon-imprime:before{content:"\e625"}.icon-connexion:before{content:"\e626"}.icon-deconnexion:before{content:"\e627"}.icon-mail:before{content:"\e628"}.icon-menu:before{content:"\e629"}.icon-cocher:before{content:"\e62a"}.icon-decocher:before{content:"\e62b"}.icon-rep:before{content:"\e62c"}.icon-rep-open:before{content:"\e62d"}.icon-download:before{content:"\e62e"}.icon-lock:before{content:"\e62f"}.icon-alphaasc:before{content:"\e630"}.icon-alphadesc:before{content:"\e631"}.icon-chronoasc:before{content:"\e632"}.icon-chronodesc:before{content:"\e633"}.icon-ajouterep:before{content:"\e634"}.icon-ajoutedoc:before{content:"\e635"}.icon-doc:before{content:"\e636"}.icon-doc-txt:before{content:"\e636"}.icon-doc-pdf:before{content:"\e637"}.icon-doc-doc:before{content:"\e638"}.icon-doc-xls:before{content:"\e639"}.icon-doc-ppt:before{content:"\e63a"}.icon-doc-jpg:before{content:"\e63b"}.icon-doc-zip:before{content:"\e63c"}.icon-doc-mp3:before{content:"\e63d"}.icon-doc-mp4:before{content:"\e63e"}.icon-doc-pyt:before{content:"\e63f"}.icon-rss:before{content:"\e640"}.icon-infos:before{content:"\e641"}.icon-colles:before{content:"\e642"}.icon-recent:before{content:"\e643"}.icon-lock1:before{content:"\e644"}.icon-lock2:before{content:"\e645"}.icon-lock3:before{content:"\e646"}.icon-lock4:before{content:"\e647"}.icon-lock5:before{content:"\e648";color:#C00}.icon-agenda:before{content:"\e649"}.icon-ajout-colle:before{content:"\e64a"}
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/css/style.css cahier-de-prepa6.0.0/css/style.css
--- cahier-de-prepa5.1.0/css/style.css	2015-10-27 23:43:15.710451945 +0100
+++ cahier-de-prepa6.0.0/css/style.css	2016-08-30 14:51:42.652649986 +0200
@@ -1,5 +1,19 @@
 /* Feuille de style général : tailles et positionnements */
 
+/* Couleurs :
+ * #99B3E5 : menus à gauche (HSL: 220,60,75)
+ * #CDD5E4 : article        (HSL: 220,30,85)
+ * #E7EEFE : fenêtre        (HSL: 220,90,95)
+ * #BA0D1F : rouge annonces
+ * #001030,#002877 : titres/liens dans menus à gauche
+ * #F6F6F6 : fond
+ * #DDD : bandeau bas, barre de recherche, boutons d'édition des textarea
+ * #AAA : articles cachés
+ * #EFE/#090 : bandeau ok vert (fond/texte)
+ * #FEE/#D00 : bandeau non-ok rouge (fond/texte)
+ * #EFF : hover sur les tableaux (#planning,#utilisateurs,#notes,.usergrp,.usermat)
+*/
+
 /* Police et taille globales */
 html,body { height: 100%; }
 body { font-size: 100%; font-family:Arial, Helvetica, sans-serif; position: relative; width:100%; margin: 0 auto; max-width: 1500px; background-color: #F6F6F6; }
@@ -34,18 +48,18 @@
   h2 { font-size: 1.65em; }
   #colonne, nav, #recent { display: none; }
   #colonne.visible { display: block; }
-  nav.visible, #recent.visible { display: block; position: fixed; z-index: 2; top: 3.3em; left: 0.5em; padding: 1em 20px 0.7em;
+  nav.visible, #recent.visible { display: block; position: fixed; z-index: 10; top: 3.3em; left: 0.5em; padding: 1em 20px 0.7em;
                                  width: 80%; min-width: 200px; max-width: 280px; max-height: 70%; overflow: auto;
                                  box-shadow: 0.5em 0.5em 0.5em #777; -moz-box-shadow: 0.5em 0.5em 0.5em #777; -webkit-box-shadow: 0.5em 0.5em 0.5em #777; }
-  .icon-menu, .icon-recent { position: fixed; z-index: 2; top: 0.8em; left: 0.5em; font-size: 1.2em; cursor: pointer; }
+  .icon-menu, .icon-recent { position: fixed; z-index: 10; top: 0.8em; left: 0.5em; font-size: 1.2em; cursor: pointer; }
   .icon-recent { left: 2.5em; }
   section { position: relative; width:96%; margin: 0 2%; padding: 0 0 3em; }
   header + section { text-align: center; }
   footer { font-size: 0.6em; }
 }
-article { margin: 1em 0; padding: 1em 2%; background-color: #CCD3E0; }
+article { margin: 1em 0; padding: 1em 2%; background-color: #CDD5E4; }
 article:first-child, .general + article { margin-top: 0 !important; }
-footer { text-align: center; width: 90%; padding: 1em 5%; clear: both; position: fixed; left: 0; bottom: 0; z-index: 6;
+footer { text-align: center; width: 90%; padding: 1em 5%; clear: both; position: fixed; left: 0; bottom: 0; z-index: 15;
          border-top: 1px solid black; background-color: #DDD; opacity: 0.97; filter: alpha(opacity=97); }
 
 /* PDF et JPG */
@@ -69,9 +83,10 @@
 h1 span { font-size: 70%; vertical-align: 7%; margin-left: 0.4em; } /* indication de protection en mode édition */
 
 /* Menu de recherche, programme de colle et cahier de texte */
-#recherchecdt a, #recherchecolle a { float: none !important; margin-left: 0.5em; }
-.topbarre select#semaines { margin-left: 1.3em; width: 8em; height: 1.7em; }
-.topbarre select#seances { margin-left: 1.3em; width: 10.5em; height: 1.7em; }
+#recherchecdt a, #recherchecolle a, #rechercheagenda a { float: none !important; margin-left: 0.5em; }
+#rechercheagenda a { vertical-align: sub; }
+.topbarre select#semaines { margin-left: 1.3em; width: 8.5em; height: 1.7em; }
+.topbarre select#seances { margin-left: 1.3em; width: 11em; height: 1.7em; }
 .topbarre input { position: absolute; margin:0 0.8em 0 1.5em; padding-left: 1.8em; width: -moz-available; height: 1.7em; }
 .topbarre span { position: relative; left: 1.9em; cursor: pointer; top: 0.1em; }
 /* Disparition de la case de recherche */
@@ -101,7 +116,7 @@
   #recherchecolle input { width: 40%; }
   .topbarre span { top: 0.2em; }
   #recherchecdt a, #recherchecolle a { vertical-align: middle; }
-  .topbarre select { height: 1.7em; }
+/*  .topbarre select { height: 1.7em; }*/
 }
 
 /* Documents */
@@ -122,15 +137,15 @@
 h3.edition.editable { padding-right: 1%; }
 .edition ~ div, .edition + p, .edition ~ form { margin-top: 0.75em; }
 article.cache { background-color: #AAA; opacity: 0.6; filter: alpha(opacity=60); }
-#log { position: fixed; top:3%; left: 3%; padding: 0.3em 2%; z-index: 6; margin-right: 3%; }
+#log { position: fixed; top:3%; left: 3%; padding: 0.3em 2%; z-index: 20; margin-right: 3%; }
 .ok { background-color: #EFE; color: #090; border: 1px solid #090; }
 .nok { background-color: #FEE; color: #D00; border: 1px solid #D00; }
 .ok span { color: #090; }
 .nok span { color: #D00; }
 #log span { cursor: pointer; position: relative; right: -0.8em; top: 0.1em;}
-#fenetre_fond { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; opacity: 0.2; filter: alpha(opacity=20); z-index: 3; }
-#fenetre { position: fixed; left: 50%; z-index: 4; padding: 0 2%; overflow: auto; background-color: #E3ECFC; opacity: 0.97; filter: alpha(opacity=97);
-           box-shadow: 0.5em 0.5em 0.5em #777; -moz-box-shadow: 0.5em 0.5em 0.5em #777; -webkit-box-shadow: 0.5em 0.5em 0.5em #777; }
+#fenetre_fond { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; opacity: 0.2; filter: alpha(opacity=20); z-index: 12; }
+#fenetre { position: fixed; left: 50%; z-index: 14; padding: 0 2%; overflow: auto; background-color: #E7EEFE; opacity: 0.97; filter: alpha(opacity=97);
+           box-shadow: 0.5em 0.5em 0.5em #777; -webkit-box-shadow: 0.5em 0.5em 0.5em #777; }
 #fenetre > *:last-child { margin-bottom: 1em; }
 @media screen and (min-width: 800px) {
   #fenetre { top: 10%; width: 70%; margin-left: -37%; max-height: 80%; }
@@ -160,15 +175,15 @@
 #fenetre td { border-top: none !important; border-left: none !important; border-right: none !important; border-bottom: 1px dotted #BBB !important; }
 #planning { text-align: center; }
 .labelchecked { color: #999; }
-tr:hover { background-color: #EFF; }
-
+#planning tr:hover, #utilisateurs tr:hover, #notes tr:hover, .usergrp .ligne:hover, .usermat .ligne:hover { background-color: #EFF; }
+ 
 /* Édition : formulaires */
-input, select, textarea { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; }
+input, select, textarea { box-sizing: border-box; -webkit-box-sizing: border-box; border: 1px solid; border-radius: 2px; padding: 0 0.3em; }
 p.ligne { padding: 0; clear: right; }
 .ligne label { font-weight: 700; }
-.ligne input, .ligne select, .ligne code { width: 65%; float: right; margin-top: -0.2em; }
+.ligne input, .ligne select, .ligne code { width: 65%; float: right; margin-top: -0.1em; margin-left: 0.2em; line-height: 1em; height: 1.5em; box-sizing: border-box; }
 .ligne input[type="checkbox"], .ligne input[type="radio"] { width: 1em; margin-top: 0.2em; }
-input.ligne { width: 100%;  margin-bottom: 0.5em; display: block; }
+input.ligne { width: 100%;  margin-bottom: 0.5em; line-height: 1em; height: 1.5em; display: block; }
 .supprmultiple { margin-top: 0.3em; margin-bottom: 0 !important; }
 .usermat { margin-top: 0.5em; padding: 0; clear: right; }
 .usermat a { padding: 0 !important; }
@@ -180,14 +195,15 @@
 table td .icon-edite { float: left !important; margin: 0 0.2em 0 0.1em; }
 
 /* Édition : champs éditables */
-div.placeholder:before { content: attr(data-placeholder); color: #AAA; margin-left: 4px; z-index: 2;  }
-span.placeholder { color: #AAA; position: absolute; margin: 0.2em 2.5% 0 5px; z-index: 2; }
-#fenetre span.placeholder, #fenetre div.placeholder:before { z-index: 5;  }
+div.placeholder:before { content: attr(data-placeholder); color: #AAA; margin-left: 4px; z-index: 12;  }
+span.placeholder { color: #AAA; position: absolute; margin: 0.25em 2.5% 0 5px; z-index: 12; font-size: 0.8em; }
+p.ligne span.placeholder { left: 35%; margin-top: 0.1em; margin-left: 1em; }
+#fenetre span.placeholder, #fenetre div.placeholder:before { z-index: 15;  }
 .editable, .titrecdt.edition, form.titrecdt, .editabledest { border: 1px dotted #BBB; position: relative; }
 .editable a[class^="icon-"], p.titrecdt a[class^="icon-"], .editabledest a[class^="icon-"] { float: none; }
 .avecform { padding: 0; border: none !important; }
 h3.editable a[class^="icon-"], h3 span.editable a[class^="icon-"] { font-weight: 500; font-size: 0.67em; padding-top: 0.1em;}
-h3.avecform span { font-weight: 500; font-size: 0.67em; margin-top: 0.4em; width: 80%; overflow: hidden; white-space:nowrap; }
+h3.avecform span { font-weight: 500; font-size: 0.6em; margin-top: 0.5em; width: 80%; overflow: hidden; white-space:nowrap; }
 h3.avecform input { width: 50%; }
 textarea { width: 100%;  margin: 0 0 0.2em; }
 textarea + div { min-height: 6em; border: 1px dotted #CCC; background-color: #FFF; }
@@ -202,7 +218,7 @@
 div.edithtml a.icon-annule { top: 3.1em; }
 
 /* Dans le menu et dans les informations récentes*/
-nav, #recent { background-color: #9AB3E4; }
+nav, #recent { background-color: #99B3E5; }
 nav a[class^="icon-"] { float: none !important; display: inline !important; margin: 0.5em 3% 1em; color: #001030; }
 nav a { display: block; margin-bottom: 0.2em; padding: 0; text-decoration: none; color: #002877; }
 nav a:hover { color: #CDF; }
@@ -229,7 +245,7 @@
 
 /* Pour l'impression */
 @media print {
-  #colonne, #recherchecolle, #recherchecdt, [id^="aide-"], [id^="form-"], footer, a[class^="icon-"] { display: none; }
+  #colonne, #recherchecolle, #recherchecdt, #rechercheagenda, [id^="aide-"], [id^="form-"], footer, a[class^="icon-"] { display: none; }
   .editable, .titrecdt.edition, form.titrecdt, .editabledest { border: none; }
   h1 { font-size: 1.7em; text-align: center; margin: 0; padding: 0 0 1em; }
   h2 { font-size: 1.5em; margin: 0.7em 0; padding: 0; }
@@ -240,232 +256,19 @@
   article { border: 1px solid #999; }
 }
 
-/*//////////////////////////////////////////////////////////
-Pour Datepick et Timeentry : édition des cahiers de texte */
-.timeEntry-control { float: right; margin: 0 5px 0 0; }
-.datepick-trigger { float: right; margin: 0.1em 7px 0 0; }
-
-/* Default styling for jQuery Datepicker v5.0.1. */
-.datepick {
-	background-color: #fff;
-	color: #000;
-	border: 1px solid #444;
-    border-radius: 0.25em;
-    -moz-border-radius: 0.25em;
-    -webkit-border-radius: 0.25em;
-	font-family: Arial,Helvetica,Sans-serif;
-	font-size: 90%;
-}
-.datepick-rtl {
-	direction: rtl;
-}
-.datepick-popup {
-	z-index: 2;
-}
-.datepick-disable {
-	position: absolute;
-	z-index: 1;
-	background-color: white;
-	opacity: 0.5;
-	filter: alpha(opacity=50);
-}
-.datepick a {
-	color: #fff;
-	text-decoration: none;
-}
-.datepick a.datepick-disabled {
-	color: #888;
-	cursor: auto;
-}
-.datepick button {
-    margin: 0.25em;
-    padding: 0.125em 0em;
-    background-color: #fcc;
-    border: none;
-    border-radius: 0.25em;
-    -moz-border-radius: 0.25em;
-    -webkit-border-radius: 0.25em;
-    font-weight: bold;
-}
-.datepick-nav, .datepick-ctrl {
-	float: left;
-	width: 100%;
-	background-color: #000;
-	color: #fff;
-	font-size: 90%;
-	font-weight: bold;
-}
-.datepick-ctrl {
-	background-color: #600;
-}
-.datepick-cmd {
-	width: 30%;
-}
-.datepick-cmd:hover {
-	background-color: #777;
-}
-.datepick-ctrl .datepick-cmd:hover {
-	background-color: #f08080;
-}
-.datepick-cmd-prevJump, .datepick-cmd-nextJump {
-	width: 8%;
-}
-a.datepick-cmd {
-	height: 1.5em;
-}
-button.datepick-cmd {
-	text-align: center;
-}
-.datepick-cmd-prev, .datepick-cmd-prevJump, .datepick-cmd-clear {
-	float: left;
-	padding-left: 2%;
-}
-.datepick-cmd-current, .datepick-cmd-today {
-	float: left;
-	width: 35%;
-	text-align: center;
-}
-.datepick-cmd-next, .datepick-cmd-nextJump, .datepick-cmd-close {
-	float: right;
-	padding-right: 2%;
-	text-align: right;
-}
-.datepick-rtl .datepick-cmd-prev, .datepick-rtl .datepick-cmd-prevJump,
-.datepick-rtl .datepick-cmd-clear {
-	float: right;
-	padding-left: 0%;
-	padding-right: 2%;
-	text-align: right;
-}
-.datepick-rtl .datepick-cmd-current, .datepick-rtl .datepick-cmd-today {
-	float: right;
-}
-.datepick-rtl .datepick-cmd-next, .datepick-rtl .datepick-cmd-nextJump,
-.datepick-rtl .datepick-cmd-close {
-	float: left;
-	padding-left: 2%;
-	padding-right: 0%;
-	text-align: left;
-}
-.datepick-month-nav {
-	float: left;
-	background-color: #777;
-	text-align: center;
-}
-.datepick-month-nav div {
-	float: left;
-	width: 12.5%;
-	margin: 1%;
-	padding: 1%;
-}
-.datepick-month-nav span {
-	color: #888;
-}
-.datepick-month-row {
-	clear: left;
-}
-.datepick-month {
-	float: left;
-	width: 15em;
-	border: 1px solid #444;
-	text-align: center;
-}
-.datepick-month-header, .datepick-month-header select, .datepick-month-header input {
-	height: 1.5em;
-	background-color: #444;
-	color: #fff;
-	font-weight: bold;
-}
-.datepick-month-header select, .datepick-month-header input {
-	height: 1.4em;
-	margin: 0em;
-	padding: 0em;
-	border: none;
-	font-size: 100%;
-}
-.datepick-month-header input {
-	position: absolute;
-	display: none;
-}
-.datepick-month table {
-	width: 100%;
-	border-collapse: collapse;
-}
-.datepick-month thead {
-	border-bottom: 1px solid #aaa;
-}
-.datepick-month th, .datepick-month td {
-	margin: 0em;
-	padding: 0em;
-	font-weight: normal;
-	text-align: center;
-}
-.datepick-month th {
-	border: 1px solid #777;
-}
-.datepick-month th, .datepick-month th a {
-	background-color: #777;
-	color: #fff;
-}
-.datepick-month td {
-	background-color: #eee;
-	border: 1px solid #aaa;
-}
-.datepick-month td.datepick-week {
-	border: 1px solid #777;
-}
-.datepick-month td.datepick-week * {
-	background-color: #777;
-	color: #fff;
-	border: none;
-}
-.datepick-month a {
-	display: block;
-	width: 100%;
-	padding: 0.125em 0em;
-	background-color: #eee;
-	color: #000;
-	text-decoration: none;
-}
-.datepick-month span {
-	display: block;
-	width: 100%;
-	padding: 0.125em 0em;
-}
-.datepick-month td span {
-	color: #888;
-}
-.datepick-month td .datepick-other-month {
-	background-color: #fff;
-}
-.datepick-month td .datepick-weekend {
-	background-color: #ddd;
-}
-.datepick-month td .datepick-today {
-	background-color: #f0c0c0;
-}
-.datepick-month td .datepick-highlight {
-	background-color: #f08080;
-}
-.datepick-month td .datepick-selected {
-	background-color: #777;
-	color: #fff;
-}
-.datepick-month th.datepick-week {
-	background-color: #777;
-	color: #fff;
-}
-.datepick-status {
-	clear: both;
-	background-color: #ddd;
-	text-align: center;
-}
-.datepick-clear-fix {
-	clear: both;
-}
-
-/* TimeEntry styles v2.0.0 */
-.timeEntry-control {
-	vertical-align: middle;
-	margin-left: 2px;
-}
+/* Agenda */
+#calendrier { margin-top: 1em; }
+#calendrier table { table-layout: fixed; }
+#semaine, .semaine-bg, .evenements { margin: 0; }
+#semaine { font-weight: 900; text-align: center; }
+#semaine th { overflow: hidden; text-overflow: clip; }
+.semaine-bg { border-top: none; position: absolute; z-index: 1; }
+.autremois { background-color: #E7EEFE; color: #002877; }
+#aujourdhui { background-color: #99B3E5; }
+.evenements { position: relative; z-index: 2; border-top: none; border-bottom: none; }
+.evenements thead { border-bottom: 1px solid #999; }
+.evenements th { padding: 0.15em 0.5%; text-align: right; }
+.evenements td { padding: 2px 3px 1px; border: none !important; }
+.evnmt { padding: 1px 3px; border-radius: 5px; white-space: nowrap; overflow: hidden; font-size: 0.8em; cursor: pointer; }
+.evnmt_suivi { border-top-right-radius: 0px; border-bottom-right-radius: 0px; margin-right: -2px; }
+.evnmt_suite { border-top-left-radius: 0px; border-bottom-left-radius: 0px; margin-left: -3px; }
diff -urN cahier-de-prepa5.1.0/css/style-min.css cahier-de-prepa6.0.0/css/style-min.css
--- cahier-de-prepa5.1.0/css/style-min.css	2015-10-27 23:43:57.237757896 +0100
+++ cahier-de-prepa6.0.0/css/style-min.css	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-html,body{height:100%}body{font-size:100%;font-family:Arial,Helvetica,sans-serif;position:relative;width:100%;margin:0 auto;max-width:1500px;background-color:#f6f6f6}h1{font-size:2.2em;text-align:center;margin:0;padding:1em 2em}h2{font-size:1.8em;margin:1em 0 .8em;padding:0}h3{font-size:1.5em;margin:1em 0 .5em;padding:0 1% 0}h4{font-size:1.3em;margin:.5em 0 .2em;padding:0 2.5% 0}h5{font-size:1.1em;margin:.2em 0 0;padding:0 4% 0}h6{font-size:1em;margin:.2em 0 0;padding:0 5.5% 0}ul{margin:.5em 0;padding:0 2% 0 6%}p{margin:0;padding:0 2%}p+p{margin-top:.5em}div,form{margin:0;padding:0}img{border:0;max-width:100%}div,p,section,article{text-align:justify}article>*:first-child{margin-top:0}article>*:last-child{margin-bottom:0}section>h2:first-child{margin-top:0}@media screen and (min-width:800px){#colonne{width:280px;float:left;margin:0 30px 3em}nav{margin:0;padding:1em 20px .7em}.icon-menu,.icon-recent{display:none}#recent{margin-top:1.5em;padding:1em 20px}section{position:relative;margin:0 30px 0 340px;padding:0 0 3em}header+section{width:96%;margin:0 auto;max-width:1500px;text-align:center}footer{font-size:.8em}}@media screen and (max-width:800px){h1{font-size:1.8em;padding:.3em 3em}h2{font-size:1.65em}#colonne,nav,#recent{display:none}#colonne.visible{display:block}nav.visible,#recent.visible{display:block;position:fixed;z-index:2;top:3.3em;left:.5em;padding:1em 20px .7em;width:80%;min-width:200px;max-width:280px;max-height:70%;overflow:auto;box-shadow:.5em .5em .5em #777;-moz-box-shadow:.5em .5em .5em #777;-webkit-box-shadow:.5em .5em .5em #777}.icon-menu,.icon-recent{position:fixed;z-index:2;top:.8em;left:.5em;font-size:1.2em;cursor:pointer}.icon-recent{left:2.5em}section{position:relative;width:96%;margin:0 2%;padding:0 0 3em}header+section{text-align:center}footer{font-size:.6em}}article{margin:1em 0;padding:1em 2%;background-color:#ccd3e0}article:first-child,.general+article{margin-top:0!important}footer{text-align:center;width:90%;padding:1em 5%;clear:both;position:fixed;left:0;bottom:0;z-index:6;border-top:1px solid black;background-color:#DDD;opacity:.97;filter:alpha(opacity=97)}.pdf{height:0;width:100%;overflow:hidden;position:relative}.portrait{padding-bottom:138%}.paysage{padding-bottom:74%}.hauteur50{padding-bottom:50%}.pdf object{position:absolute}.warning{text-align:center;width:50%;margin:1em auto;padding:.5em 3%}.annonce{margin:1em 3%;padding:.5em 4%}.note{margin:.5em 2%;padding:0 4%}.warning,.annonce{color:#ba0d1f;border:2px solid #ba0d1f}.note{color:#ba0d1f}.oubli{font-size:.8em;text-align:center}.oubli a{text-decoration:none;color:#333}p.titrecdt{text-align:right;text-decoration:underline}.titrecdt.edition{text-align:left;text-decoration:none;padding-right:1%}.topbarre{height:1.5em;background-color:#DDD;border:1px solid #BBB;width:auto;padding:0;margin-bottom:0;border-radius:4px}h1 span{font-size:70%;vertical-align:7%;margin-left:.4em}#recherchecdt a,#recherchecolle a{float:none!important;margin-left:.5em}.topbarre select#semaines{margin-left:1.3em;width:8em;height:1.7em}.topbarre select#seances{margin-left:1.3em;width:10.5em;height:1.7em}.topbarre input{position:absolute;margin:0 .8em 0 1.5em;padding-left:1.8em;width:-moz-available;height:1.7em}.topbarre span{position:relative;left:1.9em;cursor:pointer;top:.1em}@media screen and (max-width:980px) and (min-width:800px),screen and (max-width:600px){#recherchecdt input{display:none;top:1.8em;padding-left:.1em;right:2em;margin-left:2em!important}#recherchecdt span{left:1.3em}}@media screen and (max-width:450px){#recherchecdt a,#recherchecdt select{margin-left:.3em!important}#recherchecdt input{margin-left:.3em}#recherchecdt select{width:6em!important}#recherchecdt span{left:.3em}}@media screen and (max-width:400px){#recherchecolle a,#recherchecolle select{margin-left:.3em!important}#recherchecolle input{margin-left:0!important}#recherchecolle select{width:6em}#recherchecolle span{left:.3em}}@media screen and (max-width:350px){#recherchecolle input{display:none;top:1.8em;padding-left:.1em;right:2em;margin-left:2em!important}}@media screen and (-webkit-min-device-pixel-ratio:0){.topbarre{height:1.4em;vertical-align:bottom}#recherchecolle input{width:40%}.topbarre span{top:.2em}#recherchecdt a,#recherchecolle a{vertical-align:middle}.topbarre select{height:1.7em}}#parentsdoc{margin-bottom:1.5em;padding:.3em 2% 0}#parentsdoc *{padding-top:0}#parentsdoc span{position:static;cursor:auto}.rep,.doc{padding:0;margin-left:2%;margin-right:2%;border-bottom:1px dotted #BBB}.repcontenu,.docdonnees{float:right;font-size:.8em;padding-top:.2em;padding-left:.5em}#parentsdoc a,.rep a,.doc a{text-decoration:none;color:black}#parentsdoc .nom,.rep .nom,.doc .nom{font-weight:700;margin-left:.5em}.general{position:absolute;top:-4.1em;right:1em}.general+.general{right:2.2em}.general+.general+.general{right:3.4em}.general+.general+.general+.general{right:4.6em}.edition{display:inline;text-align:left;padding-right:3em}h3.edition.editable{padding-right:1%}.edition ~ div,.edition+p,.edition ~ form{margin-top:.75em}article.cache{background-color:#AAA;opacity:.6;filter:alpha(opacity=60)}#log{position:fixed;top:3%;left:3%;padding:.3em 2%;z-index:6;margin-right:3%}.ok{background-color:#EFE;color:#090;border:1px solid #090}.nok{background-color:#FEE;color:#D00;border:1px solid #D00}.ok span{color:#090}.nok span{color:#D00}#log span{cursor:pointer;position:relative;right:-0.8em;top:.1em}#fenetre_fond{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:.2;filter:alpha(opacity=20);z-index:3}#fenetre{position:fixed;left:50%;z-index:4;padding:0 2%;overflow:auto;background-color:#e3ecfc;opacity:.97;filter:alpha(opacity=97);box-shadow:.5em .5em .5em #777;-moz-box-shadow:.5em .5em .5em #777;-webkit-box-shadow:.5em .5em .5em #777}#fenetre>*:last-child{margin-bottom:1em}@media screen and (min-width:800px){#fenetre{top:10%;width:70%;margin-left:-37%;max-height:80%}}@media screen and (max-width:800px){.general{top:-2.2em}#fenetre{top:4%;width:92%;margin-left:-48%;max-height:92%}}#fenetre a[class^="icon-"]{margin-top:1.5em}#fenetre hr{margin:1.5em 0}#epingle{margin-top:1.5em}#epingle h3{padding-left:0}[id^="aide-"],[id^="form-"]{display:none}#fenetre [name="titre"]{margin:2em 0 1em}#fenetre [name="titre"]+*{display:inline}form.titrecdt{padding:.2em 0 .5em;margin-top:.2em}.suppression{text-align:center}#fenetre.usermat h3{margin-bottom:0}#fenetre.usermat a.icon-ajoute,#fenetre a.icon-supprime{margin-top:.8em}#fenetre.usermat .ligne,#fenetre.usergrp .ligne{border-bottom:1px dotted #BBB}#fenetre.usermat input,#fenetre.usergrp input{margin-top:.2em}#fenetre th+th,#fenetre td+td{text-align:center;width:2em;padding:.15em}#fenetre th a{float:none}#fenetre th{border:none!important}#fenetre td{border-top:none!important;border-left:none!important;border-right:none!important;border-bottom:1px dotted #BBB!important}#planning{text-align:center}.labelchecked{color:#999}tr:hover{background-color:#EFF}input,select,textarea{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}p.ligne{padding:0;clear:right}.ligne label{font-weight:700}.ligne input,.ligne select,.ligne code{width:65%;float:right;margin-top:-0.2em}.ligne input[type="checkbox"],.ligne input[type="radio"]{width:1em;margin-top:.2em}input.ligne{width:100%;margin-bottom:.5em;display:block}.supprmultiple{margin-top:.3em;margin-bottom:0!important}.usermat{margin-top:.5em;padding:0;clear:right}.usermat a{padding:0!important}table{width:100%;margin:1em 0;border-collapse:collapse;border:medium solid #999}table td{padding:.15em .5%}table th{padding:.15em 3%}table td,table th{border:thin solid #AAA!important}table td .icon-edite{float:left!important;margin:0 .2em 0 .1em}div.placeholder:before{content:attr(data-placeholder);color:#AAA;margin-left:4px;z-index:2}span.placeholder{color:#AAA;position:absolute;margin:.2em 2.5% 0 5px;z-index:2}#fenetre span.placeholder,#fenetre div.placeholder:before{z-index:5}.editable,.titrecdt.edition,form.titrecdt,.editabledest{border:1px dotted #BBB;position:relative}.editable a[class^="icon-"],p.titrecdt a[class^="icon-"],.editabledest a[class^="icon-"]{float:none}.avecform{padding:0;border:none!important}h3.editable a[class^="icon-"],h3 span.editable a[class^="icon-"]{font-weight:500;font-size:.67em;padding-top:.1em}h3.avecform span{font-weight:500;font-size:.67em;margin-top:.4em;width:80%;overflow:hidden;white-space:nowrap}h3.avecform input{width:50%}textarea{width:100%;margin:0 0 .2em}textarea+div{min-height:6em;border:1px dotted #CCC;background-color:#FFF}.boutons{clear:right;background-color:#DDD;border:1px solid #BBB;width:auto;padding:0;margin-bottom:0;border-radius:4px}.boutons button{cursor:default;background-color:transparent;border-top:0;border-left:none;border-bottom:1px solid #BBB;border-right:1px solid #BBB;height:1.5em;font-size:100%;width:2em}.boutons button+button{margin-left:-0.2em}div.editable a[class^="icon-"]{position:absolute;right:3px;top:0}div.editable a.icon-annule{top:1.5em}div.edithtml a.icon-ok{top:1.6em}div.edithtml a.icon-annule{top:3.1em}nav,#recent{background-color:#9ab3e4}nav a[class^="icon-"]{float:none!important;display:inline!important;margin:.5em 3% 1em;color:#001030}nav a{display:block;margin-bottom:.2em;padding:0;text-decoration:none;color:#002877}nav a:hover{color:#CDF}nav h3{font-size:1.2em;margin:.5em 3% .1em;padding-top:.3em;color:#001030;border-top:1px solid #001030}nav hr{margin:.5em 3% .5em;color:#001030;border-top:1px solid #001030;border-bottom:0}nav a.menurep{padding-left:3%;font-size:.9em}#actuel{font-style:italic}nav h3 span{font-weight:500;font-size:.83em;margin-right:.2em;color:#001030!important}#recent a{display:block;margin-bottom:.4em;padding:0;text-decoration:none;color:#002877;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#recent a span{color:#002877}#recent h3{font-size:1.2em;margin:0 3% .5em;color:#001030}th.semaines{vertical-align:bottom;padding:1.6em 0;text-align:center}td.semaines{padding-bottom:1em!important;vertical-align:bottom;text-align:center;padding:.2em 5px}td.semaines span{display:block;font-weight:700;margin:0;padding:0;width:1.2em;transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);white-space:nowrap;zoom:1}td.pasnote{font-style:italic;text-align:center}.collsel{font-weight:700}.collnosel,.dejanote{color:#AAA}#recherchenote{padding:0 1em}#notes td+td{text-align:right}@media print{#colonne,#recherchecolle,#recherchecdt,[id^="aide-"],[id^="form-"],footer,a[class^="icon-"]{display:none}.editable,.titrecdt.edition,form.titrecdt,.editabledest{border:0}h1{font-size:1.7em;text-align:center;margin:0;padding:0 0 1em}h2{font-size:1.5em;margin:.7em 0;padding:0}h3{font-size:1.35em;margin:.6em 0;padding:0 1% 0}h4{font-size:1.2em;margin:.4em 0 .2em;padding:0 2.5% 0}h5{font-size:1.1em;margin:.2em 0 0;padding:0 4% 0}h6{font-size:1em;margin:.2em 0 0;padding:0 5.5% 0}article{border:1px solid #999}}.timeEntry-control{float:right;margin:0 5px 0 0}.datepick-trigger{float:right;margin:.1em 7px 0 0}.datepick{background-color:#fff;color:#000;border:1px solid #444;border-radius:.25em;-moz-border-radius:.25em;-webkit-border-radius:.25em;font-family:Arial,Helvetica,Sans-serif;font-size:90%}.datepick-rtl{direction:rtl}.datepick-popup{z-index:2}.datepick-disable{position:absolute;z-index:1;background-color:white;opacity:.5;filter:alpha(opacity=50)}.datepick a{color:#fff;text-decoration:none}.datepick a.datepick-disabled{color:#888;cursor:auto}.datepick button{margin:.25em;padding:.125em 0;background-color:#fcc;border:0;border-radius:.25em;-moz-border-radius:.25em;-webkit-border-radius:.25em;font-weight:bold}.datepick-nav,.datepick-ctrl{float:left;width:100%;background-color:#000;color:#fff;font-size:90%;font-weight:bold}.datepick-ctrl{background-color:#600}.datepick-cmd{width:30%}.datepick-cmd:hover{background-color:#777}.datepick-ctrl .datepick-cmd:hover{background-color:#f08080}.datepick-cmd-prevJump,.datepick-cmd-nextJump{width:8%}a.datepick-cmd{height:1.5em}button.datepick-cmd{text-align:center}.datepick-cmd-prev,.datepick-cmd-prevJump,.datepick-cmd-clear{float:left;padding-left:2%}.datepick-cmd-current,.datepick-cmd-today{float:left;width:35%;text-align:center}.datepick-cmd-next,.datepick-cmd-nextJump,.datepick-cmd-close{float:right;padding-right:2%;text-align:right}.datepick-rtl .datepick-cmd-prev,.datepick-rtl .datepick-cmd-prevJump,.datepick-rtl .datepick-cmd-clear{float:right;padding-left:0;padding-right:2%;text-align:right}.datepick-rtl .datepick-cmd-current,.datepick-rtl .datepick-cmd-today{float:right}.datepick-rtl .datepick-cmd-next,.datepick-rtl .datepick-cmd-nextJump,.datepick-rtl .datepick-cmd-close{float:left;padding-left:2%;padding-right:0;text-align:left}.datepick-month-nav{float:left;background-color:#777;text-align:center}.datepick-month-nav div{float:left;width:12.5%;margin:1%;padding:1%}.datepick-month-nav span{color:#888}.datepick-month-row{clear:left}.datepick-month{float:left;width:15em;border:1px solid #444;text-align:center}.datepick-month-header,.datepick-month-header select,.datepick-month-header input{height:1.5em;background-color:#444;color:#fff;font-weight:bold}.datepick-month-header select,.datepick-month-header input{height:1.4em;margin:0;padding:0;border:0;font-size:100%}.datepick-month-header input{position:absolute;display:none}.datepick-month table{width:100%;border-collapse:collapse}.datepick-month thead{border-bottom:1px solid #aaa}.datepick-month th,.datepick-month td{margin:0;padding:0;font-weight:normal;text-align:center}.datepick-month th{border:1px solid #777}.datepick-month th,.datepick-month th a{background-color:#777;color:#fff}.datepick-month td{background-color:#eee;border:1px solid #aaa}.datepick-month td.datepick-week{border:1px solid #777}.datepick-month td.datepick-week *{background-color:#777;color:#fff;border:0}.datepick-month a{display:block;width:100%;padding:.125em 0;background-color:#eee;color:#000;text-decoration:none}.datepick-month span{display:block;width:100%;padding:.125em 0}.datepick-month td span{color:#888}.datepick-month td .datepick-other-month{background-color:#fff}.datepick-month td .datepick-weekend{background-color:#ddd}.datepick-month td .datepick-today{background-color:#f0c0c0}.datepick-month td .datepick-highlight{background-color:#f08080}.datepick-month td .datepick-selected{background-color:#777;color:#fff}.datepick-month th.datepick-week{background-color:#777;color:#fff}.datepick-status{clear:both;background-color:#ddd;text-align:center}.datepick-clear-fix{clear:both}.timeEntry-control{vertical-align:middle;margin-left:2px}
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/css/style.min.css cahier-de-prepa6.0.0/css/style.min.css
--- cahier-de-prepa5.1.0/css/style.min.css	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/css/style.min.css	2016-08-30 18:10:54.730794496 +0200
@@ -0,0 +1 @@
+html,body{height:100%}body{font-size:100%;font-family:Arial,Helvetica,sans-serif;position:relative;width:100%;margin:0 auto;max-width:1500px;background-color:#f6f6f6}h1{font-size:2.2em;text-align:center;margin:0;padding:1em 2em}h2{font-size:1.8em;margin:1em 0 .8em;padding:0}h3{font-size:1.5em;margin:1em 0 .5em;padding:0 1% 0}h4{font-size:1.3em;margin:.5em 0 .2em;padding:0 2.5% 0}h5{font-size:1.1em;margin:.2em 0 0;padding:0 4% 0}h6{font-size:1em;margin:.2em 0 0;padding:0 5.5% 0}ul{margin:.5em 0;padding:0 2% 0 6%}p{margin:0;padding:0 2%}p+p{margin-top:.5em}div,form{margin:0;padding:0}img{border:0;max-width:100%}div,p,section,article{text-align:justify}article>*:first-child{margin-top:0}article>*:last-child{margin-bottom:0}section>h2:first-child{margin-top:0}@media screen and (min-width:800px){#colonne{width:280px;float:left;margin:0 30px 3em}nav{margin:0;padding:1em 20px .7em}.icon-menu,.icon-recent{display:none}#recent{margin-top:1.5em;padding:1em 20px}section{position:relative;margin:0 30px 0 340px;padding:0 0 3em}header+section{width:96%;margin:0 auto;max-width:1500px;text-align:center}footer{font-size:.8em}}@media screen and (max-width:800px){h1{font-size:1.8em;padding:.3em 3em}h2{font-size:1.65em}#colonne,nav,#recent{display:none}#colonne.visible{display:block}nav.visible,#recent.visible{display:block;position:fixed;z-index:10;top:3.3em;left:.5em;padding:1em 20px .7em;width:80%;min-width:200px;max-width:280px;max-height:70%;overflow:auto;box-shadow:.5em .5em .5em #777;-moz-box-shadow:.5em .5em .5em #777;-webkit-box-shadow:.5em .5em .5em #777}.icon-menu,.icon-recent{position:fixed;z-index:10;top:.8em;left:.5em;font-size:1.2em;cursor:pointer}.icon-recent{left:2.5em}section{position:relative;width:96%;margin:0 2%;padding:0 0 3em}header+section{text-align:center}footer{font-size:.6em}}article{margin:1em 0;padding:1em 2%;background-color:#cdd5e4}article:first-child,.general+article{margin-top:0!important}footer{text-align:center;width:90%;padding:1em 5%;clear:both;position:fixed;left:0;bottom:0;z-index:15;border-top:1px solid black;background-color:#DDD;opacity:.97;filter:alpha(opacity=97)}.pdf{height:0;width:100%;overflow:hidden;position:relative}.portrait{padding-bottom:138%}.paysage{padding-bottom:74%}.hauteur50{padding-bottom:50%}.pdf object{position:absolute}.warning{text-align:center;width:50%;margin:1em auto;padding:.5em 3%}.annonce{margin:1em 3%;padding:.5em 4%}.note{margin:.5em 2%;padding:0 4%}.warning,.annonce{color:#ba0d1f;border:2px solid #ba0d1f}.note{color:#ba0d1f}.oubli{font-size:.8em;text-align:center}.oubli a{text-decoration:none;color:#333}p.titrecdt{text-align:right;text-decoration:underline}.titrecdt.edition{text-align:left;text-decoration:none;padding-right:1%}.topbarre{height:1.5em;background-color:#DDD;border:1px solid #BBB;width:auto;padding:0;margin-bottom:0;border-radius:4px}h1 span{font-size:70%;vertical-align:7%;margin-left:.4em}#recherchecdt a,#recherchecolle a,#rechercheagenda a{float:none!important;margin-left:.5em}#rechercheagenda a{vertical-align:sub}.topbarre select#semaines{margin-left:1.3em;width:8.5em;height:1.7em}.topbarre select#seances{margin-left:1.3em;width:11em;height:1.7em}.topbarre input{position:absolute;margin:0 .8em 0 1.5em;padding-left:1.8em;width:-moz-available;height:1.7em}.topbarre span{position:relative;left:1.9em;cursor:pointer;top:.1em}@media screen and (max-width:980px) and (min-width:800px),screen and (max-width:600px){#recherchecdt input{display:none;top:1.8em;padding-left:.1em;right:2em;margin-left:2em!important}#recherchecdt span{left:1.3em}}@media screen and (max-width:450px){#recherchecdt a,#recherchecdt select{margin-left:.3em!important}#recherchecdt input{margin-left:.3em}#recherchecdt select{width:6em!important}#recherchecdt span{left:.3em}}@media screen and (max-width:400px){#recherchecolle a,#recherchecolle select{margin-left:.3em!important}#recherchecolle input{margin-left:0!important}#recherchecolle select{width:6em}#recherchecolle span{left:.3em}}@media screen and (max-width:350px){#recherchecolle input{display:none;top:1.8em;padding-left:.1em;right:2em;margin-left:2em!important}}@media screen and (-webkit-min-device-pixel-ratio:0){.topbarre{height:1.4em;vertical-align:bottom}#recherchecolle input{width:40%}.topbarre span{top:.2em}#recherchecdt a,#recherchecolle a{vertical-align:middle}}#parentsdoc{margin-bottom:1.5em;padding:.3em 2% 0}#parentsdoc *{padding-top:0}#parentsdoc span{position:static;cursor:auto}.rep,.doc{padding:0;margin-left:2%;margin-right:2%;border-bottom:1px dotted #BBB}.repcontenu,.docdonnees{float:right;font-size:.8em;padding-top:.2em;padding-left:.5em}#parentsdoc a,.rep a,.doc a{text-decoration:none;color:black}#parentsdoc .nom,.rep .nom,.doc .nom{font-weight:700;margin-left:.5em}.general{position:absolute;top:-4.1em;right:1em}.general+.general{right:2.2em}.general+.general+.general{right:3.4em}.general+.general+.general+.general{right:4.6em}.edition{display:inline;text-align:left;padding-right:3em}h3.edition.editable{padding-right:1%}.edition ~ div,.edition+p,.edition ~ form{margin-top:.75em}article.cache{background-color:#AAA;opacity:.6;filter:alpha(opacity=60)}#log{position:fixed;top:3%;left:3%;padding:.3em 2%;z-index:20;margin-right:3%}.ok{background-color:#EFE;color:#090;border:1px solid #090}.nok{background-color:#FEE;color:#D00;border:1px solid #D00}.ok span{color:#090}.nok span{color:#D00}#log span{cursor:pointer;position:relative;right:-0.8em;top:.1em}#fenetre_fond{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:.2;filter:alpha(opacity=20);z-index:12}#fenetre{position:fixed;left:50%;z-index:14;padding:0 2%;overflow:auto;background-color:#e7eefe;opacity:.97;filter:alpha(opacity=97);box-shadow:.5em .5em .5em #777;-webkit-box-shadow:.5em .5em .5em #777}#fenetre>*:last-child{margin-bottom:1em}@media screen and (min-width:800px){#fenetre{top:10%;width:70%;margin-left:-37%;max-height:80%}}@media screen and (max-width:800px){.general{top:-2.2em}#fenetre{top:4%;width:92%;margin-left:-48%;max-height:92%}}#fenetre a[class^="icon-"]{margin-top:1.5em}#fenetre hr{margin:1.5em 0}#epingle{margin-top:1.5em}#epingle h3{padding-left:0}[id^="aide-"],[id^="form-"]{display:none}#fenetre [name="titre"]{margin:2em 0 1em}#fenetre [name="titre"]+*{display:inline}form.titrecdt{padding:.2em 0 .5em;margin-top:.2em}.suppression{text-align:center}#fenetre.usermat h3{margin-bottom:0}#fenetre.usermat a.icon-ajoute,#fenetre a.icon-supprime{margin-top:.8em}#fenetre.usermat .ligne,#fenetre.usergrp .ligne{border-bottom:1px dotted #BBB}#fenetre.usermat input,#fenetre.usergrp input{margin-top:.2em}#fenetre th+th,#fenetre td+td{text-align:center;width:2em;padding:.15em}#fenetre th a{float:none}#fenetre th{border:none!important}#fenetre td{border-top:none!important;border-left:none!important;border-right:none!important;border-bottom:1px dotted #BBB!important}#planning{text-align:center}.labelchecked{color:#999}#planning tr:hover,#utilisateurs tr:hover,#notes tr:hover,.usergrp .ligne:hover,.usermat .ligne:hover{background-color:#EFF}input,select,textarea{box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid;border-radius:2px;padding:0 .3em}p.ligne{padding:0;clear:right}.ligne label{font-weight:700}.ligne input,.ligne select,.ligne code{width:65%;float:right;margin-top:-0.1em;margin-left:.2em;line-height:1em;height:1.5em;box-sizing:border-box}.ligne input[type="checkbox"],.ligne input[type="radio"]{width:1em;margin-top:.2em}input.ligne{width:100%;margin-bottom:.5em;line-height:1em;height:1.5em;display:block}.supprmultiple{margin-top:.3em;margin-bottom:0!important}.usermat{margin-top:.5em;padding:0;clear:right}.usermat a{padding:0!important}table{width:100%;margin:1em 0;border-collapse:collapse;border:medium solid #999}table td{padding:.15em .5%}table th{padding:.15em 3%}table td,table th{border:thin solid #AAA!important}table td .icon-edite{float:left!important;margin:0 .2em 0 .1em}div.placeholder:before{content:attr(data-placeholder);color:#AAA;margin-left:4px;z-index:12}span.placeholder{color:#AAA;position:absolute;margin:.25em 2.5% 0 5px;z-index:12;font-size:.8em}p.ligne span.placeholder{left:35%;margin-top:.1em;margin-left:1em}#fenetre span.placeholder,#fenetre div.placeholder:before{z-index:15}.editable,.titrecdt.edition,form.titrecdt,.editabledest{border:1px dotted #BBB;position:relative}.editable a[class^="icon-"],p.titrecdt a[class^="icon-"],.editabledest a[class^="icon-"]{float:none}.avecform{padding:0;border:none!important}h3.editable a[class^="icon-"],h3 span.editable a[class^="icon-"]{font-weight:500;font-size:.67em;padding-top:.1em}h3.avecform span{font-weight:500;font-size:.6em;margin-top:.5em;width:80%;overflow:hidden;white-space:nowrap}h3.avecform input{width:50%}textarea{width:100%;margin:0 0 .2em}textarea+div{min-height:6em;border:1px dotted #CCC;background-color:#FFF}.boutons{clear:right;background-color:#DDD;border:1px solid #BBB;width:auto;padding:0;margin-bottom:0;border-radius:4px}.boutons button{cursor:default;background-color:transparent;border-top:0;border-left:none;border-bottom:1px solid #BBB;border-right:1px solid #BBB;height:1.5em;font-size:100%;width:2em}.boutons button+button{margin-left:-0.2em}div.editable a[class^="icon-"]{position:absolute;right:3px;top:0}div.editable a.icon-annule{top:1.5em}div.edithtml a.icon-ok{top:1.6em}div.edithtml a.icon-annule{top:3.1em}nav,#recent{background-color:#99b3e5}nav a[class^="icon-"]{float:none!important;display:inline!important;margin:.5em 3% 1em;color:#001030}nav a{display:block;margin-bottom:.2em;padding:0;text-decoration:none;color:#002877}nav a:hover{color:#CDF}nav h3{font-size:1.2em;margin:.5em 3% .1em;padding-top:.3em;color:#001030;border-top:1px solid #001030}nav hr{margin:.5em 3% .5em;color:#001030;border-top:1px solid #001030;border-bottom:0}nav a.menurep{padding-left:3%;font-size:.9em}#actuel{font-style:italic}nav h3 span{font-weight:500;font-size:.83em;margin-right:.2em;color:#001030!important}#recent a{display:block;margin-bottom:.4em;padding:0;text-decoration:none;color:#002877;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#recent a span{color:#002877}#recent h3{font-size:1.2em;margin:0 3% .5em;color:#001030}th.semaines{vertical-align:bottom;padding:1.6em 0;text-align:center}td.semaines{padding-bottom:1em!important;vertical-align:bottom;text-align:center;padding:.2em 5px}td.semaines span{display:block;font-weight:700;margin:0;padding:0;width:1.2em;transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);white-space:nowrap;zoom:1}td.pasnote{font-style:italic;text-align:center}.collsel{font-weight:700}.collnosel,.dejanote{color:#AAA}#recherchenote{padding:0 1em}#notes td+td{text-align:right}@media print{#colonne,#recherchecolle,#recherchecdt,#rechercheagenda,[id^="aide-"],[id^="form-"],footer,a[class^="icon-"]{display:none}.editable,.titrecdt.edition,form.titrecdt,.editabledest{border:0}h1{font-size:1.7em;text-align:center;margin:0;padding:0 0 1em}h2{font-size:1.5em;margin:.7em 0;padding:0}h3{font-size:1.35em;margin:.6em 0;padding:0 1% 0}h4{font-size:1.2em;margin:.4em 0 .2em;padding:0 2.5% 0}h5{font-size:1.1em;margin:.2em 0 0;padding:0 4% 0}h6{font-size:1em;margin:.2em 0 0;padding:0 5.5% 0}article{border:1px solid #999}}#calendrier{margin-top:1em}#calendrier table{table-layout:fixed}#semaine,.semaine-bg,.evenements{margin:0}#semaine{font-weight:900;text-align:center}#semaine th{overflow:hidden;text-overflow:clip}.semaine-bg{border-top:0;position:absolute;z-index:1}.autremois{background-color:#e7eefe;color:#002877}#aujourdhui{background-color:#99b3e5}.evenements{position:relative;z-index:2;border-top:0;border-bottom:0}.evenements thead{border-bottom:1px solid #999}.evenements th{padding:.15em .5%;text-align:right}.evenements td{padding:2px 3px 1px;border:none!important}.evnmt{padding:1px 3px;border-radius:5px;white-space:nowrap;overflow:hidden;font-size:.8em;cursor:pointer}.evnmt_suivi{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-2px}.evnmt_suite{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-3px}
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/def_sql.php cahier-de-prepa6.0.0/def_sql.php
--- cahier-de-prepa5.1.0/def_sql.php	2015-10-27 23:00:31.081183450 +0100
+++ cahier-de-prepa6.0.0/def_sql.php	2016-08-30 14:43:42.175818682 +0200
@@ -22,6 +22,11 @@
 FLUSH PRIVILEGES;
 USE `$base`;
 
+CREATE TABLE `prefs` (
+  `nom` varchar(50) NOT NULL,
+  `val` tinyint(2) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
 CREATE TABLE `matieres` (
   `id` tinyint(2) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
   `ordre` tinyint(2) unsigned NOT NULL,
@@ -196,9 +201,34 @@
   `nom` varchar(10) NOT NULL,
   `nom_nat` varchar(30) NOT NULL,
   `mailnotes` tinyint(1) UNSIGNED NOT NULL,
-  `eleves` varchar(100) NOT NULL
+  `eleves` varchar(250) NOT NULL
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
 
+CREATE TABLE `agenda` (
+  `id` smallint(3) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  `matiere` tinyint(2) unsigned NOT NULL,
+  `type` tinyint(2) unsigned NOT NULL,
+  `debut` datetime NOT NULL,
+  `fin` datetime NOT NULL,
+  `texte` text NOT NULL,
+  KEY `matiere` (`matiere`),
+  KEY `type` (`type`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `agenda-types` (
+  `id` tinyint(2) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  `nom` varchar(50) NOT NULL,
+  `ordre` tinyint(2) unsigned NOT NULL,
+  `cle` varchar(20) NOT NULL,
+  `couleur` varchar(6) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO prefs (nom,val)
+  VALUES ('creation_compte',1),
+         ('nb_agenda_index',10),
+         ('protection_globale',0),
+         ('protection_agenda',0);
+
 INSERT INTO utilisateurs (id,login,prenom,nom,mail,mdp,autorisation,matieres,timeout,mailexp,mailcopy)
   VALUES (1, '$login', '$prenom', '$nom', '$mail', '*', 4, '0,1', 900, '$prenom $nom', 1);
 
@@ -221,12 +251,48 @@
          (1, 6, 'distributions', 'Distribution de document', 0),
          (1, 7, 'DM', 'Devoir maison', 2);
 
-INSERT INTO semaines (debut) VALUES ('2015-09-01'),('2015-09-07'),('2015-09-14'),('2015-09-21'),('2015-09-28'),
-  ('2015-10-05'),('2015-10-12'),('2015-10-19'),('2015-10-26'),('2015-11-02'),('2015-11-09'),('2015-11-16'),('2015-11-23'),('2015-11-30'),
-  ('2015-12-07'),('2015-12-14'),('2015-12-21'),('2015-12-28'),('2016-01-04'),('2016-01-11'),('2016-01-18'),('2016-01-25'),
-  ('2016-02-01'),('2016-02-08'),('2016-02-15'),('2016-02-22'),('2016-02-29'),('2016-03-07'),('2016-03-14'),('2016-03-21'),('2016-03-29'),
-  ('2016-04-04'),('2016-04-11'),('2016-04-18'),('2016-04-25'),('2016-05-02'),('2016-05-09'),('2016-05-17'),('2016-05-23'),('2016-05-30'),
-  ('2016-06-06'),('2016-06-13'),('2016-06-20'),('2016-06-27'),('2016-07-04');
+INSERT INTO `agenda-types` (id,ordre,nom,cle,couleur)
+  VALUES (3, 1, 'Cours', 'cours', 'CC6633'),
+         (4, 2, 'Pas de cours', 'pascours', 'CC9933'),
+         (5, 3, 'Devoir surveillé', 'DS', '6633CC'),
+         (6, 4, 'Devoir maison', 'DM', '99CC33'),
+         (9, 5, 'Divers','div', 'CCCC33'),
+         (1, 6, 'Déplacement de colle', 'depl_colle', '33CCCC'),
+         (2, 7, 'Rattrapage de colle', 'ratt_colle', '3399CC'),
+         (7, 8, 'Jour férié', 'fer', 'CC3333'),
+         (8, 9, 'Vacances', 'vac', '66CC33');
+
+
+INSERT INTO agenda (id,matiere,debut,fin,type,texte)
+  VALUES (1, 0, '2016-08-15 00:00:00', '2016-08-15 00:00:00', 7, '<p>Assomption</p>'),
+         (2, 0, '2016-11-01 00:00:00', '2016-11-01 00:00:00', 7, '<p>Toussaint</p>'),
+         (3, 0, '2016-11-11 00:00:00', '2016-11-11 00:00:00', 7, '<p>Armistice 1918</p>'),
+         (4, 0, '2016-12-25 00:00:00', '2016-12-25 00:00:00', 7, '<p>Noël</p>'),
+         (5, 0, '2017-01-01 00:00:00', '2017-01-01 00:00:00', 7, '<p>Jour de l''an</p>'),
+         (6, 0, '2017-04-17 00:00:00', '2017-04-17 00:00:00', 7, '<p>Pâques</p>'),
+         (7, 0, '2017-05-01 00:00:00', '2017-05-01 00:00:00', 7, '<p>Fête du travail</p>'),
+         (8, 0, '2017-05-08 00:00:00', '2017-05-08 00:00:00', 7, '<p>Armistice 1945</p>'),
+         (9, 0, '2017-05-25 00:00:00', '2017-05-25 00:00:00', 7, '<p>Ascension</p>'),
+         (10, 0, '2017-06-05 00:00:00', '2017-06-05 00:00:00', 7, '<p>Pentecôte</p>'),
+         (11, 0, '2017-07-14 00:00:00', '2017-07-14 00:00:00', 7, '<p>Fête Nationale</p>'),
+         (12, 0, '2016-07-06 00:00:00', '2016-08-31 00:00:00', 8, '<p>Vacances d''été</p>'),
+         (13, 0, '2016-10-20 00:00:00', '2016-11-02 00:00:00', 8, '<p>Vacances de la Toussaint</p>'),
+         (14, 0, '2016-12-18 00:00:00', '2017-01-02 00:00:00', 8, '<p>Vacances de Noël</p>'),
+         (15, 0, '2017-02-19 00:00:00', '2017-03-05 00:00:00', 8, '<p>Vacances d''hiver, zone A</p>'),
+         (16, 0, '2017-02-10 00:00:00', '2017-02-26 00:00:00', 8, '<p>Vacances d''hiver, zone B</p>'),
+         (17, 0, '2017-02-03 00:00:00', '2017-02-19 00:00:00', 8, '<p>Vacances d''hiver, zone C</p>'),
+         (18, 0, '2017-04-16 00:00:00', '2017-05-01 00:00:00', 8, '<p>Vacances de printemps, zone A</p>'),
+         (19, 0, '2017-04-09 00:00:00', '2017-04-23 00:00:00', 8, '<p>Vacances de printemps, zone B</p>'),
+         (20, 0, '2017-04-02 00:00:00', '2017-04-17 00:00:00', 8, '<p>Vacances de printemps, zone C</p>'),
+         (21, 0, '2017-07-09 00:00:00', '2017-08-31 00:00:00', 8, '<p>Vacances d''été</p>'),
+         (22, 0, '2016-09-01 00:00:00', '2016-09-01 00:00:00', 1, '<div class="annonce">C''est la rentrée ! Bon courage pour cette nouvelle année&nbsp;!</div>');
+
+INSERT INTO semaines (debut) VALUES ('2016-09-01'),('2016-09-04'),('2016-09-11'),('2016-09-18'),('2016-09-25'),
+  ('2016-10-03'),('2016-10-10'),('2016-10-17'),('2016-10-20'),('2016-11-03'),('2016-11-07'),('2016-11-14'),('2016-11-21'),('2016-11-28'),
+  ('2016-12-05'),('2016-12-12'),('2016-12-19'),('2016-12-26'),('2017-01-03'),('2017-01-09'),('2017-01-16'),('2017-01-23'),
+  ('2017-01-30'),('2017-02-06'),('2017-02-13'),('2017-02-20'),('2017-02-27'),('2017-03-06'),('2017-03-13'),('2017-03-20'),('2017-03-27'),
+  ('2017-04-03'),('2017-04-10'),('2017-04-18'),('2017-04-24'),('2017-05-02'),('2017-05-09'),('2017-05-15'),('2017-05-22'),('2017-05-29'),
+  ('2017-06-05'),('2017-06-12'),('2017-06-19'),('2017-06-26'),('2017-07-03');
 UPDATE semaines SET colle = 1;
 
 FIN;
diff -urN cahier-de-prepa5.1.0/fonctions.php cahier-de-prepa6.0.0/fonctions.php
--- cahier-de-prepa5.1.0/fonctions.php	2015-10-28 01:06:40.366809494 +0100
+++ cahier-de-prepa6.0.0/fonctions.php	2016-08-30 18:14:47.789078427 +0200
@@ -101,110 +101,158 @@
 }
 
 // Fonction de mise à jour des informations récentes
-function recent($mysqli,$type,$id,$prop=array())  {
-  // type : 1->informations, 2->programmes de colles, 3->documents
-  // id : celui de l'information/le programme de colles/le document
-
-  // Ajout/modification dans la base de données, suppression si données vides
-  if ( $prop )  {
-    $requete = 'id='.($type*1000+$id).', heure = NOW()';
-    if ( isset($prop['titre']) )
-      $requete .= ", titre = '${prop['titre']}'";
-    if ( isset($prop['lien']) )
-      $requete .= ", lien = '${prop['lien']}'";
-    if ( isset($prop['texte']) )
-      $requete .= ", texte = '${prop['texte']}'";
-    if ( isset($prop['matiere']) )
-      $requete .= ", matiere = '${prop['matiere']}'";
-    if ( isset($prop['protection']) )
-      $requete .= ", protection = '${prop['protection']}'";
-    requete('recents',"REPLACE INTO recents SET $requete",$mysqli);
+function recent($mysqli,$type,$id,$matiere,$prop=array(),$ext='')  {
+  // $type : 1->informations, 2->programmes de colles, 3->documents, 5->agenda
+  // $id : celui de l'information/le programme de colles/le document/l'événement
+  // $matiere : id de la matière concernée (ou 0) pour savoir quel flux modifier
+  // $prop : contient titre (sans icône), lien, texte, matiere, protection
+  //         incomplet si mise à jour
+  //         vide si suppression de l'information récente
+  // $ext : ne sert que pour les documents, pour connaître l'icône à mettre
+
+  // Ajout dans la base de données
+  if ( count($prop) == 5 )  {
+    switch ( $type )  {
+      case 1: $icone = '<span class="icon-infos"></span>'; break;
+      case 2: $icone = '<span class="icon-colles"></span>'; break;
+      case 3:
+        // Liste des icônes pour affichage
+        $icones = array(
+          '.pdf' => 'pdf',
+          '.doc' => 'doc', '.odt' => 'doc', '.docx' => 'doc',
+          '.xls' => 'xls', '.ods' => 'xls', '.xlsx' => 'xls',
+          '.ppt' => 'ppt', '.odp' => 'ppt', '.pptx' => 'ppt',
+          '.jpg' => 'jpg', '.jpeg' => 'jpg', '.png' => 'jpg', '.gif' => 'jpg', '.svg' => 'jpg', '.tif' => 'jpg', '.tiff' => 'jpg', '.bmp' => 'jpg', '.ps' => 'jpg', '.eps' => 'jpg',
+          '.mp3' => 'mp3', '.ogg' => 'mp3', '.oga' => 'mp3', '.wma' => 'mp3', '.wav' => 'mp3', '.ra' => 'mp3', '.rm' => 'mp3',
+          '.mp4' => 'mp4', '.avi' => 'mp4', '.mpeg' => 'mp4', '.mpg' => 'mp4', '.wmv' => 'mp4', '.mp4' => 'mp4', '.ogv' => 'mp4', '.qt' => 'mp4', '.mov' => 'mp4', '.mkv' => 'mp4', '.flv' => 'mp4',
+          '.zip' => 'zip', '.rar' => 'zip', '.7z' => 'zip',
+          '.py' => 'pyt', '.exe' => 'pyt', '.sh' => 'pyt', '.ml' => 'pyt', '.mw' => 'pyt',
+          '.txt' => 'txt', '.rtf' => 'txt', '' => 'txt'
+        );
+        $icone = '<span class="icon-doc-'.(( isset($icones[strtolower($ext)]) ) ? $icones[strtolower($ext)] : 'txt').'"></span>'; break;
+      case 5:
+        $icone = '<span class="icon-agenda"></span>';
+        // Suppression avant insertion, pour une mise à jour
+        requete('recents','DELETE FROM recents WHERE id = '.($type*1000+$id),$mysqli);
+    }
+    requete('recents',"INSERT INTO recents SET id=".($type*1000+$id).", heure = NOW(), titre = '$icone ${prop['titre']}', lien = '${prop['lien']}', texte = '${prop['texte']}', matiere = '${prop['matiere']}', protection = '${prop['protection']}'",$mysqli);
   }
-  else
+  // Suppression de la base
+  elseif ( empty($prop) )  {
     requete('recents','DELETE FROM recents WHERE id = '.($type*1000+$id),$mysqli);
+  }
+  // Modification
+  else  {
+    switch ( $type )  {
+      case 1:
+        // Modification du titre : pas de changement de date de l'info récente
+        if ( isset($prop['titre']) )
+          $requete = "titre = '<span class=\"icon-infos\"></span> ${prop['titre']}'";
+        // Modification de texte : mise en valeur dans les flux RSS
+        elseif ( isset($prop['texte']) )
+          $requete = "heure = NOW(), texte = '${prop['texte']}', titre = CONCAT(titre,' (mise à jour)')";
+      break;
+      case 2:
+        // Modification de texte uniquement
+        $requete = "heure = NOW(), texte = '${prop['texte']}', titre = CONCAT(titre,' (mise à jour)')";
+      break;
+      case 3:
+        // Nouveau nom de document : mise à jour du titre et du texte seulement
+        if ( isset($prop['nom']) )
+          $requete = "titre = REPLACE(REPLACE(CONCAT(titre,'¤'),'/${prop['ancien_nom']}¤','/${prop['nom']}¤'),'¤',''), texte = REPLACE(texte,'/${prop['ancien_nom']}</a>','/${prop['nom']}</a>')";
+        // Déplacement de répertoire : mise à jour du chemin et peut-être de la
+        // matière. Pas de mise en valeur dans les flux RSS
+        elseif ( isset($prop['chemin']) )
+          $requete = "texte = REPLACE(texte,SUBSTRING(titre,36),'${prop['chemin']}'), titre = CONCAT(SUBSTRING(titre,1,35),'${prop['chemin']}'), matiere = '${prop['matiere']}'";
+        elseif ( isset($prop['maj']) )
+          $requete = 'heure = NOW(), texte = REPLACE(texte,\'<p>Nouveau \',\'<p>Mise à jour du \')';
+      break;
+    }
+    requete('recents',"UPDATE recents SET $requete WHERE id=".($type*1000+$id),$mysqli);
+  }
   
   // Pas la peine d'aller plus loin si la table n'a pas été modifiée.
-  if ( !($mysqli->affected_rows) )
+  if ( !($mysqli->affected_rows) )  {
+    // Cas de la mise à jour de document sans info récente liée : on en crée une
+    if ( ( $type == 3 ) && isset($prop['maj']) )
+      recent($mysqli,3,$id,$matiere,array('titre'=>$prop['maj'], 'lien'=>"download?id=$id", 'texte'=>"<p>Mise à jour du document&nbsp;: <a href=\"download?id=$id\">${prop['maj']}</a></p>", 'matiere'=>$matiere, 'protection'=>$prop['p']),$prop['e']);
     return;
+  }
 
-  // Nettoyage des anciennes entrées
-  $mysqli->query('DELETE FROM recents WHERE DATEDIFF(NOW(),heure) > 30');
   // Mise dans l'ordre, les plus récents en premier
   $mysqli->query('ALTER TABLE recents ORDER BY heure DESC');
   // Regénération des flux
-  rss($mysqli);
-  if ( isset($prop['matiere']) )  {
-    if ( $prop['matiere'] )
-      rss($mysqli,$prop['matiere'],0);
-  }
-  else  {
-    $resultat = $mysqli->query('SELECT GROUP_CONCAT(id) FROM matieres');
-    $r = $resultat->fetch_row();
-    $resultat->free();
-    $matieres = explode(',',$r[0]);
-    foreach ( $matieres as $m )
-      rss($mysqli,$m,0);
-  }
+  $matieres = array(0);
+  if ( $matiere )
+    $matieres[] = $matiere;
+  // Cas des documents déplacés : deux flux à regénérer
+  if ( isset($prop['matiere']) && ( $matiere != $prop['matiere'] ) )
+    $matieres[] = $prop['matiere'];
+  rss($mysqli,$matieres);
 }
 
 // Fonction de mise à jour des flux RSS
-// $matieres doit être soit zéro, soit un identifiant de matière, soit une
-// chaine contenant 0 et des identifiants séparés par des virgules
-// Si $matieres est nul : flux global toutes matières sans autorisation
-// Si $matieres est un identifiant : flux avec ou sans autorisation
-// Si $matieres est une chaine : flux avec autorisation obligatoire
-function rss($mysqli,$matieres='0',$autorisation=0)  {
-  // Titre du flux : titre du site
+// $matieres doit être soit zéro ou un identifiant de matière
+function rss($mysqli,$matieres)  {
+  $requete = '';
+  foreach ( $matieres as $matiere ) 
+    $requete .= " OR FIND_IN_SET($matiere,matieres)";
+  // Récupération de toutes les combinaisons autorisation-matières possibles
+  $combinaisons = array('0|toutes');
+  $resultat = $mysqli->query('SELECT CONCAT(autorisation,\'|\',matieres) FROM utilisateurs WHERE '.substr($requete,4));
+  while ( $r = $resultat->fetch_row() )
+    $combinaisons[] = $r[0];
+  $resultat->free();
+  $combinaisons = array_unique($combinaisons);
+
+  // Préambule du flux RSS - Titre du flux : titre du site
   $resultat = $mysqli->query('SELECT titre FROM pages WHERE id = 1');
   $r = $resultat->fetch_row();
   $resultat->free();
-  $titre = $r[0].' - Flux RSS';
-  // Description
-  if ( $matieres )  {
-    $resultat = $mysqli->query("SELECT GROUP_CONCAT(nom SEPARATOR ', ') FROM matieres WHERE FIND_IN_SET(id,$matieres) ORDER BY ordre");
-    $r = $resultat->fetch_row();
-    $resultat->free();
-    $description = "$titre - ${r[0]}";
-  }
-  else
-     $description = $titre;
-
-  // Regénération du flux RSS
-  $rep = 'documents/rss/'.sha1($GLOBALS['base'].$autorisation.$matieres);
+  $titre = $r[0];
   $d = date(DATE_RSS);
-  $rss = <<<FIN
+  $site = ( $GLOBALS['https'] ) ? "https://${GLOBALS['site']}" : "http://${GLOBALS['site']}";
+  $preambule = <<<FIN
 <?xml version="1.0" encoding="UTF-8"?>
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
     <title>$titre</title>
-    <atom:link href="http://${GLOBALS['site']}/$rep/rss.xml" rel="self" type="application/rss+xml" />
-    <link>http://${GLOBALS['site']}</link>
-    <description>$description</description>
+    <atom:link href="$site/REP/rss.xml" rel="self" type="application/rss+xml" />
+    <link>$site</link>
+    <description>$titre - Flux RSS</description>
     <lastBuildDate>$d</lastBuildDate>
     <language>fr-FR</language>
 
 
 FIN;
-  // Récupération des items
-  if ( !$matieres )
-    $requete = '';
-  elseif ( is_numeric($matieres) )
-    $requete = "WHERE matiere = $matieres".( ($autorisation) ? " AND protection <= $autorisation" : '' );
-  else
-    $requete = "WHERE matiere = $matieres AND protection <= $autorisation";
-  $resultat = $mysqli->query("SELECT UNIX_TIMESTAMP(heure) AS heure, titre, lien, texte, protection FROM recents $requete");
-  while ( $r = $resultat->fetch_assoc() )  {
-    $d = date(DATE_RSS,$r['heure']);
-    $titre = preg_replace('/^<.*span> /','',$r['titre']);
-    // Si non connecté et document protégé
-    if ( !$autorisation && $r['protection'] )
-      $texte = "<a href=\"http://${GLOBALS['site']}/${r['lien']}\">".strip_tags($r['titre']).'</a>';
-    else
-      $texte = preg_replace('/href="([^h])/',"href=\"http://${GLOBALS['site']}/\\1",$r['texte']);
-    $rss .= <<<FIN
+
+  // Log
+  $mois = date('Y-m');
+  $heure = date('d/m/Y à H:i:s');
+  if ( file_exists("documents/rss/log.$mois.php") )
+    $fichierlog = fopen("documents/rss/log.$mois.php",'ab');
+  else  {
+    $fichierlog = fopen("documents/rss/log.$mois.php",'wb');
+    fwrite($fichierlog,'<?php exit(); ?>');
+  }
+  fwrite($fichierlog, "\n-- Génération le $heure -- ".json_encode($matieres)."\n");
+
+  // Génération pour les différentes combinaisons autorisation-matières
+  foreach ( $combinaisons as $c )  {
+    list($autorisation,$matieres) = explode('|',$c);
+    $requete = ( $autorisation ) ? "FIND_IN_SET(matiere,'$matieres') AND protection <= $autorisation" : 'protection = 0';
+    $resultat = $mysqli->query("SELECT UNIX_TIMESTAMP(heure) AS heure, titre, lien, texte, protection FROM recents
+                                WHERE $requete AND DATEDIFF(NOW(),heure) < 60");
+    $rss = '';
+    if ( $resultat->num_rows )  {
+      while ( $r = $resultat->fetch_assoc() )  {
+        $d = date(DATE_RSS,$r['heure']);
+        $titre = preg_replace('/^<.*span> /','',$r['titre']);
+        $texte = preg_replace('/href="([^h])/',"href=\"$site/\\1",$r['texte']);
+        $rss .= <<<FIN
     <item>
       <title><![CDATA[$titre]]></title>
-      <link>http://${GLOBALS['site']}/${r['lien']}</link>
+      <link>$site/${r['lien']}</link>
       <guid isPermaLink="false">${r['heure']}</guid>
       <description><![CDATA[$texte]]></description>
       <pubDate>$d</pubDate>
@@ -212,19 +260,22 @@
 
 
 FIN;
-  }
-  $rss .= <<<FIN
-  </channel>
-</rss>
+      }
+      $resultat->free();
+    }
 
-FIN;
+    // Mise à jour du flux RSS
+    $rep = 'documents/rss/'.sha1("?!${GLOBALS['base']}$c");
+    if ( !is_dir($rep) )
+      mkdir($rep,0777,true);
+    $fichier = fopen($rep.'/rss.xml','wb');
+    fwrite($fichier, str_replace('REP',$rep,$preambule).$rss."  </channel>\n</rss>\n");
+    fclose($fichier);
 
-  // Mise à jour du flux RSS
-  if ( !is_dir($rep) )
-    mkdir($rep,0777,true);
-  $fichier = fopen($rep.'/rss.xml','wb');
-  fwrite($fichier, $rss);
-  fclose($fichier);
+    // Log
+    fwrite($fichierlog, "  $c $rep\n");
+  }
+  fclose($fichierlog);
 }
 
 ////////////
@@ -232,24 +283,27 @@
 ////////////
 
 // En-têtes HTML et début de page
-function debut($mysqli,$titre,$message,$autorisation,$actuel=false,$matiere=false)  {
+function debut($mysqli,$titre,$message,$autorisation,$actuel=false,$matiere=false,$css=false)  {
   // Menu seulement si $actuel non vide
   if ( $actuel )  {
     // Récupération et affichage des pages
     $menu = "<a class=\"icon-menu\" title=\"Afficher le menu\"></a>\n<div id=\"colonne\">\n  <nav>\n";
     $resultat = $mysqli->query('SELECT cle, nom FROM pages WHERE mat = 0 AND (id = 1 OR '. ( $autorisation ? "LEAST(protection,4) <= $autorisation" : 'protection < 5' ) .')');
     $r = $resultat->fetch_assoc();
-    // Page d'accueil
-    $menu .= "    <a class=\"icon-accueil\" href=\".?${r['cle']}\" title=\"${r['nom']}\"></a>\n";
-    // Impression et rss
-    $menu .= "    <a class=\"icon-imprime\" title=\"Imprimer cette page\" onclick=\"window.print();return false;\"></a>
-    <a class=\"icon-rss\" href=\"rss\" title=\"Voir les flux RSS disponibles\"></a>\n";
+    // Icônes principales (accueil, agenda, impression, rss)
+    $menu .= <<<FIN
+    <a class="icon-accueil" href=".?${r['cle']}" title="${r['nom']}"></a>
+    <a class="icon-agenda" href="agenda" title="Agenda"></a>
+    <a class="icon-imprime" title="Imprimer cette page" onclick="window.print();return false;"></a>
+    <a class="icon-rss" href="rss" title="Voir les flux RSS disponibles"></a>
+
+FIN;
     // Préférences (élèves, colleurs, professeurs)
     if ( $autorisation > 1 )
-      $menu .= "    <a class=\"icon-prefs\" title=\"Gérer ses préférences\" href=\"prefs\"></a>\n";
+      $menu .= "    <a class=\"icon-prefs\" href=\"prefs\" title=\"Gérer ses préférences\"></a>\n";
     // Mail (colleurs, professeurs)
     if ( $autorisation > 2 )
-      $menu .= "    <a class=\"icon-mail\" title=\"Envoyer un mail\" href=\"mail\"></a>\n";
+      $menu .= "    <a class=\"icon-mail\" href=\"mail\" title=\"Envoyer un mail\"></a>\n";
     // Connexion/Déconnexion
     $menu .= ( $autorisation ) ? "    <a class=\"icon-deconnexion\" title=\"Se déconnecter\"></a>\n    <hr>\n" : "    <a class=\"icon-connexion\" title=\"Se connecter\"></a>\n    <hr>\n";
     // Autres pages
@@ -367,6 +421,7 @@
     
   // RSS
   $rss = sha1($GLOBALS['base'].'00');
+  $rss = ( $autorisation ) ? sha1("?!${GLOBALS['base']}0|toutes") : sha1("?!${GLOBALS['base']}$autorisation|${_SESSION['matieres']}");
   // Message si non vide
   if ( strlen($message) )
     $message = "  <div class=\"warning\">$message</div>\n";
@@ -384,6 +439,8 @@
   $matiere = ( $matiere ) ? " data-matiere=\"$matiere\"" : '';
   // Titre dans le head : <span> pouvant indiquer la protection en mode édition
   $head = strtok($titre,'<');
+  // Fichiers CSS supplémentaires
+  $css = ( $css ) ? "\n  <link rel=\"stylesheet\" href=\"css/$css.min.css\">" : '';
   // Affichage
   echo <<<FIN
 <!doctype html>
@@ -392,8 +449,8 @@
   <title>$head</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
-  <link rel="stylesheet" href="css/style-min.css?v=3">
-  <link rel="stylesheet" href="css/icones-min.css?v=2">
+  <link rel="stylesheet" href="css/style.min.css">
+  <link rel="stylesheet" href="css/icones.min.css">$css
   <script type="text/javascript" src="js/jquery.min.js"></script>
   <link rel="alternate" type="application/rss+xml" title="Flux RSS" href="documents/rss/$rss/rss.xml">
   <!--[if lte IE 8]><script src="js/html5shiv.min.js"></script><![endif]--> 
@@ -417,11 +474,11 @@
 <script type="text/javascript" src="/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
 <script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax:{inlineMath:[["$","$"],["\\\\(","\\\\)"]]}});</script>' : '';
   // Édition possible si $edition est true
-  $js = ( $edition ) ? '<script type="text/javascript" src="js/edition-min.js?v=5"></script>' : '<script type="text/javascript" src="js/fonctions-min.js"></script>';
+  $js = ( $edition ) ? '<script type="text/javascript" src="js/edition.min.js"></script>' : '<script type="text/javascript" src="js/fonctions.min.js"></script>';
   // Affichage de message si $_SESSION['message']
   if ( isset($_SESSION['message']) )  {
     $m = json_decode($_SESSION['message'],true);
-    $m = "\n<script type=\"text/javascript\">$(window).load( function() { affiche(\"${m['message']}\",'${m['etat']}'); });</script>";
+    $m = "\n<script type=\"text/javascript\">$( function() { affiche(\"${m['message']}\",'${m['etat']}'); });</script>";
     unset($_SESSION['message']);
   }
   else
@@ -444,7 +501,7 @@
 function format_date($date)  {
   $semaine = array('dimanche','lundi','mardi','mercredi','jeudi','vendredi','samedi');
   $mois = array('','janvier','février','mars','avril','mai','juin','juillet','août','septembre','octobre','novembre','décembre');
-  return $semaine[substr($date,0,1)].' '.substr($date,7).' '.$mois[intval(substr($date,5,2))].' '.substr($date,1,4);
+  return $semaine[substr($date,0,1)].' '.substr($date,7).( ( substr($date,7) == '1' ) ? 'er' : '' ).' '.$mois[intval(substr($date,5,2))].' '.substr($date,1,4);
 }
 
 ?>
Binary files cahier-de-prepa5.1.0/fonts/icomoon.eot and cahier-de-prepa6.0.0/fonts/icomoon.eot differ
diff -urN cahier-de-prepa5.1.0/fonts/icomoon.svg cahier-de-prepa6.0.0/fonts/icomoon.svg
--- cahier-de-prepa5.1.0/fonts/icomoon.svg	2015-10-21 01:49:21.858635064 +0200
+++ cahier-de-prepa6.0.0/fonts/icomoon.svg	2016-07-25 23:25:24.406289625 +0200
@@ -80,4 +80,6 @@
 <glyph unicode="&#xe646;" glyph-name="lock3" d="M443.75 960c-112.928 0-204.813-91.885-204.813-204.813v-204.813h-17.063c-28.16 0-51.188-23.027-51.188-51.188v-512c0-28.16 23.028-51.188 51.188-51.188h580.25c28.16 0 51.188 23.028 51.188 51.188v512c0 28.16-23.028 51.188-51.188 51.188h-17.063v204.813c0 112.928-91.885 204.813-204.813 204.813h-136.5zM443.75 823.437h136.5c37.644 0 68.25-30.608 68.25-68.25v-204.813h-273.063v204.813c0 37.644 30.671 68.25 68.313 68.25zM492.313 512.375c29.386-0.001 54.72-3.532 76-10.625s38.757-17.265 52.438-30.438c14.186-12.667 24.6-27.83 31.188-45.563 7.093-17.227 10.625-36.227 10.625-57 0-24.32-6.82-46.122-20.5-65.375-13.174-19.254-30.408-33.929-51.688-44.063 27.36-9.627 49.891-25.582 67.625-47.875 18.24-22.294 27.375-50.915 27.375-85.875 0-23.307-4.081-45.108-12.188-65.375-8.107-19.76-20.53-36.994-37.25-51.688-16.72-14.187-37.973-25.574-63.813-34.188-25.334-8.107-55.721-12.187-91.188-12.188-13.68 0-27.869 1.036-42.563 3.063-14.187 1.52-27.889 3.773-41.063 6.813-12.667 2.533-24.298 5.335-34.938 8.375-10.64 3.547-18.739 6.835-24.313 9.875l18.188 78.313c10.64-5.067 26.108-10.913 46.375-17.5 20.267-6.080 45.357-9.125 75.25-9.125 40.026 0 68.891 7.612 86.625 22.813 17.733 15.707 26.625 36.472 26.625 62.313 0 16.72-3.532 30.666-10.625 41.813-6.587 11.146-15.965 19.976-28.125 26.563-11.654 7.093-25.356 11.904-41.063 14.438-15.2 3.040-31.399 4.562-48.625 4.563h-31.188v74.5h38c11.653 0 23.346 1.036 35 3.063 12.16 2.533 23.061 6.551 32.688 12.125 9.626 6.080 17.482 13.935 23.563 23.563s9.062 22.050 9.063 37.25c0 12.16-2.253 22.511-6.813 31.125s-10.65 15.739-18.25 21.313c-7.094 5.573-15.436 9.654-25.063 12.188s-19.798 3.75-30.438 3.75c-22.8 0-43.017-3.532-60.75-10.625-17.733-6.587-33.445-14.2-47.125-22.813l-33.438 68.438c7.093 4.56 15.679 9.37 25.813 14.438 10.133 5.066 21.277 9.877 33.438 14.438 12.667 4.559 26.126 8.091 40.313 10.625 14.187 3.039 29.106 4.562 44.813 4.563z" />
 <glyph unicode="&#xe647;" glyph-name="lock4" d="M443.75 960c-112.928 0-204.813-91.885-204.813-204.813v-204.813h-17.063c-28.16 0-51.188-23.027-51.188-51.188v-512c0-28.16 23.028-51.188 51.188-51.188h580.25c28.16 0 51.188 23.028 51.188 51.188v512c0 28.16-23.028 51.188-51.188 51.188h-17.063v204.813c0 112.928-91.885 204.813-204.813 204.813h-136.5zM443.75 823.437h136.5c37.644 0 68.25-30.608 68.25-68.25v-204.813h-273.063v204.813c0 37.644 30.671 68.25 68.313 68.25zM559.938 500.187h87.438v-325.25h59.25v-75.25h-59.25v-126.125h-89.688v126.125h-231.063v65.375c10.133 22.293 23.592 47.87 40.313 76.75 17.227 28.88 36.227 58.537 57 88.938s42.818 60.3 66.125 89.688c23.306 29.386 46.568 55.936 69.875 79.75zM557.688 387c-12.16-14.694-24.827-30.405-38-47.125-12.667-16.72-25.090-34.198-37.25-52.438s-23.791-36.997-34.938-56.25c-11.147-18.747-21.318-37.504-30.438-56.25h140.625v212.063z" />
 <glyph unicode="&#xe648;" glyph-name="lock5" d="M443.75 960c-112.928 0-204.813-91.885-204.813-204.813v-204.813h-17.063c-28.16 0-51.188-23.027-51.188-51.188v-512c0-28.16 23.028-51.188 51.188-51.188h580.25c28.16 0 51.188 23.028 51.188 51.188v512c0 28.16-23.028 51.188-51.188 51.188h-17.063v204.813c0 112.928-91.885 204.813-204.813 204.813h-136.5zM443.75 823.437h136.5c37.644 0 68.25-30.608 68.25-68.25v-204.813h-273.063v204.813c0 37.644 30.671 68.25 68.313 68.25zM398.063 500.187h269.063v-77.5h-190.75c-0.507-8.614-1.299-18.479-2.313-29.625-0.507-10.64-1.237-21.541-2.25-32.688-0.507-11.147-1.299-21.805-2.313-31.938s-1.987-18.72-3-25.813c74.986-4.054 130.221-21.288 165.688-51.688 35.973-29.894 53.937-70.939 53.938-123.125 0-23.813-4.081-45.858-12.188-66.125s-20.468-37.744-37.188-52.438c-16.72-14.693-37.792-26.324-63.125-34.938-25.334-8.107-54.929-12.187-88.875-12.188-13.68 0-27.626 1.036-41.813 3.063s-27.889 4.523-41.063 7.563c-12.667 2.533-24.054 5.335-34.188 8.375s-17.746 5.842-22.813 8.375l17.5 77.5c10.64-5.067 25.802-10.608 45.563-16.688 20.267-5.573 44.87-8.375 73.75-8.375 19.76 0 36.751 2.009 50.938 6.063 14.186 4.56 25.574 10.65 34.188 18.25 9.12 7.6 15.696 16.186 19.75 25.813 4.053 10.133 6.062 20.791 6.063 31.938 0 16.72-3.289 31.701-9.875 44.875s-18.218 24.317-34.938 33.438c-16.214 9.12-38.259 15.94-66.125 20.5-27.36 4.56-62.072 6.812-104.125 6.813 5.573 48.64 9.897 94.801 12.938 138.375 3.040 44.080 5.536 88.107 7.563 132.188z" />
+<glyph unicode="&#xe649;" glyph-name="agenda" d="M320 576h128v-128h-128zM512 576h128v-128h-128zM704 576h128v-128h-128zM128 192h128v-128h-128zM320 192h128v-128h-128zM512 192h128v-128h-128zM320 384h128v-128h-128zM512 384h128v-128h-128zM704 384h128v-128h-128zM128 384h128v-128h-128zM832 960v-64h-128v64h-448v-64h-128v64h-128v-1024h960v1024h-128zM896 0h-832v704h832v-704z" />
+<glyph unicode="&#xe64a;" glyph-name="ajout-colle" d="M992 576h-352v352c0 17.672-14.328 32-32 32h-192c-17.672 0-32-14.328-32-32v-352h-352c-17.672 0-32-14.328-32-32v-192c0-17.672 14.328-32 32-32h352v-352c0-17.672 14.328-32 32-32h192c17.672 0 32 14.328 32 32v352h352c17.672 0 32 14.328 32 32v192c0 17.672-14.328 32-32 32zM958.454 190.145c0 0-24.773 46.503-83.81 47.377-36.65 0.543-102.27-30.681-102.19-112.544 0.084-86.010 69.942-113.203 102.686-112.398 27.915 0.686 61.171 12.84 84.039 48.86 0.229-22.411-0.509-46.731 0.108-69.597-23.462-14.295-50.084-34.075-104.461-31.33-85.844 4.334-149.030 79.244-149.945 165.399-1.114 104.9 86.806 157.013 130.992 162.992 61.646 8.341 102.132-15.219 122.256-31.709 0.274-38.882 0.323-67.049 0.323-67.049z" />
 </font></defs></svg>
\ No newline at end of file
Binary files cahier-de-prepa5.1.0/fonts/icomoon.ttf and cahier-de-prepa6.0.0/fonts/icomoon.ttf differ
Binary files cahier-de-prepa5.1.0/fonts/icomoon.woff and cahier-de-prepa6.0.0/fonts/icomoon.woff differ
diff -urN cahier-de-prepa5.1.0/index.php cahier-de-prepa6.0.0/index.php
--- cahier-de-prepa5.1.0/index.php	2015-10-27 18:16:03.279877757 +0100
+++ cahier-de-prepa6.0.0/index.php	2016-08-30 11:45:20.905130342 +0200
@@ -67,6 +67,45 @@
 // MathJax désactivé par défaut
 $mathjax = false;
 
+// Agenda éventuel
+$resultat = $mysqli->query('SELECT val FROM prefs WHERE nom=\'nb_agenda_index\' OR nom=\'protection_agenda\' ORDER BY nom');
+$r = $resultat->fetch_row();
+$n = $r[0];
+$r = $resultat->fetch_row();
+$resultat->free();
+if ( $autorisation >= $r[0] )  {
+  $resultat = $mysqli->query('SELECT m.nom AS matiere, t.nom AS type, texte,
+                            DATE_FORMAT(debut,\'%w%Y%m%e\') AS d, DATE_FORMAT(fin,\'%w%Y%m%e\') AS f,
+                            DATE_FORMAT(debut,\'%kh%i\') AS hd, DATE_FORMAT(fin,\'%kh%i\') AS hf
+                            FROM agenda AS a JOIN `agenda-types` AS t ON a.type = t.id LEFT JOIN matieres AS m ON a.matiere = m.id
+                            WHERE NOW() <= fin AND ADDDATE(NOW(),7) >= debut ORDER BY debut,fin LIMIT '.$n);
+  if ( $resultat->num_rows )  {
+    echo "\n  <h2><a href=\"agenda\" title=\"Afficher l'agenda du mois\" style=\"text-decoration: none;\"><span class=\"icon-agenda\"></span></a>&nbsp;Prochains événements</h2>\n\n  <article>";
+    while ( $r = $resultat->fetch_assoc() )  {
+      // Événement sur un seul jour
+      if ( ( $d = $r['d'] ) == ( $f = $r['f'] ) )  {
+        $date = substr(ucfirst(format_date($d)),0,-5);
+        if ( ( $hd = $r['hd'] ) != '0h00' )
+          $date .= ( $hd == $r['hf'] ) ? ' à '.str_replace('00','',$hd) : ' de '.str_replace('00','',$hd).' à '.str_replace('00','',$r['hf']);
+      }
+      // Événement sur plusieurs jours
+      else  {
+        if ( ( $hd = $r['hd'] ) == '0h00' )
+          $date = 'Du '.substr(format_date($d),0,-5).' au '.substr(format_date($f),0,-5);
+        else
+          $date = 'Du '.substr(format_date($d),0,-5).' à '.str_replace('00','',$r['hd']).' au '.substr(format_date($f),0,-5).' à '.str_replace('00','',$r['hf']);
+      }
+      $titre = ( strlen($r['matiere']) ) ? "${r['type']} en ${r['matiere']}" : $r['type'];
+      echo "\n  <h3>$date&nbsp;: $titre</h3>\n";
+      if ( strlen($r['texte']) )
+        echo "  <p>${r['texte']}</p>\n";
+    }
+    $resultat->free();
+    echo "  </article>\n\n";
+  }
+}
+
+
 // Affichage public sans édition
 if ( !$edition )  {
   // Affichage des informations diffusées
Binary files cahier-de-prepa5.1.0/js/calendar-blue.gif and cahier-de-prepa6.0.0/js/calendar-blue.gif differ
diff -urN cahier-de-prepa5.1.0/js/colpick.js cahier-de-prepa6.0.0/js/colpick.js
--- cahier-de-prepa5.1.0/js/colpick.js	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/js/colpick.js	2016-08-24 22:07:34.417132180 +0200
@@ -0,0 +1,525 @@
+/*
+colpick Color Picker
+Copyright 2013 Jose Vargas. Licensed under GPL license. Based on Stefan Petre's Color Picker www.eyecon.ro, dual licensed under the MIT and GPL licenses
+
+For usage and examples: colpick.com/plugin
+ */
+
+(function ($) {
+	var colpick = function () {
+		var
+			tpl = '<div class="colpick"><div class="colpick_color"><div class="colpick_color_overlay1"><div class="colpick_color_overlay2"><div class="colpick_selector_outer"><div class="colpick_selector_inner"></div></div></div></div></div><div class="colpick_hue"><div class="colpick_hue_arrs"><div class="colpick_hue_larr"></div><div class="colpick_hue_rarr"></div></div></div><div class="colpick_new_color"></div><div class="colpick_current_color"></div><div class="colpick_hex_field"><div class="colpick_field_letter">#</div><input type="text" maxlength="6" size="6" /></div><div class="colpick_rgb_r colpick_field"><div class="colpick_field_letter">R</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_g colpick_field"><div class="colpick_field_letter">G</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_h colpick_field"><div class="colpick_field_letter">H</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_s colpick_field"><div class="colpick_field_letter">S</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_submit"></div></div>',
+			defaults = {
+				showEvent: 'focus',
+				onShow: function () {},
+				onBeforeShow: function(){},
+				onHide: function () {},
+				onChange: function (hsb,hex,rgb,el,bySetColor) { $(el).css('background-color','#'+hex).val(hex); },
+				onSubmit: function () {},
+//				colorScheme: 'light',
+				color: 'ffffff',
+				livePreview: true,
+				flat: false,
+				layout: 'rgbhex',
+				submit: 0,
+				submitText: 'OK',
+				height: 156
+			},
+			//Fill the inputs of the plugin
+			fillRGBFields = function  (hsb, cal) {
+				var rgb = hsbToRgb(hsb);
+				$(cal).data('colpick').fields
+					.eq(1).val(rgb.r).end()
+					.eq(2).val(rgb.g).end()
+					.eq(3).val(rgb.b).end();
+			},
+			fillHSBFields = function  (hsb, cal) {
+				$(cal).data('colpick').fields
+					.eq(4).val(Math.round(hsb.h)).end()
+					.eq(5).val(Math.round(hsb.s)).end()
+					.eq(6).val(Math.round(hsb.b)).end();
+			},
+			fillHexFields = function (hsb, cal) {
+				$(cal).data('colpick').fields.eq(0).val(hsbToHex(hsb));
+			},
+			//Set the round selector position
+			setSelector = function (hsb, cal) {
+				$(cal).data('colpick').selector.css('backgroundColor', '#' + hsbToHex({h: hsb.h, s: 100, b: 100}));
+				$(cal).data('colpick').selectorIndic.css({
+					left: parseInt($(cal).data('colpick').height * hsb.s/100, 10),
+					top: parseInt($(cal).data('colpick').height * (100-hsb.b)/100, 10)
+				});
+			},
+			//Set the hue selector position
+			setHue = function (hsb, cal) {
+				$(cal).data('colpick').hue.css('top', parseInt($(cal).data('colpick').height - $(cal).data('colpick').height * hsb.h/360, 10));
+			},
+			//Set current and new colors
+			setCurrentColor = function (hsb, cal) {
+				$(cal).data('colpick').currentColor.css('backgroundColor', '#' + hsbToHex(hsb));
+			},
+			setNewColor = function (hsb, cal) {
+				$(cal).data('colpick').newColor.css('backgroundColor', '#' + hsbToHex(hsb));
+			},
+			//Called when the new color is changed
+			change = function (ev) {
+				var cal = $(this).parent().parent(), col;
+				if (this.parentNode.className.indexOf('_hex') > 0) {
+					cal.data('colpick').color = col = hexToHsb(fixHex(this.value));
+					fillRGBFields(col, cal.get(0));
+					fillHSBFields(col, cal.get(0));
+				} else if (this.parentNode.className.indexOf('_hsb') > 0) {
+					cal.data('colpick').color = col = fixHSB({
+						h: parseInt(cal.data('colpick').fields.eq(4).val(), 10),
+						s: parseInt(cal.data('colpick').fields.eq(5).val(), 10),
+						b: parseInt(cal.data('colpick').fields.eq(6).val(), 10)
+					});
+					fillRGBFields(col, cal.get(0));
+					fillHexFields(col, cal.get(0));
+				} else {
+					cal.data('colpick').color = col = rgbToHsb(fixRGB({
+						r: parseInt(cal.data('colpick').fields.eq(1).val(), 10),
+						g: parseInt(cal.data('colpick').fields.eq(2).val(), 10),
+						b: parseInt(cal.data('colpick').fields.eq(3).val(), 10)
+					}));
+					fillHexFields(col, cal.get(0));
+					fillHSBFields(col, cal.get(0));
+				}
+				setSelector(col, cal.get(0));
+				setHue(col, cal.get(0));
+				setNewColor(col, cal.get(0));
+				cal.data('colpick').onChange.apply(cal.parent(), [col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el, 0]);
+			},
+			//Change style on blur and on focus of inputs
+			blur = function (ev) {
+				$(this).parent().removeClass('colpick_focus');
+			},
+			focus = function () {
+				$(this).parent().parent().data('colpick').fields.parent().removeClass('colpick_focus');
+				$(this).parent().addClass('colpick_focus');
+			},
+			//Increment/decrement arrows functions
+			downIncrement = function (ev) {
+				ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
+				var field = $(this).parent().find('input').focus();
+				var current = {
+					el: $(this).parent().addClass('colpick_slider'),
+					max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
+					y: ev.pageY,
+					field: field,
+					val: parseInt(field.val(), 10),
+					preview: $(this).parent().parent().data('colpick').livePreview
+				};
+				$(document).mouseup(current, upIncrement);
+				$(document).mousemove(current, moveIncrement);
+			},
+			moveIncrement = function (ev) {
+				ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val - ev.pageY + ev.data.y, 10))));
+				if (ev.data.preview) {
+					change.apply(ev.data.field.get(0), [true]);
+				}
+				return false;
+			},
+			upIncrement = function (ev) {
+				change.apply(ev.data.field.get(0), [true]);
+				ev.data.el.removeClass('colpick_slider').find('input').focus();
+				$(document).off('mouseup', upIncrement);
+				$(document).off('mousemove', moveIncrement);
+				return false;
+			},
+			//Hue slider functions
+			downHue = function (ev) {
+				ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
+				var current = {
+					cal: $(this).parent(),
+					y: $(this).offset().top
+				};
+				$(document).on('mouseup touchend',current,upHue);
+				$(document).on('mousemove touchmove',current,moveHue);
+				
+				var pageY = ((ev.type == 'touchstart') ? ev.originalEvent.changedTouches[0].pageY : ev.pageY );
+				change.apply(
+					current.cal.data('colpick')
+					.fields.eq(4).val(parseInt(360*(current.cal.data('colpick').height - (pageY - current.y))/current.cal.data('colpick').height, 10))
+						.get(0),
+					[current.cal.data('colpick').livePreview]
+				);
+				return false;
+			},
+			moveHue = function (ev) {
+				var pageY = ((ev.type == 'touchmove') ? ev.originalEvent.changedTouches[0].pageY : ev.pageY );
+				change.apply(
+					ev.data.cal.data('colpick')
+					.fields.eq(4).val(parseInt(360*(ev.data.cal.data('colpick').height - Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageY - ev.data.y))))/ev.data.cal.data('colpick').height, 10))
+						.get(0),
+					[ev.data.preview]
+				);
+				return false;
+			},
+			upHue = function (ev) {
+				fillRGBFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
+				fillHexFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
+				$(document).off('mouseup touchend',upHue);
+				$(document).off('mousemove touchmove',moveHue);
+				return false;
+			},
+			//Color selector functions
+			downSelector = function (ev) {
+				ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
+				var current = {
+					cal: $(this).parent(),
+					pos: $(this).offset()
+				};
+				current.preview = current.cal.data('colpick').livePreview;
+				
+				$(document).on('mouseup touchend',current,upSelector);
+				$(document).on('mousemove touchmove',current,moveSelector);
+
+				var payeX,pageY;
+				if(ev.type == 'touchstart') {
+					pageX = ev.originalEvent.changedTouches[0].pageX,
+					pageY = ev.originalEvent.changedTouches[0].pageY;
+				} else {
+					pageX = ev.pageX;
+					pageY = ev.pageY;
+				}
+
+				change.apply(
+					current.cal.data('colpick').fields
+					.eq(6).val(parseInt(100*(current.cal.data('colpick').height - (pageY - current.pos.top))/current.cal.data('colpick').height, 10)).end()
+					.eq(5).val(parseInt(100*(pageX - current.pos.left)/current.cal.data('colpick').height, 10))
+					.get(0),
+					[current.preview]
+				);
+				return false;
+			},
+			moveSelector = function (ev) {
+				var payeX,pageY;
+				if(ev.type == 'touchmove') {
+					pageX = ev.originalEvent.changedTouches[0].pageX,
+					pageY = ev.originalEvent.changedTouches[0].pageY;
+				} else {
+					pageX = ev.pageX;
+					pageY = ev.pageY;
+				}
+
+				change.apply(
+					ev.data.cal.data('colpick').fields
+					.eq(6).val(parseInt(100*(ev.data.cal.data('colpick').height - Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageY - ev.data.pos.top))))/ev.data.cal.data('colpick').height, 10)).end()
+					.eq(5).val(parseInt(100*(Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageX - ev.data.pos.left))))/ev.data.cal.data('colpick').height, 10))
+					.get(0),
+					[ev.data.preview]
+				);
+				return false;
+			},
+			upSelector = function (ev) {
+				fillRGBFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
+				fillHexFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
+				$(document).off('mouseup touchend',upSelector);
+				$(document).off('mousemove touchmove',moveSelector);
+				return false;
+			},
+			//Submit button
+			clickSubmit = function (ev) {
+				var cal = $(this).parent();
+				var col = cal.data('colpick').color;
+				cal.data('colpick').origColor = col;
+				setCurrentColor(col, cal.get(0));
+				cal.data('colpick').onSubmit(col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el);
+			},
+			//Show/hide the color picker
+			show = function (ev) {
+				// Prevent the trigger of any direct parent
+				ev.stopPropagation();
+				var cal = $('#' + $(this).data('colpickId'));
+				cal.data('colpick').onBeforeShow.apply(this, [cal.get(0)]);
+				var pos = $(this).offset();
+				var top = pos.top + this.offsetHeight;
+				var left = pos.left;
+				var viewPort = getViewport();
+				var calW = cal.width();
+				if (left + calW > viewPort.l + viewPort.w) {
+					left -= calW;
+				}
+				cal.css({left: left + 'px', top: top + 'px'});
+				if (cal.data('colpick').onShow.apply(this, [cal.get(0)]) != false) {
+					cal.show();
+				}
+				//Hide when user clicks outside
+				$('html').mousedown({cal:cal}, hide);
+				cal.mousedown(function(ev){ev.stopPropagation();})
+			},
+			hide = function (ev) {
+				if (ev.data.cal.data('colpick').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
+					ev.data.cal.hide();
+				}
+				$('html').off('mousedown', hide);
+			},
+			getViewport = function () {
+				var m = document.compatMode == 'CSS1Compat';
+				return {
+					l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
+					w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth)
+				};
+			},
+			//Fix the values if the user enters a negative or high value
+			fixHSB = function (hsb) {
+				return {
+					h: Math.min(360, Math.max(0, hsb.h)),
+					s: Math.min(100, Math.max(0, hsb.s)),
+					b: Math.min(100, Math.max(0, hsb.b))
+				};
+			}, 
+			fixRGB = function (rgb) {
+				return {
+					r: Math.min(255, Math.max(0, rgb.r)),
+					g: Math.min(255, Math.max(0, rgb.g)),
+					b: Math.min(255, Math.max(0, rgb.b))
+				};
+			},
+			fixHex = function (hex) {
+				var len = 6 - hex.length;
+				if (len > 0) {
+					var o = [];
+					for (var i=0; i<len; i++) {
+						o.push('0');
+					}
+					o.push(hex);
+					hex = o.join('');
+				}
+				return hex;
+			},
+			restoreOriginal = function () {
+				var cal = $(this).parent();
+				var col = cal.data('colpick').origColor;
+				cal.data('colpick').color = col;
+				fillRGBFields(col, cal.get(0));
+				fillHexFields(col, cal.get(0));
+				fillHSBFields(col, cal.get(0));
+				setSelector(col, cal.get(0));
+				setHue(col, cal.get(0));
+				setNewColor(col, cal.get(0));
+			};
+		return {
+			init: function (opt) {
+				opt = $.extend({}, defaults, opt||{});
+				//Set color
+				if (typeof opt.color == 'string') {
+					opt.color = hexToHsb(opt.color);
+				// } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
+					// opt.color = rgbToHsb(opt.color);
+				// } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
+					// opt.color = fixHSB(opt.color);
+				} else {
+					return this;
+				}
+				
+				//For each selected DOM element
+        return this.each(function () {
+          var v = this.value;
+          if (typeof v == 'string' && v.length )  {
+            opt.color = hexToHsb(v);
+            $(this).css('background-color','#'+v);
+          }
+					//If the element does not have an ID
+					if (!$(this).data('colpickId')) {
+						var options = $.extend({}, opt);
+						options.origColor = opt.color;
+						//Generate and assign a random ID
+						var id = 'colorpicker_' + parseInt(Math.random() * 1000);
+						$(this).data('colpickId', id);
+						//Set the tpl's ID and get the HTML
+						var cal = $(tpl).attr('id', id);
+						//Add class according to layout
+						cal.addClass('colpick_'+options.layout+(options.submit?'':' colpick_'+options.layout+'_ns'));
+						//Add class if the color scheme is not default
+						// if(options.colorScheme != 'light') {
+							// cal.addClass('colpick_'+options.colorScheme);
+						// }
+						//Setup submit button
+						cal.find('div.colpick_submit').html(options.submitText).click(clickSubmit);
+						//Setup input fields
+						options.fields = cal.find('input').change(change).blur(blur).focus(focus);
+						cal.find('div.colpick_field_arrs').mousedown(downIncrement).end().find('div.colpick_current_color').click(restoreOriginal);
+						//Setup hue selector
+						options.selector = cal.find('div.colpick_color').on('mousedown touchstart',downSelector);
+						options.selectorIndic = options.selector.find('div.colpick_selector_outer');
+						//Store parts of the plugin
+						options.el = this;
+						options.hue = cal.find('div.colpick_hue_arrs');
+						huebar = options.hue.parent();
+						//Paint the hue bar
+						var UA = navigator.userAgent.toLowerCase();
+						var isIE = navigator.appName === 'Microsoft Internet Explorer';
+						var IEver = isIE ? parseFloat( UA.match( /msie ([0-9]{1,}[\.0-9]{0,})/ )[1] ) : 0;
+						var ngIE = ( isIE && IEver < 10 );
+						var stops = ['#ff0000','#ff0080','#ff00ff','#8000ff','#0000ff','#0080ff','#00ffff','#00ff80','#00ff00','#80ff00','#ffff00','#ff8000','#ff0000'];
+						if(ngIE) {
+							var i, div;
+							for(i=0; i<=11; i++) {
+								div = $('<div></div>').attr('style','height:8.333333%; filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+stops[i]+', endColorstr='+stops[i+1]+'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+stops[i]+', endColorstr='+stops[i+1]+')";');
+								huebar.append(div);
+							}
+						} else {
+							stopList = stops.join(',');
+							huebar.attr('style','background:-webkit-linear-gradient(top,'+stopList+'); background: -o-linear-gradient(top,'+stopList+'); background: -ms-linear-gradient(top,'+stopList+'); background:-moz-linear-gradient(top,'+stopList+'); -webkit-linear-gradient(top,'+stopList+'); background:linear-gradient(to bottom,'+stopList+'); ');
+						}
+						cal.find('div.colpick_hue').on('mousedown touchstart',downHue);
+						options.newColor = cal.find('div.colpick_new_color');
+						options.currentColor = cal.find('div.colpick_current_color');
+						//Store options and fill with default color
+						cal.data('colpick', options);
+						fillRGBFields(options.color, cal.get(0));
+						fillHSBFields(options.color, cal.get(0));
+						fillHexFields(options.color, cal.get(0));
+						setHue(options.color, cal.get(0));
+						setSelector(options.color, cal.get(0));
+						setCurrentColor(options.color, cal.get(0));
+						setNewColor(options.color, cal.get(0));
+						//Append to body if flat=false, else show in place
+						if (options.flat) {
+							cal.appendTo(this).show();
+							cal.css({
+								position: 'relative',
+								display: 'block'
+							});
+						} else {
+							cal.appendTo(document.body);
+							$(this).on(options.showEvent, show);
+							cal.css({
+								position:'absolute'
+							});
+						}
+					}
+				});
+			},
+			//Shows the picker
+			showPicker: function() {
+				return this.each( function () {
+					if ($(this).data('colpickId')) {
+						show.apply(this);
+					}
+				});
+			},
+			//Hides the picker
+			hidePicker: function() {
+				return this.each( function () {
+					if ($(this).data('colpickId')) {
+						$('#' + $(this).data('colpickId')).hide();
+					}
+				});
+			},
+			//Sets a color as new and current (default)
+			setColor: function(col, setCurrent) {
+				setCurrent = (typeof setCurrent === "undefined") ? 1 : setCurrent;
+				if (typeof col == 'string') {
+					col = hexToHsb(col);
+				} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
+					col = rgbToHsb(col);
+				} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
+					col = fixHSB(col);
+				} else {
+					return this;
+				}
+				return this.each(function(){
+					if ($(this).data('colpickId')) {
+						var cal = $('#' + $(this).data('colpickId'));
+						cal.data('colpick').color = col;
+						cal.data('colpick').origColor = col;
+						fillRGBFields(col, cal.get(0));
+						fillHSBFields(col, cal.get(0));
+						fillHexFields(col, cal.get(0));
+						setHue(col, cal.get(0));
+						setSelector(col, cal.get(0));
+						
+						setNewColor(col, cal.get(0));
+						cal.data('colpick').onChange.apply(cal.parent(), [col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el, 1]);
+						if(setCurrent) {
+							setCurrentColor(col, cal.get(0));
+						}
+					}
+				});
+			}
+		};
+	}();
+	//Color space convertions
+	var hexToRgb = function (hex) {
+		var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
+		return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
+	};
+	var hexToHsb = function (hex) {
+		return rgbToHsb(hexToRgb(hex));
+	};
+	var rgbToHsb = function (rgb) {
+		var hsb = {h: 0, s: 0, b: 0};
+		var min = Math.min(rgb.r, rgb.g, rgb.b);
+		var max = Math.max(rgb.r, rgb.g, rgb.b);
+		var delta = max - min;
+		hsb.b = max;
+		hsb.s = max != 0 ? 255 * delta / max : 0;
+		if (hsb.s != 0) {
+			if (rgb.r == max) hsb.h = (rgb.g - rgb.b) / delta;
+			else if (rgb.g == max) hsb.h = 2 + (rgb.b - rgb.r) / delta;
+			else hsb.h = 4 + (rgb.r - rgb.g) / delta;
+		} else hsb.h = -1;
+		hsb.h *= 60;
+		if (hsb.h < 0) hsb.h += 360;
+		hsb.s *= 100/255;
+		hsb.b *= 100/255;
+		return hsb;
+	};
+	var hsbToRgb = function (hsb) {
+		var rgb = {};
+		var h = hsb.h;
+		var s = hsb.s*255/100;
+		var v = hsb.b*255/100;
+		if(s == 0) {
+			rgb.r = rgb.g = rgb.b = v;
+		} else {
+			var t1 = v;
+			var t2 = (255-s)*v/255;
+			var t3 = (t1-t2)*(h%60)/60;
+			if(h==360) h = 0;
+			if(h<60) {rgb.r=t1;	rgb.b=t2; rgb.g=t2+t3}
+			else if(h<120) {rgb.g=t1; rgb.b=t2;	rgb.r=t1-t3}
+			else if(h<180) {rgb.g=t1; rgb.r=t2;	rgb.b=t2+t3}
+			else if(h<240) {rgb.b=t1; rgb.r=t2;	rgb.g=t1-t3}
+			else if(h<300) {rgb.b=t1; rgb.g=t2;	rgb.r=t2+t3}
+			else if(h<360) {rgb.r=t1; rgb.g=t2;	rgb.b=t1-t3}
+			else {rgb.r=0; rgb.g=0;	rgb.b=0}
+		}
+		return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
+	};
+	var rgbToHex = function (rgb) {
+		var hex = [
+			rgb.r.toString(16),
+			rgb.g.toString(16),
+			rgb.b.toString(16)
+		];
+		$.each(hex, function (nr, val) {
+			if (val.length == 1) {
+				hex[nr] = '0' + val;
+			}
+		});
+		return hex.join('');
+	};
+	var hsbToHex = function (hsb) {
+		return rgbToHex(hsbToRgb(hsb));
+	};
+	$.fn.extend({
+		colpick: colpick.init,
+		colpickHide: colpick.hidePicker,
+		colpickShow: colpick.showPicker,
+		colpickSetColor: colpick.setColor
+	});
+	$.extend({
+		colpick:{ 
+			rgbToHex: rgbToHex,
+			rgbToHsb: rgbToHsb,
+			hsbToHex: hsbToHex,
+			hsbToRgb: hsbToRgb,
+			hexToHsb: hexToHsb,
+			hexToRgb: hexToRgb
+		}
+	});
+})(jQuery);
diff -urN cahier-de-prepa5.1.0/js/colpick.min.js cahier-de-prepa6.0.0/js/colpick.min.js
--- cahier-de-prepa5.1.0/js/colpick.min.js	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/js/colpick.min.js	2016-08-24 22:08:49.593888686 +0200
@@ -0,0 +1,6 @@
+/*
+colpick Color Picker
+Copyright 2013 Jose Vargas. Licensed under GPL license. Based on Stefan Petre's Color Picker www.eyecon.ro, dual licensed under the MIT and GPL licenses
+
+For usage and examples: colpick.com/plugin
+ */(function(e){var t=function(){var t='<div class="colpick"><div class="colpick_color"><div class="colpick_color_overlay1"><div class="colpick_color_overlay2"><div class="colpick_selector_outer"><div class="colpick_selector_inner"></div></div></div></div></div><div class="colpick_hue"><div class="colpick_hue_arrs"><div class="colpick_hue_larr"></div><div class="colpick_hue_rarr"></div></div></div><div class="colpick_new_color"></div><div class="colpick_current_color"></div><div class="colpick_hex_field"><div class="colpick_field_letter">#</div><input type="text" maxlength="6" size="6" /></div><div class="colpick_rgb_r colpick_field"><div class="colpick_field_letter">R</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_g colpick_field"><div class="colpick_field_letter">G</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_h colpick_field"><div class="colpick_field_letter">H</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_s colpick_field"><div class="colpick_field_letter">S</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_submit"></div></div>',n={showEvent:"focus",onShow:function(){},onBeforeShow:function(){},onHide:function(){},onChange:function(t,n,r,i,s){e(i).css("background-color","#"+n).val(n)},onSubmit:function(){},color:"ffffff",livePreview:!0,flat:!1,layout:"rgbhex",submit:0,submitText:"OK",height:156},o=function(t,n){var r=s(t);e(n).data("colpick").fields.eq(1).val(r.r).end().eq(2).val(r.g).end().eq(3).val(r.b).end()},a=function(t,n){e(n).data("colpick").fields.eq(4).val(Math.round(t.h)).end().eq(5).val(Math.round(t.s)).end().eq(6).val(Math.round(t.b)).end()},f=function(t,n){e(n).data("colpick").fields.eq(0).val(u(t))},l=function(t,n){e(n).data("colpick").selector.css("backgroundColor","#"+u({h:t.h,s:100,b:100})),e(n).data("colpick").selectorIndic.css({left:parseInt(e(n).data("colpick").height*t.s/100,10),top:parseInt(e(n).data("colpick").height*(100-t.b)/100,10)})},c=function(t,n){e(n).data("colpick").hue.css("top",parseInt(e(n).data("colpick").height-e(n).data("colpick").height*t.h/360,10))},h=function(t,n){e(n).data("colpick").currentColor.css("backgroundColor","#"+u(t))},p=function(t,n){e(n).data("colpick").newColor.css("backgroundColor","#"+u(t))},d=function(t){var n=e(this).parent().parent(),h;this.parentNode.className.indexOf("_hex")>0?(n.data("colpick").color=h=r(_(this.value)),o(h,n.get(0)),a(h,n.get(0))):this.parentNode.className.indexOf("_hsb")>0?(n.data("colpick").color=h=O({h:parseInt(n.data("colpick").fields.eq(4).val(),10),s:parseInt(n.data("colpick").fields.eq(5).val(),10),b:parseInt(n.data("colpick").fields.eq(6).val(),10)}),o(h,n.get(0)),f(h,n.get(0))):(n.data("colpick").color=h=i(M({r:parseInt(n.data("colpick").fields.eq(1).val(),10),g:parseInt(n.data("colpick").fields.eq(2).val(),10),b:parseInt(n.data("colpick").fields.eq(3).val(),10)})),f(h,n.get(0)),a(h,n.get(0))),l(h,n.get(0)),c(h,n.get(0)),p(h,n.get(0)),n.data("colpick").onChange.apply(n.parent(),[h,u(h),s(h),n.data("colpick").el,0])},v=function(t){e(this).parent().removeClass("colpick_focus")},m=function(){e(this).parent().parent().data("colpick").fields.parent().removeClass("colpick_focus"),e(this).parent().addClass("colpick_focus")},g=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e(this).parent().find("input").focus(),r={el:e(this).parent().addClass("colpick_slider"),max:this.parentNode.className.indexOf("_hsb_h")>0?360:this.parentNode.className.indexOf("_hsb")>0?100:255,y:t.pageY,field:n,val:parseInt(n.val(),10),preview:e(this).parent().parent().data("colpick").livePreview};e(document).mouseup(r,b),e(document).mousemove(r,y)},y=function(e){return e.data.field.val(Math.max(0,Math.min(e.data.max,parseInt(e.data.val-e.pageY+e.data.y,10)))),e.data.preview&&d.apply(e.data.field.get(0),[!0]),!1},b=function(t){return d.apply(t.data.field.get(0),[!0]),t.data.el.removeClass("colpick_slider").find("input").focus(),e(document).off("mouseup",b),e(document).off("mousemove",y),!1},w=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1;var n={cal:e(this).parent(),y:e(this).offset().top};e(document).on("mouseup touchend",n,S),e(document).on("mousemove touchmove",n,E);var r=t.type=="touchstart"?t.originalEvent.changedTouches[0].pageY:t.pageY;return d.apply(n.cal.data("colpick").fields.eq(4).val(parseInt(360*(n.cal.data("colpick").height-(r-n.y))/n.cal.data("colpick").height,10)).get(0),[n.cal.data("colpick").livePreview]),!1},E=function(e){var t=e.type=="touchmove"?e.originalEvent.changedTouches[0].pageY:e.pageY;return d.apply(e.data.cal.data("colpick").fields.eq(4).val(parseInt(360*(e.data.cal.data("colpick").height-Math.max(0,Math.min(e.data.cal.data("colpick").height,t-e.data.y)))/e.data.cal.data("colpick").height,10)).get(0),[e.data.preview]),!1},S=function(t){return o(t.data.cal.data("colpick").color,t.data.cal.get(0)),f(t.data.cal.data("colpick").color,t.data.cal.get(0)),e(document).off("mouseup touchend",S),e(document).off("mousemove touchmove",E),!1},x=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1;var n={cal:e(this).parent(),pos:e(this).offset()};n.preview=n.cal.data("colpick").livePreview,e(document).on("mouseup touchend",n,N),e(document).on("mousemove touchmove",n,T);var r,i;return t.type=="touchstart"?(pageX=t.originalEvent.changedTouches[0].pageX,i=t.originalEvent.changedTouches[0].pageY):(pageX=t.pageX,i=t.pageY),d.apply(n.cal.data("colpick").fields.eq(6).val(parseInt(100*(n.cal.data("colpick").height-(i-n.pos.top))/n.cal.data("colpick").height,10)).end().eq(5).val(parseInt(100*(pageX-n.pos.left)/n.cal.data("colpick").height,10)).get(0),[n.preview]),!1},T=function(e){var t,n;return e.type=="touchmove"?(pageX=e.originalEvent.changedTouches[0].pageX,n=e.originalEvent.changedTouches[0].pageY):(pageX=e.pageX,n=e.pageY),d.apply(e.data.cal.data("colpick").fields.eq(6).val(parseInt(100*(e.data.cal.data("colpick").height-Math.max(0,Math.min(e.data.cal.data("colpick").height,n-e.data.pos.top)))/e.data.cal.data("colpick").height,10)).end().eq(5).val(parseInt(100*Math.max(0,Math.min(e.data.cal.data("colpick").height,pageX-e.data.pos.left))/e.data.cal.data("colpick").height,10)).get(0),[e.data.preview]),!1},N=function(t){return o(t.data.cal.data("colpick").color,t.data.cal.get(0)),f(t.data.cal.data("colpick").color,t.data.cal.get(0)),e(document).off("mouseup touchend",N),e(document).off("mousemove touchmove",T),!1},C=function(t){var n=e(this).parent(),r=n.data("colpick").color;n.data("colpick").origColor=r,h(r,n.get(0)),n.data("colpick").onSubmit(r,u(r),s(r),n.data("colpick").el)},k=function(t){t.stopPropagation();var n=e("#"+e(this).data("colpickId"));n.data("colpick").onBeforeShow.apply(this,[n.get(0)]);var r=e(this).offset(),i=r.top+this.offsetHeight,s=r.left,o=A(),u=n.width();s+u>o.l+o.w&&(s-=u),n.css({left:s+"px",top:i+"px"}),n.data("colpick").onShow.apply(this,[n.get(0)])!=0&&n.show(),e("html").mousedown({cal:n},L),n.mousedown(function(e){e.stopPropagation()})},L=function(t){t.data.cal.data("colpick").onHide.apply(this,[t.data.cal.get(0)])!=0&&t.data.cal.hide(),e("html").off("mousedown",L)},A=function(){var e=document.compatMode=="CSS1Compat";return{l:window.pageXOffset||(e?document.documentElement.scrollLeft:document.body.scrollLeft),w:window.innerWidth||(e?document.documentElement.clientWidth:document.body.clientWidth)}},O=function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},M=function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},_=function(e){var t=6-e.length;if(t>0){var n=[];for(var r=0;r<t;r++)n.push("0");n.push(e),e=n.join("")}return e},D=function(){var t=e(this).parent(),n=t.data("colpick").origColor;t.data("colpick").color=n,o(n,t.get(0)),f(n,t.get(0)),a(n,t.get(0)),l(n,t.get(0)),c(n,t.get(0)),p(n,t.get(0))};return{init:function(i){return i=e.extend({},n,i||{}),typeof i.color!="string"?this:(i.color=r(i.color),this.each(function(){var n=this.value;typeof n=="string"&&n.length&&(i.color=r(n),e(this).css("background-color","#"+n));if(!e(this).data("colpickId")){var s=e.extend({},i);s.origColor=i.color;var u="colorpicker_"+parseInt(Math.random()*1e3);e(this).data("colpickId",u);var y=e(t).attr("id",u);y.addClass("colpick_"+s.layout+(s.submit?"":" colpick_"+s.layout+"_ns")),y.find("div.colpick_submit").html(s.submitText).click(C),s.fields=y.find("input").change(d).blur(v).focus(m),y.find("div.colpick_field_arrs").mousedown(g).end().find("div.colpick_current_color").click(D),s.selector=y.find("div.colpick_color").on("mousedown touchstart",x),s.selectorIndic=s.selector.find("div.colpick_selector_outer"),s.el=this,s.hue=y.find("div.colpick_hue_arrs"),huebar=s.hue.parent();var b=navigator.userAgent.toLowerCase(),E=navigator.appName==="Microsoft Internet Explorer",S=E?parseFloat(b.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,T=E&&S<10,N=["#ff0000","#ff0080","#ff00ff","#8000ff","#0000ff","#0080ff","#00ffff","#00ff80","#00ff00","#80ff00","#ffff00","#ff8000","#ff0000"];if(T){var L,A;for(L=0;L<=11;L++)A=e("<div></div>").attr("style","height:8.333333%; filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr="+N[L]+", endColorstr="+N[L+1]+'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+N[L]+", endColorstr="+N[L+1]+')";'),huebar.append(A)}else stopList=N.join(","),huebar.attr("style","background:-webkit-linear-gradient(top,"+stopList+"); background: -o-linear-gradient(top,"+stopList+"); background: -ms-linear-gradient(top,"+stopList+"); background:-moz-linear-gradient(top,"+stopList+"); -webkit-linear-gradient(top,"+stopList+"); background:linear-gradient(to bottom,"+stopList+"); ");y.find("div.colpick_hue").on("mousedown touchstart",w),s.newColor=y.find("div.colpick_new_color"),s.currentColor=y.find("div.colpick_current_color"),y.data("colpick",s),o(s.color,y.get(0)),a(s.color,y.get(0)),f(s.color,y.get(0)),c(s.color,y.get(0)),l(s.color,y.get(0)),h(s.color,y.get(0)),p(s.color,y.get(0)),s.flat?(y.appendTo(this).show(),y.css({position:"relative",display:"block"})):(y.appendTo(document.body),e(this).on(s.showEvent,k),y.css({position:"absolute"}))}}))},showPicker:function(){return this.each(function(){e(this).data("colpickId")&&k.apply(this)})},hidePicker:function(){return this.each(function(){e(this).data("colpickId")&&e("#"+e(this).data("colpickId")).hide()})},setColor:function(t,n){n=typeof n=="undefined"?1:n;if(typeof t=="string")t=r(t);else if(t.r!=undefined&&t.g!=undefined&&t.b!=undefined)t=i(t);else{if(t.h==undefined||t.s==undefined||t.b==undefined)return this;t=O(t)}return this.each(function(){if(e(this).data("colpickId")){var r=e("#"+e(this).data("colpickId"));r.data("colpick").color=t,r.data("colpick").origColor=t,o(t,r.get(0)),a(t,r.get(0)),f(t,r.get(0)),c(t,r.get(0)),l(t,r.get(0)),p(t,r.get(0)),r.data("colpick").onChange.apply(r.parent(),[t,u(t),s(t),r.data("colpick").el,1]),n&&h(t,r.get(0))}})}}}(),n=function(e){var e=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:e>>16,g:(e&65280)>>8,b:e&255}},r=function(e){return i(n(e))},i=function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),i=r-n;return t.b=r,t.s=r!=0?255*i/r:0,t.s!=0?e.r==r?t.h=(e.g-e.b)/i:e.g==r?t.h=2+(e.b-e.r)/i:t.h=4+(e.r-e.g)/i:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},s=function(e){var t={},n=e.h,r=e.s*255/100,i=e.b*255/100;if(r==0)t.r=t.g=t.b=i;else{var s=i,o=(255-r)*i/255,u=(s-o)*(n%60)/60;n==360&&(n=0),n<60?(t.r=s,t.b=o,t.g=o+u):n<120?(t.g=s,t.b=o,t.r=s-u):n<180?(t.g=s,t.r=o,t.b=o+u):n<240?(t.b=s,t.r=o,t.g=s-u):n<300?(t.b=s,t.g=o,t.r=o+u):n<360?(t.r=s,t.g=o,t.b=s-u):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},o=function(t){var n=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];return e.each(n,function(e,t){t.length==1&&(n[e]="0"+t)}),n.join("")},u=function(e){return o(s(e))};e.fn.extend({colpick:t.init,colpickHide:t.hidePicker,colpickShow:t.showPicker,colpickSetColor:t.setColor}),e.extend({colpick:{rgbToHex:o,rgbToHsb:i,hsbToHex:u,hsbToRgb:s,hexToHsb:r,hexToRgb:n}})})(jQuery);
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/js/datetimepicker.js cahier-de-prepa6.0.0/js/datetimepicker.js
--- cahier-de-prepa5.1.0/js/datetimepicker.js	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/js/datetimepicker.js	2016-08-23 22:49:39.236343654 +0200
@@ -0,0 +1,2703 @@
+/* Version modifiée et simplifiée de jQuery DateTimePicker plugin v2.5.4, de Chupurnov Valeriy http://xdsoft.net/jqplugins/datetimepicker/
+ * supression des options du parser non utilisées, des langues autres que le français, de fonctionnalités inutiles
+ * Cyril Ravat, https://cahier-de-prepa.fr 2016 */
+/*!
+ * @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2015
+ * @version 1.3.3
+ *
+ * Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format.
+ * @see http://php.net/manual/en/function.date.php
+ *
+ * For more JQuery plugins visit http://plugins.krajee.com
+ * For more Yii related demos visit http://demos.krajee.com
+ */
+var DateFormatter;
+(function () {
+    "use strict";
+
+    var _compare, _lpad, _extend, defaultSettings, DAY, HOUR;
+    DAY = 1000 * 60 * 60 * 24;
+    HOUR = 3600;
+
+    _compare = function (str1, str2) {
+        return typeof(str1) === 'string' && typeof(str2) === 'string' && str1.toLowerCase() === str2.toLowerCase();
+    };
+    _lpad = function (value, length, char) {
+        var chr = char || '0', val = value.toString();
+        return val.length < length ? _lpad(chr + val, length) : val;
+    };
+    _extend = function (out) {
+        var i, obj;
+        out = out || {};
+        for (i = 1; i < arguments.length; i++) {
+            obj = arguments[i];
+            if (!obj) {
+                continue;
+            }
+            for (var key in obj) {
+                if (obj.hasOwnProperty(key)) {
+                    if (typeof obj[key] === 'object') {
+                        _extend(out[key], obj[key]);
+                    } else {
+                        out[key] = obj[key];
+                    }
+                }
+            }
+        }
+        return out;
+    };
+    defaultSettings = {
+        dateSettings: {
+            // days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+            // daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+            // months: [
+                // 'January', 'February', 'March', 'April', 'May', 'June', 'July',
+                // 'August', 'September', 'October', 'November', 'December'
+            // ],
+            // monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+            // meridiem: ['AM', 'PM'],
+            // ordinal: function (number) {
+                // var n = number % 10, suffixes = {1: 'st', 2: 'nd', 3: 'rd'};
+                // return Math.floor(number % 100 / 10) === 1 || !suffixes[n] ? 'th' : suffixes[n];
+            // }
+        },
+        // separators: /[ \-+\/\.T:@]/g,
+        // validParts: /[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,
+        // intParts: /[djwNzmnyYhHgGis]/g,
+        separators: /[ \-\/:h]/g,
+        validParts: /[dmYGi]/g,
+        intParts: /[dmYGi]/g,
+        // tzParts: /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
+        // tzClip: /[^-+\dA-Z]/g
+    };
+
+    DateFormatter = function (options) {
+        var self = this, config = _extend(defaultSettings, options);
+        self.dateSettings = config.dateSettings;
+        self.separators = config.separators;
+        self.validParts = config.validParts;
+        self.intParts = config.intParts;
+        // self.tzParts = config.tzParts;
+        // self.tzClip = config.tzClip;
+    };
+
+    DateFormatter.prototype = {
+        constructor: DateFormatter,
+        parseDate: function (vDate, vFormat) {
+            var self = this, vFormatParts, vDateParts, i, vDateFlag = false, vTimeFlag = false, vDatePart, iDatePart,
+                vSettings = self.dateSettings, vMonth, vMeriIndex, vMeriOffset, len, mer,
+                out = {date: null, year: null, month: null, day: null, hour: 0, min: 0, sec: 0};
+            if (!vDate) {
+                return undefined;
+            }
+            if (vDate instanceof Date) {
+                return vDate;
+            }
+            if (typeof vDate === 'number') {
+                return new Date(vDate);
+            }
+            // if (vFormat === 'U') {
+                // i = parseInt(vDate);
+                // return i ? new Date(i * 1000) : vDate;
+            // }
+            if (typeof vDate !== 'string') {
+                return '';
+            }
+            vFormatParts = vFormat.match(self.validParts);
+            if (!vFormatParts || vFormatParts.length === 0) {
+                throw new Error("Invalid date format definition.");
+            }
+            vDateParts = vDate.replace(self.separators, '\0').split('\0');
+            for (i = 0; i < vDateParts.length; i++) {
+                vDatePart = vDateParts[i];
+                iDatePart = parseInt(vDatePart);
+                switch (vFormatParts[i]) {
+                    // case 'y':
+                    case 'Y':
+                        len = vDatePart.length;
+                        if (len === 2) {
+                            out.year = parseInt((iDatePart < 70 ? '20' : '19') + vDatePart);
+                        } else if (len === 4) {
+                            out.year = iDatePart;
+                        }
+                        vDateFlag = true;
+                        break;
+                    case 'm':
+                    // case 'n':
+                    // case 'M':
+                    // case 'F':
+                        if (isNaN(vDatePart)) {
+                            vMonth = vSettings.monthsShort.indexOf(vDatePart);
+                            if (vMonth > -1) {
+                                out.month = vMonth + 1;
+                            }
+                            vMonth = vSettings.months.indexOf(vDatePart);
+                            if (vMonth > -1) {
+                                out.month = vMonth + 1;
+                            }
+                        } else {
+                            if (iDatePart >= 1 && iDatePart <= 12) {
+                                out.month = iDatePart;
+                            }
+                        }
+                        vDateFlag = true;
+                        break;
+                    case 'd':
+                    // case 'j':
+                        if (iDatePart >= 1 && iDatePart <= 31) {
+                            out.day = iDatePart;
+                        }
+                        vDateFlag = true;
+                        break;
+                    // case 'g':
+                    // case 'h':
+                        // vMeriIndex = (vFormatParts.indexOf('a') > -1) ? vFormatParts.indexOf('a') :
+                            // (vFormatParts.indexOf('A') > -1) ? vFormatParts.indexOf('A') : -1;
+                        // mer = vDateParts[vMeriIndex];
+                        // if (vMeriIndex > -1) {
+                            // vMeriOffset = _compare(mer, vSettings.meridiem[0]) ? 0 :
+                                // (_compare(mer, vSettings.meridiem[1]) ? 12 : -1);
+                            // if (iDatePart >= 1 && iDatePart <= 12 && vMeriOffset > -1) {
+                                // out.hour = iDatePart + vMeriOffset;
+                            // } else if (iDatePart >= 0 && iDatePart <= 23) {
+                                // out.hour = iDatePart;
+                            // }
+                        // } else if (iDatePart >= 0 && iDatePart <= 23) {
+                            // out.hour = iDatePart;
+                        // }
+                        // vTimeFlag = true;
+                        // break;
+                    case 'G':
+                    // case 'H':
+                        if (iDatePart >= 0 && iDatePart <= 23) {
+                            out.hour = iDatePart;
+                        }
+                        vTimeFlag = true;
+                        break;
+                    case 'i':
+                        if (iDatePart >= 0 && iDatePart <= 59) {
+                            out.min = iDatePart;
+                        }
+                        vTimeFlag = true;
+                        break;
+                    // case 's':
+                        // if (iDatePart >= 0 && iDatePart <= 59) {
+                            // out.sec = iDatePart;
+                        // }
+                        // vTimeFlag = true;
+                        // break;
+                }
+            }
+            if (vDateFlag === true && out.year && out.month && out.day) {
+                out.date = new Date(out.year, out.month - 1, out.day, out.hour, out.min, out.sec, 0);
+            } else {
+                if (vTimeFlag !== true) {
+                    return false;
+                }
+                out.date = new Date(0, 0, 0, out.hour, out.min, out.sec, 0);
+            }
+            return out.date;
+        },
+        // guessDate: function (vDateStr, vFormat) {
+            // if (typeof vDateStr !== 'string') {
+                // return vDateStr;
+            // }
+            // var self = this, vParts = vDateStr.replace(self.separators, '\0').split('\0'), vPattern = /^[djmn]/g,
+                // vFormatParts = vFormat.match(self.validParts), vDate = new Date(), vDigit = 0, vYear, i, iPart, iSec;
+
+            // if (!vPattern.test(vFormatParts[0])) {
+                // return vDateStr;
+            // }
+
+            // for (i = 0; i < vParts.length; i++) {
+                // vDigit = 2;
+                // iPart = vParts[i];
+                // iSec = parseInt(iPart.substr(0, 2));
+                // switch (i) {
+                    // case 0:
+                        // if (vFormatParts[0] === 'm' || vFormatParts[0] === 'n') {
+                            // vDate.setMonth(iSec - 1);
+                        // } else {
+                            // vDate.setDate(iSec);
+                        // }
+                        // break;
+                    // case 1:
+                        // if (vFormatParts[0] === 'm' || vFormatParts[0] === 'n') {
+                            // vDate.setDate(iSec);
+                        // } else {
+                            // vDate.setMonth(iSec - 1);
+                        // }
+                        // break;
+                    // case 2:
+                        // vYear = vDate.getFullYear();
+                        // if (iPart.length < 4) {
+                            // vDate.setFullYear(parseInt(vYear.toString().substr(0, 4 - iPart.length) + iPart));
+                            // vDigit = iPart.length;
+                        // } else {
+                            // vDate.setFullYear = parseInt(iPart.substr(0, 4));
+                            // vDigit = 4;
+                        // }
+                        // break;
+                    // case 3:
+                        // vDate.setHours(iSec);
+                        // break;
+                    // case 4:
+                        // vDate.setMinutes(iSec);
+                        // break;
+                    // case 5:
+                        // vDate.setSeconds(iSec);
+                        // break;
+                // }
+                // if (iPart.substr(vDigit).length > 0) {
+                    // vParts.splice(i + 1, 0, iPart.substr(vDigit));
+                // }
+            // }
+            // return vDate;
+        // },
+        parseFormat: function (vChar, vDate) {
+            var self = this, vSettings = self.dateSettings, fmt, backspace = /\\?(.?)/gi, doFormat = function (t, s) {
+                return fmt[t] ? fmt[t]() : s;
+            };
+            fmt = {
+                /////////
+                // DAY //
+                /////////
+                /**
+                 * Day of month with leading 0: `01..31`
+                 * @return {string}
+                 */
+                d: function () {
+                    return _lpad(vDate.getDate(), 2);
+                    // return _lpad(fmt.j(), 2);
+                },
+                // /**
+                 // * Shorthand day name: `Mon...Sun`
+                 // * @return {string}
+                 // */
+                // D: function () {
+                    // return vSettings.daysShort[fmt.w()];
+                // },
+                // /**
+                 // * Day of month: `1..31`
+                 // * @return {number}
+                 // */
+                // j: function () {
+                    // return vDate.getDate();
+                // },
+                // /**
+                 // * Full day name: `Monday...Sunday`
+                 // * @return {number}
+                 // */
+                // l: function () {
+                    // return vSettings.days[fmt.w()];
+                // },
+                // /**
+                 // * ISO-8601 day of week: `1[Mon]..7[Sun]`
+                 // * @return {number}
+                 // */
+                // N: function () {
+                    // return fmt.w() || 7;
+                // },
+                // /**
+                 // * Day of week: `0[Sun]..6[Sat]`
+                 // * @return {number}
+                 // */
+                // w: function () {
+                    // return vDate.getDay();
+                // },
+                // /**
+                 // * Day of year: `0..365`
+                 // * @return {number}
+                 // */
+                // z: function () {
+                    // var a = new Date(fmt.Y(), fmt.n() - 1, fmt.j()), b = new Date(fmt.Y(), 0, 1);
+                    // return Math.round((a - b) / DAY);
+                // },
+
+                //////////
+                // WEEK //
+                //////////
+                // /**
+                 // * ISO-8601 week number
+                 // * @return {number}
+                 // */
+                // W: function () {
+                    // var a = new Date(fmt.Y(), fmt.n() - 1, fmt.j() - fmt.N() + 3), b = new Date(a.getFullYear(), 0, 4);
+                    // return _lpad(1 + Math.round((a - b) / DAY / 7), 2);
+                // },
+
+                ///////////
+                // MONTH //
+                ///////////
+                // /**
+                 // * Full month name: `January...December`
+                 // * @return {string}
+                 // */
+                // F: function () {
+                    // return vSettings.months[vDate.getMonth()];
+                // },
+                /**
+                 * Month w/leading 0: `01..12`
+                 * @return {string}
+                 */
+                m: function () {
+                    return _lpad(vDate.getMonth() + 1, 2);
+                    // return _lpad(fmt.n(), 2);
+                },
+                // /**
+                 // * Shorthand month name; `Jan...Dec`
+                 // * @return {string}
+                 // */
+                // M: function () {
+                    // return vSettings.monthsShort[vDate.getMonth()];
+                // },
+                // /**
+                 // * Month: `1...12`
+                 // * @return {number}
+                 // */
+                // n: function () {
+                    // return vDate.getMonth() + 1;
+                // },
+                // /**
+                 // * Days in month: `28...31`
+                 // * @return {number}
+                 // */
+                // t: function () {
+                    // return (new Date(fmt.Y(), fmt.n(), 0)).getDate();
+                // },
+
+                //////////
+                // YEAR //
+                //////////
+                // /**
+                 // * Is leap year? `0 or 1`
+                 // * @return {number}
+                 // */
+                // L: function () {
+                    // var Y = fmt.Y();
+                    // return (Y % 4 === 0 && Y % 100 !== 0 || Y % 400 === 0) ? 1 : 0;
+                // },
+                // /**
+                 // * ISO-8601 year
+                 // * @return {number}
+                 // */
+                // o: function () {
+                    // var n = fmt.n(), W = fmt.W(), Y = fmt.Y();
+                    // return Y + (n === 12 && W < 9 ? 1 : n === 1 && W > 9 ? -1 : 0);
+                // },
+                /**
+                 * Full year: `e.g. 1980...2010`
+                 * @return {number}
+                 */
+                Y: function () {
+                    return vDate.getFullYear();
+                },
+                // /**
+                 // * Last two digits of year: `00...99`
+                 // * @return {string}
+                 // */
+                // y: function () {
+                    // return fmt.Y().toString().slice(-2);
+                // },
+
+                //////////
+                // TIME //
+                //////////
+                // /**
+                 // * Meridian lower: `am or pm`
+                 // * @return {string}
+                 // */
+                // a: function () {
+                    // return fmt.A().toLowerCase();
+                // },
+                // /**
+                 // * Meridian upper: `AM or PM`
+                 // * @return {string}
+                 // */
+                // A: function () {
+                    // var n = fmt.G() < 12 ? 0 : 1;
+                    // return vSettings.meridiem[n];
+                // },
+                // /**
+                 // * Swatch Internet time: `000..999`
+                 // * @return {string}
+                 // */
+                // B: function () {
+                    // var H = vDate.getUTCHours() * HOUR, i = vDate.getUTCMinutes() * 60, s = vDate.getUTCSeconds();
+                    // return _lpad(Math.floor((H + i + s + HOUR) / 86.4) % 1000, 3);
+                // },
+                // /**
+                 // * 12-Hours: `1..12`
+                 // * @return {number}
+                 // */
+                // g: function () {
+                    // return fmt.G() % 12 || 12;
+                // },
+                /**
+                 * 24-Hours: `0..23`
+                 * @return {number}
+                 */
+                G: function () {
+                    return vDate.getHours();
+                },
+                // /**
+                 // * 12-Hours with leading 0: `01..12`
+                 // * @return {string}
+                 // */
+                // h: function () {
+                    // return _lpad(fmt.g(), 2);
+                // },
+                // /**
+                 // * 24-Hours w/leading 0: `00..23`
+                 // * @return {string}
+                 // */
+                // H: function () {
+                    // return _lpad(fmt.G(), 2);
+                // },
+                /**
+                 * Minutes w/leading 0: `00..59`
+                 * @return {string}
+                 */
+                i: function () {
+                    return _lpad(vDate.getMinutes(), 2);
+                }//,
+                // /**
+                 // * Seconds w/leading 0: `00..59`
+                 // * @return {string}
+                 // */
+                // s: function () {
+                    // return _lpad(vDate.getSeconds(), 2);
+                // },
+                // /**
+                 // * Microseconds: `000000-999000`
+                 // * @return {string}
+                 // */
+                // u: function () {
+                    // return _lpad(vDate.getMilliseconds() * 1000, 6);
+                // },
+
+                //////////////
+                // TIMEZONE //
+                //////////////
+                // /**
+                 // * Timezone identifier: `e.g. Atlantic/Azores, ...`
+                 // * @return {string}
+                 // */
+                // e: function () {
+                    // var str = /\((.*)\)/.exec(String(vDate))[1];
+                    // return str || 'Coordinated Universal Time';
+                // },
+                // /**
+                 // * Timezone abbreviation: `e.g. EST, MDT, ...`
+                 // * @return {string}
+                 // */
+                // T: function () {
+                    // var str = (String(vDate).match(self.tzParts) || [""]).pop().replace(self.tzClip, "");
+                    // return str || 'UTC';
+                // },
+                // /**
+                 // * DST observed? `0 or 1`
+                 // * @return {number}
+                 // */
+                // I: function () {
+                    // var a = new Date(fmt.Y(), 0), c = Date.UTC(fmt.Y(), 0),
+                        // b = new Date(fmt.Y(), 6), d = Date.UTC(fmt.Y(), 6);
+                    // return ((a - c) !== (b - d)) ? 1 : 0;
+                // },
+                // /**
+                 // * Difference to GMT in hour format: `e.g. +0200`
+                 // * @return {string}
+                 // */
+                // O: function () {
+                    // var tzo = vDate.getTimezoneOffset(), a = Math.abs(tzo);
+                    // return (tzo > 0 ? '-' : '+') + _lpad(Math.floor(a / 60) * 100 + a % 60, 4);
+                // },
+                // /**
+                 // * Difference to GMT with colon: `e.g. +02:00`
+                 // * @return {string}
+                 // */
+                // P: function () {
+                    // var O = fmt.O();
+                    // return (O.substr(0, 3) + ':' + O.substr(3, 2));
+                // },
+                // /**
+                 // * Timezone offset in seconds: `-43200...50400`
+                 // * @return {number}
+                 // */
+                // Z: function () {
+                    // return -vDate.getTimezoneOffset() * 60;
+                // },
+
+                ////////////////////
+                // FULL DATE TIME //
+                ////////////////////
+                // /**
+                 // * ISO-8601 date
+                 // * @return {string}
+                 // */
+                // c: function () {
+                    // return 'Y-m-d\\TH:i:sP'.replace(backspace, doFormat);
+                // },
+                // /**
+                 // * RFC 2822 date
+                 // * @return {string}
+                 // */
+                // r: function () {
+                    // return 'D, d M Y H:i:s O'.replace(backspace, doFormat);
+                // },
+                // /**
+                 // * Seconds since UNIX epoch
+                 // * @return {number}
+                 // */
+                // U: function () {
+                    // return vDate.getTime() / 1000 || 0;
+                // }
+            };
+            return doFormat(vChar, vChar);
+        },
+        formatDate: function (vDate, vFormat) {
+            var self = this, i, n, len, str, vChar, vDateStr = '';
+            if (typeof vDate === 'string') {
+                vDate = self.parseDate(vDate, vFormat);
+                if (vDate === false) {
+                    return false;
+                }
+            }
+            if (vDate instanceof Date) {
+                len = vFormat.length;
+                for (i = 0; i < len; i++) {
+                    vChar = vFormat.charAt(i);
+                    if (vChar === 'S') {
+                        continue;
+                    }
+                    str = self.parseFormat(vChar, vDate);
+                    if (i !== (len - 1) && self.intParts.test(vChar) && vFormat.charAt(i + 1) === 'S') {
+                        n = parseInt(str);
+                        str += self.dateSettings.ordinal(n);
+                    }
+                    vDateStr += str;
+                }
+                return vDateStr;
+            }
+            return '';
+        }
+    };
+})();/**
+ * @preserve jQuery DateTimePicker plugin v2.5.4
+ * @homepage http://xdsoft.net/jqplugins/datetimepicker/
+ * @author Chupurnov Valeriy (<chupurnov@gmail.com>)
+ */
+/*global DateFormatter, document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
+;(function (factory) {
+	if ( typeof define === 'function' && define.amd ) {
+		// AMD. Register as an anonymous module.
+		define(['jquery', 'jquery-mousewheel'], factory);
+	} else if (typeof exports === 'object') {
+		// Node/CommonJS style for Browserify
+		module.exports = factory;
+	} else {
+		// Browser globals
+		factory(jQuery);
+	}
+}(function ($) {
+	'use strict';
+	
+	var currentlyScrollingTimeDiv = false;
+	
+	var default_options  = {
+		i18n: {
+			fr: { //French
+				months: [
+					"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
+				],
+				dayOfWeekShort: [
+					"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
+				],
+				dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"]
+			}
+		},
+		value: '',
+		// rtl: false,
+
+		format:	'd/m/Y Ghi',
+		formatTime:	'Ghi',
+		formatDate:	'd/m/Y',
+
+		startDate:	false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05',
+		step: 15,
+		monthChangeSpinner: true,
+
+		closeOnDateSelect: false,
+		closeOnTimeSelect: true,
+		closeOnWithoutClick: true,
+		closeOnInputClick: true,
+
+		timepicker: true,
+		datepicker: true,
+		// weeks: false,
+
+		defaultTime: '8h00',	// use formatTime format (ex. '10:00' for formatTime:	'H:i')
+		defaultDate: false,	// use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05')
+
+		minDate: false,
+		maxDate: false,
+		minTime: false,
+		maxTime: false,
+		disabledMinTime: false,
+		disabledMaxTime: false,
+
+		allowTimes: [],
+		opened: false,
+		initTime: true,
+		inline: false,
+		theme: '',
+
+		onSelectDate: function () {},
+		onSelectTime: function () {},
+		onChangeMonth: function () {},
+		onGetWeekOfYear: function () {},
+		onChangeYear: function () {},
+		onChangeDateTime: function () {},
+		onShow: function () {},
+		onClose: function () {},
+		onGenerate: function () {},
+
+		withoutCopyright: true,
+		inverseButton: false,
+		hours12: false,
+		next: 'xdsoft_next',
+		prev : 'xdsoft_prev',
+		dayOfWeekStart: 1,
+		parentID: 'body',
+		timeHeightInTimePicker: 25,
+		timepickerScrollbar: true,
+		todayButton: true,
+		prevButton: true,
+		nextButton: true,
+		defaultSelect: true,
+
+		scrollMonth: true,
+		scrollTime: true,
+		scrollInput: true,
+
+		//lazyInit: false,
+		mask: false,
+		validateOnBlur: true,
+		allowBlank: true,
+		yearStart: 2015,
+		yearEnd: 2050,
+		monthStart: 0,
+		monthEnd: 11,
+		style: '',
+		id: '',
+		fixed: false,
+		roundTime: 'round', // ceil, floor
+		className: '',
+		// weekends: [],
+		// highlightedDates: [],
+		// highlightedPeriods: [],
+		// allowDates : [],
+		// allowDateRe : null,
+		// disabledDates : [],
+		// disabledWeekDays: [],
+		yearOffset: 0,
+		beforeShowDay: null,
+
+		enterLikeTab: true,
+		// showApplyButton: true
+	};
+
+	var dateHelper = null,
+		globalLocaleDefault = 'fr',
+		globalLocale = 'fr';
+
+	// var dateFormatterOptionsDefault = {
+		// meridiem: ['AM', 'PM']
+	// };
+
+	var initDateFormatter = function(){
+		var locale = default_options.i18n[globalLocale],
+			opts = {
+				days: locale.dayOfWeek,
+				daysShort: locale.dayOfWeekShort,
+				months: locale.months,
+				monthsShort: $.map(locale.months, function(n){ return n.substring(0, 3) }),
+			};
+
+	 	dateHelper = new DateFormatter({
+			dateSettings: opts// $.extend({}, dateFormatterOptionsDefault, opts)
+		});
+	};
+
+	// for locale settings
+	$.datetimepicker = {
+		// setLocale: function(locale){
+			// var newLocale = default_options.i18n[locale]?locale:globalLocaleDefault;
+			// if(globalLocale != newLocale){
+				// globalLocale = newLocale;
+				// initDateFormatter();
+			// }
+		// },
+		setDateFormatter: function(dateFormatter) {
+			dateHelper = dateFormatter;
+		}//,
+		// RFC_2822: 'D, d M Y H:i:s O',
+		// ATOM: 'Y-m-d\TH:i:sP',
+		// ISO_8601: 'Y-m-d\TH:i:sO',
+		// RFC_822: 'D, d M y H:i:s O',
+		// RFC_850: 'l, d-M-y H:i:s T',
+		// RFC_1036: 'D, d M y H:i:s O',
+		// RFC_1123: 'D, d M Y H:i:s O',
+		// RSS: 'D, d M Y H:i:s O',
+		// W3C: 'Y-m-d\TH:i:sP'
+	};
+
+	// first init date formatter
+	initDateFormatter();
+
+	// fix for ie8
+	if (!window.getComputedStyle) {
+		window.getComputedStyle = function (el, pseudo) {
+			this.el = el;
+			this.getPropertyValue = function (prop) {
+				var re = /(\-([a-z]){1})/g;
+				if (prop === 'float') {
+					prop = 'styleFloat';
+				}
+				if (re.test(prop)) {
+					prop = prop.replace(re, function (a, b, c) {
+						return c.toUpperCase();
+					});
+				}
+				return el.currentStyle[prop] || null;
+			};
+			return this;
+		};
+	}
+	if (!Array.prototype.indexOf) {
+		Array.prototype.indexOf = function (obj, start) {
+			var i, j;
+			for (i = (start || 0), j = this.length; i < j; i += 1) {
+				if (this[i] === obj) { return i; }
+			}
+			return -1;
+		};
+	}
+	Date.prototype.countDaysInMonth = function () {
+		return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
+	};
+	$.fn.xdsoftScroller = function (percent) {
+		return this.each(function () {
+			var timeboxparent = $(this),
+				pointerEventToXY = function (e) {
+					var out = {x: 0, y: 0},
+						touch;
+					if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') {
+						touch  = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
+						out.x = touch.clientX;
+						out.y = touch.clientY;
+					} else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
+						out.x = e.clientX;
+						out.y = e.clientY;
+					}
+					return out;
+				},
+				timebox,
+				parentHeight,
+				height,
+				scrollbar,
+				scroller,
+				maximumOffset = 100,
+				start = false,
+				startY = 0,
+				startTop = 0,
+				h1 = 0,
+				touchStart = false,
+				startTopScroll = 0,
+				calcOffset = function () {};
+			if (percent === 'hide') {
+				timeboxparent.find('.xdsoft_scrollbar').hide();
+				return;
+			}
+			if (!$(this).hasClass('xdsoft_scroller_box')) {
+				timebox = timeboxparent.children().eq(0);
+				parentHeight = timeboxparent[0].clientHeight;
+				height = timebox[0].offsetHeight;
+				scrollbar = $('<div class="xdsoft_scrollbar"></div>');
+				scroller = $('<div class="xdsoft_scroller"></div>');
+				scrollbar.append(scroller);
+
+				timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
+				calcOffset = function calcOffset(event) {
+					var offset = pointerEventToXY(event).y - startY + startTopScroll;
+					if (offset < 0) {
+						offset = 0;
+					}
+					if (offset + scroller[0].offsetHeight > h1) {
+						offset = h1 - scroller[0].offsetHeight;
+					}
+					timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]);
+				};
+
+				scroller
+					.on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) {
+						if (!parentHeight) {
+							timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
+						}
+
+						startY = pointerEventToXY(event).y;
+						startTopScroll = parseInt(scroller.css('margin-top'), 10);
+						h1 = scrollbar[0].offsetHeight;
+
+						if (event.type === 'mousedown' || event.type === 'touchstart') {
+							if (document) {
+								$(document.body).addClass('xdsoft_noselect');
+							}
+							$([document.body, window]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() {
+								$([document.body, window]).off('touchend mouseup.xdsoft_scroller', arguments_callee)
+									.off('mousemove.xdsoft_scroller', calcOffset)
+									.removeClass('xdsoft_noselect');
+							});
+							$(document.body).on('mousemove.xdsoft_scroller', calcOffset);
+						} else {
+							touchStart = true;
+							event.stopPropagation();
+							event.preventDefault();
+						}
+					})
+					.on('touchmove', function (event) {
+						if (touchStart) {
+							event.preventDefault();
+							calcOffset(event);
+						}
+					})
+					.on('touchend touchcancel', function () {
+						touchStart =  false;
+						startTopScroll = 0;
+					});
+
+				timeboxparent
+					.on('scroll_element.xdsoft_scroller', function (event, percentage) {
+						if (!parentHeight) {
+							timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]);
+						}
+						percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage;
+
+						scroller.css('margin-top', maximumOffset * percentage);
+
+						setTimeout(function () {
+							timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10));
+						}, 10);
+					})
+					.on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) {
+						var percent, sh;
+						parentHeight = timeboxparent[0].clientHeight;
+						height = timebox[0].offsetHeight;
+						percent = parentHeight / height;
+						sh = percent * scrollbar[0].offsetHeight;
+						if (percent > 1) {
+							scroller.hide();
+						} else {
+							scroller.show();
+							scroller.css('height', parseInt(sh > 10 ? sh : 10, 10));
+							maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight;
+							if (noTriggerScroll !== true) {
+								timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]);
+							}
+						}
+					});
+
+				timeboxparent.on('mousewheel', function (event) {
+					var top = Math.abs(parseInt(timebox.css('marginTop'), 10));
+
+					top = top - (event.deltaY * 20);
+					if (top < 0) {
+						top = 0;
+					}
+
+					timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]);
+					event.stopPropagation();
+					return false;
+				});
+
+				timeboxparent.on('touchstart', function (event) {
+					start = pointerEventToXY(event);
+					startTop = Math.abs(parseInt(timebox.css('marginTop'), 10));
+				});
+
+				timeboxparent.on('touchmove', function (event) {
+					if (start) {
+						event.preventDefault();
+						var coord = pointerEventToXY(event);
+						timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]);
+					}
+				});
+
+				timeboxparent.on('touchend touchcancel', function () {
+					start = false;
+					startTop = 0;
+				});
+			}
+			timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
+		});
+	};
+
+	$.fn.datetimepicker = function (opt, opt2) {
+		var result = this,
+			KEY0 = 48,
+			KEY9 = 57,
+			_KEY0 = 96,
+			_KEY9 = 105,
+			CTRLKEY = 17,
+			DEL = 46,
+			ENTER = 13,
+			ESC = 27,
+			BACKSPACE = 8,
+			ARROWLEFT = 37,
+			ARROWUP = 38,
+			ARROWRIGHT = 39,
+			ARROWDOWN = 40,
+			TAB = 9,
+			F5 = 116,
+			AKEY = 65,
+			CKEY = 67,
+			VKEY = 86,
+			ZKEY = 90,
+			YKEY = 89,
+			ctrlDown	=	false,
+			options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options),
+
+			// lazyInitTimer = 0,
+			createDateTimePicker,
+			destroyDateTimePicker,
+
+			// lazyInit = function (input) {
+				// input
+					// .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback() {
+						// if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) {
+							// return;
+						// }
+						// clearTimeout(lazyInitTimer);
+						// lazyInitTimer = setTimeout(function () {
+
+							// if (!input.data('xdsoft_datetimepicker')) {
+								// createDateTimePicker(input);
+							// }
+							// input
+								// .off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback)
+								// .trigger('open.xdsoft');
+						// }, 100);
+					// });
+			// };
+
+		createDateTimePicker = function (input) {
+			var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),
+				xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
+				datepicker = $('<div class="xdsoft_datepicker active"></div>'),
+				month_picker = $('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' +
+					'<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>' +
+					'<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>' +
+					'<button type="button" class="xdsoft_next"></button></div>'),
+				calendar = $('<div class="xdsoft_calendar"></div>'),
+				timepicker = $('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),
+				timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
+				timebox = $('<div class="xdsoft_time_variant"></div>'),
+
+				monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
+				yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),
+				triggerAfterOpen = false,
+				XDSoft_datetime,
+
+				xchangeTimer,
+				timerclick,
+				current_time_index,
+				setPos,
+				timer = 0,
+				_xdsoft_datetime,
+				forEachAncestorOf,
+				throttle;
+
+			if (options.id) {
+				datetimepicker.attr('id', options.id);
+			}
+			if (options.style) {
+				datetimepicker.attr('style', options.style);
+			}
+			// if (options.weeks) {
+				// datetimepicker.addClass('xdsoft_showweeks');
+			// }
+			// if (options.rtl) {
+				// datetimepicker.addClass('xdsoft_rtl');
+			// }
+
+			datetimepicker.addClass('xdsoft_' + options.theme);
+			datetimepicker.addClass(options.className);
+
+			month_picker
+				.find('.xdsoft_month span')
+					.after(monthselect);
+			month_picker
+				.find('.xdsoft_year span')
+					.after(yearselect);
+
+			month_picker
+				.find('.xdsoft_month,.xdsoft_year')
+					.on('touchstart mousedown.xdsoft', function (event) {
+					var select = $(this).find('.xdsoft_select').eq(0),
+						val = 0,
+						top = 0,
+						visible = select.is(':visible'),
+						items,
+						i;
+
+					month_picker
+						.find('.xdsoft_select')
+							.hide();
+					if (_xdsoft_datetime.currentTime) {
+						val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear']();
+					}
+
+					select[visible ? 'hide' : 'show']();
+					for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) {
+						if (items.eq(i).data('value') === val) {
+							break;
+						} else {
+							top += items[0].offsetHeight;
+						}
+					}
+
+					select.xdsoftScroller(top / (select.children()[0].offsetHeight - (select[0].clientHeight)));
+					event.stopPropagation();
+					return false;
+				});
+
+			month_picker
+				.find('.xdsoft_select')
+					.xdsoftScroller()
+				.on('touchstart mousedown.xdsoft', function (event) {
+					event.stopPropagation();
+					event.preventDefault();
+				})
+				.on('touchstart mousedown.xdsoft', '.xdsoft_option', function () {
+					if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
+						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
+					}
+
+					var year = _xdsoft_datetime.currentTime.getFullYear();
+					if (_xdsoft_datetime && _xdsoft_datetime.currentTime) {
+						_xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value'));
+					}
+
+					$(this).parent().parent().hide();
+
+					datetimepicker.trigger('xchange.xdsoft');
+					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
+						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+
+					if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
+						options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+				});
+
+			datetimepicker.getValue = function () {
+				return _xdsoft_datetime.getCurrentTime();
+			};
+
+			datetimepicker.setOptions = function (_options) {
+				var highlightedDates = {};
+
+				options = $.extend(true, {}, options, _options);
+
+				// if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) {
+					// options.allowTimes = $.extend(true, [], _options.allowTimes);
+				// }
+
+				// if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
+					// options.weekends = $.extend(true, [], _options.weekends);
+				// }
+
+				// if (_options.allowDates && $.isArray(_options.allowDates) && _options.allowDates.length) {
+					// options.allowDates = $.extend(true, [], _options.allowDates);
+				// }
+
+				// if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe)==="[object String]") {
+					// options.allowDateRe = new RegExp(_options.allowDateRe);
+				// }
+
+				// if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
+					// $.each(_options.highlightedDates, function (index, value) {
+						// var splitData = $.map(value.split(','), $.trim),
+							// exDesc,
+							// hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style
+							// keyDate = dateHelper.formatDate(hDate.date, options.formatDate);
+						// if (highlightedDates[keyDate] !== undefined) {
+							// exDesc = highlightedDates[keyDate].desc;
+							// if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
+								// highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
+							// }
+						// } else {
+							// highlightedDates[keyDate] = hDate;
+						// }
+					// });
+
+					// options.highlightedDates = $.extend(true, [], highlightedDates);
+				// }
+
+				// if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) {
+					// highlightedDates = $.extend(true, [], options.highlightedDates);
+					// $.each(_options.highlightedPeriods, function (index, value) {
+						// var dateTest, // start date
+							// dateEnd,
+							// desc,
+							// hDate,
+							// keyDate,
+							// exDesc,
+							// style;
+						// if ($.isArray(value)) {
+							// dateTest = value[0];
+							// dateEnd = value[1];
+							// desc = value[2];
+							// style = value[3];
+						// }
+						// else {
+							// var splitData = $.map(value.split(','), $.trim);
+							// dateTest = dateHelper.parseDate(splitData[0], options.formatDate);
+							// dateEnd = dateHelper.parseDate(splitData[1], options.formatDate);
+							// desc = splitData[2];
+							// style = splitData[3];
+						// }
+
+						// while (dateTest <= dateEnd) {
+							// hDate = new HighlightedDate(dateTest, desc, style);
+							// keyDate = dateHelper.formatDate(dateTest, options.formatDate);
+							// dateTest.setDate(dateTest.getDate() + 1);
+							// if (highlightedDates[keyDate] !== undefined) {
+								// exDesc = highlightedDates[keyDate].desc;
+								// if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
+									// highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
+								// }
+							// } else {
+								// highlightedDates[keyDate] = hDate;
+							// }
+						// }
+					// });
+
+					// options.highlightedDates = $.extend(true, [], highlightedDates);
+				// }
+
+				// if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
+					// options.disabledDates = $.extend(true, [], _options.disabledDates);
+				// }
+
+				// if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) {
+					// options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays);
+				// }
+
+				// if ((options.open || options.opened) && (!options.inline)) {
+					// input.trigger('open.xdsoft');
+				// }
+
+				// if (options.inline) {
+					// triggerAfterOpen = true;
+					// datetimepicker.addClass('xdsoft_inline');
+					// input.after(datetimepicker).hide();
+				// }
+
+				// if (options.inverseButton) {
+					// options.next = 'xdsoft_prev';
+					// options.prev = 'xdsoft_next';
+				// }
+
+				if (options.datepicker) {
+					datepicker.addClass('active');
+				} else {
+					datepicker.removeClass('active');
+				}
+
+				if (options.timepicker) {
+					timepicker.addClass('active');
+				} else {
+					timepicker.removeClass('active');
+				}
+
+				if (options.value) {
+					_xdsoft_datetime.setCurrentTime(options.value);
+					if (input && input.val) {
+						input.val(_xdsoft_datetime.str);
+					}
+				}
+
+				if (isNaN(options.dayOfWeekStart)) {
+					options.dayOfWeekStart = 0;
+				} else {
+					options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7;
+				}
+
+				if (!options.timepickerScrollbar) {
+					timeboxparent.xdsoftScroller('hide');
+				}
+
+				if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) {
+					options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate);
+				}
+
+				if (options.maxDate &&  /^[\+\-](.*)$/.test(options.maxDate)) {
+					options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate);
+				}
+
+				// applyButton.toggle(options.showApplyButton);
+
+				month_picker
+					.find('.xdsoft_today_button')
+						.css('visibility', !options.todayButton ? 'hidden' : 'visible');
+
+				month_picker
+					.find('.' + options.prev)
+						.css('visibility', !options.prevButton ? 'hidden' : 'visible');
+
+				month_picker
+					.find('.' + options.next)
+						.css('visibility', !options.nextButton ? 'hidden' : 'visible');
+
+				setMask(options);
+
+				if (options.validateOnBlur) {
+					input
+						.off('blur.xdsoft')
+						.on('blur.xdsoft', function () {
+							if (options.allowBlank && (!$.trim($(this).val()).length || (typeof options.mask == "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) {
+								$(this).val(null);
+								datetimepicker.data('xdsoft_datetime').empty();
+							} else {
+								var d = dateHelper.parseDate($(this).val(), options.format);
+								if (d) { // parseDate() may skip some invalid parts like date or time, so make it clear for user: show parsed date/time
+									$(this).val(dateHelper.formatDate(d, options.format));
+								} else {
+									var splittedHours   = +([$(this).val()[0], $(this).val()[1]].join('')),
+										splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
+	
+									// parse the numbers as 0312 => 03:12
+									if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
+										$(this).val([splittedHours, splittedMinutes].map(function (item) {
+											return item > 9 ? item : '0' + item;
+										}).join(':'));
+									} else {
+										$(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format));
+									}
+								}
+								datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
+							}
+
+							datetimepicker.trigger('changedatetime.xdsoft');
+							datetimepicker.trigger('close.xdsoft');
+						});
+				}
+				// options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1;
+
+				datetimepicker
+					.trigger('xchange.xdsoft')
+					.trigger('afterOpen.xdsoft');
+			};
+
+			datetimepicker
+				.data('options', options)
+				.on('touchstart mousedown.xdsoft', function (event) {
+					event.stopPropagation();
+					event.preventDefault();
+					yearselect.hide();
+					monthselect.hide();
+					return false;
+				});
+
+			//scroll_element = timepicker.find('.xdsoft_time_box');
+			timeboxparent.append(timebox);
+			timeboxparent.xdsoftScroller();
+
+			datetimepicker.on('afterOpen.xdsoft', function () {
+				timeboxparent.xdsoftScroller();
+			});
+
+			datetimepicker
+				.append(datepicker)
+				.append(timepicker);
+
+			if (options.withoutCopyright !== true) {
+				datetimepicker
+					.append(xdsoft_copyright);
+			}
+
+			datepicker
+				.append(month_picker)
+				.append(calendar);
+			//	.append(applyButton);
+
+			$(options.parentID)
+				.append(datetimepicker);
+
+			XDSoft_datetime = function () {
+				var _this = this;
+				_this.now = function (norecursion) {
+					var d = new Date(),
+						date,
+						time;
+
+					if (!norecursion && options.defaultDate) {
+						date = _this.strToDateTime(options.defaultDate);
+						d.setFullYear(date.getFullYear());
+						d.setMonth(date.getMonth());
+						d.setDate(date.getDate());
+					}
+
+					if (options.yearOffset) {
+						d.setFullYear(d.getFullYear() + options.yearOffset);
+					}
+
+					if (!norecursion && options.defaultTime) {
+						time = _this.strtotime(options.defaultTime);
+						d.setHours(time.getHours());
+						d.setMinutes(time.getMinutes());
+					}
+					return d;
+				};
+
+				_this.isValidDate = function (d) {
+					if (Object.prototype.toString.call(d) !== "[object Date]") {
+						return false;
+					}
+					return !isNaN(d.getTime());
+				};
+
+				_this.setCurrentTime = function (dTime, requireValidDate) {
+					if (typeof dTime === 'string') {
+						_this.currentTime = _this.strToDateTime(dTime);
+					}
+					else if (_this.isValidDate(dTime)) {
+						_this.currentTime = dTime;
+					}
+					else if (!dTime && !requireValidDate && options.allowBlank) {
+						_this.currentTime = null;
+					}
+					else {
+						_this.currentTime = _this.now();
+					}
+					
+					datetimepicker.trigger('xchange.xdsoft');
+				};
+
+				_this.empty = function () {
+					_this.currentTime = null;
+				};
+
+				_this.getCurrentTime = function (dTime) {
+					return _this.currentTime;
+				};
+
+				_this.nextMonth = function () {
+
+					if (_this.currentTime === undefined || _this.currentTime === null) {
+						_this.currentTime = _this.now();
+					}
+
+					var month = _this.currentTime.getMonth() + 1,
+						year;
+					if (month === 12) {
+						_this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1);
+						month = 0;
+					}
+
+					year = _this.currentTime.getFullYear();
+
+					_this.currentTime.setDate(
+						Math.min(
+							new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
+							_this.currentTime.getDate()
+						)
+					);
+					_this.currentTime.setMonth(month);
+
+					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
+						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+
+					if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
+						options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+
+					datetimepicker.trigger('xchange.xdsoft');
+					return month;
+				};
+
+				_this.prevMonth = function () {
+
+					if (_this.currentTime === undefined || _this.currentTime === null) {
+						_this.currentTime = _this.now();
+					}
+
+					var month = _this.currentTime.getMonth() - 1;
+					if (month === -1) {
+						_this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1);
+						month = 11;
+					}
+					_this.currentTime.setDate(
+						Math.min(
+							new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
+							_this.currentTime.getDate()
+						)
+					);
+					_this.currentTime.setMonth(month);
+					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
+						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+					datetimepicker.trigger('xchange.xdsoft');
+					return month;
+				};
+
+				_this.getWeekOfYear = function (datetime) {
+					if (options.onGetWeekOfYear && $.isFunction(options.onGetWeekOfYear)) {
+						var week = options.onGetWeekOfYear.call(datetimepicker, datetime);
+						if (typeof week !== 'undefined') {
+							return week;
+						}
+					}
+					var onejan = new Date(datetime.getFullYear(), 0, 1);
+					//First week of the year is th one with the first Thursday according to ISO8601
+					if(onejan.getDay()!=4)
+						onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7));
+					return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
+				};
+
+				_this.strToDateTime = function (sDateTime) {
+					var tmpDate = [], timeOffset, currentTime;
+
+					if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) {
+						return sDateTime;
+					}
+
+					tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime);
+					if (tmpDate) {
+						tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate);
+					}
+					if (tmpDate  && tmpDate[2]) {
+						timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
+						currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
+					} else {
+						currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now();
+					}
+
+					if (!_this.isValidDate(currentTime)) {
+						currentTime = _this.now();
+					}
+
+					return currentTime;
+				};
+
+				_this.strToDate = function (sDate) {
+					if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) {
+						return sDate;
+					}
+
+					var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true);
+					if (!_this.isValidDate(currentTime)) {
+						currentTime = _this.now(true);
+					}
+					return currentTime;
+				};
+
+				_this.strtotime = function (sTime) {
+					if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) {
+						return sTime;
+					}
+					var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true);
+					if (!_this.isValidDate(currentTime)) {
+						currentTime = _this.now(true);
+					}
+					return currentTime;
+				};
+
+				_this.str = function () {
+					return dateHelper.formatDate(_this.currentTime, options.format);
+				};
+				_this.currentTime = this.now();
+			};
+
+			_xdsoft_datetime = new XDSoft_datetime();
+
+			// applyButton.on('touchend click', function (e) {//pathbrite
+				// e.preventDefault();
+				// datetimepicker.data('changed', true);
+				// _xdsoft_datetime.setCurrentTime(getCurrentValue());
+				// input.val(_xdsoft_datetime.str());
+				// datetimepicker.trigger('close.xdsoft');
+			// });
+			month_picker
+				.find('.xdsoft_today_button')
+				.on('touchend mousedown.xdsoft', function () {
+					datetimepicker.data('changed', true);
+					_xdsoft_datetime.setCurrentTime(0, true);
+					datetimepicker.trigger('afterOpen.xdsoft');
+				}).on('dblclick.xdsoft', function () {
+					var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate;
+					currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
+					minDate = _xdsoft_datetime.strToDate(options.minDate);
+					minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
+					if (currentDate < minDate) {
+						return;
+					}
+					maxDate = _xdsoft_datetime.strToDate(options.maxDate);
+					maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
+					if (currentDate > maxDate) {
+						return;
+					}
+					input.val(_xdsoft_datetime.str());
+					input.trigger('change');
+					datetimepicker.trigger('close.xdsoft');
+				});
+			month_picker
+				.find('.xdsoft_prev,.xdsoft_next')
+				.on('touchend mousedown.xdsoft', function () {
+					var $this = $(this),
+						timer = 0,
+						stop = false;
+
+					(function arguments_callee1(v) {
+						if ($this.hasClass(options.next)) {
+							_xdsoft_datetime.nextMonth();
+						} else if ($this.hasClass(options.prev)) {
+							_xdsoft_datetime.prevMonth();
+						}
+						if (options.monthChangeSpinner) {
+							if (!stop) {
+								timer = setTimeout(arguments_callee1, v || 100);
+							}
+						}
+					}(500));
+
+					$([document.body, window]).on('touchend mouseup.xdsoft', function arguments_callee2() {
+						clearTimeout(timer);
+						stop = true;
+						$([document.body, window]).off('touchend mouseup.xdsoft', arguments_callee2);
+					});
+				});
+
+			timepicker
+				.find('.xdsoft_prev,.xdsoft_next')
+				.on('touchend mousedown.xdsoft', function () {
+					var $this = $(this),
+						timer = 0,
+						stop = false,
+						period = 110;
+					(function arguments_callee4(v) {
+						var pheight = timeboxparent[0].clientHeight,
+							height = timebox[0].offsetHeight,
+							top = Math.abs(parseInt(timebox.css('marginTop'), 10));
+						if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) {
+							timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
+						} else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) {
+							timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
+						}
+                        /**
+                         * Fixed bug:
+                         * When using css3 transition, it will cause a bug that you cannot scroll the timepicker list.
+                         * The reason is that the transition-duration time, if you set it to 0, all things fine, otherwise, this
+                         * would cause a bug when you use jquery.css method.
+                         * Let's say: * { transition: all .5s ease; }
+                         * jquery timebox.css('marginTop') will return the original value which is before you clicking the next/prev button,
+                         * meanwhile the timebox[0].style.marginTop will return the right value which is after you clicking the
+                         * next/prev button.
+                         * 
+                         * What we should do:
+                         * Replace timebox.css('marginTop') with timebox[0].style.marginTop.
+                         */
+                        timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]);
+						period = (period > 10) ? 10 : period - 10;
+						if (!stop) {
+							timer = setTimeout(arguments_callee4, v || period);
+						}
+					}(500));
+					$([document.body, window]).on('touchend mouseup.xdsoft', function arguments_callee5() {
+						clearTimeout(timer);
+						stop = true;
+						$([document.body, window])
+							.off('touchend mouseup.xdsoft', arguments_callee5);
+					});
+				});
+
+			xchangeTimer = 0;
+			// base handler - generating a calendar and timepicker
+			datetimepicker
+				.on('xchange.xdsoft', function (event) {
+					clearTimeout(xchangeTimer);
+					xchangeTimer = setTimeout(function () {
+
+						if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
+							//In case blanks are allowed, delay construction until we have a valid date 
+							if (options.allowBlank)
+								return;
+								
+							_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
+						}
+
+						var table =	'',
+							start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0),
+							i = 0,
+							j,
+							today = _xdsoft_datetime.now(),
+							maxDate = false,
+							minDate = false,
+							hDate,
+							day,
+							d,
+							y,
+							m,
+							w,
+							classes = [],
+							customDateSettings,
+							newRow = true,
+							time = '',
+							h = '',
+							line_time,
+							description;
+
+						while (start.getDay() !== options.dayOfWeekStart) {
+							start.setDate(start.getDate() - 1);
+						}
+
+						table += '<table><thead><tr>';
+
+						// if (options.weeks) {
+							// table += '<th></th>';
+						// }
+
+						for (j = 0; j < 7; j += 1) {
+							table += '<th>' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '</th>';
+						}
+
+						table += '</tr></thead>';
+						table += '<tbody>';
+
+						if (options.maxDate !== false) {
+							maxDate = _xdsoft_datetime.strToDate(options.maxDate);
+							maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999);
+						}
+
+						if (options.minDate !== false) {
+							minDate = _xdsoft_datetime.strToDate(options.minDate);
+							minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
+						}
+
+						while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) {
+							classes = [];
+							i += 1;
+
+							day = start.getDay();
+							d = start.getDate();
+							y = start.getFullYear();
+							m = start.getMonth();
+							w = _xdsoft_datetime.getWeekOfYear(start);
+							description = '';
+
+							classes.push('xdsoft_date');
+
+							if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) {
+								customDateSettings = options.beforeShowDay.call(datetimepicker, start);
+							} else {
+								customDateSettings = null;
+							}
+
+							// if(options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]"){
+								// if(!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))){
+									// classes.push('xdsoft_disabled');
+								// }
+							// } else if(options.allowDates && options.allowDates.length>0){
+								// if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){
+									// classes.push('xdsoft_disabled');
+								// }
+							// } else
+               if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
+								classes.push('xdsoft_disabled');
+							}// else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
+								// classes.push('xdsoft_disabled');
+							// } else if (options.disabledWeekDays.indexOf(day) !== -1) {
+								// classes.push('xdsoft_disabled');
+							// }else if (input.is('[readonly]')) {
+								// classes.push('xdsoft_disabled');
+							// }
+
+							if (customDateSettings && customDateSettings[1] !== "") {
+								classes.push(customDateSettings[1]);
+							}
+
+							if (_xdsoft_datetime.currentTime.getMonth() !== m) {
+								classes.push('xdsoft_other_month');
+							}
+
+							if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
+								classes.push('xdsoft_current');
+							}
+
+							if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
+								classes.push('xdsoft_today');
+							}
+
+							// if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
+								// classes.push('xdsoft_weekend');
+							// }
+
+							// if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) {
+								// hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)];
+								// classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style);
+								// description = hDate.desc === undefined ? '' : hDate.desc;
+							// }
+
+							if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) {
+								classes.push(options.beforeShowDay(start));
+							}
+
+							if (newRow) {
+								table += '<tr>';
+								newRow = false;
+								// if (options.weeks) {
+									// table += '<th>' + w + '</th>';
+								// }
+							}
+
+							table += '<td data-date="' + d + '" data-month="' + m + '" data-year="' + y + '"' + ' class="xdsoft_date xdsoft_day_of_week' + start.getDay() + ' ' + classes.join(' ') + '" title="' + description + '">' +
+										'<div>' + d + '</div>' +
+									'</td>';
+
+							if (start.getDay() === options.dayOfWeekStart - 1) {
+								table += '</tr>';
+								newRow = true;
+							}
+
+							start.setDate(d + 1);
+						}
+						table += '</tbody></table>';
+
+						calendar.html(table);
+
+						month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]);
+						month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());
+
+						// generate timebox
+						time = '';
+						h = '';
+						m = '';
+
+						line_time = function line_time(h, m) {
+							var now = _xdsoft_datetime.now(), optionDateTime, current_time,
+								isALlowTimesInit = options.allowTimes && $.isArray(options.allowTimes) && options.allowTimes.length;
+							now.setHours(h);
+							h = parseInt(now.getHours(), 10);
+							now.setMinutes(m);
+							m = parseInt(now.getMinutes(), 10);
+							optionDateTime = new Date(_xdsoft_datetime.currentTime);
+							optionDateTime.setHours(h);
+							optionDateTime.setMinutes(m);
+							classes = [];			
+							if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
+								classes.push('xdsoft_disabled');
+							} else if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
+								classes.push('xdsoft_disabled');
+							} else if (input.is('[readonly]')) {
+								classes.push('xdsoft_disabled');
+							}
+
+							current_time = new Date(_xdsoft_datetime.currentTime);
+							current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
+
+							if (!isALlowTimesInit) {
+								current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
+							}
+
+							if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && ((!isALlowTimesInit && options.step > 59) || current_time.getMinutes() === parseInt(m, 10))) {
+								if (options.defaultSelect || datetimepicker.data('changed')) {
+									classes.push('xdsoft_current');
+								} else if (options.initTime) {
+									classes.push('xdsoft_init_time');
+								}
+							}
+							if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) {
+								classes.push('xdsoft_today');
+							}
+							time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + dateHelper.formatDate(now, options.formatTime) + '</div>';
+						};
+
+						if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
+							for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) {
+								for (j = 0; j < 60; j += options.step) {
+									h = (i < 10 ? '0' : '') + i;
+									m = (j < 10 ? '0' : '') + j;
+									line_time(h, m);
+								}
+							}
+						} else {
+							for (i = 0; i < options.allowTimes.length; i += 1) {
+								h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
+								m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
+								line_time(h, m);
+							}
+						}
+
+						timebox.html(time);
+
+						opt = '';
+						i = 0;
+
+						for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) {
+							opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + i + '</div>';
+						}
+						yearselect.children().eq(0)
+												.html(opt);
+
+						for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) {
+							opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[globalLocale].months[i] + '</div>';
+						}
+						monthselect.children().eq(0).html(opt);
+						$(datetimepicker)
+							.trigger('generate.xdsoft');
+					}, 10);
+					event.stopPropagation();
+				})
+				.on('afterOpen.xdsoft', function () {
+					if (options.timepicker) {
+						var classType, pheight, height, top;
+						if (timebox.find('.xdsoft_current').length) {
+							classType = '.xdsoft_current';
+						} else if (timebox.find('.xdsoft_init_time').length) {
+							classType = '.xdsoft_init_time';
+						}
+						if (classType) {
+							pheight = timeboxparent[0].clientHeight;
+							height = timebox[0].offsetHeight;
+							top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1;
+							if ((height - pheight) < top) {
+								top = height - pheight;
+							}
+							timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]);
+						} else {
+							timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]);
+						}
+					}
+				});
+
+			timerclick = 0;
+			calendar
+				.on('touchend click.xdsoft', 'td', function (xdevent) {
+					xdevent.stopPropagation();  // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
+					timerclick += 1;
+					var $this = $(this),
+						currentTime = _xdsoft_datetime.currentTime;
+
+					if (currentTime === undefined || currentTime === null) {
+						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
+						currentTime = _xdsoft_datetime.currentTime;
+					}
+
+					if ($this.hasClass('xdsoft_disabled')) {
+						return false;
+					}
+
+					currentTime.setDate(1);
+					currentTime.setFullYear($this.data('year'));
+					currentTime.setMonth($this.data('month'));
+					currentTime.setDate($this.data('date'));
+
+					datetimepicker.trigger('select.xdsoft', [currentTime]);
+
+					input.val(_xdsoft_datetime.str());
+
+					if (options.onSelectDate &&	$.isFunction(options.onSelectDate)) {
+						options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
+					}
+
+					datetimepicker.data('changed', true);
+					datetimepicker.trigger('xchange.xdsoft');
+					datetimepicker.trigger('changedatetime.xdsoft');
+					if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) {
+						datetimepicker.trigger('close.xdsoft');
+					}
+					setTimeout(function () {
+						timerclick = 0;
+					}, 200);
+				});
+
+			timebox
+				.on('touchmove', 'div', function () { currentlyScrollingTimeDiv = true; })
+				.on('touchend click.xdsoft', 'div', function (xdevent) {
+					xdevent.stopPropagation();
+					if (currentlyScrollingTimeDiv) {
+				        	currentlyScrollingTimeDiv = false;
+				        	return;
+				    	}
+					var $this = $(this),
+						currentTime = _xdsoft_datetime.currentTime;
+
+					if (currentTime === undefined || currentTime === null) {
+						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
+						currentTime = _xdsoft_datetime.currentTime;
+					}
+
+					if ($this.hasClass('xdsoft_disabled')) {
+						return false;
+					}
+					currentTime.setHours($this.data('hour'));
+					currentTime.setMinutes($this.data('minute'));
+					datetimepicker.trigger('select.xdsoft', [currentTime]);
+
+					datetimepicker.data('input').val(_xdsoft_datetime.str());
+
+					if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
+						options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
+					}
+					datetimepicker.data('changed', true);
+					datetimepicker.trigger('xchange.xdsoft');
+					datetimepicker.trigger('changedatetime.xdsoft');
+					if (options.inline !== true && options.closeOnTimeSelect === true) {
+						datetimepicker.trigger('close.xdsoft');
+					}
+				});
+
+			datepicker
+				.on('mousewheel.xdsoft', function (event) {
+					if (!options.scrollMonth) {
+						return true;
+					}
+					if (event.deltaY < 0) {
+						_xdsoft_datetime.nextMonth();
+					} else {
+						_xdsoft_datetime.prevMonth();
+					}
+					return false;
+				});
+
+			input
+				.on('mousewheel.xdsoft', function (event) {
+					if (!options.scrollInput) {
+						return true;
+					}
+					if (!options.datepicker && options.timepicker) {
+						current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0;
+						if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) {
+							current_time_index += event.deltaY;
+						}
+						if (timebox.children().eq(current_time_index).length) {
+							timebox.children().eq(current_time_index).trigger('mousedown');
+						}
+						return false;
+					}
+					if (options.datepicker && !options.timepicker) {
+						datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]);
+						if (input.val) {
+							input.val(_xdsoft_datetime.str());
+						}
+						datetimepicker.trigger('changedatetime.xdsoft');
+						return false;
+					}
+				});
+
+			datetimepicker
+				.on('changedatetime.xdsoft', function (event) {
+					if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) {
+						var $input = datetimepicker.data('input');
+						options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
+						delete options.value;
+						$input.trigger('change');
+					}
+				})
+				.on('generate.xdsoft', function () {
+					if (options.onGenerate && $.isFunction(options.onGenerate)) {
+						options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+					if (triggerAfterOpen) {
+						datetimepicker.trigger('afterOpen.xdsoft');
+						triggerAfterOpen = false;
+					}
+				})
+				.on('click.xdsoft', function (xdevent) {
+					xdevent.stopPropagation();
+				});
+
+			current_time_index = 0;
+
+			/**
+			 * Runs the callback for each of the specified node's ancestors.
+			 *
+			 * Return FALSE from the callback to stop ascending.
+			 *
+			 * @param {DOMNode} node
+			 * @param {Function} callback
+			 * @returns {undefined}
+			 */
+			forEachAncestorOf = function (node, callback) {
+				do {
+					node = node.parentNode;
+
+					if (callback(node) === false) {
+						break;
+					}
+				} while (node.nodeName !== 'HTML');
+			};
+
+			/**
+			 * Sets the position of the picker.
+			 *
+			 * @returns {undefined}
+			 */
+			setPos = function () {
+				var dateInputOffset,
+					dateInputElem,
+					verticalPosition,
+					left,
+					position,
+					datetimepickerElem,
+					dateInputHasFixedAncestor,
+					$dateInput,
+					windowWidth,
+					verticalAnchorEdge,
+					datetimepickerCss,
+					windowHeight,
+					windowScrollTop;
+
+				$dateInput = datetimepicker.data('input');
+				dateInputOffset = $dateInput.offset();
+				dateInputElem = $dateInput[0];
+
+				verticalAnchorEdge = 'top';
+				verticalPosition = (dateInputOffset.top + dateInputElem.offsetHeight) - 1;
+				left = dateInputOffset.left;
+				position = "absolute";
+
+				windowWidth = $(window).width();
+				windowHeight = $(window).height();
+				windowScrollTop = $(window).scrollTop();
+
+				if ((document.documentElement.clientWidth - dateInputOffset.left) < datepicker.parent().outerWidth(true)) {
+					var diff = datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth;
+					left = left - diff;
+				}
+
+				// if ($dateInput.parent().css('direction') === 'rtl') {
+					// left -= (datetimepicker.outerWidth() - $dateInput.outerWidth());
+				// }
+
+				if (options.fixed) {
+					verticalPosition -= windowScrollTop;
+					left -= $(window).scrollLeft();
+					position = "fixed";
+				} else {
+					dateInputHasFixedAncestor = false;
+
+					forEachAncestorOf(dateInputElem, function (ancestorNode) {
+						if (window.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') {
+							dateInputHasFixedAncestor = true;
+							return false;
+						}
+					});
+
+					if (dateInputHasFixedAncestor) {
+						position = 'fixed';
+
+						//If the picker won't fit entirely within the viewport then display it above the date input.
+						if (verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop) {
+							verticalAnchorEdge = 'bottom';
+							verticalPosition = (windowHeight + windowScrollTop) - dateInputOffset.top;
+						} else {
+							verticalPosition -= windowScrollTop;
+						}
+					} else {
+						if (verticalPosition + dateInputElem.offsetHeight > windowHeight + windowScrollTop) {
+							verticalPosition = dateInputOffset.top - dateInputElem.offsetHeight + 1;
+						}
+					}
+
+					if (verticalPosition < 0) {
+						verticalPosition = 0;
+					}
+
+					if (left + dateInputElem.offsetWidth > windowWidth) {
+						left = windowWidth - dateInputElem.offsetWidth;
+					}
+				}
+
+				datetimepickerElem = datetimepicker[0];
+
+				forEachAncestorOf(datetimepickerElem, function (ancestorNode) {
+					var ancestorNodePosition;
+
+					ancestorNodePosition = window.getComputedStyle(ancestorNode).getPropertyValue('position');
+
+					if (ancestorNodePosition === 'relative' && windowWidth >= ancestorNode.offsetWidth) {
+						left = left - ((windowWidth - ancestorNode.offsetWidth) / 2);
+						return false;
+					}
+				});
+
+				datetimepickerCss = {
+					position: position,
+					left: left,
+					top: '',  //Initialize to prevent previous values interfering with new ones.
+					bottom: ''  //Initialize to prevent previous values interfering with new ones.
+				};
+
+				datetimepickerCss[verticalAnchorEdge] = verticalPosition;
+
+				datetimepicker.css(datetimepickerCss);
+			};
+
+			datetimepicker
+				.on('open.xdsoft', function (event) {
+					var onShow = true;
+					if (options.onShow && $.isFunction(options.onShow)) {
+						onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
+					}
+					if (onShow !== false) {
+						datetimepicker.show();
+						setPos();
+						$(window)
+							.off('resize.xdsoft', setPos)
+							.on('resize.xdsoft', setPos);
+
+						if (options.closeOnWithoutClick) {
+							$([document.body, window]).on('touchstart mousedown.xdsoft', function arguments_callee6() {
+								datetimepicker.trigger('close.xdsoft');
+								$([document.body, window]).off('touchstart mousedown.xdsoft', arguments_callee6);
+							});
+						}
+					}
+				})
+				.on('close.xdsoft', function (event) {
+					var onClose = true;
+					month_picker
+						.find('.xdsoft_month,.xdsoft_year')
+							.find('.xdsoft_select')
+								.hide();
+					if (options.onClose && $.isFunction(options.onClose)) {
+						onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
+					}
+					if (onClose !== false && !options.opened && !options.inline) {
+						datetimepicker.hide();
+					}
+					event.stopPropagation();
+				})
+				.on('toggle.xdsoft', function () {
+					if (datetimepicker.is(':visible')) {
+						datetimepicker.trigger('close.xdsoft');
+					} else {
+						datetimepicker.trigger('open.xdsoft');
+					}
+				})
+				.data('input', input);
+
+			timer = 0;
+
+			datetimepicker.data('xdsoft_datetime', _xdsoft_datetime);
+			datetimepicker.setOptions(options);
+
+			function getCurrentValue() {
+				var ct = false, time;
+
+				if (options.startDate) {
+					ct = _xdsoft_datetime.strToDate(options.startDate);
+				} else {
+					ct = options.value || ((input && input.val && input.val()) ? input.val() : '');
+					if (ct) {
+						ct = _xdsoft_datetime.strToDateTime(ct);
+					} else if (options.defaultDate) {
+						ct = _xdsoft_datetime.strToDateTime(options.defaultDate);
+						if (options.defaultTime) {
+							time = _xdsoft_datetime.strtotime(options.defaultTime);
+							ct.setHours(time.getHours());
+							ct.setMinutes(time.getMinutes());
+						}
+					}
+				}
+
+				if (ct && _xdsoft_datetime.isValidDate(ct)) {
+					datetimepicker.data('changed', true);
+				} else {
+					ct = '';
+				}
+
+				return ct || 0;
+			}
+
+			function setMask(options) {
+
+				var isValidValue = function (mask, value) {
+					var reg = mask
+						.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1')
+						.replace(/_/g, '{digit+}')
+						.replace(/([0-9]{1})/g, '{digit$1}')
+						.replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}')
+						.replace(/\{digit[\+]\}/g, '[0-9_]{1}');
+					return (new RegExp(reg)).test(value);
+				},
+				getCaretPos = function (input) {
+					try {
+						if (document.selection && document.selection.createRange) {
+							var range = document.selection.createRange();
+							return range.getBookmark().charCodeAt(2) - 2;
+						}
+						if (input.setSelectionRange) {
+							return input.selectionStart;
+						}
+					} catch (e) {
+						return 0;
+					}
+				},
+				setCaretPos = function (node, pos) {
+					node = (typeof node === "string" || node instanceof String) ? document.getElementById(node) : node;
+					if (!node) {
+						return false;
+					}
+					if (node.createTextRange) {
+						var textRange = node.createTextRange();
+						textRange.collapse(true);
+						textRange.moveEnd('character', pos);
+						textRange.moveStart('character', pos);
+						textRange.select();
+						return true;
+					}
+					if (node.setSelectionRange) {
+						node.setSelectionRange(pos, pos);
+						return true;
+					}
+					return false;
+				};
+				if(options.mask) {
+					input.off('keydown.xdsoft');
+				}
+				if (options.mask === true) {
+														if (typeof moment != 'undefined') {
+																	options.mask = options.format
+																			.replace(/Y{4}/g, '9999')
+																			.replace(/Y{2}/g, '99')
+																			.replace(/M{2}/g, '19')
+																			.replace(/D{2}/g, '39')
+																			.replace(/H{2}/g, '29')
+																			.replace(/m{2}/g, '59')
+																			.replace(/s{2}/g, '59');
+														} else {
+																	options.mask = options.format
+																			.replace(/Y/g, '9999')
+																			.replace(/F/g, '9999')
+																			.replace(/m/g, '19')
+																			.replace(/d/g, '39')
+																			.replace(/H/g, '29')
+																			.replace(/i/g, '59')
+																			.replace(/s/g, '59');
+														}
+				}
+
+				if ($.type(options.mask) === 'string') {
+					if (!isValidValue(options.mask, input.val())) {
+						input.val(options.mask.replace(/[0-9]/g, '_'));
+						setCaretPos(input[0], 0);
+					}
+
+					input.on('keydown.xdsoft', function (event) {
+						var val = this.value,
+							key = event.which,
+							pos,
+							digit;
+
+						if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) {
+							pos = getCaretPos(this);
+							digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_';
+
+							if ((key === BACKSPACE || key === DEL) && pos) {
+								pos -= 1;
+								digit = '_';
+							}
+
+							while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
+								pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
+							}
+
+							val = val.substr(0, pos) + digit + val.substr(pos + 1);
+							if ($.trim(val) === '') {
+								val = options.mask.replace(/[0-9]/g, '_');
+							} else {
+								if (pos === options.mask.length) {
+									event.preventDefault();
+									return false;
+								}
+							}
+
+							pos += (key === BACKSPACE || key === DEL) ? 0 : 1;
+							while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
+								pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
+							}
+
+							if (isValidValue(options.mask, val)) {
+								this.value = val;
+								setCaretPos(this, pos);
+							} else if ($.trim(val) === '') {
+								this.value = options.mask.replace(/[0-9]/g, '_');
+							} else {
+								input.trigger('error_input.xdsoft');
+							}
+						} else {
+							if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) {
+								return true;
+							}
+						}
+
+						event.preventDefault();
+						return false;
+					});
+				}
+			}
+
+			_xdsoft_datetime.setCurrentTime(getCurrentValue());
+
+			input
+				.data('xdsoft_datetimepicker', datetimepicker)
+				.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function () {
+					if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) {
+						return;
+					}
+					clearTimeout(timer);
+					timer = setTimeout(function () {
+						if (input.is(':disabled')) {
+							return;
+						}
+
+						triggerAfterOpen = true;
+						_xdsoft_datetime.setCurrentTime(getCurrentValue(), true);
+						if(options.mask) {
+							setMask(options);
+						}
+						datetimepicker.trigger('open.xdsoft');
+					}, 100);
+				})
+				.on('keydown.xdsoft', function (event) {
+					var elementSelector,
+						key = event.which;
+					if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
+						elementSelector = $("input:visible,textarea:visible,button:visible,a:visible");
+						datetimepicker.trigger('close.xdsoft');
+						elementSelector.eq(elementSelector.index(this) + 1).focus();
+						return false;
+					}
+					if ([TAB].indexOf(key) !== -1) {
+						datetimepicker.trigger('close.xdsoft');
+						return true;
+					}
+				})
+				.on('blur.xdsoft', function () {
+					datetimepicker.trigger('close.xdsoft');
+				});
+		};
+		destroyDateTimePicker = function (input) {
+			var datetimepicker = input.data('xdsoft_datetimepicker');
+			if (datetimepicker) {
+				datetimepicker.data('xdsoft_datetime', null);
+				datetimepicker.remove();
+				input
+					.data('xdsoft_datetimepicker', null)
+					.off('.xdsoft');
+				$(window).off('resize.xdsoft');
+				$([window, document.body]).off('mousedown.xdsoft touchstart');
+				if (input.unmousewheel) {
+					input.unmousewheel();
+				}
+			}
+		};
+		$(document)
+			.off('keydown.xdsoftctrl keyup.xdsoftctrl')
+			.on('keydown.xdsoftctrl', function (e) {
+				if (e.keyCode === CTRLKEY) {
+					ctrlDown = true;
+				}
+			})
+			.on('keyup.xdsoftctrl', function (e) {
+				if (e.keyCode === CTRLKEY) {
+					ctrlDown = false;
+				}
+			});
+
+		this.each(function () {
+			var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input;
+			if (datetimepicker) {
+				if ($.type(opt) === 'string') {
+					switch (opt) {
+					case 'show':
+						$(this).select().focus();
+						datetimepicker.trigger('open.xdsoft');
+						break;
+					case 'hide':
+						datetimepicker.trigger('close.xdsoft');
+						break;
+					case 'toggle':
+						datetimepicker.trigger('toggle.xdsoft');
+						break;
+					case 'destroy':
+						destroyDateTimePicker($(this));
+						break;
+					case 'reset':
+						this.value = this.defaultValue;
+						if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) {
+							datetimepicker.data('changed', false);
+						}
+						datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
+						break;
+					case 'validate':
+						$input = datetimepicker.data('input');
+						$input.trigger('blur.xdsoft');
+						break;
+					default:
+						if (datetimepicker[opt] && $.isFunction(datetimepicker[opt])) {
+							result = datetimepicker[opt](opt2);
+						}
+					}
+				} else {
+					datetimepicker
+						.setOptions(opt);
+				}
+				return 0;
+			}
+			if ($.type(opt) !== 'string') {
+				// if (!options.lazyInit || options.open || options.inline) {
+					createDateTimePicker($(this));
+				// } else {
+					// lazyInit($(this));
+				// }
+			}
+		});
+
+		return result;
+	};
+
+	$.fn.datetimepicker.defaults = default_options;
+
+	function HighlightedDate(date, desc, style) {
+		"use strict";
+		this.date = date;
+		this.desc = desc;
+		this.style = style;
+	}
+}));
+/*!
+ * jQuery Mousewheel 3.1.13
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ */
+
+(function (factory) {
+    if ( typeof define === 'function' && define.amd ) {
+        // AMD. Register as an anonymous module.
+        define(['jquery'], factory);
+    } else if (typeof exports === 'object') {
+        // Node/CommonJS style for Browserify
+        module.exports = factory;
+    } else {
+        // Browser globals
+        factory(jQuery);
+    }
+}(function ($) {
+
+    var toFix  = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
+        toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
+                    ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
+        slice  = Array.prototype.slice,
+        nullLowestDeltaTimeout, lowestDelta;
+
+    if ( $.event.fixHooks ) {
+        for ( var i = toFix.length; i; ) {
+            $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
+        }
+    }
+
+    var special = $.event.special.mousewheel = {
+        version: '3.1.12',
+
+        setup: function() {
+            if ( this.addEventListener ) {
+                for ( var i = toBind.length; i; ) {
+                    this.addEventListener( toBind[--i], handler, false );
+                }
+            } else {
+                this.onmousewheel = handler;
+            }
+            // Store the line height and page height for this particular element
+            $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
+            $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
+        },
+
+        teardown: function() {
+            if ( this.removeEventListener ) {
+                for ( var i = toBind.length; i; ) {
+                    this.removeEventListener( toBind[--i], handler, false );
+                }
+            } else {
+                this.onmousewheel = null;
+            }
+            // Clean up the data we added to the element
+            $.removeData(this, 'mousewheel-line-height');
+            $.removeData(this, 'mousewheel-page-height');
+        },
+
+        getLineHeight: function(elem) {
+            var $elem = $(elem),
+                $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
+            if (!$parent.length) {
+                $parent = $('body');
+            }
+            return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
+        },
+
+        getPageHeight: function(elem) {
+            return $(elem).height();
+        },
+
+        settings: {
+            adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
+            normalizeOffset: true  // calls getBoundingClientRect for each event
+        }
+    };
+
+    $.fn.extend({
+        mousewheel: function(fn) {
+            return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
+        },
+
+        unmousewheel: function(fn) {
+            return this.unbind('mousewheel', fn);
+        }
+    });
+
+
+    function handler(event) {
+        var orgEvent   = event || window.event,
+            args       = slice.call(arguments, 1),
+            delta      = 0,
+            deltaX     = 0,
+            deltaY     = 0,
+            absDelta   = 0,
+            offsetX    = 0,
+            offsetY    = 0;
+        event = $.event.fix(orgEvent);
+        event.type = 'mousewheel';
+
+        // Old school scrollwheel delta
+        if ( 'detail'      in orgEvent ) { deltaY = orgEvent.detail * -1;      }
+        if ( 'wheelDelta'  in orgEvent ) { deltaY = orgEvent.wheelDelta;       }
+        if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY;      }
+        if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
+
+        // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
+        if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
+            deltaX = deltaY * -1;
+            deltaY = 0;
+        }
+
+        // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
+        delta = deltaY === 0 ? deltaX : deltaY;
+
+        // New school wheel delta (wheel event)
+        if ( 'deltaY' in orgEvent ) {
+            deltaY = orgEvent.deltaY * -1;
+            delta  = deltaY;
+        }
+        if ( 'deltaX' in orgEvent ) {
+            deltaX = orgEvent.deltaX;
+            if ( deltaY === 0 ) { delta  = deltaX * -1; }
+        }
+
+        // No change actually happened, no reason to go any further
+        if ( deltaY === 0 && deltaX === 0 ) { return; }
+
+        // Need to convert lines and pages to pixels if we aren't already in pixels
+        // There are three delta modes:
+        //   * deltaMode 0 is by pixels, nothing to do
+        //   * deltaMode 1 is by lines
+        //   * deltaMode 2 is by pages
+        if ( orgEvent.deltaMode === 1 ) {
+            var lineHeight = $.data(this, 'mousewheel-line-height');
+            delta  *= lineHeight;
+            deltaY *= lineHeight;
+            deltaX *= lineHeight;
+        } else if ( orgEvent.deltaMode === 2 ) {
+            var pageHeight = $.data(this, 'mousewheel-page-height');
+            delta  *= pageHeight;
+            deltaY *= pageHeight;
+            deltaX *= pageHeight;
+        }
+
+        // Store lowest absolute delta to normalize the delta values
+        absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
+
+        if ( !lowestDelta || absDelta < lowestDelta ) {
+            lowestDelta = absDelta;
+
+            // Adjust older deltas if necessary
+            if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+                lowestDelta /= 40;
+            }
+        }
+
+        // Adjust older deltas if necessary
+        if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+            // Divide all the things by 40!
+            delta  /= 40;
+            deltaX /= 40;
+            deltaY /= 40;
+        }
+
+        // Get a whole, normalized value for the deltas
+        delta  = Math[ delta  >= 1 ? 'floor' : 'ceil' ](delta  / lowestDelta);
+        deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
+        deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
+
+        // Normalise offsetX and offsetY properties
+        if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
+            var boundingRect = this.getBoundingClientRect();
+            offsetX = event.clientX - boundingRect.left;
+            offsetY = event.clientY - boundingRect.top;
+        }
+
+        // Add information to the event object
+        event.deltaX = deltaX;
+        event.deltaY = deltaY;
+        event.deltaFactor = lowestDelta;
+        event.offsetX = offsetX;
+        event.offsetY = offsetY;
+        // Go ahead and set deltaMode to 0 since we converted to pixels
+        // Although this is a little odd since we overwrite the deltaX/Y
+        // properties with normalized deltas.
+        event.deltaMode = 0;
+
+        // Add event and delta to the front of the arguments
+        args.unshift(event, delta, deltaX, deltaY);
+
+        // Clearout lowestDelta after sometime to better
+        // handle multiple device types that give different
+        // a different lowestDelta
+        // Ex: trackpad = 3 and mouse wheel = 120
+        if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
+        nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
+
+        return ($.event.dispatch || $.event.handle).apply(this, args);
+    }
+
+    function nullLowestDelta() {
+        lowestDelta = null;
+    }
+
+    function shouldAdjustOldDeltas(orgEvent, absDelta) {
+        // If this is an older event and the delta is divisable by 120,
+        // then we are assuming that the browser is treating this as an
+        // older mouse wheel event and that we should divide the deltas
+        // by 40 to try and get a more usable deltaFactor.
+        // Side note, this actually impacts the reported scroll distance
+        // in older browsers and can cause scrolling to be slower than native.
+        // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
+        return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
+    }
+
+}));
diff -urN cahier-de-prepa5.1.0/js/datetimepicker.min.js cahier-de-prepa6.0.0/js/datetimepicker.min.js
--- cahier-de-prepa5.1.0/js/datetimepicker.min.js	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/js/datetimepicker.min.js	2016-08-23 22:51:31.505430393 +0200
@@ -0,0 +1,13 @@
+/* Version modifiée et simplifiée de jQuery DateTimePicker plugin v2.5.4, de Chupurnov Valeriy http://xdsoft.net/jqplugins/datetimepicker/
+ * supression des options du parser non utilisées, des langues autres que le français, de fonctionnalités inutiles
+ * Cyril Ravat, https://cahier-de-prepa.fr 2016 *//*!
+ * @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2015
+ * @version 1.3.3
+ *
+ * Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format.
+ * @see http://php.net/manual/en/function.date.php
+ *
+ * For more JQuery plugins visit http://plugins.krajee.com
+ * For more Yii related demos visit http://demos.krajee.com
+ */var DateFormatter;(function(){"use strict";var e,t,n,r,i,s;i=864e5,s=3600,e=function(e,t){return typeof e=="string"&&typeof t=="string"&&e.toLowerCase()===t.toLowerCase()},t=function(e,n,r){var i=r||"0",s=e.toString();return s.length<n?t(i+s,n):s},n=function(e){var t,r;e=e||{};for(t=1;t<arguments.length;t++){r=arguments[t];if(!r)continue;for(var i in r)r.hasOwnProperty(i)&&(typeof r[i]=="object"?n(e[i],r[i]):e[i]=r[i])}return e},r={dateSettings:{},separators:/[ \-\/:h]/g,validParts:/[dmYGi]/g,intParts:/[dmYGi]/g},DateFormatter=function(e){var t=this,i=n(r,e);t.dateSettings=i.dateSettings,t.separators=i.separators,t.validParts=i.validParts,t.intParts=i.intParts},DateFormatter.prototype={constructor:DateFormatter,parseDate:function(e,t){var n=this,r,i,s,o=!1,u=!1,a,f,l=n.dateSettings,c,h,p,d,v,m={date:null,year:null,month:null,day:null,hour:0,min:0,sec:0};if(!e)return undefined;if(e instanceof Date)return e;if(typeof e=="number")return new Date(e);if(typeof e!="string")return"";r=t.match(n.validParts);if(!r||r.length===0)throw new Error("Invalid date format definition.");i=e.replace(n.separators,"\0").split("\0");for(s=0;s<i.length;s++){a=i[s],f=parseInt(a);switch(r[s]){case"Y":d=a.length,d===2?m.year=parseInt((f<70?"20":"19")+a):d===4&&(m.year=f),o=!0;break;case"m":isNaN(a)?(c=l.monthsShort.indexOf(a),c>-1&&(m.month=c+1),c=l.months.indexOf(a),c>-1&&(m.month=c+1)):f>=1&&f<=12&&(m.month=f),o=!0;break;case"d":f>=1&&f<=31&&(m.day=f),o=!0;break;case"G":f>=0&&f<=23&&(m.hour=f),u=!0;break;case"i":f>=0&&f<=59&&(m.min=f),u=!0}}if(o===!0&&m.year&&m.month&&m.day)m.date=new Date(m.year,m.month-1,m.day,m.hour,m.min,m.sec,0);else{if(u!==!0)return!1;m.date=new Date(0,0,0,m.hour,m.min,m.sec,0)}return m.date},parseFormat:function(e,n){var r=this,i=r.dateSettings,s,o=/\\?(.?)/gi,u=function(e,t){return s[e]?s[e]():t};return s={d:function(){return t(n.getDate(),2)},m:function(){return t(n.getMonth()+1,2)},Y:function(){return n.getFullYear()},G:function(){return n.getHours()},i:function(){return t(n.getMinutes(),2)}},u(e,e)},formatDate:function(e,t){var n=this,r,i,s,o,u,a="";if(typeof e=="string"){e=n.parseDate(e,t);if(e===!1)return!1}if(e instanceof Date){s=t.length;for(r=0;r<s;r++){u=t.charAt(r);if(u==="S")continue;o=n.parseFormat(u,e),r!==s-1&&n.intParts.test(u)&&t.charAt(r+1)==="S"&&(i=parseInt(o),o+=n.dateSettings.ordinal(i)),a+=o}return a}return""}}})(),function(e){typeof define=="function"&&define.amd?define(["jquery","jquery-mousewheel"],e):typeof exports=="object"?module.exports=e:e(jQuery)}(function(e){"use strict";function u(e,t,n){this.date=e,this.desc=t,this.style=n}var t=!1,n={i18n:{fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeekShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],dayOfWeek:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]}},value:"",format:"d/m/Y Ghi",formatTime:"Ghi",formatDate:"d/m/Y",startDate:!1,step:15,monthChangeSpinner:!0,closeOnDateSelect:!1,closeOnTimeSelect:!0,closeOnWithoutClick:!0,closeOnInputClick:!0,timepicker:!0,datepicker:!0,defaultTime:"8h00",defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,disabledMinTime:!1,disabledMaxTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:"",onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onGetWeekOfYear:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:!0,inverseButton:!1,hours12:!1,next:"xdsoft_next",prev:"xdsoft_prev",dayOfWeekStart:1,parentID:"body",timeHeightInTimePicker:25,timepickerScrollbar:!0,todayButton:!0,prevButton:!0,nextButton:!0,defaultSelect:!0,scrollMonth:!0,scrollTime:!0,scrollInput:!0,mask:!1,validateOnBlur:!0,allowBlank:!0,yearStart:2015,yearEnd:2050,monthStart:0,monthEnd:11,style:"",id:"",fixed:!1,roundTime:"round",className:"",yearOffset:0,beforeShowDay:null,enterLikeTab:!0},r=null,i="fr",s="fr",o=function(){var t=n.i18n[s],i={days:t.dayOfWeek,daysShort:t.dayOfWeekShort,months:t.months,monthsShort:e.map(t.months,function(e){return e.substring(0,3)})};r=new DateFormatter({dateSettings:i})};e.datetimepicker={setDateFormatter:function(e){r=e}},o(),window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t==="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(e,t,n){return n.toUpperCase()})),e.currentStyle[t]||null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n,r;for(n=t||0,r=this.length;n<r;n+=1)if(this[n]===e)return n;return-1}),Date.prototype.countDaysInMonth=function(){return(new Date(this.getFullYear(),this.getMonth()+1,0)).getDate()},e.fn.xdsoftScroller=function(t){return this.each(function(){var n=e(this),r=function(e){var t={x:0,y:0},n;if(e.type==="touchstart"||e.type==="touchmove"||e.type==="touchend"||e.type==="touchcancel")n=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],t.x=n.clientX,t.y=n.clientY;else if(e.type==="mousedown"||e.type==="mouseup"||e.type==="mousemove"||e.type==="mouseover"||e.type==="mouseout"||e.type==="mouseenter"||e.type==="mouseleave")t.x=e.clientX,t.y=e.clientY;return t},i,s,o,u,a,f=100,l=!1,c=0,h=0,p=0,d=!1,v=0,m=function(){};if(t==="hide"){n.find(".xdsoft_scrollbar").hide();return}e(this).hasClass("xdsoft_scroller_box")||(i=n.children().eq(0),s=n[0].clientHeight,o=i[0].offsetHeight,u=e('<div class="xdsoft_scrollbar"></div>'),a=e('<div class="xdsoft_scroller"></div>'),u.append(a),n.addClass("xdsoft_scroller_box").append(u),m=function(t){var i=r(t).y-c+v;i<0&&(i=0),i+a[0].offsetHeight>p&&(i=p-a[0].offsetHeight),n.trigger("scroll_element.xdsoft_scroller",[f?i/f:0])},a.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(i){s||n.trigger("resize_scroll.xdsoft_scroller",[t]),c=r(i).y,v=parseInt(a.css("margin-top"),10),p=u[0].offsetHeight,i.type==="mousedown"||i.type==="touchstart"?(document&&e(document.body).addClass("xdsoft_noselect"),e([document.body,window]).on("touchend mouseup.xdsoft_scroller",function o(){e([document.body,window]).off("touchend mouseup.xdsoft_scroller",o).off("mousemove.xdsoft_scroller",m).removeClass("xdsoft_noselect")}),e(document.body).on("mousemove.xdsoft_scroller",m)):(d=!0,i.stopPropagation(),i.preventDefault())}).on("touchmove",function(e){d&&(e.preventDefault(),m(e))}).on("touchend touchcancel",function(){d=!1,v=0}),n.on("scroll_element.xdsoft_scroller",function(e,t){s||n.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=t>1?1:t<0||isNaN(t)?0:t,a.css("margin-top",f*t),setTimeout(function(){i.css("marginTop",-parseInt((i[0].offsetHeight-s)*t,10))},10)}).on("resize_scroll.xdsoft_scroller",function(e,t,r){var l,c;s=n[0].clientHeight,o=i[0].offsetHeight,l=s/o,c=l*u[0].offsetHeight,l>1?a.hide():(a.show(),a.css("height",parseInt(c>10?c:10,10)),f=u[0].offsetHeight-a[0].offsetHeight,r!==!0&&n.trigger("scroll_element.xdsoft_scroller",[t||Math.abs(parseInt(i.css("marginTop"),10))/(o-s)]))}),n.on("mousewheel",function(e){var t=Math.abs(parseInt(i.css("marginTop"),10));return t-=e.deltaY*20,t<0&&(t=0),n.trigger("scroll_element.xdsoft_scroller",[t/(o-s)]),e.stopPropagation(),!1}),n.on("touchstart",function(e){l=r(e),h=Math.abs(parseInt(i.css("marginTop"),10))}),n.on("touchmove",function(e){if(l){e.preventDefault();var t=r(e);n.trigger("scroll_element.xdsoft_scroller",[(h-(t.y-l.y))/(o-s)])}}),n.on("touchend touchcancel",function(){l=!1,h=0})),n.trigger("resize_scroll.xdsoft_scroller",[t])})},e.fn.datetimepicker=function(i,o){var u=this,a=48,f=57,l=96,c=105,h=17,p=46,d=13,v=27,m=8,g=37,y=38,b=39,w=40,E=9,S=116,x=65,T=67,N=86,C=90,k=89,L=!1,A=e.isPlainObject(i)||!i?e.extend(!0,{},n,i):e.extend(!0,{},n),O,M,O=function(n){function K(){var e=!1,t;return A.startDate?e=X.strToDate(A.startDate):(e=A.value||(n&&n.val&&n.val()?n.val():""),e?e=X.strToDateTime(e):A.defaultDate&&(e=X.strToDateTime(A.defaultDate),A.defaultTime&&(t=X.strtotime(A.defaultTime),e.setHours(t.getHours()),e.setMinutes(t.getMinutes())))),e&&X.isValidDate(e)?o.data("changed",!0):e="",e||0}function Q(t){var r=function(e,t){var n=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return(new RegExp(n)).test(t)},i=function(e){try{if(document.selection&&document.selection.createRange){var t=document.selection.createRange();return t.getBookmark().charCodeAt(2)-2}if(e.setSelectionRange)return e.selectionStart}catch(n){return 0}},s=function(e,t){e=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(!e)return!1;if(e.createTextRange){var n=e.createTextRange();return n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",t),n.select(),!0}return e.setSelectionRange?(e.setSelectionRange(t,t),!0):!1};t.mask&&n.off("keydown.xdsoft"),t.mask===!0&&(typeof moment!="undefined"?t.mask=t.format.replace(/Y{4}/g,"9999").replace(/Y{2}/g,"99").replace(/M{2}/g,"19").replace(/D{2}/g,"39").replace(/H{2}/g,"29").replace(/m{2}/g,"59").replace(/s{2}/g,"59"):t.mask=t.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),e.type(t.mask)==="string"&&(r(t.mask,n.val())||(n.val(t.mask.replace(/[0-9]/g,"_")),s(n[0],0)),n.on("keydown.xdsoft",function(o){var u=this.value,A=o.which,O,M;if(A>=a&&A<=f||A>=l&&A<=c||A===m||A===p){O=i(this),M=A!==m&&A!==p?String.fromCharCode(l<=A&&A<=c?A-a:A):"_",(A===m||A===p)&&O&&(O-=1,M="_");while(/[^0-9_]/.test(t.mask.substr(O,1))&&O<t.mask.length&&O>0)O+=A===m||A===p?-1:1;u=u.substr(0,O)+M+u.substr(O+1);if(e.trim(u)==="")u=t.mask.replace(/[0-9]/g,"_");else if(O===t.mask.length)return o.preventDefault(),!1;O+=A===m||A===p?0:1;while(/[^0-9_]/.test(t.mask.substr(O,1))&&O<t.mask.length&&O>0)O+=A===m||A===p?-1:1;r(t.mask,u)?(this.value=u,s(this,O)):e.trim(u)===""?this.value=t.mask.replace(/[0-9]/g,"_"):n.trigger("error_input.xdsoft")}else if([x,T,N,C,k].indexOf(A)!==-1&&L||[v,y,w,g,b,S,h,E,d].indexOf(A)!==-1)return!0;return o.preventDefault(),!1}))}var o=e('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),u=e('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),O=e('<div class="xdsoft_datepicker active"></div>'),M=e('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button><div class="xdsoft_label xdsoft_month"><span></span><i></i></div><div class="xdsoft_label xdsoft_year"><span></span><i></i></div><button type="button" class="xdsoft_next"></button></div>'),_=e('<div class="xdsoft_calendar"></div>'),D=e('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),P=D.find(".xdsoft_time_box").eq(0),H=e('<div class="xdsoft_time_variant"></div>'),B=e('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),j=e('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),F=!1,I,q,R,U,z,W=0,X,V,J;A.id&&o.attr("id",A.id),A.style&&o.attr("style",A.style),o.addClass("xdsoft_"+A.theme),o.addClass(A.className),M.find(".xdsoft_month span").after(B),M.find(".xdsoft_year span").after(j),M.find(".xdsoft_month,.xdsoft_year").on("touchstart mousedown.xdsoft",function(t){var n=e(this).find(".xdsoft_select").eq(0),r=0,i=0,s=n.is(":visible"),o,u;M.find(".xdsoft_select").hide(),X.currentTime&&(r=X.currentTime[e(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),n[s?"hide":"show"]();for(o=n.find("div.xdsoft_option"),u=0;u<o.length;u+=1){if(o.eq(u).data("value")===r)break;i+=o[0].offsetHeight}return n.xdsoftScroller(i/(n.children()[0].offsetHeight-n[0].clientHeight)),t.stopPropagation(),!1}),M.find(".xdsoft_select").xdsoftScroller().on("touchstart mousedown.xdsoft",function(e){e.stopPropagation(),e.preventDefault()}).on("touchstart mousedown.xdsoft",".xdsoft_option",function(){if(X.currentTime===undefined||X.currentTime===null)X.currentTime=X.now();var t=X.currentTime.getFullYear();X&&X.currentTime&&X.currentTime[e(this).parent().parent().hasClass("xdsoft_monthselect")?"setMonth":"setFullYear"](e(this).data("value")),e(this).parent().parent().hide(),o.trigger("xchange.xdsoft"),A.onChangeMonth&&e.isFunction(A.onChangeMonth)&&A.onChangeMonth.call(o,X.currentTime,o.data("input")),t!==X.currentTime.getFullYear()&&e.isFunction(A.onChangeYear)&&A.onChangeYear.call(o,X.currentTime,o.data("input"))}),o.getValue=function(){return X.getCurrentTime()},o.setOptions=function(t){var i={};A=e.extend(!0,{},A,t),A.datepicker?O.addClass("active"):O.removeClass("active"),A.timepicker?D.addClass("active"):D.removeClass("active"),A.value&&(X.setCurrentTime(A.value),n&&n.val&&n.val(X.str)),isNaN(A.dayOfWeekStart)?A.dayOfWeekStart=0:A.dayOfWeekStart=parseInt(A.dayOfWeekStart,10)%7,A.timepickerScrollbar||P.xdsoftScroller("hide"),A.minDate&&/^[\+\-](.*)$/.test(A.minDate)&&(A.minDate=r.formatDate(X.strToDateTime(A.minDate),A.formatDate)),A.maxDate&&/^[\+\-](.*)$/.test(A.maxDate)&&(A.maxDate=r.formatDate(X.strToDateTime(A.maxDate),A.formatDate)),M.find(".xdsoft_today_button").css("visibility",A.todayButton?"visible":"hidden"),M.find("."+A.prev).css("visibility",A.prevButton?"visible":"hidden"),M.find("."+A.next).css("visibility",A.nextButton?"visible":"hidden"),Q(A),A.validateOnBlur&&n.off("blur.xdsoft").on("blur.xdsoft",function(){if(A.allowBlank&&(!e.trim(e(this).val()).length||typeof A.mask=="string"&&e.trim(e(this).val())===A.mask.replace(/[0-9]/g,"_")))e(this).val(null),o.data("xdsoft_datetime").empty();else{var t=r.parseDate(e(this).val(),A.format);if(t)e(this).val(r.formatDate(t,A.format));else{var n=+[e(this).val()[0],e(this).val()[1]].join(""),i=+[e(this).val()[2],e(this).val()[3]].join("");!A.datepicker&&A.timepicker&&n>=0&&n<24&&i>=0&&i<60?e(this).val([n,i].map(function(e){return e>9?e:"0"+e}).join(":")):e(this).val(r.formatDate(X.now(),A.format))}o.data("xdsoft_datetime").setCurrentTime(e(this).val())}o.trigger("changedatetime.xdsoft"),o.trigger("close.xdsoft")}),o.trigger("xchange.xdsoft").trigger("afterOpen.xdsoft")},o.data("options",A).on("touchstart mousedown.xdsoft",function(e){return e.stopPropagation(),e.preventDefault(),j.hide(),B.hide(),!1}),P.append(H),P.xdsoftScroller(),o.on("afterOpen.xdsoft",function(){P.xdsoftScroller()}),o.append(O).append(D),A.withoutCopyright!==!0&&o.append(u),O.append(M).append(_),e(A.parentID).append(o),I=function(){var t=this;t.now=function(e){var n=new Date,r,i;return!e&&A.defaultDate&&(r=t.strToDateTime(A.defaultDate),n.setFullYear(r.getFullYear()),n.setMonth(r.getMonth()),n.setDate(r.getDate())),A.yearOffset&&n.setFullYear(n.getFullYear()+A.yearOffset),!e&&A.defaultTime&&(i=t.strtotime(A.defaultTime),n.setHours(i.getHours()),n.setMinutes(i.getMinutes())),n},t.isValidDate=function(e){return Object.prototype.toString.call(e)!=="[object Date]"?!1:!isNaN(e.getTime())},t.setCurrentTime=function(e,n){typeof e=="string"?t.currentTime=t.strToDateTime(e):t.isValidDate(e)?t.currentTime=e:!e&&!n&&A.allowBlank?t.currentTime=null:t.currentTime=t.now(),o.trigger("xchange.xdsoft")},t.empty=function(){t.currentTime=null},t.getCurrentTime=function(e){return t.currentTime},t.nextMonth=function(){if(t.currentTime===undefined||t.currentTime===null)t.currentTime=t.now();var n=t.currentTime.getMonth()+1,r;return n===12&&(t.currentTime.setFullYear(t.currentTime.getFullYear()+1),n=0),r=t.currentTime.getFullYear(),t.currentTime.setDate(Math.min((new Date(t.currentTime.getFullYear(),n+1,0)).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(n),A.onChangeMonth&&e.isFunction(A.onChangeMonth)&&A.onChangeMonth.call(o,X.currentTime,o.data("input")),r!==t.currentTime.getFullYear()&&e.isFunction(A.onChangeYear)&&A.onChangeYear.call(o,X.currentTime,o.data("input")),o.trigger("xchange.xdsoft"),n},t.prevMonth=function(){if(t.currentTime===undefined||t.currentTime===null)t.currentTime=t.now();var n=t.currentTime.getMonth()-1;return n===-1&&(t.currentTime.setFullYear(t.currentTime.getFullYear()-1),n=11),t.currentTime.setDate(Math.min((new Date(t.currentTime.getFullYear(),n+1,0)).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(n),A.onChangeMonth&&e.isFunction(A.onChangeMonth)&&A.onChangeMonth.call(o,X.currentTime,o.data("input")),o.trigger("xchange.xdsoft"),n},t.getWeekOfYear=function(t){if(A.onGetWeekOfYear&&e.isFunction(A.onGetWeekOfYear)){var n=A.onGetWeekOfYear.call(o,t);if(typeof n!="undefined")return n}var r=new Date(t.getFullYear(),0,1);return r.getDay()!=4&&r.setMonth(0,1+(4-r.getDay()+7)%7),Math.ceil(((t-r)/864e5+r.getDay()+1)/7)},t.strToDateTime=function(e){var n=[],i,s;return e&&e instanceof Date&&t.isValidDate(e)?e:(n=/^(\+|\-)(.*)$/.exec(e),n&&(n[2]=r.parseDate(n[2],A.formatDate)),n&&n[2]?(i=n[2].getTime()-n[2].getTimezoneOffset()*6e4,s=new Date(t.now(!0).getTime()+parseInt(n[1]+"1",10)*i)):s=e?r.parseDate(e,A.format):t.now(),t.isValidDate(s)||(s=t.now()),s)},t.strToDate=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=e?r.parseDate(e,A.formatDate):t.now(!0);return t.isValidDate(n)||(n=t.now(!0)),n},t.strtotime=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=e?r.parseDate(e,A.formatTime):t.now(!0);return t.isValidDate(n)||(n=t.now(!0)),n},t.str=function(){return r.formatDate(t.currentTime,A.format)},t.currentTime=this.now()},X=new I,M.find(".xdsoft_today_button").on("touchend mousedown.xdsoft",function(){o.data("changed",!0),X.setCurrentTime(0,!0),o.trigger("afterOpen.xdsoft")}).on("dblclick.xdsoft",function(){var e=X.getCurrentTime(),t,r;e=new Date(e.getFullYear(),e.getMonth(),e.getDate()),t=X.strToDate(A.minDate),t=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(e<t)return;r=X.strToDate(A.maxDate),r=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(e>r)return;n.val(X.str()),n.trigger("change"),o.trigger("close.xdsoft")}),M.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var t=e(this),n=0,r=!1;(function i(e){t.hasClass(A.next)?X.nextMonth():t.hasClass(A.prev)&&X.prevMonth(),A.monthChangeSpinner&&(r||(n=setTimeout(i,e||100)))})(500),e([document.body,window]).on("touchend mouseup.xdsoft",function s(){clearTimeout(n),r=!0,e([document.body,window]).off("touchend mouseup.xdsoft",s)})}),D.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var t=e(this),n=0,r=!1,i=110;(function s(e){var o=P[0].clientHeight,u=H[0].offsetHeight,a=Math.abs(parseInt(H.css("marginTop"),10));t.hasClass(A.next)&&u-o-A.timeHeightInTimePicker>=a?H.css("marginTop","-"+(a+A.timeHeightInTimePicker)+"px"):t.hasClass(A.prev)&&a-A.timeHeightInTimePicker>=0&&H.css("marginTop","-"+(a-A.timeHeightInTimePicker)+"px"),P.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(H[0].style.marginTop,10)/(u-o))]),i=i>10?10:i-10,r||(n=setTimeout(s,e||i))})(500),e([document.body,window]).on("touchend mouseup.xdsoft",function o(){clearTimeout(n),r=!0,e([document.body,window]).off("touchend mouseup.xdsoft",o)})}),q=0,o.on("xchange.xdsoft",function(t){clearTimeout(q),q=setTimeout(function(){if(X.currentTime===undefined||X.currentTime===null){if(A.allowBlank)return;X.currentTime=X.now()}var t="",u=new Date(X.currentTime.getFullYear(),X.currentTime.getMonth(),1,12,0,0),a=0,f,l=X.now(),c=!1,h=!1,p,d,v,m,g,y,b=[],w,E=!0,S="",x="",T,N;while(u.getDay()!==A.dayOfWeekStart)u.setDate(u.getDate()-1);t+="<table><thead><tr>";for(f=0;f<7;f+=1)t+="<th>"+A.i18n[s].dayOfWeekShort[(f+A.dayOfWeekStart)%7]+"</th>";t+="</tr></thead>",t+="<tbody>",A.maxDate!==!1&&(c=X.strToDate(A.maxDate),c=new Date(c.getFullYear(),c.getMonth(),c.getDate(),23,59,59,999)),A.minDate!==!1&&(h=X.strToDate(A.minDate),h=new Date(h.getFullYear(),h.getMonth(),h.getDate()));while(a<X.currentTime.countDaysInMonth()||u.getDay()!==A.dayOfWeekStart||X.currentTime.getMonth()===u.getMonth())b=[],a+=1,d=u.getDay(),v=u.getDate(),m=u.getFullYear(),g=u.getMonth(),y=X.getWeekOfYear(u),N="",b.push("xdsoft_date"),A.beforeShowDay&&e.isFunction(A.beforeShowDay.call)?w=A.beforeShowDay.call(o,u):w=null,(c!==!1&&u>c||h!==!1&&u<h||w&&w[0]===!1)&&b.push("xdsoft_disabled"),w&&w[1]!==""&&b.push(w[1]),X.currentTime.getMonth()!==g&&b.push("xdsoft_other_month"),(A.defaultSelect||o.data("changed"))&&r.formatDate(X.currentTime,A.formatDate)===r.formatDate(u,A.formatDate)&&b.push("xdsoft_current"),r.formatDate(l,A.formatDate)===r.formatDate(u,A.formatDate)&&b.push("xdsoft_today"),A.beforeShowDay&&e.isFunction(A.beforeShowDay)&&b.push(A.beforeShowDay(u)),E&&(t+="<tr>",E=!1),t+='<td data-date="'+v+'" data-month="'+g+'" data-year="'+m+'"'+' class="xdsoft_date xdsoft_day_of_week'+u.getDay()+" "+b.join(" ")+'" title="'+N+'">'+"<div>"+v+"</div>"+"</td>",u.getDay()===A.dayOfWeekStart-1&&(t+="</tr>",E=!0),u.setDate(v+1);t+="</tbody></table>",_.html(t),M.find(".xdsoft_label span").eq(0).text(A.i18n[s].months[X.currentTime.getMonth()]),M.find(".xdsoft_label span").eq(1).text(X.currentTime.getFullYear()),S="",x="",g="",T=function(i,s){var u=X.now(),a,f,c=A.allowTimes&&e.isArray(A.allowTimes)&&A.allowTimes.length;u.setHours(i),i=parseInt(u.getHours(),10),u.setMinutes(s),s=parseInt(u.getMinutes(),10),a=new Date(X.currentTime),a.setHours(i),a.setMinutes(s),b=[],A.minDateTime!==!1&&A.minDateTime>a||A.maxTime!==!1&&X.strtotime(A.maxTime).getTime()<u.getTime()||A.minTime!==!1&&X.strtotime(A.minTime).getTime()>u.getTime()?b.push("xdsoft_disabled"):A.minDateTime!==!1&&A.minDateTime>a||A.disabledMinTime!==!1&&u.getTime()>X.strtotime(A.disabledMinTime).getTime()&&A.disabledMaxTime!==!1&&u.getTime()<X.strtotime(A.disabledMaxTime).getTime()?b.push("xdsoft_disabled"):n.is("[readonly]")&&b.push("xdsoft_disabled"),f=new Date(X.currentTime),f.setHours(parseInt(X.currentTime.getHours(),10)),c||f.setMinutes(Math[A.roundTime](X.currentTime.getMinutes()/A.step)*A.step),(A.initTime||A.defaultSelect||o.data("changed"))&&f.getHours()===parseInt(i,10)&&(!c&&A.step>59||f.getMinutes()===parseInt(s,10))&&(A.defaultSelect||o.data("changed")?b.push("xdsoft_current"):A.initTime&&b.push("xdsoft_init_time")),parseInt(l.getHours(),10)===parseInt(i,10)&&parseInt(l.getMinutes(),10)===parseInt(s,10)&&b.push("xdsoft_today"),S+='<div class="xdsoft_time '+b.join(" ")+'" data-hour="'+i+'" data-minute="'+s+'">'+r.formatDate(u,A.formatTime)+"</div>"};if(!A.allowTimes||!e.isArray(A.allowTimes)||!A.allowTimes.length)for(a=0,f=0;a<(A.hours12?12:24);a+=1)for(f=0;f<60;f+=A.step)x=(a<10?"0":"")+a,g=(f<10?"0":"")+f,T(x,g);else for(a=0;a<A.allowTimes.length;a+=1)x=X.strtotime(A.allowTimes[a]).getHours(),g=X.strtotime(A.allowTimes[a]).getMinutes(),T(x,g);H.html(S),i="",a=0;for(a=parseInt(A.yearStart,10)+A.yearOffset;a<=parseInt(A.yearEnd,10)+A.yearOffset;a+=1)i+='<div class="xdsoft_option '+(X.currentTime.getFullYear()===a?"xdsoft_current":"")+'" data-value="'+a+'">'+a+"</div>";j.children().eq(0).html(i);for(a=parseInt(A.monthStart,10),i="";a<=parseInt(A.monthEnd,10);a+=1)i+='<div class="xdsoft_option '+(X.currentTime.getMonth()===a?"xdsoft_current":"")+'" data-value="'+a+'">'+A.i18n[s].months[a]+"</div>";B.children().eq(0).html(i),e(o).trigger("generate.xdsoft")},10),t.stopPropagation()}).on("afterOpen.xdsoft",function(){if(A.timepicker){var e,t,n,r;H.find(".xdsoft_current").length?e=".xdsoft_current":H.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=P[0].clientHeight,n=H[0].offsetHeight,r=H.find(e).index()*A.timeHeightInTimePicker+1,n-t<r&&(r=n-t),P.trigger("scroll_element.xdsoft_scroller",[parseInt(r,10)/(n-t)])):P.trigger("scroll_element.xdsoft_scroller",[0])}}),R=0,_.on("touchend click.xdsoft","td",function(t){t.stopPropagation(),R+=1;var r=e(this),i=X.currentTime;if(i===undefined||i===null)X.currentTime=X.now(),i=X.currentTime;if(r.hasClass("xdsoft_disabled"))return!1;i.setDate(1),i.setFullYear(r.data("year")),i.setMonth(r.data("month")),i.setDate(r.data("date")),o.trigger("select.xdsoft",[i]),n.val(X.str()),A.onSelectDate&&e.isFunction(A.onSelectDate)&&A.onSelectDate.call(o,X.currentTime,o.data("input"),t),o.data("changed",!0),o.trigger("xchange.xdsoft"),o.trigger("changedatetime.xdsoft"),(R>1||A.closeOnDateSelect===!0||A.closeOnDateSelect===!1&&!A.timepicker)&&!A.inline&&o.trigger("close.xdsoft"),setTimeout(function(){R=0},200)}),H.on("touchmove","div",function(){t=!0}).on("touchend click.xdsoft","div",function(n){n.stopPropagation();if(t){t=!1;return}var r=e(this),i=X.currentTime;if(i===undefined||i===null)X.currentTime=X.now(),i=X.currentTime;if(r.hasClass("xdsoft_disabled"))return!1;i.setHours(r.data("hour")),i.setMinutes(r.data("minute")),o.trigger("select.xdsoft",[i]),o.data("input").val(X.str()),A.onSelectTime&&e.isFunction(A.onSelectTime)&&A.onSelectTime.call(o,X.currentTime,o.data("input"),n),o.data("changed",!0),o.trigger("xchange.xdsoft"),o.trigger("changedatetime.xdsoft"),A.inline!==!0&&A.closeOnTimeSelect===!0&&o.trigger("close.xdsoft")}),O.on("mousewheel.xdsoft",function(e){return A.scrollMonth?(e.deltaY<0?X.nextMonth():X.prevMonth(),!1):!0}),n.on("mousewheel.xdsoft",function(e){if(!A.scrollInput)return!0;if(!A.datepicker&&A.timepicker)return U=H.find(".xdsoft_current").length?H.find(".xdsoft_current").eq(0).index():0,U+e.deltaY>=0&&U+e.deltaY<H.children().length&&(U+=e.deltaY),H.children().eq(U).length&&H.children().eq(U).trigger("mousedown"),!1;if(A.datepicker&&!A.timepicker)return O.trigger(e,[e.deltaY,e.deltaX,e.deltaY]),n.val&&n.val(X.str()),o.trigger("changedatetime.xdsoft"),!1}),o.on("changedatetime.xdsoft",function(t){if(A.onChangeDateTime&&e.isFunction(A.onChangeDateTime)){var n=o.data("input");A.onChangeDateTime.call(o,X.currentTime,n,t),delete A.value,n.trigger("change")}}).on("generate.xdsoft",function(){A.onGenerate&&e.isFunction(A.onGenerate)&&A.onGenerate.call(o,X.currentTime,o.data("input")),F&&(o.trigger("afterOpen.xdsoft"),F=!1)}).on("click.xdsoft",function(e){e.stopPropagation()}),U=0,V=function(e,t){do{e=e.parentNode;if(t(e)===!1)break}while(e.nodeName!=="HTML")},z=function(){var t,n,r,i,s,u,a,f,l,c,h,p,d;f=o.data("input"),t=f.offset(),n=f[0],c="top",r=t.top+n.offsetHeight-1,i=t.left,s="absolute",l=e(window).width(),p=e(window).height(),d=e(window).scrollTop();if(document.documentElement.clientWidth-t.left<O.parent().outerWidth(!0)){var v=O.parent().outerWidth(!0)-n.offsetWidth;i-=v}A.fixed?(r-=d,i-=e(window).scrollLeft(),s="fixed"):(a=!1,V(n,function(e){if(window.getComputedStyle(e).getPropertyValue("position")==="fixed")return a=!0,!1}),a?(s="fixed",r+o.outerHeight()>p+d?(c="bottom",r=p+d-t.top):r-=d):r+n.offsetHeight>p+d&&(r=t.top-n.offsetHeight+1),r<0&&(r=0),i+n.offsetWidth>l&&(i=l-n.offsetWidth)),u=o[0],V(u,function(e){var t;t=window.getComputedStyle(e).getPropertyValue("position");if(t==="relative"&&l>=e.offsetWidth)return i-=(l-e.offsetWidth)/2,!1}),h={position:s,left:i,top:"",bottom:""},h[c]=r,o.css(h)},o.on("open.xdsoft",function(t){var n=!0;A.onShow&&e.isFunction(A.onShow)&&(n=A.onShow.call(o,X.currentTime,o.data("input"),t)),n!==!1&&(o.show(),z(),e(window).off("resize.xdsoft",z).on("resize.xdsoft",z),A.closeOnWithoutClick&&e([document.body,window]).on("touchstart mousedown.xdsoft",function r(){o.trigger("close.xdsoft"),e([document.body,window]).off("touchstart mousedown.xdsoft",r)}))}).on("close.xdsoft",function(t){var n=!0;M.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),A.onClose&&e.isFunction(A.onClose)&&(n=A.onClose.call(o,X.currentTime,o.data("input"),t)),n!==!1&&!A.opened&&!A.inline&&o.hide(),t.stopPropagation()}).on("toggle.xdsoft",function(){o.is(":visible")?o.trigger("close.xdsoft"):o.trigger("open.xdsoft")}).data("input",n),W=0,o.data("xdsoft_datetime",X),o.setOptions(A),X.setCurrentTime(K()),n.data("xdsoft_datetimepicker",o).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function(){if(n.is(":disabled")||n.data("xdsoft_datetimepicker").is(":visible")&&A.closeOnInputClick)return;clearTimeout(W),W=setTimeout(function(){if(n.is(":disabled"))return;F=!0,X.setCurrentTime(K(),!0),A.mask&&Q(A),o.trigger("open.xdsoft")},100)}).on("keydown.xdsoft",function(t){var n,r=t.which;if([d].indexOf(r)!==-1&&A.enterLikeTab)return n=e("input:visible,textarea:visible,button:visible,a:visible"),o.trigger("close.xdsoft"),n.eq(n.index(this)+1).focus(),!1;if([E].indexOf(r)!==-1)return o.trigger("close.xdsoft"),!0}).on("blur.xdsoft",function(){o.trigger("close.xdsoft")})};return M=function(t){var n=t.data("xdsoft_datetimepicker");n&&(n.data("xdsoft_datetime",null),n.remove(),t.data("xdsoft_datetimepicker",null).off(".xdsoft"),e(window).off("resize.xdsoft"),e([window,document.body]).off("mousedown.xdsoft touchstart"),t.unmousewheel&&t.unmousewheel())},e(document).off("keydown.xdsoftctrl keyup.xdsoftctrl").on("keydown.xdsoftctrl",function(e){e.keyCode===h&&(L=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===h&&(L=!1)}),this.each(function(){var t=e(this).data("xdsoft_datetimepicker"),n;if(t){if(e.type(i)==="string")switch(i){case"show":e(this).select().focus(),t.trigger("open.xdsoft");break;case"hide":t.trigger("close.xdsoft");break;case"toggle":t.trigger("toggle.xdsoft");break;case"destroy":M(e(this));break;case"reset":this.value=this.defaultValue,(!this.value||!t.data("xdsoft_datetime").isValidDate(r.parseDate(this.value,A.format)))&&t.data("changed",!1),t.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":n=t.data("input"),n.trigger("blur.xdsoft");break;default:t[i]&&e.isFunction(t[i])&&(u=t[i](o))}else t.setOptions(i);return 0}e.type(i)!=="string"&&O(e(this))}),u},e.fn.datetimepicker.defaults=n}),function(e){typeof define=="function"&&define.amd?define(["jquery"],e):typeof exports=="object"?module.exports=e:e(jQuery)}(function(e){function a(t){var n=t||window.event,o=r.call(arguments,1),a=0,c=0,h=0,p=0,d=0,v=0;t=e.event.fix(n),t.type="mousewheel","detail"in n&&(h=n.detail*-1),"wheelDelta"in n&&(h=n.wheelDelta),"wheelDeltaY"in n&&(h=n.wheelDeltaY),"wheelDeltaX"in n&&(c=n.wheelDeltaX*-1),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(c=h*-1,h=0),a=h===0?c:h,"deltaY"in n&&(h=n.deltaY*-1,a=h),"deltaX"in n&&(c=n.deltaX,h===0&&(a=c*-1));if(h===0&&c===0)return;if(n.deltaMode===1){var m=e.data(this,"mousewheel-line-height");a*=m,h*=m,c*=m}else if(n.deltaMode===2){var g=e.data(this,"mousewheel-page-height");a*=g,h*=g,c*=g}p=Math.max(Math.abs(h),Math.abs(c));if(!s||p<s)s=p,l(n,p)&&(s/=40);l(n,p)&&(a/=40,c/=40,h/=40),a=Math[a>=1?"floor":"ceil"](a/s),c=Math[c>=1?"floor":"ceil"](c/s),h=Math[h>=1?"floor":"ceil"](h/s);if(u.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();d=t.clientX-y.left,v=t.clientY-y.top}return t.deltaX=c,t.deltaY=h,t.deltaFactor=s,t.offsetX=d,t.offsetY=v,t.deltaMode=0,o.unshift(t,a,c,h),i&&clearTimeout(i),i=setTimeout(f,200),(e.event.dispatch||e.event.handle).apply(this,o)}function f(){s=null}function l(e,t){return u.settings.adjustOldDeltas&&e.type==="mousewheel"&&t%120===0}var t=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],n="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],r=Array.prototype.slice,i,s;if(e.event.fixHooks)for(var o=t.length;o;)e.event.fixHooks[t[--o]]=e.event.mouseHooks;var u=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=n.length;t;)this.addEventListener(n[--t],a,!1);else this.onmousewheel=a;e.data(this,"mousewheel-line-height",u.getLineHeight(this)),e.data(this,"mousewheel-page-height",u.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=n.length;t;)this.removeEventListener(n[--t],a,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),r=n["offsetParent"in e.fn?"offsetParent":"parent"]();return r.length||(r=e("body")),parseInt(r.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset
+:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})});
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/js/datetimepicker.orig.js cahier-de-prepa6.0.0/js/datetimepicker.orig.js
--- cahier-de-prepa5.1.0/js/datetimepicker.orig.js	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/js/datetimepicker.orig.js	2016-08-23 22:34:10.995381857 +0200
@@ -0,0 +1,3192 @@
+/*!
+ * @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2015
+ * @version 1.3.3
+ *
+ * Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format.
+ * @see http://php.net/manual/en/function.date.php
+ *
+ * For more JQuery plugins visit http://plugins.krajee.com
+ * For more Yii related demos visit http://demos.krajee.com
+ */
+var DateFormatter;
+(function () {
+    "use strict";
+
+    var _compare, _lpad, _extend, defaultSettings, DAY, HOUR;
+    DAY = 1000 * 60 * 60 * 24;
+    HOUR = 3600;
+
+    _compare = function (str1, str2) {
+        return typeof(str1) === 'string' && typeof(str2) === 'string' && str1.toLowerCase() === str2.toLowerCase();
+    };
+    _lpad = function (value, length, char) {
+        var chr = char || '0', val = value.toString();
+        return val.length < length ? _lpad(chr + val, length) : val;
+    };
+    _extend = function (out) {
+        var i, obj;
+        out = out || {};
+        for (i = 1; i < arguments.length; i++) {
+            obj = arguments[i];
+            if (!obj) {
+                continue;
+            }
+            for (var key in obj) {
+                if (obj.hasOwnProperty(key)) {
+                    if (typeof obj[key] === 'object') {
+                        _extend(out[key], obj[key]);
+                    } else {
+                        out[key] = obj[key];
+                    }
+                }
+            }
+        }
+        return out;
+    };
+    defaultSettings = {
+        dateSettings: {
+            days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+            daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+            months: [
+                'January', 'February', 'March', 'April', 'May', 'June', 'July',
+                'August', 'September', 'October', 'November', 'December'
+            ],
+            monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+            meridiem: ['AM', 'PM'],
+            ordinal: function (number) {
+                var n = number % 10, suffixes = {1: 'st', 2: 'nd', 3: 'rd'};
+                return Math.floor(number % 100 / 10) === 1 || !suffixes[n] ? 'th' : suffixes[n];
+            }
+        },
+        separators: /[ \-+\/\.T:@]/g,
+        validParts: /[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,
+        intParts: /[djwNzmnyYhHgGis]/g,
+        tzParts: /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
+        tzClip: /[^-+\dA-Z]/g
+    };
+
+    DateFormatter = function (options) {
+        var self = this, config = _extend(defaultSettings, options);
+        self.dateSettings = config.dateSettings;
+        self.separators = config.separators;
+        self.validParts = config.validParts;
+        self.intParts = config.intParts;
+        self.tzParts = config.tzParts;
+        self.tzClip = config.tzClip;
+    };
+
+    DateFormatter.prototype = {
+        constructor: DateFormatter,
+        parseDate: function (vDate, vFormat) {
+            var self = this, vFormatParts, vDateParts, i, vDateFlag = false, vTimeFlag = false, vDatePart, iDatePart,
+                vSettings = self.dateSettings, vMonth, vMeriIndex, vMeriOffset, len, mer,
+                out = {date: null, year: null, month: null, day: null, hour: 0, min: 0, sec: 0};
+            if (!vDate) {
+                return undefined;
+            }
+            if (vDate instanceof Date) {
+                return vDate;
+            }
+            if (typeof vDate === 'number') {
+                return new Date(vDate);
+            }
+            if (vFormat === 'U') {
+                i = parseInt(vDate);
+                return i ? new Date(i * 1000) : vDate;
+            }
+            if (typeof vDate !== 'string') {
+                return '';
+            }
+            vFormatParts = vFormat.match(self.validParts);
+            if (!vFormatParts || vFormatParts.length === 0) {
+                throw new Error("Invalid date format definition.");
+            }
+            vDateParts = vDate.replace(self.separators, '\0').split('\0');
+            for (i = 0; i < vDateParts.length; i++) {
+                vDatePart = vDateParts[i];
+                iDatePart = parseInt(vDatePart);
+                switch (vFormatParts[i]) {
+                    case 'y':
+                    case 'Y':
+                        len = vDatePart.length;
+                        if (len === 2) {
+                            out.year = parseInt((iDatePart < 70 ? '20' : '19') + vDatePart);
+                        } else if (len === 4) {
+                            out.year = iDatePart;
+                        }
+                        vDateFlag = true;
+                        break;
+                    case 'm':
+                    case 'n':
+                    case 'M':
+                    case 'F':
+                        if (isNaN(vDatePart)) {
+                            vMonth = vSettings.monthsShort.indexOf(vDatePart);
+                            if (vMonth > -1) {
+                                out.month = vMonth + 1;
+                            }
+                            vMonth = vSettings.months.indexOf(vDatePart);
+                            if (vMonth > -1) {
+                                out.month = vMonth + 1;
+                            }
+                        } else {
+                            if (iDatePart >= 1 && iDatePart <= 12) {
+                                out.month = iDatePart;
+                            }
+                        }
+                        vDateFlag = true;
+                        break;
+                    case 'd':
+                    case 'j':
+                        if (iDatePart >= 1 && iDatePart <= 31) {
+                            out.day = iDatePart;
+                        }
+                        vDateFlag = true;
+                        break;
+                    case 'g':
+                    case 'h':
+                        vMeriIndex = (vFormatParts.indexOf('a') > -1) ? vFormatParts.indexOf('a') :
+                            (vFormatParts.indexOf('A') > -1) ? vFormatParts.indexOf('A') : -1;
+                        mer = vDateParts[vMeriIndex];
+                        if (vMeriIndex > -1) {
+                            vMeriOffset = _compare(mer, vSettings.meridiem[0]) ? 0 :
+                                (_compare(mer, vSettings.meridiem[1]) ? 12 : -1);
+                            if (iDatePart >= 1 && iDatePart <= 12 && vMeriOffset > -1) {
+                                out.hour = iDatePart + vMeriOffset;
+                            } else if (iDatePart >= 0 && iDatePart <= 23) {
+                                out.hour = iDatePart;
+                            }
+                        } else if (iDatePart >= 0 && iDatePart <= 23) {
+                            out.hour = iDatePart;
+                        }
+                        vTimeFlag = true;
+                        break;
+                    case 'G':
+                    case 'H':
+                        if (iDatePart >= 0 && iDatePart <= 23) {
+                            out.hour = iDatePart;
+                        }
+                        vTimeFlag = true;
+                        break;
+                    case 'i':
+                        if (iDatePart >= 0 && iDatePart <= 59) {
+                            out.min = iDatePart;
+                        }
+                        vTimeFlag = true;
+                        break;
+                    case 's':
+                        if (iDatePart >= 0 && iDatePart <= 59) {
+                            out.sec = iDatePart;
+                        }
+                        vTimeFlag = true;
+                        break;
+                }
+            }
+            if (vDateFlag === true && out.year && out.month && out.day) {
+                out.date = new Date(out.year, out.month - 1, out.day, out.hour, out.min, out.sec, 0);
+            } else {
+                if (vTimeFlag !== true) {
+                    return false;
+                }
+                out.date = new Date(0, 0, 0, out.hour, out.min, out.sec, 0);
+            }
+            return out.date;
+        },
+        guessDate: function (vDateStr, vFormat) {
+            if (typeof vDateStr !== 'string') {
+                return vDateStr;
+            }
+            var self = this, vParts = vDateStr.replace(self.separators, '\0').split('\0'), vPattern = /^[djmn]/g,
+                vFormatParts = vFormat.match(self.validParts), vDate = new Date(), vDigit = 0, vYear, i, iPart, iSec;
+
+            if (!vPattern.test(vFormatParts[0])) {
+                return vDateStr;
+            }
+
+            for (i = 0; i < vParts.length; i++) {
+                vDigit = 2;
+                iPart = vParts[i];
+                iSec = parseInt(iPart.substr(0, 2));
+                switch (i) {
+                    case 0:
+                        if (vFormatParts[0] === 'm' || vFormatParts[0] === 'n') {
+                            vDate.setMonth(iSec - 1);
+                        } else {
+                            vDate.setDate(iSec);
+                        }
+                        break;
+                    case 1:
+                        if (vFormatParts[0] === 'm' || vFormatParts[0] === 'n') {
+                            vDate.setDate(iSec);
+                        } else {
+                            vDate.setMonth(iSec - 1);
+                        }
+                        break;
+                    case 2:
+                        vYear = vDate.getFullYear();
+                        if (iPart.length < 4) {
+                            vDate.setFullYear(parseInt(vYear.toString().substr(0, 4 - iPart.length) + iPart));
+                            vDigit = iPart.length;
+                        } else {
+                            vDate.setFullYear = parseInt(iPart.substr(0, 4));
+                            vDigit = 4;
+                        }
+                        break;
+                    case 3:
+                        vDate.setHours(iSec);
+                        break;
+                    case 4:
+                        vDate.setMinutes(iSec);
+                        break;
+                    case 5:
+                        vDate.setSeconds(iSec);
+                        break;
+                }
+                if (iPart.substr(vDigit).length > 0) {
+                    vParts.splice(i + 1, 0, iPart.substr(vDigit));
+                }
+            }
+            return vDate;
+        },
+        parseFormat: function (vChar, vDate) {
+            var self = this, vSettings = self.dateSettings, fmt, backspace = /\\?(.?)/gi, doFormat = function (t, s) {
+                return fmt[t] ? fmt[t]() : s;
+            };
+            fmt = {
+                /////////
+                // DAY //
+                /////////
+                /**
+                 * Day of month with leading 0: `01..31`
+                 * @return {string}
+                 */
+                d: function () {
+                    return _lpad(fmt.j(), 2);
+                },
+                /**
+                 * Shorthand day name: `Mon...Sun`
+                 * @return {string}
+                 */
+                D: function () {
+                    return vSettings.daysShort[fmt.w()];
+                },
+                /**
+                 * Day of month: `1..31`
+                 * @return {number}
+                 */
+                j: function () {
+                    return vDate.getDate();
+                },
+                /**
+                 * Full day name: `Monday...Sunday`
+                 * @return {number}
+                 */
+                l: function () {
+                    return vSettings.days[fmt.w()];
+                },
+                /**
+                 * ISO-8601 day of week: `1[Mon]..7[Sun]`
+                 * @return {number}
+                 */
+                N: function () {
+                    return fmt.w() || 7;
+                },
+                /**
+                 * Day of week: `0[Sun]..6[Sat]`
+                 * @return {number}
+                 */
+                w: function () {
+                    return vDate.getDay();
+                },
+                /**
+                 * Day of year: `0..365`
+                 * @return {number}
+                 */
+                z: function () {
+                    var a = new Date(fmt.Y(), fmt.n() - 1, fmt.j()), b = new Date(fmt.Y(), 0, 1);
+                    return Math.round((a - b) / DAY);
+                },
+
+                //////////
+                // WEEK //
+                //////////
+                /**
+                 * ISO-8601 week number
+                 * @return {number}
+                 */
+                W: function () {
+                    var a = new Date(fmt.Y(), fmt.n() - 1, fmt.j() - fmt.N() + 3), b = new Date(a.getFullYear(), 0, 4);
+                    return _lpad(1 + Math.round((a - b) / DAY / 7), 2);
+                },
+
+                ///////////
+                // MONTH //
+                ///////////
+                /**
+                 * Full month name: `January...December`
+                 * @return {string}
+                 */
+                F: function () {
+                    return vSettings.months[vDate.getMonth()];
+                },
+                /**
+                 * Month w/leading 0: `01..12`
+                 * @return {string}
+                 */
+                m: function () {
+                    return _lpad(fmt.n(), 2);
+                },
+                /**
+                 * Shorthand month name; `Jan...Dec`
+                 * @return {string}
+                 */
+                M: function () {
+                    return vSettings.monthsShort[vDate.getMonth()];
+                },
+                /**
+                 * Month: `1...12`
+                 * @return {number}
+                 */
+                n: function () {
+                    return vDate.getMonth() + 1;
+                },
+                /**
+                 * Days in month: `28...31`
+                 * @return {number}
+                 */
+                t: function () {
+                    return (new Date(fmt.Y(), fmt.n(), 0)).getDate();
+                },
+
+                //////////
+                // YEAR //
+                //////////
+                /**
+                 * Is leap year? `0 or 1`
+                 * @return {number}
+                 */
+                L: function () {
+                    var Y = fmt.Y();
+                    return (Y % 4 === 0 && Y % 100 !== 0 || Y % 400 === 0) ? 1 : 0;
+                },
+                /**
+                 * ISO-8601 year
+                 * @return {number}
+                 */
+                o: function () {
+                    var n = fmt.n(), W = fmt.W(), Y = fmt.Y();
+                    return Y + (n === 12 && W < 9 ? 1 : n === 1 && W > 9 ? -1 : 0);
+                },
+                /**
+                 * Full year: `e.g. 1980...2010`
+                 * @return {number}
+                 */
+                Y: function () {
+                    return vDate.getFullYear();
+                },
+                /**
+                 * Last two digits of year: `00...99`
+                 * @return {string}
+                 */
+                y: function () {
+                    return fmt.Y().toString().slice(-2);
+                },
+
+                //////////
+                // TIME //
+                //////////
+                /**
+                 * Meridian lower: `am or pm`
+                 * @return {string}
+                 */
+                a: function () {
+                    return fmt.A().toLowerCase();
+                },
+                /**
+                 * Meridian upper: `AM or PM`
+                 * @return {string}
+                 */
+                A: function () {
+                    var n = fmt.G() < 12 ? 0 : 1;
+                    return vSettings.meridiem[n];
+                },
+                /**
+                 * Swatch Internet time: `000..999`
+                 * @return {string}
+                 */
+                B: function () {
+                    var H = vDate.getUTCHours() * HOUR, i = vDate.getUTCMinutes() * 60, s = vDate.getUTCSeconds();
+                    return _lpad(Math.floor((H + i + s + HOUR) / 86.4) % 1000, 3);
+                },
+                /**
+                 * 12-Hours: `1..12`
+                 * @return {number}
+                 */
+                g: function () {
+                    return fmt.G() % 12 || 12;
+                },
+                /**
+                 * 24-Hours: `0..23`
+                 * @return {number}
+                 */
+                G: function () {
+                    return vDate.getHours();
+                },
+                /**
+                 * 12-Hours with leading 0: `01..12`
+                 * @return {string}
+                 */
+                h: function () {
+                    return _lpad(fmt.g(), 2);
+                },
+                /**
+                 * 24-Hours w/leading 0: `00..23`
+                 * @return {string}
+                 */
+                H: function () {
+                    return _lpad(fmt.G(), 2);
+                },
+                /**
+                 * Minutes w/leading 0: `00..59`
+                 * @return {string}
+                 */
+                i: function () {
+                    return _lpad(vDate.getMinutes(), 2);
+                },
+                /**
+                 * Seconds w/leading 0: `00..59`
+                 * @return {string}
+                 */
+                s: function () {
+                    return _lpad(vDate.getSeconds(), 2);
+                },
+                /**
+                 * Microseconds: `000000-999000`
+                 * @return {string}
+                 */
+                u: function () {
+                    return _lpad(vDate.getMilliseconds() * 1000, 6);
+                },
+
+                //////////////
+                // TIMEZONE //
+                //////////////
+                /**
+                 * Timezone identifier: `e.g. Atlantic/Azores, ...`
+                 * @return {string}
+                 */
+                e: function () {
+                    var str = /\((.*)\)/.exec(String(vDate))[1];
+                    return str || 'Coordinated Universal Time';
+                },
+                /**
+                 * Timezone abbreviation: `e.g. EST, MDT, ...`
+                 * @return {string}
+                 */
+                T: function () {
+                    var str = (String(vDate).match(self.tzParts) || [""]).pop().replace(self.tzClip, "");
+                    return str || 'UTC';
+                },
+                /**
+                 * DST observed? `0 or 1`
+                 * @return {number}
+                 */
+                I: function () {
+                    var a = new Date(fmt.Y(), 0), c = Date.UTC(fmt.Y(), 0),
+                        b = new Date(fmt.Y(), 6), d = Date.UTC(fmt.Y(), 6);
+                    return ((a - c) !== (b - d)) ? 1 : 0;
+                },
+                /**
+                 * Difference to GMT in hour format: `e.g. +0200`
+                 * @return {string}
+                 */
+                O: function () {
+                    var tzo = vDate.getTimezoneOffset(), a = Math.abs(tzo);
+                    return (tzo > 0 ? '-' : '+') + _lpad(Math.floor(a / 60) * 100 + a % 60, 4);
+                },
+                /**
+                 * Difference to GMT with colon: `e.g. +02:00`
+                 * @return {string}
+                 */
+                P: function () {
+                    var O = fmt.O();
+                    return (O.substr(0, 3) + ':' + O.substr(3, 2));
+                },
+                /**
+                 * Timezone offset in seconds: `-43200...50400`
+                 * @return {number}
+                 */
+                Z: function () {
+                    return -vDate.getTimezoneOffset() * 60;
+                },
+
+                ////////////////////
+                // FULL DATE TIME //
+                ////////////////////
+                /**
+                 * ISO-8601 date
+                 * @return {string}
+                 */
+                c: function () {
+                    return 'Y-m-d\\TH:i:sP'.replace(backspace, doFormat);
+                },
+                /**
+                 * RFC 2822 date
+                 * @return {string}
+                 */
+                r: function () {
+                    return 'D, d M Y H:i:s O'.replace(backspace, doFormat);
+                },
+                /**
+                 * Seconds since UNIX epoch
+                 * @return {number}
+                 */
+                U: function () {
+                    return vDate.getTime() / 1000 || 0;
+                }
+            };
+            return doFormat(vChar, vChar);
+        },
+        formatDate: function (vDate, vFormat) {
+            var self = this, i, n, len, str, vChar, vDateStr = '';
+            if (typeof vDate === 'string') {
+                vDate = self.parseDate(vDate, vFormat);
+                if (vDate === false) {
+                    return false;
+                }
+            }
+            if (vDate instanceof Date) {
+                len = vFormat.length;
+                for (i = 0; i < len; i++) {
+                    vChar = vFormat.charAt(i);
+                    if (vChar === 'S') {
+                        continue;
+                    }
+                    str = self.parseFormat(vChar, vDate);
+                    if (i !== (len - 1) && self.intParts.test(vChar) && vFormat.charAt(i + 1) === 'S') {
+                        n = parseInt(str);
+                        str += self.dateSettings.ordinal(n);
+                    }
+                    vDateStr += str;
+                }
+                return vDateStr;
+            }
+            return '';
+        }
+    };
+})();/**
+ * @preserve jQuery DateTimePicker plugin v2.5.4
+ * @homepage http://xdsoft.net/jqplugins/datetimepicker/
+ * @author Chupurnov Valeriy (<chupurnov@gmail.com>)
+ */
+/*global DateFormatter, document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
+;(function (factory) {
+	if ( typeof define === 'function' && define.amd ) {
+		// AMD. Register as an anonymous module.
+		define(['jquery', 'jquery-mousewheel'], factory);
+	} else if (typeof exports === 'object') {
+		// Node/CommonJS style for Browserify
+		module.exports = factory;
+	} else {
+		// Browser globals
+		factory(jQuery);
+	}
+}(function ($) {
+	'use strict';
+	
+	var currentlyScrollingTimeDiv = false;
+	
+	var default_options  = {
+		i18n: {
+			ar: { // Arabic
+				months: [
+					"كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"
+				],
+				dayOfWeekShort: [
+					"ن", "ث", "ع", "خ", "ج", "س", "ح"
+				],
+				dayOfWeek: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"]
+			},
+			ro: { // Romanian
+				months: [
+					"Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"
+				],
+				dayOfWeekShort: [
+					"Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ"
+				],
+				dayOfWeek: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă"]
+			},
+			id: { // Indonesian
+				months: [
+					"Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"
+				],
+				dayOfWeekShort: [
+					"Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"
+				],
+				dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]
+			},
+			is: { // Icelandic
+				months: [
+					"Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"
+				],
+				dayOfWeekShort: [
+					"Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau"
+				],
+				dayOfWeek: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"]
+			},
+			bg: { // Bulgarian
+				months: [
+					"Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
+				],
+				dayOfWeekShort: [
+					"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
+				],
+				dayOfWeek: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"]
+			},
+			fa: { // Persian/Farsi
+				months: [
+					'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'
+				],
+				dayOfWeekShort: [
+					'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'
+				],
+				dayOfWeek: ["یک‌شنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنج‌شنبه", "جمعه", "شنبه", "یک‌شنبه"]
+			},
+			ru: { // Russian
+				months: [
+					'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
+				],
+				dayOfWeekShort: [
+					"Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
+				],
+				dayOfWeek: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"]
+			},
+			uk: { // Ukrainian
+				months: [
+					'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
+				],
+				dayOfWeekShort: [
+					"Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
+				],
+				dayOfWeek: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"]
+			},
+			en: { // English
+				months: [
+					"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+				],
+				dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+			},
+			el: { // Ελληνικά
+				months: [
+					"Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
+				],
+				dayOfWeekShort: [
+					"Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
+				],
+				dayOfWeek: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"]
+			},
+			de: { // German
+				months: [
+					'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
+				],
+				dayOfWeekShort: [
+					"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
+				],
+				dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]
+			},
+			nl: { // Dutch
+				months: [
+					"januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"
+				],
+				dayOfWeekShort: [
+					"zo", "ma", "di", "wo", "do", "vr", "za"
+				],
+				dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"]
+			},
+			tr: { // Turkish
+				months: [
+					"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
+				],
+				dayOfWeekShort: [
+					"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"
+				],
+				dayOfWeek: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"]
+			},
+			fr: { //French
+				months: [
+					"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
+				],
+				dayOfWeekShort: [
+					"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
+				],
+				dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"]
+			},
+			es: { // Spanish
+				months: [
+					"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
+				],
+				dayOfWeekShort: [
+					"Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"
+				],
+				dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"]
+			},
+			th: { // Thai
+				months: [
+					'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'
+				],
+				dayOfWeekShort: [
+					'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'
+				],
+				dayOfWeek: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"]
+			},
+			pl: { // Polish
+				months: [
+					"styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
+				],
+				dayOfWeekShort: [
+					"nd", "pn", "wt", "śr", "cz", "pt", "sb"
+				],
+				dayOfWeek: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"]
+			},
+			pt: { // Portuguese
+				months: [
+					"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
+				],
+				dayOfWeekShort: [
+					"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"
+				],
+				dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"]
+			},
+			ch: { // Simplified Chinese
+				months: [
+					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
+				],
+				dayOfWeekShort: [
+					"日", "一", "二", "三", "四", "五", "六"
+				]
+			},
+			se: { // Swedish
+				months: [
+					"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September",  "Oktober", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
+				]
+			},
+			kr: { // Korean
+				months: [
+					"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
+				],
+				dayOfWeekShort: [
+					"일", "월", "화", "수", "목", "금", "토"
+				],
+				dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
+			},
+			it: { // Italian
+				months: [
+					"Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"
+				],
+				dayOfWeekShort: [
+					"Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"
+				],
+				dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"]
+			},
+			da: { // Dansk
+				months: [
+					"January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
+				],
+				dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"]
+			},
+			no: { // Norwegian
+				months: [
+					"Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
+				],
+				dayOfWeekShort: [
+					"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
+				],
+				dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag']
+			},
+			ja: { // Japanese
+				months: [
+					"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
+				],
+				dayOfWeekShort: [
+					"日", "月", "火", "水", "木", "金", "土"
+				],
+				dayOfWeek: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜"]
+			},
+			vi: { // Vietnamese
+				months: [
+					"Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"
+				],
+				dayOfWeekShort: [
+					"CN", "T2", "T3", "T4", "T5", "T6", "T7"
+				],
+				dayOfWeek: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"]
+			},
+			sl: { // Slovenščina
+				months: [
+					"Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
+				],
+				dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"]
+			},
+			cs: { // Čeština
+				months: [
+					"Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
+				],
+				dayOfWeekShort: [
+					"Ne", "Po", "Út", "St", "Čt", "Pá", "So"
+				]
+			},
+			hu: { // Hungarian
+				months: [
+					"Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
+				],
+				dayOfWeek: ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"]
+			},
+			az: { //Azerbaijanian (Azeri)
+				months: [
+					"Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"
+				],
+				dayOfWeekShort: [
+					"B", "Be", "Ça", "Ç", "Ca", "C", "Ş"
+				],
+				dayOfWeek: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə"]
+			},
+			bs: { //Bosanski
+				months: [
+					"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
+				],
+				dayOfWeekShort: [
+					"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
+				],
+				dayOfWeek: ["Nedjelja","Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
+			},
+			ca: { //Català
+				months: [
+					"Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
+				],
+				dayOfWeekShort: [
+					"Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"
+				],
+				dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"]
+			},
+			'en-GB': { //English (British)
+				months: [
+					"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+				],
+				dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+			},
+			et: { //"Eesti"
+				months: [
+					"Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"
+				],
+				dayOfWeekShort: [
+					"P", "E", "T", "K", "N", "R", "L"
+				],
+				dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"]
+			},
+			eu: { //Euskara
+				months: [
+					"Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"
+				],
+				dayOfWeekShort: [
+					"Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La."
+				],
+				dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata']
+			},
+			fi: { //Finnish (Suomi)
+				months: [
+					"Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
+				],
+				dayOfWeekShort: [
+					"Su", "Ma", "Ti", "Ke", "To", "Pe", "La"
+				],
+				dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"]
+			},
+			gl: { //Galego
+				months: [
+					"Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec"
+				],
+				dayOfWeekShort: [
+					"Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab"
+				],
+				dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"]
+			},
+			hr: { //Hrvatski
+				months: [
+					"Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
+				],
+				dayOfWeekShort: [
+					"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
+				],
+				dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
+			},
+			ko: { //Korean (한국어)
+				months: [
+					"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
+				],
+				dayOfWeekShort: [
+					"일", "월", "화", "수", "목", "금", "토"
+				],
+				dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
+			},
+			lt: { //Lithuanian (lietuvių)
+				months: [
+					"Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio"
+				],
+				dayOfWeekShort: [
+					"Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"
+				],
+				dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"]
+			},
+			lv: { //Latvian (Latviešu)
+				months: [
+					"Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"
+				],
+				dayOfWeekShort: [
+					"Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St"
+				],
+				dayOfWeek: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena"]
+			},
+			mk: { //Macedonian (Македонски)
+				months: [
+					"јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"
+				],
+				dayOfWeekShort: [
+					"нед", "пон", "вто", "сре", "чет", "пет", "саб"
+				],
+				dayOfWeek: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"]
+			},
+			mn: { //Mongolian (Монгол)
+				months: [
+					"1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"
+				],
+				dayOfWeekShort: [
+					"Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням"
+				],
+				dayOfWeek: ["Даваа", "Мягмар", "Лхагва", "Пүрэв", "Баасан", "Бямба", "Ням"]
+			},
+			'pt-BR': { //Português(Brasil)
+				months: [
+					"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
+				],
+				dayOfWeekShort: [
+					"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"
+				],
+				dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"]
+			},
+			sk: { //Slovenčina
+				months: [
+					"Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Ne", "Po", "Ut", "St", "Št", "Pi", "So"
+				],
+				dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"]
+			},
+			sq: { //Albanian (Shqip)
+				months: [
+					"Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"
+				],
+				dayOfWeekShort: [
+					"Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu"
+				],
+				dayOfWeek: ["E Diel", "E Hënë", "E Martē", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"]
+			},
+			'sr-YU': { //Serbian (Srpski)
+				months: [
+					"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
+				],
+				dayOfWeekShort: [
+					"Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub"
+				],
+				dayOfWeek: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota"]
+			},
+			sr: { //Serbian Cyrillic (Српски)
+				months: [
+					"јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар"
+				],
+				dayOfWeekShort: [
+					"нед", "пон", "уто", "сре", "чет", "пет", "суб"
+				],
+				dayOfWeek: ["Недеља","Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"]
+			},
+			sv: { //Svenska
+				months: [
+					"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
+				],
+				dayOfWeek: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"]
+			},
+			'zh-TW': { //Traditional Chinese (繁體中文)
+				months: [
+					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
+				],
+				dayOfWeekShort: [
+					"日", "一", "二", "三", "四", "五", "六"
+				],
+				dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
+			},
+			zh: { //Simplified Chinese (简体中文)
+				months: [
+					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
+				],
+				dayOfWeekShort: [
+					"日", "一", "二", "三", "四", "五", "六"
+				],
+				dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
+			},
+			he: { //Hebrew (עברית)
+				months: [
+					'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
+				],
+				dayOfWeekShort: [
+					'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'
+				],
+				dayOfWeek: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"]
+			},
+			hy: { // Armenian
+				months: [
+					"Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"
+				],
+				dayOfWeekShort: [
+					"Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ"
+				],
+				dayOfWeek: ["Կիրակի", "Երկուշաբթի", "Երեքշաբթի", "Չորեքշաբթի", "Հինգշաբթի", "Ուրբաթ", "Շաբաթ"]
+			},
+			kg: { // Kyrgyz
+				months: [
+					'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'
+				],
+				dayOfWeekShort: [
+					"Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"
+				],
+				dayOfWeek: [
+					"Жекшемб", "Дүйшөмб", "Шейшемб", "Шаршемб", "Бейшемби", "Жума", "Ишенб"
+				]
+			},
+			rm: { // Romansh
+				months: [
+					"Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December"
+				],
+				dayOfWeekShort: [
+					"Du", "Gli", "Ma", "Me", "Gie", "Ve", "So"
+				],
+				dayOfWeek: [
+					"Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda"
+				]
+			},
+			ka: { // Georgian
+				months: [
+					'იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი'
+				],
+				dayOfWeekShort: [
+					"კვ", "ორშ", "სამშ", "ოთხ", "ხუთ", "პარ", "შაბ"
+				],
+				dayOfWeek: ["კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი"]
+			},
+		},
+		value: '',
+		rtl: false,
+
+		format:	'Y/m/d H:i',
+		formatTime:	'H:i',
+		formatDate:	'Y/m/d',
+
+		startDate:	false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05',
+		step: 60,
+		monthChangeSpinner: true,
+
+		closeOnDateSelect: false,
+		closeOnTimeSelect: true,
+		closeOnWithoutClick: true,
+		closeOnInputClick: true,
+
+		timepicker: true,
+		datepicker: true,
+		weeks: false,
+
+		defaultTime: false,	// use formatTime format (ex. '10:00' for formatTime:	'H:i')
+		defaultDate: false,	// use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05')
+
+		minDate: false,
+		maxDate: false,
+		minTime: false,
+		maxTime: false,
+		disabledMinTime: false,
+		disabledMaxTime: false,
+
+		allowTimes: [],
+		opened: false,
+		initTime: true,
+		inline: false,
+		theme: '',
+
+		onSelectDate: function () {},
+		onSelectTime: function () {},
+		onChangeMonth: function () {},
+		onGetWeekOfYear: function () {},
+		onChangeYear: function () {},
+		onChangeDateTime: function () {},
+		onShow: function () {},
+		onClose: function () {},
+		onGenerate: function () {},
+
+		withoutCopyright: true,
+		inverseButton: false,
+		hours12: false,
+		next: 'xdsoft_next',
+		prev : 'xdsoft_prev',
+		dayOfWeekStart: 0,
+		parentID: 'body',
+		timeHeightInTimePicker: 25,
+		timepickerScrollbar: true,
+		todayButton: true,
+		prevButton: true,
+		nextButton: true,
+		defaultSelect: true,
+
+		scrollMonth: true,
+		scrollTime: true,
+		scrollInput: true,
+
+		lazyInit: false,
+		mask: false,
+		validateOnBlur: true,
+		allowBlank: true,
+		yearStart: 1950,
+		yearEnd: 2050,
+		monthStart: 0,
+		monthEnd: 11,
+		style: '',
+		id: '',
+		fixed: false,
+		roundTime: 'round', // ceil, floor
+		className: '',
+		weekends: [],
+		highlightedDates: [],
+		highlightedPeriods: [],
+		allowDates : [],
+		allowDateRe : null,
+		disabledDates : [],
+		disabledWeekDays: [],
+		yearOffset: 0,
+		beforeShowDay: null,
+
+		enterLikeTab: true,
+		showApplyButton: false
+	};
+
+	var dateHelper = null,
+		globalLocaleDefault = 'en',
+		globalLocale = 'en';
+
+	var dateFormatterOptionsDefault = {
+		meridiem: ['AM', 'PM']
+	};
+
+	var initDateFormatter = function(){
+		var locale = default_options.i18n[globalLocale],
+			opts = {
+				days: locale.dayOfWeek,
+				daysShort: locale.dayOfWeekShort,
+				months: locale.months,
+				monthsShort: $.map(locale.months, function(n){ return n.substring(0, 3) }),
+			};
+
+	 	dateHelper = new DateFormatter({
+			dateSettings: $.extend({}, dateFormatterOptionsDefault, opts)
+		});
+	};
+
+	// for locale settings
+	$.datetimepicker = {
+		setLocale: function(locale){
+			var newLocale = default_options.i18n[locale]?locale:globalLocaleDefault;
+			if(globalLocale != newLocale){
+				globalLocale = newLocale;
+				// reinit date formatter
+				initDateFormatter();
+			}
+		},
+		setDateFormatter: function(dateFormatter) {
+			dateHelper = dateFormatter;
+		},
+		RFC_2822: 'D, d M Y H:i:s O',
+		ATOM: 'Y-m-d\TH:i:sP',
+		ISO_8601: 'Y-m-d\TH:i:sO',
+		RFC_822: 'D, d M y H:i:s O',
+		RFC_850: 'l, d-M-y H:i:s T',
+		RFC_1036: 'D, d M y H:i:s O',
+		RFC_1123: 'D, d M Y H:i:s O',
+		RSS: 'D, d M Y H:i:s O',
+		W3C: 'Y-m-d\TH:i:sP'
+	};
+
+	// first init date formatter
+	initDateFormatter();
+
+	// fix for ie8
+	if (!window.getComputedStyle) {
+		window.getComputedStyle = function (el, pseudo) {
+			this.el = el;
+			this.getPropertyValue = function (prop) {
+				var re = /(\-([a-z]){1})/g;
+				if (prop === 'float') {
+					prop = 'styleFloat';
+				}
+				if (re.test(prop)) {
+					prop = prop.replace(re, function (a, b, c) {
+						return c.toUpperCase();
+					});
+				}
+				return el.currentStyle[prop] || null;
+			};
+			return this;
+		};
+	}
+	if (!Array.prototype.indexOf) {
+		Array.prototype.indexOf = function (obj, start) {
+			var i, j;
+			for (i = (start || 0), j = this.length; i < j; i += 1) {
+				if (this[i] === obj) { return i; }
+			}
+			return -1;
+		};
+	}
+	Date.prototype.countDaysInMonth = function () {
+		return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
+	};
+	$.fn.xdsoftScroller = function (percent) {
+		return this.each(function () {
+			var timeboxparent = $(this),
+				pointerEventToXY = function (e) {
+					var out = {x: 0, y: 0},
+						touch;
+					if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') {
+						touch  = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
+						out.x = touch.clientX;
+						out.y = touch.clientY;
+					} else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
+						out.x = e.clientX;
+						out.y = e.clientY;
+					}
+					return out;
+				},
+				timebox,
+				parentHeight,
+				height,
+				scrollbar,
+				scroller,
+				maximumOffset = 100,
+				start = false,
+				startY = 0,
+				startTop = 0,
+				h1 = 0,
+				touchStart = false,
+				startTopScroll = 0,
+				calcOffset = function () {};
+			if (percent === 'hide') {
+				timeboxparent.find('.xdsoft_scrollbar').hide();
+				return;
+			}
+			if (!$(this).hasClass('xdsoft_scroller_box')) {
+				timebox = timeboxparent.children().eq(0);
+				parentHeight = timeboxparent[0].clientHeight;
+				height = timebox[0].offsetHeight;
+				scrollbar = $('<div class="xdsoft_scrollbar"></div>');
+				scroller = $('<div class="xdsoft_scroller"></div>');
+				scrollbar.append(scroller);
+
+				timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
+				calcOffset = function calcOffset(event) {
+					var offset = pointerEventToXY(event).y - startY + startTopScroll;
+					if (offset < 0) {
+						offset = 0;
+					}
+					if (offset + scroller[0].offsetHeight > h1) {
+						offset = h1 - scroller[0].offsetHeight;
+					}
+					timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]);
+				};
+
+				scroller
+					.on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) {
+						if (!parentHeight) {
+							timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
+						}
+
+						startY = pointerEventToXY(event).y;
+						startTopScroll = parseInt(scroller.css('margin-top'), 10);
+						h1 = scrollbar[0].offsetHeight;
+
+						if (event.type === 'mousedown' || event.type === 'touchstart') {
+							if (document) {
+								$(document.body).addClass('xdsoft_noselect');
+							}
+							$([document.body, window]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() {
+								$([document.body, window]).off('touchend mouseup.xdsoft_scroller', arguments_callee)
+									.off('mousemove.xdsoft_scroller', calcOffset)
+									.removeClass('xdsoft_noselect');
+							});
+							$(document.body).on('mousemove.xdsoft_scroller', calcOffset);
+						} else {
+							touchStart = true;
+							event.stopPropagation();
+							event.preventDefault();
+						}
+					})
+					.on('touchmove', function (event) {
+						if (touchStart) {
+							event.preventDefault();
+							calcOffset(event);
+						}
+					})
+					.on('touchend touchcancel', function () {
+						touchStart =  false;
+						startTopScroll = 0;
+					});
+
+				timeboxparent
+					.on('scroll_element.xdsoft_scroller', function (event, percentage) {
+						if (!parentHeight) {
+							timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]);
+						}
+						percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage;
+
+						scroller.css('margin-top', maximumOffset * percentage);
+
+						setTimeout(function () {
+							timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10));
+						}, 10);
+					})
+					.on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) {
+						var percent, sh;
+						parentHeight = timeboxparent[0].clientHeight;
+						height = timebox[0].offsetHeight;
+						percent = parentHeight / height;
+						sh = percent * scrollbar[0].offsetHeight;
+						if (percent > 1) {
+							scroller.hide();
+						} else {
+							scroller.show();
+							scroller.css('height', parseInt(sh > 10 ? sh : 10, 10));
+							maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight;
+							if (noTriggerScroll !== true) {
+								timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]);
+							}
+						}
+					});
+
+				timeboxparent.on('mousewheel', function (event) {
+					var top = Math.abs(parseInt(timebox.css('marginTop'), 10));
+
+					top = top - (event.deltaY * 20);
+					if (top < 0) {
+						top = 0;
+					}
+
+					timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]);
+					event.stopPropagation();
+					return false;
+				});
+
+				timeboxparent.on('touchstart', function (event) {
+					start = pointerEventToXY(event);
+					startTop = Math.abs(parseInt(timebox.css('marginTop'), 10));
+				});
+
+				timeboxparent.on('touchmove', function (event) {
+					if (start) {
+						event.preventDefault();
+						var coord = pointerEventToXY(event);
+						timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]);
+					}
+				});
+
+				timeboxparent.on('touchend touchcancel', function () {
+					start = false;
+					startTop = 0;
+				});
+			}
+			timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
+		});
+	};
+
+	$.fn.datetimepicker = function (opt, opt2) {
+		var result = this,
+			KEY0 = 48,
+			KEY9 = 57,
+			_KEY0 = 96,
+			_KEY9 = 105,
+			CTRLKEY = 17,
+			DEL = 46,
+			ENTER = 13,
+			ESC = 27,
+			BACKSPACE = 8,
+			ARROWLEFT = 37,
+			ARROWUP = 38,
+			ARROWRIGHT = 39,
+			ARROWDOWN = 40,
+			TAB = 9,
+			F5 = 116,
+			AKEY = 65,
+			CKEY = 67,
+			VKEY = 86,
+			ZKEY = 90,
+			YKEY = 89,
+			ctrlDown	=	false,
+			options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options),
+
+			lazyInitTimer = 0,
+			createDateTimePicker,
+			destroyDateTimePicker,
+
+			lazyInit = function (input) {
+				input
+					.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback() {
+						if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) {
+							return;
+						}
+						clearTimeout(lazyInitTimer);
+						lazyInitTimer = setTimeout(function () {
+
+							if (!input.data('xdsoft_datetimepicker')) {
+								createDateTimePicker(input);
+							}
+							input
+								.off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback)
+								.trigger('open.xdsoft');
+						}, 100);
+					});
+			};
+
+		createDateTimePicker = function (input) {
+			var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),
+				xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
+				datepicker = $('<div class="xdsoft_datepicker active"></div>'),
+				month_picker = $('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' +
+					'<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>' +
+					'<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>' +
+					'<button type="button" class="xdsoft_next"></button></div>'),
+				calendar = $('<div class="xdsoft_calendar"></div>'),
+				timepicker = $('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),
+				timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
+				timebox = $('<div class="xdsoft_time_variant"></div>'),
+				applyButton = $('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),
+
+				monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
+				yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),
+				triggerAfterOpen = false,
+				XDSoft_datetime,
+
+				xchangeTimer,
+				timerclick,
+				current_time_index,
+				setPos,
+				timer = 0,
+				_xdsoft_datetime,
+				forEachAncestorOf,
+				throttle;
+
+			if (options.id) {
+				datetimepicker.attr('id', options.id);
+			}
+			if (options.style) {
+				datetimepicker.attr('style', options.style);
+			}
+			if (options.weeks) {
+				datetimepicker.addClass('xdsoft_showweeks');
+			}
+			if (options.rtl) {
+				datetimepicker.addClass('xdsoft_rtl');
+			}
+
+			datetimepicker.addClass('xdsoft_' + options.theme);
+			datetimepicker.addClass(options.className);
+
+			month_picker
+				.find('.xdsoft_month span')
+					.after(monthselect);
+			month_picker
+				.find('.xdsoft_year span')
+					.after(yearselect);
+
+			month_picker
+				.find('.xdsoft_month,.xdsoft_year')
+					.on('touchstart mousedown.xdsoft', function (event) {
+					var select = $(this).find('.xdsoft_select').eq(0),
+						val = 0,
+						top = 0,
+						visible = select.is(':visible'),
+						items,
+						i;
+
+					month_picker
+						.find('.xdsoft_select')
+							.hide();
+					if (_xdsoft_datetime.currentTime) {
+						val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear']();
+					}
+
+					select[visible ? 'hide' : 'show']();
+					for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) {
+						if (items.eq(i).data('value') === val) {
+							break;
+						} else {
+							top += items[0].offsetHeight;
+						}
+					}
+
+					select.xdsoftScroller(top / (select.children()[0].offsetHeight - (select[0].clientHeight)));
+					event.stopPropagation();
+					return false;
+				});
+
+			month_picker
+				.find('.xdsoft_select')
+					.xdsoftScroller()
+				.on('touchstart mousedown.xdsoft', function (event) {
+					event.stopPropagation();
+					event.preventDefault();
+				})
+				.on('touchstart mousedown.xdsoft', '.xdsoft_option', function () {
+					if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
+						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
+					}
+
+					var year = _xdsoft_datetime.currentTime.getFullYear();
+					if (_xdsoft_datetime && _xdsoft_datetime.currentTime) {
+						_xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value'));
+					}
+
+					$(this).parent().parent().hide();
+
+					datetimepicker.trigger('xchange.xdsoft');
+					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
+						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+
+					if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
+						options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+				});
+
+			datetimepicker.getValue = function () {
+				return _xdsoft_datetime.getCurrentTime();
+			};
+
+			datetimepicker.setOptions = function (_options) {
+				var highlightedDates = {};
+
+				options = $.extend(true, {}, options, _options);
+
+				if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) {
+					options.allowTimes = $.extend(true, [], _options.allowTimes);
+				}
+
+				if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
+					options.weekends = $.extend(true, [], _options.weekends);
+				}
+
+				if (_options.allowDates && $.isArray(_options.allowDates) && _options.allowDates.length) {
+					options.allowDates = $.extend(true, [], _options.allowDates);
+				}
+
+				if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe)==="[object String]") {
+					options.allowDateRe = new RegExp(_options.allowDateRe);
+				}
+
+				if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
+					$.each(_options.highlightedDates, function (index, value) {
+						var splitData = $.map(value.split(','), $.trim),
+							exDesc,
+							hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style
+							keyDate = dateHelper.formatDate(hDate.date, options.formatDate);
+						if (highlightedDates[keyDate] !== undefined) {
+							exDesc = highlightedDates[keyDate].desc;
+							if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
+								highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
+							}
+						} else {
+							highlightedDates[keyDate] = hDate;
+						}
+					});
+
+					options.highlightedDates = $.extend(true, [], highlightedDates);
+				}
+
+				if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) {
+					highlightedDates = $.extend(true, [], options.highlightedDates);
+					$.each(_options.highlightedPeriods, function (index, value) {
+						var dateTest, // start date
+							dateEnd,
+							desc,
+							hDate,
+							keyDate,
+							exDesc,
+							style;
+						if ($.isArray(value)) {
+							dateTest = value[0];
+							dateEnd = value[1];
+							desc = value[2];
+							style = value[3];
+						}
+						else {
+							var splitData = $.map(value.split(','), $.trim);
+							dateTest = dateHelper.parseDate(splitData[0], options.formatDate);
+							dateEnd = dateHelper.parseDate(splitData[1], options.formatDate);
+							desc = splitData[2];
+							style = splitData[3];
+						}
+
+						while (dateTest <= dateEnd) {
+							hDate = new HighlightedDate(dateTest, desc, style);
+							keyDate = dateHelper.formatDate(dateTest, options.formatDate);
+							dateTest.setDate(dateTest.getDate() + 1);
+							if (highlightedDates[keyDate] !== undefined) {
+								exDesc = highlightedDates[keyDate].desc;
+								if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
+									highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
+								}
+							} else {
+								highlightedDates[keyDate] = hDate;
+							}
+						}
+					});
+
+					options.highlightedDates = $.extend(true, [], highlightedDates);
+				}
+
+				if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
+					options.disabledDates = $.extend(true, [], _options.disabledDates);
+				}
+
+				if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) {
+					options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays);
+				}
+
+				if ((options.open || options.opened) && (!options.inline)) {
+					input.trigger('open.xdsoft');
+				}
+
+				if (options.inline) {
+					triggerAfterOpen = true;
+					datetimepicker.addClass('xdsoft_inline');
+					input.after(datetimepicker).hide();
+				}
+
+				if (options.inverseButton) {
+					options.next = 'xdsoft_prev';
+					options.prev = 'xdsoft_next';
+				}
+
+				if (options.datepicker) {
+					datepicker.addClass('active');
+				} else {
+					datepicker.removeClass('active');
+				}
+
+				if (options.timepicker) {
+					timepicker.addClass('active');
+				} else {
+					timepicker.removeClass('active');
+				}
+
+				if (options.value) {
+					_xdsoft_datetime.setCurrentTime(options.value);
+					if (input && input.val) {
+						input.val(_xdsoft_datetime.str);
+					}
+				}
+
+				if (isNaN(options.dayOfWeekStart)) {
+					options.dayOfWeekStart = 0;
+				} else {
+					options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7;
+				}
+
+				if (!options.timepickerScrollbar) {
+					timeboxparent.xdsoftScroller('hide');
+				}
+
+				if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) {
+					options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate);
+				}
+
+				if (options.maxDate &&  /^[\+\-](.*)$/.test(options.maxDate)) {
+					options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate);
+				}
+
+				applyButton.toggle(options.showApplyButton);
+
+				month_picker
+					.find('.xdsoft_today_button')
+						.css('visibility', !options.todayButton ? 'hidden' : 'visible');
+
+				month_picker
+					.find('.' + options.prev)
+						.css('visibility', !options.prevButton ? 'hidden' : 'visible');
+
+				month_picker
+					.find('.' + options.next)
+						.css('visibility', !options.nextButton ? 'hidden' : 'visible');
+
+				setMask(options);
+
+				if (options.validateOnBlur) {
+					input
+						.off('blur.xdsoft')
+						.on('blur.xdsoft', function () {
+							if (options.allowBlank && (!$.trim($(this).val()).length || (typeof options.mask == "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) {
+								$(this).val(null);
+								datetimepicker.data('xdsoft_datetime').empty();
+							} else {
+								var d = dateHelper.parseDate($(this).val(), options.format);
+								if (d) { // parseDate() may skip some invalid parts like date or time, so make it clear for user: show parsed date/time
+									$(this).val(dateHelper.formatDate(d, options.format));
+								} else {
+									var splittedHours   = +([$(this).val()[0], $(this).val()[1]].join('')),
+										splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
+	
+									// parse the numbers as 0312 => 03:12
+									if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
+										$(this).val([splittedHours, splittedMinutes].map(function (item) {
+											return item > 9 ? item : '0' + item;
+										}).join(':'));
+									} else {
+										$(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format));
+									}
+								}
+								datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
+							}
+
+							datetimepicker.trigger('changedatetime.xdsoft');
+							datetimepicker.trigger('close.xdsoft');
+						});
+				}
+				options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1;
+
+				datetimepicker
+					.trigger('xchange.xdsoft')
+					.trigger('afterOpen.xdsoft');
+			};
+
+			datetimepicker
+				.data('options', options)
+				.on('touchstart mousedown.xdsoft', function (event) {
+					event.stopPropagation();
+					event.preventDefault();
+					yearselect.hide();
+					monthselect.hide();
+					return false;
+				});
+
+			//scroll_element = timepicker.find('.xdsoft_time_box');
+			timeboxparent.append(timebox);
+			timeboxparent.xdsoftScroller();
+
+			datetimepicker.on('afterOpen.xdsoft', function () {
+				timeboxparent.xdsoftScroller();
+			});
+
+			datetimepicker
+				.append(datepicker)
+				.append(timepicker);
+
+			if (options.withoutCopyright !== true) {
+				datetimepicker
+					.append(xdsoft_copyright);
+			}
+
+			datepicker
+				.append(month_picker)
+				.append(calendar)
+				.append(applyButton);
+
+			$(options.parentID)
+				.append(datetimepicker);
+
+			XDSoft_datetime = function () {
+				var _this = this;
+				_this.now = function (norecursion) {
+					var d = new Date(),
+						date,
+						time;
+
+					if (!norecursion && options.defaultDate) {
+						date = _this.strToDateTime(options.defaultDate);
+						d.setFullYear(date.getFullYear());
+						d.setMonth(date.getMonth());
+						d.setDate(date.getDate());
+					}
+
+					if (options.yearOffset) {
+						d.setFullYear(d.getFullYear() + options.yearOffset);
+					}
+
+					if (!norecursion && options.defaultTime) {
+						time = _this.strtotime(options.defaultTime);
+						d.setHours(time.getHours());
+						d.setMinutes(time.getMinutes());
+					}
+					return d;
+				};
+
+				_this.isValidDate = function (d) {
+					if (Object.prototype.toString.call(d) !== "[object Date]") {
+						return false;
+					}
+					return !isNaN(d.getTime());
+				};
+
+				_this.setCurrentTime = function (dTime, requireValidDate) {
+					if (typeof dTime === 'string') {
+						_this.currentTime = _this.strToDateTime(dTime);
+					}
+					else if (_this.isValidDate(dTime)) {
+						_this.currentTime = dTime;
+					}
+					else if (!dTime && !requireValidDate && options.allowBlank) {
+						_this.currentTime = null;
+					}
+					else {
+						_this.currentTime = _this.now();
+					}
+					
+					datetimepicker.trigger('xchange.xdsoft');
+				};
+
+				_this.empty = function () {
+					_this.currentTime = null;
+				};
+
+				_this.getCurrentTime = function (dTime) {
+					return _this.currentTime;
+				};
+
+				_this.nextMonth = function () {
+
+					if (_this.currentTime === undefined || _this.currentTime === null) {
+						_this.currentTime = _this.now();
+					}
+
+					var month = _this.currentTime.getMonth() + 1,
+						year;
+					if (month === 12) {
+						_this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1);
+						month = 0;
+					}
+
+					year = _this.currentTime.getFullYear();
+
+					_this.currentTime.setDate(
+						Math.min(
+							new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
+							_this.currentTime.getDate()
+						)
+					);
+					_this.currentTime.setMonth(month);
+
+					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
+						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+
+					if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
+						options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+
+					datetimepicker.trigger('xchange.xdsoft');
+					return month;
+				};
+
+				_this.prevMonth = function () {
+
+					if (_this.currentTime === undefined || _this.currentTime === null) {
+						_this.currentTime = _this.now();
+					}
+
+					var month = _this.currentTime.getMonth() - 1;
+					if (month === -1) {
+						_this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1);
+						month = 11;
+					}
+					_this.currentTime.setDate(
+						Math.min(
+							new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
+							_this.currentTime.getDate()
+						)
+					);
+					_this.currentTime.setMonth(month);
+					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
+						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+					datetimepicker.trigger('xchange.xdsoft');
+					return month;
+				};
+
+				_this.getWeekOfYear = function (datetime) {
+					if (options.onGetWeekOfYear && $.isFunction(options.onGetWeekOfYear)) {
+						var week = options.onGetWeekOfYear.call(datetimepicker, datetime);
+						if (typeof week !== 'undefined') {
+							return week;
+						}
+					}
+					var onejan = new Date(datetime.getFullYear(), 0, 1);
+					//First week of the year is th one with the first Thursday according to ISO8601
+					if(onejan.getDay()!=4)
+						onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7));
+					return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
+				};
+
+				_this.strToDateTime = function (sDateTime) {
+					var tmpDate = [], timeOffset, currentTime;
+
+					if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) {
+						return sDateTime;
+					}
+
+					tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime);
+					if (tmpDate) {
+						tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate);
+					}
+					if (tmpDate  && tmpDate[2]) {
+						timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
+						currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
+					} else {
+						currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now();
+					}
+
+					if (!_this.isValidDate(currentTime)) {
+						currentTime = _this.now();
+					}
+
+					return currentTime;
+				};
+
+				_this.strToDate = function (sDate) {
+					if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) {
+						return sDate;
+					}
+
+					var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true);
+					if (!_this.isValidDate(currentTime)) {
+						currentTime = _this.now(true);
+					}
+					return currentTime;
+				};
+
+				_this.strtotime = function (sTime) {
+					if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) {
+						return sTime;
+					}
+					var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true);
+					if (!_this.isValidDate(currentTime)) {
+						currentTime = _this.now(true);
+					}
+					return currentTime;
+				};
+
+				_this.str = function () {
+					return dateHelper.formatDate(_this.currentTime, options.format);
+				};
+				_this.currentTime = this.now();
+			};
+
+			_xdsoft_datetime = new XDSoft_datetime();
+
+			applyButton.on('touchend click', function (e) {//pathbrite
+				e.preventDefault();
+				datetimepicker.data('changed', true);
+				_xdsoft_datetime.setCurrentTime(getCurrentValue());
+				input.val(_xdsoft_datetime.str());
+				datetimepicker.trigger('close.xdsoft');
+			});
+			month_picker
+				.find('.xdsoft_today_button')
+				.on('touchend mousedown.xdsoft', function () {
+					datetimepicker.data('changed', true);
+					_xdsoft_datetime.setCurrentTime(0, true);
+					datetimepicker.trigger('afterOpen.xdsoft');
+				}).on('dblclick.xdsoft', function () {
+					var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate;
+					currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
+					minDate = _xdsoft_datetime.strToDate(options.minDate);
+					minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
+					if (currentDate < minDate) {
+						return;
+					}
+					maxDate = _xdsoft_datetime.strToDate(options.maxDate);
+					maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
+					if (currentDate > maxDate) {
+						return;
+					}
+					input.val(_xdsoft_datetime.str());
+					input.trigger('change');
+					datetimepicker.trigger('close.xdsoft');
+				});
+			month_picker
+				.find('.xdsoft_prev,.xdsoft_next')
+				.on('touchend mousedown.xdsoft', function () {
+					var $this = $(this),
+						timer = 0,
+						stop = false;
+
+					(function arguments_callee1(v) {
+						if ($this.hasClass(options.next)) {
+							_xdsoft_datetime.nextMonth();
+						} else if ($this.hasClass(options.prev)) {
+							_xdsoft_datetime.prevMonth();
+						}
+						if (options.monthChangeSpinner) {
+							if (!stop) {
+								timer = setTimeout(arguments_callee1, v || 100);
+							}
+						}
+					}(500));
+
+					$([document.body, window]).on('touchend mouseup.xdsoft', function arguments_callee2() {
+						clearTimeout(timer);
+						stop = true;
+						$([document.body, window]).off('touchend mouseup.xdsoft', arguments_callee2);
+					});
+				});
+
+			timepicker
+				.find('.xdsoft_prev,.xdsoft_next')
+				.on('touchend mousedown.xdsoft', function () {
+					var $this = $(this),
+						timer = 0,
+						stop = false,
+						period = 110;
+					(function arguments_callee4(v) {
+						var pheight = timeboxparent[0].clientHeight,
+							height = timebox[0].offsetHeight,
+							top = Math.abs(parseInt(timebox.css('marginTop'), 10));
+						if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) {
+							timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
+						} else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) {
+							timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
+						}
+                        /**
+                         * Fixed bug:
+                         * When using css3 transition, it will cause a bug that you cannot scroll the timepicker list.
+                         * The reason is that the transition-duration time, if you set it to 0, all things fine, otherwise, this
+                         * would cause a bug when you use jquery.css method.
+                         * Let's say: * { transition: all .5s ease; }
+                         * jquery timebox.css('marginTop') will return the original value which is before you clicking the next/prev button,
+                         * meanwhile the timebox[0].style.marginTop will return the right value which is after you clicking the
+                         * next/prev button.
+                         * 
+                         * What we should do:
+                         * Replace timebox.css('marginTop') with timebox[0].style.marginTop.
+                         */
+                        timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]);
+						period = (period > 10) ? 10 : period - 10;
+						if (!stop) {
+							timer = setTimeout(arguments_callee4, v || period);
+						}
+					}(500));
+					$([document.body, window]).on('touchend mouseup.xdsoft', function arguments_callee5() {
+						clearTimeout(timer);
+						stop = true;
+						$([document.body, window])
+							.off('touchend mouseup.xdsoft', arguments_callee5);
+					});
+				});
+
+			xchangeTimer = 0;
+			// base handler - generating a calendar and timepicker
+			datetimepicker
+				.on('xchange.xdsoft', function (event) {
+					clearTimeout(xchangeTimer);
+					xchangeTimer = setTimeout(function () {
+
+						if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
+							//In case blanks are allowed, delay construction until we have a valid date 
+							if (options.allowBlank)
+								return;
+								
+							_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
+						}
+
+						var table =	'',
+							start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0),
+							i = 0,
+							j,
+							today = _xdsoft_datetime.now(),
+							maxDate = false,
+							minDate = false,
+							hDate,
+							day,
+							d,
+							y,
+							m,
+							w,
+							classes = [],
+							customDateSettings,
+							newRow = true,
+							time = '',
+							h = '',
+							line_time,
+							description;
+
+						while (start.getDay() !== options.dayOfWeekStart) {
+							start.setDate(start.getDate() - 1);
+						}
+
+						table += '<table><thead><tr>';
+
+						if (options.weeks) {
+							table += '<th></th>';
+						}
+
+						for (j = 0; j < 7; j += 1) {
+							table += '<th>' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '</th>';
+						}
+
+						table += '</tr></thead>';
+						table += '<tbody>';
+
+						if (options.maxDate !== false) {
+							maxDate = _xdsoft_datetime.strToDate(options.maxDate);
+							maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999);
+						}
+
+						if (options.minDate !== false) {
+							minDate = _xdsoft_datetime.strToDate(options.minDate);
+							minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
+						}
+
+						while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) {
+							classes = [];
+							i += 1;
+
+							day = start.getDay();
+							d = start.getDate();
+							y = start.getFullYear();
+							m = start.getMonth();
+							w = _xdsoft_datetime.getWeekOfYear(start);
+							description = '';
+
+							classes.push('xdsoft_date');
+
+							if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) {
+								customDateSettings = options.beforeShowDay.call(datetimepicker, start);
+							} else {
+								customDateSettings = null;
+							}
+
+							if(options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]"){
+								if(!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))){
+									classes.push('xdsoft_disabled');
+								}
+							} else if(options.allowDates && options.allowDates.length>0){
+								if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){
+									classes.push('xdsoft_disabled');
+								}
+							} else if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
+								classes.push('xdsoft_disabled');
+							} else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
+								classes.push('xdsoft_disabled');
+							} else if (options.disabledWeekDays.indexOf(day) !== -1) {
+								classes.push('xdsoft_disabled');
+							}else if (input.is('[readonly]')) {
+								classes.push('xdsoft_disabled');
+							}
+
+							if (customDateSettings && customDateSettings[1] !== "") {
+								classes.push(customDateSettings[1]);
+							}
+
+							if (_xdsoft_datetime.currentTime.getMonth() !== m) {
+								classes.push('xdsoft_other_month');
+							}
+
+							if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
+								classes.push('xdsoft_current');
+							}
+
+							if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
+								classes.push('xdsoft_today');
+							}
+
+							if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
+								classes.push('xdsoft_weekend');
+							}
+
+							if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) {
+								hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)];
+								classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style);
+								description = hDate.desc === undefined ? '' : hDate.desc;
+							}
+
+							if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) {
+								classes.push(options.beforeShowDay(start));
+							}
+
+							if (newRow) {
+								table += '<tr>';
+								newRow = false;
+								if (options.weeks) {
+									table += '<th>' + w + '</th>';
+								}
+							}
+
+							table += '<td data-date="' + d + '" data-month="' + m + '" data-year="' + y + '"' + ' class="xdsoft_date xdsoft_day_of_week' + start.getDay() + ' ' + classes.join(' ') + '" title="' + description + '">' +
+										'<div>' + d + '</div>' +
+									'</td>';
+
+							if (start.getDay() === options.dayOfWeekStartPrev) {
+								table += '</tr>';
+								newRow = true;
+							}
+
+							start.setDate(d + 1);
+						}
+						table += '</tbody></table>';
+
+						calendar.html(table);
+
+						month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]);
+						month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());
+
+						// generate timebox
+						time = '';
+						h = '';
+						m = '';
+
+						line_time = function line_time(h, m) {
+							var now = _xdsoft_datetime.now(), optionDateTime, current_time,
+								isALlowTimesInit = options.allowTimes && $.isArray(options.allowTimes) && options.allowTimes.length;
+							now.setHours(h);
+							h = parseInt(now.getHours(), 10);
+							now.setMinutes(m);
+							m = parseInt(now.getMinutes(), 10);
+							optionDateTime = new Date(_xdsoft_datetime.currentTime);
+							optionDateTime.setHours(h);
+							optionDateTime.setMinutes(m);
+							classes = [];			
+							if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
+								classes.push('xdsoft_disabled');
+							} else if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
+								classes.push('xdsoft_disabled');
+							} else if (input.is('[readonly]')) {
+								classes.push('xdsoft_disabled');
+							}
+
+							current_time = new Date(_xdsoft_datetime.currentTime);
+							current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
+
+							if (!isALlowTimesInit) {
+								current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
+							}
+
+							if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && ((!isALlowTimesInit && options.step > 59) || current_time.getMinutes() === parseInt(m, 10))) {
+								if (options.defaultSelect || datetimepicker.data('changed')) {
+									classes.push('xdsoft_current');
+								} else if (options.initTime) {
+									classes.push('xdsoft_init_time');
+								}
+							}
+							if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) {
+								classes.push('xdsoft_today');
+							}
+							time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + dateHelper.formatDate(now, options.formatTime) + '</div>';
+						};
+
+						if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
+							for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) {
+								for (j = 0; j < 60; j += options.step) {
+									h = (i < 10 ? '0' : '') + i;
+									m = (j < 10 ? '0' : '') + j;
+									line_time(h, m);
+								}
+							}
+						} else {
+							for (i = 0; i < options.allowTimes.length; i += 1) {
+								h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
+								m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
+								line_time(h, m);
+							}
+						}
+
+						timebox.html(time);
+
+						opt = '';
+						i = 0;
+
+						for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) {
+							opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + i + '</div>';
+						}
+						yearselect.children().eq(0)
+												.html(opt);
+
+						for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) {
+							opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[globalLocale].months[i] + '</div>';
+						}
+						monthselect.children().eq(0).html(opt);
+						$(datetimepicker)
+							.trigger('generate.xdsoft');
+					}, 10);
+					event.stopPropagation();
+				})
+				.on('afterOpen.xdsoft', function () {
+					if (options.timepicker) {
+						var classType, pheight, height, top;
+						if (timebox.find('.xdsoft_current').length) {
+							classType = '.xdsoft_current';
+						} else if (timebox.find('.xdsoft_init_time').length) {
+							classType = '.xdsoft_init_time';
+						}
+						if (classType) {
+							pheight = timeboxparent[0].clientHeight;
+							height = timebox[0].offsetHeight;
+							top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1;
+							if ((height - pheight) < top) {
+								top = height - pheight;
+							}
+							timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]);
+						} else {
+							timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]);
+						}
+					}
+				});
+
+			timerclick = 0;
+			calendar
+				.on('touchend click.xdsoft', 'td', function (xdevent) {
+					xdevent.stopPropagation();  // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
+					timerclick += 1;
+					var $this = $(this),
+						currentTime = _xdsoft_datetime.currentTime;
+
+					if (currentTime === undefined || currentTime === null) {
+						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
+						currentTime = _xdsoft_datetime.currentTime;
+					}
+
+					if ($this.hasClass('xdsoft_disabled')) {
+						return false;
+					}
+
+					currentTime.setDate(1);
+					currentTime.setFullYear($this.data('year'));
+					currentTime.setMonth($this.data('month'));
+					currentTime.setDate($this.data('date'));
+
+					datetimepicker.trigger('select.xdsoft', [currentTime]);
+
+					input.val(_xdsoft_datetime.str());
+
+					if (options.onSelectDate &&	$.isFunction(options.onSelectDate)) {
+						options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
+					}
+
+					datetimepicker.data('changed', true);
+					datetimepicker.trigger('xchange.xdsoft');
+					datetimepicker.trigger('changedatetime.xdsoft');
+					if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) {
+						datetimepicker.trigger('close.xdsoft');
+					}
+					setTimeout(function () {
+						timerclick = 0;
+					}, 200);
+				});
+
+			timebox
+				.on('touchmove', 'div', function () { currentlyScrollingTimeDiv = true; })
+				.on('touchend click.xdsoft', 'div', function (xdevent) {
+					xdevent.stopPropagation();
+					if (currentlyScrollingTimeDiv) {
+				        	currentlyScrollingTimeDiv = false;
+				        	return;
+				    	}
+					var $this = $(this),
+						currentTime = _xdsoft_datetime.currentTime;
+
+					if (currentTime === undefined || currentTime === null) {
+						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
+						currentTime = _xdsoft_datetime.currentTime;
+					}
+
+					if ($this.hasClass('xdsoft_disabled')) {
+						return false;
+					}
+					currentTime.setHours($this.data('hour'));
+					currentTime.setMinutes($this.data('minute'));
+					datetimepicker.trigger('select.xdsoft', [currentTime]);
+
+					datetimepicker.data('input').val(_xdsoft_datetime.str());
+
+					if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
+						options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
+					}
+					datetimepicker.data('changed', true);
+					datetimepicker.trigger('xchange.xdsoft');
+					datetimepicker.trigger('changedatetime.xdsoft');
+					if (options.inline !== true && options.closeOnTimeSelect === true) {
+						datetimepicker.trigger('close.xdsoft');
+					}
+				});
+
+			datepicker
+				.on('mousewheel.xdsoft', function (event) {
+					if (!options.scrollMonth) {
+						return true;
+					}
+					if (event.deltaY < 0) {
+						_xdsoft_datetime.nextMonth();
+					} else {
+						_xdsoft_datetime.prevMonth();
+					}
+					return false;
+				});
+
+			input
+				.on('mousewheel.xdsoft', function (event) {
+					if (!options.scrollInput) {
+						return true;
+					}
+					if (!options.datepicker && options.timepicker) {
+						current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0;
+						if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) {
+							current_time_index += event.deltaY;
+						}
+						if (timebox.children().eq(current_time_index).length) {
+							timebox.children().eq(current_time_index).trigger('mousedown');
+						}
+						return false;
+					}
+					if (options.datepicker && !options.timepicker) {
+						datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]);
+						if (input.val) {
+							input.val(_xdsoft_datetime.str());
+						}
+						datetimepicker.trigger('changedatetime.xdsoft');
+						return false;
+					}
+				});
+
+			datetimepicker
+				.on('changedatetime.xdsoft', function (event) {
+					if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) {
+						var $input = datetimepicker.data('input');
+						options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
+						delete options.value;
+						$input.trigger('change');
+					}
+				})
+				.on('generate.xdsoft', function () {
+					if (options.onGenerate && $.isFunction(options.onGenerate)) {
+						options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
+					}
+					if (triggerAfterOpen) {
+						datetimepicker.trigger('afterOpen.xdsoft');
+						triggerAfterOpen = false;
+					}
+				})
+				.on('click.xdsoft', function (xdevent) {
+					xdevent.stopPropagation();
+				});
+
+			current_time_index = 0;
+
+			/**
+			 * Runs the callback for each of the specified node's ancestors.
+			 *
+			 * Return FALSE from the callback to stop ascending.
+			 *
+			 * @param {DOMNode} node
+			 * @param {Function} callback
+			 * @returns {undefined}
+			 */
+			forEachAncestorOf = function (node, callback) {
+				do {
+					node = node.parentNode;
+
+					if (callback(node) === false) {
+						break;
+					}
+				} while (node.nodeName !== 'HTML');
+			};
+
+			/**
+			 * Sets the position of the picker.
+			 *
+			 * @returns {undefined}
+			 */
+			setPos = function () {
+				var dateInputOffset,
+					dateInputElem,
+					verticalPosition,
+					left,
+					position,
+					datetimepickerElem,
+					dateInputHasFixedAncestor,
+					$dateInput,
+					windowWidth,
+					verticalAnchorEdge,
+					datetimepickerCss,
+					windowHeight,
+					windowScrollTop;
+
+				$dateInput = datetimepicker.data('input');
+				dateInputOffset = $dateInput.offset();
+				dateInputElem = $dateInput[0];
+
+				verticalAnchorEdge = 'top';
+				verticalPosition = (dateInputOffset.top + dateInputElem.offsetHeight) - 1;
+				left = dateInputOffset.left;
+				position = "absolute";
+
+				windowWidth = $(window).width();
+				windowHeight = $(window).height();
+				windowScrollTop = $(window).scrollTop();
+
+				if ((document.documentElement.clientWidth - dateInputOffset.left) < datepicker.parent().outerWidth(true)) {
+					var diff = datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth;
+					left = left - diff;
+				}
+
+				if ($dateInput.parent().css('direction') === 'rtl') {
+					left -= (datetimepicker.outerWidth() - $dateInput.outerWidth());
+				}
+
+				if (options.fixed) {
+					verticalPosition -= windowScrollTop;
+					left -= $(window).scrollLeft();
+					position = "fixed";
+				} else {
+					dateInputHasFixedAncestor = false;
+
+					forEachAncestorOf(dateInputElem, function (ancestorNode) {
+						if (window.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') {
+							dateInputHasFixedAncestor = true;
+							return false;
+						}
+					});
+
+					if (dateInputHasFixedAncestor) {
+						position = 'fixed';
+
+						//If the picker won't fit entirely within the viewport then display it above the date input.
+						if (verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop) {
+							verticalAnchorEdge = 'bottom';
+							verticalPosition = (windowHeight + windowScrollTop) - dateInputOffset.top;
+						} else {
+							verticalPosition -= windowScrollTop;
+						}
+					} else {
+						if (verticalPosition + dateInputElem.offsetHeight > windowHeight + windowScrollTop) {
+							verticalPosition = dateInputOffset.top - dateInputElem.offsetHeight + 1;
+						}
+					}
+
+					if (verticalPosition < 0) {
+						verticalPosition = 0;
+					}
+
+					if (left + dateInputElem.offsetWidth > windowWidth) {
+						left = windowWidth - dateInputElem.offsetWidth;
+					}
+				}
+
+				datetimepickerElem = datetimepicker[0];
+
+				forEachAncestorOf(datetimepickerElem, function (ancestorNode) {
+					var ancestorNodePosition;
+
+					ancestorNodePosition = window.getComputedStyle(ancestorNode).getPropertyValue('position');
+
+					if (ancestorNodePosition === 'relative' && windowWidth >= ancestorNode.offsetWidth) {
+						left = left - ((windowWidth - ancestorNode.offsetWidth) / 2);
+						return false;
+					}
+				});
+
+				datetimepickerCss = {
+					position: position,
+					left: left,
+					top: '',  //Initialize to prevent previous values interfering with new ones.
+					bottom: ''  //Initialize to prevent previous values interfering with new ones.
+				};
+
+				datetimepickerCss[verticalAnchorEdge] = verticalPosition;
+
+				datetimepicker.css(datetimepickerCss);
+			};
+
+			datetimepicker
+				.on('open.xdsoft', function (event) {
+					var onShow = true;
+					if (options.onShow && $.isFunction(options.onShow)) {
+						onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
+					}
+					if (onShow !== false) {
+						datetimepicker.show();
+						setPos();
+						$(window)
+							.off('resize.xdsoft', setPos)
+							.on('resize.xdsoft', setPos);
+
+						if (options.closeOnWithoutClick) {
+							$([document.body, window]).on('touchstart mousedown.xdsoft', function arguments_callee6() {
+								datetimepicker.trigger('close.xdsoft');
+								$([document.body, window]).off('touchstart mousedown.xdsoft', arguments_callee6);
+							});
+						}
+					}
+				})
+				.on('close.xdsoft', function (event) {
+					var onClose = true;
+					month_picker
+						.find('.xdsoft_month,.xdsoft_year')
+							.find('.xdsoft_select')
+								.hide();
+					if (options.onClose && $.isFunction(options.onClose)) {
+						onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
+					}
+					if (onClose !== false && !options.opened && !options.inline) {
+						datetimepicker.hide();
+					}
+					event.stopPropagation();
+				})
+				.on('toggle.xdsoft', function () {
+					if (datetimepicker.is(':visible')) {
+						datetimepicker.trigger('close.xdsoft');
+					} else {
+						datetimepicker.trigger('open.xdsoft');
+					}
+				})
+				.data('input', input);
+
+			timer = 0;
+
+			datetimepicker.data('xdsoft_datetime', _xdsoft_datetime);
+			datetimepicker.setOptions(options);
+
+			function getCurrentValue() {
+				var ct = false, time;
+
+				if (options.startDate) {
+					ct = _xdsoft_datetime.strToDate(options.startDate);
+				} else {
+					ct = options.value || ((input && input.val && input.val()) ? input.val() : '');
+					if (ct) {
+						ct = _xdsoft_datetime.strToDateTime(ct);
+					} else if (options.defaultDate) {
+						ct = _xdsoft_datetime.strToDateTime(options.defaultDate);
+						if (options.defaultTime) {
+							time = _xdsoft_datetime.strtotime(options.defaultTime);
+							ct.setHours(time.getHours());
+							ct.setMinutes(time.getMinutes());
+						}
+					}
+				}
+
+				if (ct && _xdsoft_datetime.isValidDate(ct)) {
+					datetimepicker.data('changed', true);
+				} else {
+					ct = '';
+				}
+
+				return ct || 0;
+			}
+
+			function setMask(options) {
+
+				var isValidValue = function (mask, value) {
+					var reg = mask
+						.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1')
+						.replace(/_/g, '{digit+}')
+						.replace(/([0-9]{1})/g, '{digit$1}')
+						.replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}')
+						.replace(/\{digit[\+]\}/g, '[0-9_]{1}');
+					return (new RegExp(reg)).test(value);
+				},
+				getCaretPos = function (input) {
+					try {
+						if (document.selection && document.selection.createRange) {
+							var range = document.selection.createRange();
+							return range.getBookmark().charCodeAt(2) - 2;
+						}
+						if (input.setSelectionRange) {
+							return input.selectionStart;
+						}
+					} catch (e) {
+						return 0;
+					}
+				},
+				setCaretPos = function (node, pos) {
+					node = (typeof node === "string" || node instanceof String) ? document.getElementById(node) : node;
+					if (!node) {
+						return false;
+					}
+					if (node.createTextRange) {
+						var textRange = node.createTextRange();
+						textRange.collapse(true);
+						textRange.moveEnd('character', pos);
+						textRange.moveStart('character', pos);
+						textRange.select();
+						return true;
+					}
+					if (node.setSelectionRange) {
+						node.setSelectionRange(pos, pos);
+						return true;
+					}
+					return false;
+				};
+				if(options.mask) {
+					input.off('keydown.xdsoft');
+				}
+				if (options.mask === true) {
+														if (typeof moment != 'undefined') {
+																	options.mask = options.format
+																			.replace(/Y{4}/g, '9999')
+																			.replace(/Y{2}/g, '99')
+																			.replace(/M{2}/g, '19')
+																			.replace(/D{2}/g, '39')
+																			.replace(/H{2}/g, '29')
+																			.replace(/m{2}/g, '59')
+																			.replace(/s{2}/g, '59');
+														} else {
+																	options.mask = options.format
+																			.replace(/Y/g, '9999')
+																			.replace(/F/g, '9999')
+																			.replace(/m/g, '19')
+																			.replace(/d/g, '39')
+																			.replace(/H/g, '29')
+																			.replace(/i/g, '59')
+																			.replace(/s/g, '59');
+														}
+				}
+
+				if ($.type(options.mask) === 'string') {
+					if (!isValidValue(options.mask, input.val())) {
+						input.val(options.mask.replace(/[0-9]/g, '_'));
+						setCaretPos(input[0], 0);
+					}
+
+					input.on('keydown.xdsoft', function (event) {
+						var val = this.value,
+							key = event.which,
+							pos,
+							digit;
+
+						if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) {
+							pos = getCaretPos(this);
+							digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_';
+
+							if ((key === BACKSPACE || key === DEL) && pos) {
+								pos -= 1;
+								digit = '_';
+							}
+
+							while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
+								pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
+							}
+
+							val = val.substr(0, pos) + digit + val.substr(pos + 1);
+							if ($.trim(val) === '') {
+								val = options.mask.replace(/[0-9]/g, '_');
+							} else {
+								if (pos === options.mask.length) {
+									event.preventDefault();
+									return false;
+								}
+							}
+
+							pos += (key === BACKSPACE || key === DEL) ? 0 : 1;
+							while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
+								pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
+							}
+
+							if (isValidValue(options.mask, val)) {
+								this.value = val;
+								setCaretPos(this, pos);
+							} else if ($.trim(val) === '') {
+								this.value = options.mask.replace(/[0-9]/g, '_');
+							} else {
+								input.trigger('error_input.xdsoft');
+							}
+						} else {
+							if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) {
+								return true;
+							}
+						}
+
+						event.preventDefault();
+						return false;
+					});
+				}
+			}
+
+			_xdsoft_datetime.setCurrentTime(getCurrentValue());
+
+			input
+				.data('xdsoft_datetimepicker', datetimepicker)
+				.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function () {
+					if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) {
+						return;
+					}
+					clearTimeout(timer);
+					timer = setTimeout(function () {
+						if (input.is(':disabled')) {
+							return;
+						}
+
+						triggerAfterOpen = true;
+						_xdsoft_datetime.setCurrentTime(getCurrentValue(), true);
+						if(options.mask) {
+							setMask(options);
+						}
+						datetimepicker.trigger('open.xdsoft');
+					}, 100);
+				})
+				.on('keydown.xdsoft', function (event) {
+					var elementSelector,
+						key = event.which;
+					if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
+						elementSelector = $("input:visible,textarea:visible,button:visible,a:visible");
+						datetimepicker.trigger('close.xdsoft');
+						elementSelector.eq(elementSelector.index(this) + 1).focus();
+						return false;
+					}
+					if ([TAB].indexOf(key) !== -1) {
+						datetimepicker.trigger('close.xdsoft');
+						return true;
+					}
+				})
+				.on('blur.xdsoft', function () {
+					datetimepicker.trigger('close.xdsoft');
+				});
+		};
+		destroyDateTimePicker = function (input) {
+			var datetimepicker = input.data('xdsoft_datetimepicker');
+			if (datetimepicker) {
+				datetimepicker.data('xdsoft_datetime', null);
+				datetimepicker.remove();
+				input
+					.data('xdsoft_datetimepicker', null)
+					.off('.xdsoft');
+				$(window).off('resize.xdsoft');
+				$([window, document.body]).off('mousedown.xdsoft touchstart');
+				if (input.unmousewheel) {
+					input.unmousewheel();
+				}
+			}
+		};
+		$(document)
+			.off('keydown.xdsoftctrl keyup.xdsoftctrl')
+			.on('keydown.xdsoftctrl', function (e) {
+				if (e.keyCode === CTRLKEY) {
+					ctrlDown = true;
+				}
+			})
+			.on('keyup.xdsoftctrl', function (e) {
+				if (e.keyCode === CTRLKEY) {
+					ctrlDown = false;
+				}
+			});
+
+		this.each(function () {
+			var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input;
+			if (datetimepicker) {
+				if ($.type(opt) === 'string') {
+					switch (opt) {
+					case 'show':
+						$(this).select().focus();
+						datetimepicker.trigger('open.xdsoft');
+						break;
+					case 'hide':
+						datetimepicker.trigger('close.xdsoft');
+						break;
+					case 'toggle':
+						datetimepicker.trigger('toggle.xdsoft');
+						break;
+					case 'destroy':
+						destroyDateTimePicker($(this));
+						break;
+					case 'reset':
+						this.value = this.defaultValue;
+						if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) {
+							datetimepicker.data('changed', false);
+						}
+						datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
+						break;
+					case 'validate':
+						$input = datetimepicker.data('input');
+						$input.trigger('blur.xdsoft');
+						break;
+					default:
+						if (datetimepicker[opt] && $.isFunction(datetimepicker[opt])) {
+							result = datetimepicker[opt](opt2);
+						}
+					}
+				} else {
+					datetimepicker
+						.setOptions(opt);
+				}
+				return 0;
+			}
+			if ($.type(opt) !== 'string') {
+				if (!options.lazyInit || options.open || options.inline) {
+					createDateTimePicker($(this));
+				} else {
+					lazyInit($(this));
+				}
+			}
+		});
+
+		return result;
+	};
+
+	$.fn.datetimepicker.defaults = default_options;
+
+	function HighlightedDate(date, desc, style) {
+		"use strict";
+		this.date = date;
+		this.desc = desc;
+		this.style = style;
+	}
+}));
+/*!
+ * jQuery Mousewheel 3.1.13
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ */
+
+(function (factory) {
+    if ( typeof define === 'function' && define.amd ) {
+        // AMD. Register as an anonymous module.
+        define(['jquery'], factory);
+    } else if (typeof exports === 'object') {
+        // Node/CommonJS style for Browserify
+        module.exports = factory;
+    } else {
+        // Browser globals
+        factory(jQuery);
+    }
+}(function ($) {
+
+    var toFix  = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
+        toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
+                    ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
+        slice  = Array.prototype.slice,
+        nullLowestDeltaTimeout, lowestDelta;
+
+    if ( $.event.fixHooks ) {
+        for ( var i = toFix.length; i; ) {
+            $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
+        }
+    }
+
+    var special = $.event.special.mousewheel = {
+        version: '3.1.12',
+
+        setup: function() {
+            if ( this.addEventListener ) {
+                for ( var i = toBind.length; i; ) {
+                    this.addEventListener( toBind[--i], handler, false );
+                }
+            } else {
+                this.onmousewheel = handler;
+            }
+            // Store the line height and page height for this particular element
+            $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
+            $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
+        },
+
+        teardown: function() {
+            if ( this.removeEventListener ) {
+                for ( var i = toBind.length; i; ) {
+                    this.removeEventListener( toBind[--i], handler, false );
+                }
+            } else {
+                this.onmousewheel = null;
+            }
+            // Clean up the data we added to the element
+            $.removeData(this, 'mousewheel-line-height');
+            $.removeData(this, 'mousewheel-page-height');
+        },
+
+        getLineHeight: function(elem) {
+            var $elem = $(elem),
+                $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
+            if (!$parent.length) {
+                $parent = $('body');
+            }
+            return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
+        },
+
+        getPageHeight: function(elem) {
+            return $(elem).height();
+        },
+
+        settings: {
+            adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
+            normalizeOffset: true  // calls getBoundingClientRect for each event
+        }
+    };
+
+    $.fn.extend({
+        mousewheel: function(fn) {
+            return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
+        },
+
+        unmousewheel: function(fn) {
+            return this.unbind('mousewheel', fn);
+        }
+    });
+
+
+    function handler(event) {
+        var orgEvent   = event || window.event,
+            args       = slice.call(arguments, 1),
+            delta      = 0,
+            deltaX     = 0,
+            deltaY     = 0,
+            absDelta   = 0,
+            offsetX    = 0,
+            offsetY    = 0;
+        event = $.event.fix(orgEvent);
+        event.type = 'mousewheel';
+
+        // Old school scrollwheel delta
+        if ( 'detail'      in orgEvent ) { deltaY = orgEvent.detail * -1;      }
+        if ( 'wheelDelta'  in orgEvent ) { deltaY = orgEvent.wheelDelta;       }
+        if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY;      }
+        if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
+
+        // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
+        if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
+            deltaX = deltaY * -1;
+            deltaY = 0;
+        }
+
+        // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
+        delta = deltaY === 0 ? deltaX : deltaY;
+
+        // New school wheel delta (wheel event)
+        if ( 'deltaY' in orgEvent ) {
+            deltaY = orgEvent.deltaY * -1;
+            delta  = deltaY;
+        }
+        if ( 'deltaX' in orgEvent ) {
+            deltaX = orgEvent.deltaX;
+            if ( deltaY === 0 ) { delta  = deltaX * -1; }
+        }
+
+        // No change actually happened, no reason to go any further
+        if ( deltaY === 0 && deltaX === 0 ) { return; }
+
+        // Need to convert lines and pages to pixels if we aren't already in pixels
+        // There are three delta modes:
+        //   * deltaMode 0 is by pixels, nothing to do
+        //   * deltaMode 1 is by lines
+        //   * deltaMode 2 is by pages
+        if ( orgEvent.deltaMode === 1 ) {
+            var lineHeight = $.data(this, 'mousewheel-line-height');
+            delta  *= lineHeight;
+            deltaY *= lineHeight;
+            deltaX *= lineHeight;
+        } else if ( orgEvent.deltaMode === 2 ) {
+            var pageHeight = $.data(this, 'mousewheel-page-height');
+            delta  *= pageHeight;
+            deltaY *= pageHeight;
+            deltaX *= pageHeight;
+        }
+
+        // Store lowest absolute delta to normalize the delta values
+        absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
+
+        if ( !lowestDelta || absDelta < lowestDelta ) {
+            lowestDelta = absDelta;
+
+            // Adjust older deltas if necessary
+            if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+                lowestDelta /= 40;
+            }
+        }
+
+        // Adjust older deltas if necessary
+        if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+            // Divide all the things by 40!
+            delta  /= 40;
+            deltaX /= 40;
+            deltaY /= 40;
+        }
+
+        // Get a whole, normalized value for the deltas
+        delta  = Math[ delta  >= 1 ? 'floor' : 'ceil' ](delta  / lowestDelta);
+        deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
+        deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
+
+        // Normalise offsetX and offsetY properties
+        if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
+            var boundingRect = this.getBoundingClientRect();
+            offsetX = event.clientX - boundingRect.left;
+            offsetY = event.clientY - boundingRect.top;
+        }
+
+        // Add information to the event object
+        event.deltaX = deltaX;
+        event.deltaY = deltaY;
+        event.deltaFactor = lowestDelta;
+        event.offsetX = offsetX;
+        event.offsetY = offsetY;
+        // Go ahead and set deltaMode to 0 since we converted to pixels
+        // Although this is a little odd since we overwrite the deltaX/Y
+        // properties with normalized deltas.
+        event.deltaMode = 0;
+
+        // Add event and delta to the front of the arguments
+        args.unshift(event, delta, deltaX, deltaY);
+
+        // Clearout lowestDelta after sometime to better
+        // handle multiple device types that give different
+        // a different lowestDelta
+        // Ex: trackpad = 3 and mouse wheel = 120
+        if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
+        nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
+
+        return ($.event.dispatch || $.event.handle).apply(this, args);
+    }
+
+    function nullLowestDelta() {
+        lowestDelta = null;
+    }
+
+    function shouldAdjustOldDeltas(orgEvent, absDelta) {
+        // If this is an older event and the delta is divisable by 120,
+        // then we are assuming that the browser is treating this as an
+        // older mouse wheel event and that we should divide the deltas
+        // by 40 to try and get a more usable deltaFactor.
+        // Side note, this actually impacts the reported scroll distance
+        // in older browsers and can cause scrolling to be slower than native.
+        // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
+        return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
+    }
+
+}));
diff -urN cahier-de-prepa5.1.0/js/edition.js cahier-de-prepa6.0.0/js/edition.js
--- cahier-de-prepa5.1.0/js/edition.js	2015-10-26 23:34:58.975104306 +0100
+++ cahier-de-prepa6.0.0/js/edition.js	2016-08-25 02:11:31.794538731 +0200
@@ -55,7 +55,7 @@
             fonction: function() {
               return true;
             }
-    }).success( function(data) {
+    }).done( function(data) {
       // Si erreur d'identification, on reste bloqué là
       if ( data['etat'] == 'login_nok' )
         $('#fenetre > p').html(data['message']).addClass('warning');
@@ -133,7 +133,7 @@
         $(this).next().focus();
       }).hide();
       el.on("change keyup mouseup",function() {
-        if ( !(this.value.length) && ( $(this).is(':visible') ) )
+        if ( ( this.value != undefined ) && !(this.value.length) && ( $(this).is(':visible') ) )
           // bug avec show() : donne du display:block pour certains éléments
           $(this).prev().css('display','inline');
         else
@@ -300,8 +300,12 @@
   var el = $(this).parent();
   el.children('.icon-edite').remove();
   var form = $('<form class="titrecdt"></form>').insertBefore(el.parent().children('div')).html($('#form-cdt').html());
+  // Récupération des valeurs et modification initiale du formulaire
+  var valeurs = JSON.parse(el.attr('data-donnees'));
+  for ( var cle in valeurs )
+    form.find('[name="'+cle+'"]').val(valeurs[cle]);
   // Mise en place des facilités  
-  form.boutonscdt();
+  form.init_cdt_boutons();
   // Mise à jour du titre si modification
   form.find('input,[name="demigroupe"]').on('change keyup', function() {
     var t = new Date(form.find('[name="jour"]').val().replace(/(.{2})\/(.{2})\/(.{4})/,function(tout,x,y,z) {return z+'-'+y+'-'+x; }));
@@ -327,10 +331,6 @@
     }
     el.children('span').text(titre);
   });
-  // Récupération des valeurs et modification initiale du formulaire
-  var valeurs = $.parseJSON(el.attr('data-donnees'));
-  for ( var cle in valeurs )
-    form.find('[name="'+cle+'"]').val(valeurs[cle]);
   // Envoi
   $('<a class="icon-ok" title="Valider"></a>').appendTo(el).on("click",function() {
     // Identifiant de l'entrée à modifier : table|id
@@ -348,7 +348,7 @@
               el.children('a').remove();
               $('<a class="icon-edite" title="Modifier"></a>').appendTo(el).on("click",transformecdt);
             }
-    }).success( function(data) {
+    }).done( function(data) {
       if ( ( data['etat'] == 'ok' ) && ( data['reload'] == 'oui' ) )
         location.reload(true);
     });
@@ -365,10 +365,15 @@
 // Facilités du formulaire de modification des propriétés des éléments de cahier
 // de texte, utilisé par transformecdt() (élément existant) et formulaire()
 // (nouvel élément)
-$.fn.boutonscdt = function() {
-  form = this;
-  form.find('.date').datepick({ dateFormat: 'dd/mm/yyyy', showTrigger: '<img src="js/calendar-blue.gif">', onSelect: function() { form.find('[name="h_debut"]').change(); } });
-  form.find('.heure').timeEntry({timeSteps: [1, 15, 0], separator: 'h', spinnerImage: 'js/spinnerDefault.png'});
+$.fn.init_cdt_boutons = function() {
+  var form = this;
+  form.find('[name="jour"],[name="pour"]').datetimepicker({ format: 'd/m/Y', timepicker: false });
+  form.find('[name="h_debut"]').datetimepicker({ format: 'Ghi', datepicker: false,
+    onClose: function(t,input) {
+      form.find('[name="h_fin"]').val(function(i,v){ return v || ( input.val().length ? (parseInt(input.val().slice(0,-3))+2)+input.val().slice(-3) : ''); });
+    }
+  });
+  form.find('[name="h_fin"]').datetimepicker({ format: 'Ghi', datepicker: false });
   // Ajout du zéro devant les dates et heures à 1 chiffre
   var zero = function(n) {
     return ( String(n).length == 1 ) ? '0'+n : String(n);
@@ -450,10 +455,15 @@
 
 // Facilités du formulaire de modification des propriétés des raccourcis de
 // cahier de texte, utilisé sur les éléments de classe cdt-raccourcis
-$.fn.affichechamps = function() {
+$.fn.init_cdt_raccourcis = function() {
   this.each(function() {
     var form = $(this);
-    form.find('.heure').timeEntry({timeSteps: [1, 15, 0], separator: 'h', spinnerImage: 'js/spinnerDefault.png'});
+    form.find('[name="h_debut"]').datetimepicker({ format: 'Ghi', datepicker: false,
+      onClose: function(t,input) {
+        form.find('[name="h_fin"]').val(function(i,v){ return v || ( input.val().length ? (parseInt(input.val().slice(0,-3))+2)+input.val().slice(-3) : ''); });
+      }
+    });
+    form.find('[name="h_fin"]').datetimepicker({ format: 'Ghi', datepicker: false });
     // Action lancée à la modification du type de séance
     form.find('[name="type"]').on('change keyup', function() {
       switch ( parseInt(seances[this.value]) ) {
@@ -803,7 +813,7 @@
           method: "post",
           data: { recupdoc:'' },
           dataType: 'json'})
-    .success( function(data) {
+    .done( function(data) {
       // Fonction de mise à jour de l'aperçu
       var majapercu = function() {
         var apercu = $('#apercu');
@@ -990,7 +1000,7 @@
                   method: "post",
                   data: { login: $('#login').val(), motdepasse: $('#motdepasse').val(), recupdoc: '' },
                   dataType: 'json'})
-            .success( function(data) {
+            .done( function(data) {
               // Si erreur d'identification, on reste bloqué là
               if ( data['etat'] == 'login_nok' )
                 $('#fenetre > div:first > p:first').html(data['message']).addClass('warning');
@@ -1239,7 +1249,7 @@
                   this.setAttribute('class',this.getAttribute('class').replace('editable','editable-remplace'));
                 }).html('<p>Le programme de colles de cette semaine n\'est pas encore défini.</p>');
               }
-              else if ( prop[0] == 'utilisateurs' )
+              else if ( ( prop[0] == 'utilisateurs' ) || ( prop[0] == 'agenda' ) )
                 location.reload(true);
               else
                 el.remove();
@@ -1254,8 +1264,8 @@
 // Formulaire généré lors des clics sur les boutons icon-ajoute et icon-prefs
 function formulaire(el) {
   var action = el.getAttribute('data-id');
-  // Si pas d'action : validation de compte utilisateur
-  if ( !action ) {
+  // Si validation de compte utilisateur, pas de formulaire à afficher
+  if ( action == 'valide_utilisateur' ) {
     $.ajax({url: 'ajax.php',
             method: "post",
             data: { table:'utilisateurs', id:$(el).parent().attr('data-id').split('|')[1] },
@@ -1285,18 +1295,81 @@
     // Création du nouveau formulaire
     var article = $('<article id="epingle"><a class="icon-ferme" title="Fermer"></a>\
   <a class="icon-aide" title="Aide pour ce formulaire"></a>\
-  <a class="icon-ok" title="Valider"></a></article>').insertBefore('article:first');
+  <a class="icon-ok" title="Valider"></a></article>').prependTo('section');
     var form = $('<form></form>').appendTo(article).html($('#form-'+action).html());
   }
-  // Facilités
+  // Facilités et peuplement du formulaire
   form.find('.edithtml').textareahtml();
   form.find('[data-placeholder]').placeholder();
-  if ( form.children('[name="table"]').val() == 'cdt' )
-    form.boutonscdt();
-  else if ( form.children('[name="table"]').val() == 'cdt-seances' )
-    form.affichechamps();
-  else if ( $('table#notes').length )
-    notes(el);
+  if ( $.colpick )  form.find('[name="couleur"]').colpick();
+  switch ( action ) {
+    case 'ajoute-cdt':
+      form.init_cdt_boutons();
+      break;
+    case 'ajoute-cdt-raccourci':
+      form.init_cdt_raccourcis();
+      break;
+    case 'notes':
+    case 'ajoute-notes':
+      notes(el);
+      break;
+    case 'evenement':
+      if ( el.id[0] == 'e' )  {
+        var id = el.id.substr(1);
+        var valeurs = evenements[id];
+        var cles = ['type','matiere','debut','fin','texte'];
+        for ( var i = 0 ; i < 6 ; i++ )  {
+          form.find('[name="'+cles[i]+'"]').val(valeurs[cles[i]]);
+        };
+        form.find('[name="texte"]').change();
+        form.find('[name="id"]').val(id);
+        form.find('[name="jours"]').prop('checked',valeurs['je']);
+        $('<a class="icon-supprime" title="Supprimer cette information"></a>').insertBefore($('.icon-ok'))
+          .on('click',function(){ supprime($(this)); })
+          .parent().attr('data-id','agenda|'+id);
+      }
+      // Gestion des sélections de date/heure
+      form.find('[name="debut"]').datetimepicker({
+        onShow: function()  {
+          this.setOptions({maxDate: form.find('[name="fin"]').val() || false });
+        },
+        onClose: function(t,input) {
+          form.find('[name="fin"]').val(function(i,v){ return v || input.val(); });
+        }
+      });
+      form.find('[name="fin"]').datetimepicker({
+        onShow: function()  {
+          this.setOptions({minDate: form.find('[name="debut"]').val() || false });
+        },
+        onClose: function(t,input) {
+          form.find('[name="debut"]').val(function(i,v){ return v || input.val(); });
+        }
+      });
+      // Case "dates seulement" : changement de format, conservation de l'heure
+      form.find('[name="jours"]').on('change',function() {
+        var v;
+        if ( this.checked )  {
+          form.find('[name="debut"],[name="fin"]').each( function() {
+            v = this.value.split(' ');
+            $(this).val(v[0]).attr('data-heure',v[1]).datetimepicker({ format: 'd/m/Y', timepicker: false });
+          });
+        }
+        else  {
+          form.find('[name="debut"],[name="fin"]').each( function() {
+            if ( this.hasAttribute('data-heure') )
+              $(this).val(this.value+' '+$(this).attr('data-heure')).removeAttr('data-heure');
+            $(this).datetimepicker({ format: 'd/m/Y Ghi', timepicker: true });
+          });
+        }
+      }).change();
+      break;
+    case 'deplacement-colle':
+      form.find('[name="ancien"],[name="nouveau"]').each( function() {
+        $(this).datetimepicker();
+        $(this).next().on('click',function() { $(this).prev().val('').change(); });
+      });
+      break;
+  }
   // Édition des élèves d'un nouveau groupe
   form.find('.usergrp > .icon-edite').on("click", function() {
     utilisateursgroupe(this);
@@ -1318,7 +1391,7 @@
       this.value = nettoie( ( $(this).is(':visible') ) ? this.value : $(this).next().html() );
     });
     // Nettoyage des notes à ne pas mettre
-    if ( form.children('[name="table"]').val() == 'notes' )
+    if ( ( action == 'notes' ) || ( action == 'ajoute-notes' ) )
       $('#epingle select:not(:visible)').val('x');
     // Envoi
     $.ajax({url: 'ajax.php',
@@ -1329,9 +1402,8 @@
             fonction: function(el) {
               // Sans remplacement : on recharge la page
               if ( el.attr('id') == 'epingle' ) {
-                // Cas du réglage des demandes de création de compte
-                // (utilisateurs.php) : ne rien faire
-                if ( !$('#epingle #autoriser').length )
+                // Sauf si #noreload présent : ne rien faire
+                if ( !$('#epingle #noreload').length )
                   location.reload(true);
               }
               // Avec remplacement : on modifie l'article pour permettre à nouveau l'édition
@@ -1467,7 +1539,7 @@
               else
                 $(bouton).parent().children('span').text('Cette matière ne concerne aucun utilisateur.');
             }
-    }).success( function(data) {
+    }).done( function(data) {
       // Si erreur, on décoche
       if ( data['etat'] != 'ok' )
         box.checked = !box.checked;
@@ -1530,7 +1602,7 @@
                   return $(this).text().replace(' (identifiant)','').trim();
                 }).get().join(', '));
               }
-      }).success( function(data) {
+      }).done( function(data) {
         // Si erreur, on décoche
         if ( data['etat'] != 'ok' )
           box.checked = !box.checked;
@@ -1847,7 +1919,7 @@
   $('.titrecdt').editinplacecdt();
 
   // Édition des propriétés des raccourcis des cahiers de texte
-  $('.cdt-raccourcis').affichechamps();
+  $('.cdt-raccourcis').init_cdt_raccourcis();
 
   // Boutons de suppression massive des éléments de matière et des informations d'une page
   $('.supprmultiple').on("click", function() {
@@ -1887,6 +1959,12 @@
     modifiedocument(this);
   });
 
+  // Édition des événements de l'agenda
+  $('.evnmt').on("click", function() {
+    this.setAttribute('data-id','evenement');
+    formulaire(this);
+  });
+
   // Édition de l'utilisation des groupes d'élèves
   $('[name="mailnotes"]').on("change", function() {
     $.ajax({url: 'ajax.php',
@@ -1910,6 +1988,12 @@
     $(this).hide();
   });
 
+  // Placeholders à afficher au chargement de la page
+  $('[data-placeholder]').placeholder();
+
+  // Sélecteurs de couleurs pour les formulaire affichés au chargement
+  if ( $.colpick )  $('[name="couleur"]').colpick();
+
   // Boutons cache, montre, monte, descend, supprime
   $('a.icon-cache,a.icon-montre,a.icon-monte,a.icon-descend,a.icon-supprime').on("click", function() {
     window[this.className.substring(5)]($(this));
@@ -1921,7 +2005,7 @@
   });
 
   // Formulaires affichés par clic sur les icônes ajouts et préférences
-  $('a.icon-prefs.general,a.icon-ajoute').on("click", function() {
+  $('a.icon-prefs.general,a.icon-ajoute,a.icon-ajout-colle').on("click", function() {
     formulaire(this);
   });
 
diff -urN cahier-de-prepa5.1.0/js/edition-min.js cahier-de-prepa6.0.0/js/edition-min.js
--- cahier-de-prepa5.1.0/js/edition-min.js	2015-10-26 23:35:17.446784902 +0100
+++ cahier-de-prepa6.0.0/js/edition-min.js	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-function affiche(c,a){$("#log").removeClass().addClass(a).html(c).append('<span class="icon-ferme"></span>').show().off("click").on("click",function(){window.clearTimeout(b);$(this).hide(500)});var b=window.setTimeout(function(){$("#log").hide(500)},10000)}function afficher_login(a){$("#fenetre,#fenetre_fond").remove();popup('<a class="icon-ok" title="Valider"></a><h3>Connexion nécessaire</h3>  <p>Vous avez été automatiquement déconnecté. Vous devez vous connecter à nouveau pour valider vos modifications.</p>  <form>  <p class="ligne"><label for="login">Identifiant&nbsp;: </label><input type="text" name="login" id="login"></p>  <p class="ligne"><label for="motdepasse">Mot de passe&nbsp;: </label><input type="password" name="motdepasse" id="motdepasse"></p>  </form>',true);$("#login").focus();$("#fenetre a.icon-ok").on("click",function(){$.ajax({url:"ajax.php",method:"post",data:$("#fenetre form").serialize()+"&"+a.data,dataType:"json",el:"",fonction:function(){return true}}).success(function(b){if(b.etat=="login_nok"){$("#fenetre > p").html(b.message).addClass("warning")}else{$("#fenetre,#fenetre_fond").remove();if(b.etat=="ok"){a.fonction(a.el)}}})});$("#fenetre a.icon-ferme").on("click",function(){affiche("Modification non effectuée, connexion nécessaire","nok")});$("#fenetre input").on("keypress",function(b){if(b.which==13){$("#fenetre a.icon-ok").click()}})}function popup(b,c){$("#fenetre,#fenetre_fond").remove();var a=$('<div id="fenetre"></div>').appendTo("body").html(b).focus();if(c){$('<div id="fenetre_fond"></div>').appendTo("body").click(function(){$("#fenetre,#fenetre_fond").remove()})}else{$('<a class="icon-epingle" title="Épingler à la page"></a>').prependTo(a).on("click",function(){$("#fenetre_fond").remove();$(this).remove();$("section").children("div,article").first().before(a.removeAttr("id"))})}$('<a class="icon-ferme" title="Fermer"></a>').prependTo(a).on("click",function(){a.remove();$("#fenetre_fond").remove()})}$.fn.placeholder=function(){this.each(function(){var a=$(this);if(a.is("div")){a.on("change keyup mouseup",function(){if($(this).text().length){$(this).removeClass("placeholder")}else{$(this).addClass("placeholder")}}).change()}else{$('<span class="placeholder">'+this.getAttribute("data-placeholder")+"</span>").insertBefore(a).on("click",function(){$(this).next().focus()}).hide();a.on("change keyup mouseup",function(){if(!(this.value.length)&&($(this).is(":visible"))){$(this).prev().css("display","inline")}else{$(this).prev().hide()}}).change()}})};$.fn.textareahtml=function(){this.each(function(){var a=$(this);var c=this.getAttribute("data-placeholder");this.setAttribute("data-placeholder",c+". Formattage en HTML, balises visibles.");var b=$('<div contenteditable="true" data-placeholder="'+c+'"></div>').insertAfter(a.before(boutons)).hide();var d=a.prev().children(".icon-retour");a.on("keypress",function(f){if(f.which==13){this.value=nettoie(this.value)}}).on("paste cut",function(){var e=this;setTimeout(function(){e.value=nettoie(e.value)},100)});b.on("keypress",function(f){if(f.which==13){d.click()}}).on("paste cut",function(){var e=this;setTimeout(function(){e.innerHTML=nettoie(e.innerHTML)+"<br>"},100)});a.prev().children(".icon-nosource").on("click",function(h){h.preventDefault();a.hide();a.prev().hide();b.show().css("min-height",a.outerHeight());$(this).hide().prev().show();b.focus().html(nettoie(a.val())).change();if(window.getSelection){var g=document.createRange();g.selectNodeContents(b[0]);g.collapse(false);var f=window.getSelection();f.removeAllRanges();f.addRange(g)}else{var g=document.body.createTextRange();g.moveToElementText(b[0]);g.collapse(false);g.select()}});a.prev().children(".icon-source").on("click",function(f){f.preventDefault();b.hide(0);a.show(0).css("height",b.height());$(this).hide().next().show();a.focus().val(nettoie(b.html())).change()}).hide();a.prev().children(".icon-aide").on("click",function(f){f.preventDefault();aidetexte()});a.prev().children().not(".icon-nosource,.icon-source,.icon-aide").on("click",function(f){f.preventDefault();window["insertion_"+this.className.substring(5)]($(this))})})};$.fn.editinplace=function(){this.each(function(){var a=$(this);this.setAttribute("data-original",(a.is("h3"))?a.text():a.html());$('<a class="icon-edite" title="Modifier"></a>').appendTo(a).on("click",transforme)})};function transforme(){var b=$(this).parent().addClass("avecform");if(b.is("div")){b.html('<form><textarea name="val" rows="'+(b.attr("data-original").split(/\r\n|\r|\n/).length+3)+'"></textarea></form>')}else{b.html('<form class="edition" onsubmit="$(this).children(\'a.icon-ok\').click(); return false;"><input type="text" name="val" value=""></form>')}var a=b.find('[name="val"]').val(b.attr("data-original"));if(b.attr("data-placeholder")){a.attr("data-placeholder",b.attr("data-placeholder"));if(b.hasClass("edithtml")){a.textareahtml();a.next().placeholder()}a.placeholder()}$('<a class="icon-ok" title="Valider"></a>').appendTo(b.children()).on("click",function(){var c=b.attr("data-id").split("|");if(b.hasClass("edithtml")){a.val(nettoie((a.is(":visible"))?a.val():a.next().html()))}$.ajax({url:"ajax.php",method:"post",data:{table:c[0],champ:c[1],id:c[2],val:a.val()},dataType:"json",el:b,fonction:function(d){var e=d.find('[name="val"]').val();d.removeClass("avecform").html(e).attr("data-original",e);$('<a class="icon-edite" title="Modifier"></a>').appendTo(d).on("click",transforme)}})});$('<a class="icon-annule" title="Annuler"></a>').appendTo(b.children()).on("click",function(){b.removeClass("avecform").html(b.attr("data-original"));$('<a class="icon-edite" title="Modifier"></a>').appendTo(b).on("click",transforme)});a.focus().val((b.hasClass("edithtml"))?nettoie(a.val()):a.val())}$.fn.editinplacecdt=function(){this.each(function(){$(this).wrapInner("<span></span>").attr("data-original",$(this).text());$('<a class="icon-edite" title="Modifier"></a>').appendTo($(this)).on("click",transformecdt)})};function transformecdt(){var b=$(this).parent();b.children(".icon-edite").remove();var c=$('<form class="titrecdt"></form>').insertBefore(b.parent().children("div")).html($("#form-cdt").html());c.boutonscdt();c.find('input,[name="demigroupe"]').on("change keyup",function(){var e=new Date(c.find('[name="jour"]').val().replace(/(.{2})\/(.{2})\/(.{4})/,function(i,h,k,j){return j+"-"+k+"-"+h}));var f=(c.find('[name="demigroupe"]').val()==1)?" (en demi-groupe)":"";switch(parseInt(seances[c.find('[name="tid"]').val()])){case 0:var g=jours[e.getDay()]+" "+c.find('[name="jour"]').val()+" à "+c.find('[name="h_debut"]').val()+" : "+c.find('[name="tid"] option:selected').text()+f;break;case 1:var g=jours[e.getDay()]+" "+c.find('[name="jour"]').val()+" de "+c.find('[name="h_debut"]').val()+" à "+c.find('[name="h_fin"]').val()+" : "+c.find('[name="tid"] option:selected').text()+f;break;case 2:var g=jours[e.getDay()]+" "+c.find('[name="jour"]').val()+" : "+c.find('[name="tid"] option:selected').text()+" pour le "+c.find('[name="pour"]').val()+f;break;case 3:var g=jours[e.getDay()]+" "+c.find('[name="jour"]').val()+" : "+c.find('[name="tid"] option:selected').text()+f;break;case 4:var g=jours[e.getDay()]+" "+c.find('[name="jour"]').val();break;case 5:var g="[Entrée hebdomadaire]"}b.children("span").text(g)});var d=$.parseJSON(b.attr("data-donnees"));for(var a in d){c.find('[name="'+a+'"]').val(d[a])}$('<a class="icon-ok" title="Valider"></a>').appendTo(b).on("click",function(){var e=b.parent().attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:"table=cdt&id="+e[1]+"&"+c.serialize(),dataType:"json",el:b,fonction:function(f){var g=f.siblings("form");f.attr("data-original",f.children("span").text()).attr("data-donnees",'{"tid":'+g.find('[name="tid"]').val()+',"jour":"'+g.find('[name="jour"]').val()+'","h_debut":"'+g.find('[name="h_debut"]').val()+'","h_fin":"'+g.find('[name="h_fin"]').val()+'","pour":"'+g.find('[name="pour"]').val()+'","demigroupe":'+g.find('[name="demigroupe"]').val()+"}");g.remove();f.children("a").remove();$('<a class="icon-edite" title="Modifier"></a>').appendTo(f).on("click",transformecdt)}}).success(function(f){if((f.etat=="ok")&&(f.reload=="oui")){location.reload(true)}})});$('<a class="icon-annule" title="Annuler"></a>').appendTo(b).on("click",function(){c.remove();b.children("span").html(b.attr("data-original"));b.children("a").remove();$('<a class="icon-edite" title="Modifier"></a>').appendTo(b).on("click",transformecdt)})}$.fn.boutonscdt=function(){form=this;form.find(".date").datepick({dateFormat:"dd/mm/yyyy",showTrigger:'<img src="js/calendar-blue.gif">',onSelect:function(){form.find('[name="h_debut"]').change()}});form.find(".heure").timeEntry({timeSteps:[1,15,0],separator:"h",spinnerImage:"js/spinnerDefault.png"});var a=function(b){return(String(b).length==1)?"0"+b:String(b)};form.find('[name="raccourci"]').on("change keyup",function(){var e=raccourcis[this.value];for(var d in e){if(d=="jour"){var c=new Date;var b=parseInt(e.jour);c.setDate((b>c.getDay())?c.getDate()-c.getDay()-7+b:c.getDate()-c.getDay()+b);form.find('[name="jour"]').val(a(c.getDate())+"/"+a(c.getMonth()+1)+"/"+c.getFullYear())}else{form.find('[name="'+d+'"]').val(e[d])}}this.setAttribute("data-modif",1);form.find('[name="tid"]').change()}).attr("data-modif",0);form.find('[name="tid"]').on("change keyup",function(){switch(parseInt(seances[this.value])){case 0:form.find('[name="h_debut"]').parent().show();form.find('[name="h_fin"]').parent().hide();form.find('[name="pour"]').parent().hide();form.find('[name="demigroupe"]').parent().show();break;case 1:form.find('[name="h_debut"]').parent().show();form.find('[name="h_fin"]').parent().show();form.find('[name="pour"]').parent().hide();form.find('[name="demigroupe"]').parent().show();break;case 2:form.find('[name="h_debut"]').parent().hide();form.find('[name="h_fin"]').parent().hide();form.find('[name="pour"]').parent().show();form.find('[name="demigroupe"]').parent().show();break;case 3:form.find('[name="h_debut"]').parent().hide();form.find('[name="h_fin"]').parent().hide();form.find('[name="pour"]').parent().hide();form.find('[name="demigroupe"]').parent().show();break;default:form.find('[name="h_debut"]').parent().hide();form.find('[name="h_fin"]').parent().hide();form.find('[name="pour"]').parent().hide();form.find('[name="demigroupe"]').parent().hide();break}form.find('[name="jour"]').change()});form.find('input,[name="demigroupe"]').on("change keyup",function(){if(form.find('[name="raccourci"]').attr("data-modif")==0){form.find('[name="raccourci"]').val(0)}else{form.find('[name="raccourci"]').attr("data-modif",0)}});form.find("input,select").on("keypress",function(b){if(b.which==13){el.find("a.icon-ok").click()}});form.find("select:first").focus();form.find('[name="tid"]').change()};$.fn.affichechamps=function(){this.each(function(){var a=$(this);a.find(".heure").timeEntry({timeSteps:[1,15,0],separator:"h",spinnerImage:"js/spinnerDefault.png"});a.find('[name="type"]').on("change keyup",function(){switch(parseInt(seances[this.value])){case 0:a.find('[name="h_debut"]').parent().show();a.find('[name="h_fin"]').parent().hide();a.find('[name="demigroupe"]').parent().show();break;case 1:a.find('[name="h_debut"]').parent().show();a.find('[name="h_fin"]').parent().show();a.find('[name="demigroupe"]').parent().show();break;case 2:a.find('[name="h_debut"]').parent().hide();a.find('[name="h_fin"]').parent().hide();a.find('[name="demigroupe"]').parent().show();break;case 3:a.find('[name="h_debut"]').parent().hide();a.find('[name="h_fin"]').parent().hide();a.find('[name="demigroupe"]').parent().show();break;default:a.find('[name="h_debut"]').parent().hide();a.find('[name="h_fin"]').parent().hide();a.find('[name="demigroupe"]').parent().hide();break}}).change();a.find("input,select").on("keypress",function(b){if(b.which==13){a.find("a.icon-ok").click()}})})};function nettoie(b){if(b.indexOf("cdptmp")>0){var a=$("<div>"+b+"</div>");a.find(".cdptmp").contents().unwrap();b=a.html();if(b.indexOf("cdptmp")>0){b=b.replace(/<span class="cdptmp"><\/span>/g,"")}}return b.replace(/(<\/?[A-Z]+)([^>]*>)/g,function(d,c,e){return c.toLowerCase()+e}).replace(/[\r\n ]+/g," ").replace(/(<br>)+[ ]?<\/(p|div|li|h)/g,function(d,c,e){return"</"+e}).replace(/<br>/g,"<br>\n").replace(/<(p|div|li|h)/g,function(c){return"\n"+c}).replace(/<\/(p|div|li|h.)>/g,function(c){return c+"\n"}).replace(/<\/?(ul|ol)[^>]*>/g,function(c){return"\n"+c+"\n"}).replace(/^(?!(<p|<div|<ul|<ol|<li|<h))(.+)<br>$/gm,function(d,c,e){return"<p>"+e+"</p>"}).replace(/^(?!(<(p|div|ul|ol|li)))[ ]?(.+)[ ]?$/gm,function(d,c,f,e){return(e.match(/.*(p|div|ul|ol|li|h.)>$/))?e:"<p>"+e+"</p>"}).replace(/^[ ]?(<\/?(br|p|div|h.)>){0,2}[ ]?(<\/(p|div|h.)>)?[ ]?$/gm,"").replace(/^\n/gm,"").replace(/<li/g,"  <li")}function insert(d,a,g,e){var b=d.parent().siblings("textarea,[contenteditable]").filter(":visible")[0];if(!b.hasAttribute("data-selection")){marqueselection(d)}var f=(e===undefined)?a+"Í"+b.getAttribute("data-selection")+"Ì"+g:a+"Í"+e+"Ì"+g;var c=nettoie(b.getAttribute("data-contenu").replace(/Í.*Ì/,f));if(b.tagName=="TEXTAREA"){b.value=c.replace(/[ÍÌ]/g,"")}else{b.innerHTML=c.replace(/[ÍÌ]/g,"")}marqueselection(d,true);$(b).change();if((b.tagName=="TEXTAREA")&&(b.selectionStart!==undefined)){b.selectionStart=c.indexOf("Í");b.selectionEnd=c.indexOf("Ì")-1;b.focus()}else{if(document.selection){if(b.tagName!="TEXTAREA"){c=c.replace(/(<([^>]+)>)[\n]*/g,"")}range=document.body.createTextRange();range.moveToElementText(b);range.collapse(true);range.moveEnd("character",c.indexOf("Ì")-1);range.moveStart("character",c.indexOf("Í"));range.select()}else{if(window.getSelection){b.innerHTML=c.replace("Í",'<span class="cdptmp">').replace("Ì","</span>")+"<br>";selection=window.getSelection();range=document.createRange();range.selectNodeContents($(b).find(".cdptmp")[0]);selection.removeAllRanges();selection.addRange(range);b.focus()}}}}function marqueselection(f,c){var a=f.parent().siblings("textarea,[contenteditable]").filter(":visible")[0];if(c){a.removeAttribute("data-selection");a.removeAttribute("data-contenu");return true}var d=(a.tagName=="TEXTAREA")?a.value:a.innerHTML;var g="";if((a.tagName=="TEXTAREA")&&(a.selectionStart!==undefined)){a.focus();g=a.value.substring(a.selectionStart,a.selectionEnd);a.value=a.value.substr(0,a.selectionStart)+"Í"+g+"Ì"+a.value.substring(a.selectionEnd)}else{if(window.getSelection){var b=window.getSelection().getRangeAt(0);if((a==b.commonAncestorContainer)||$.contains(a,b.commonAncestorContainer)){var g=window.getSelection().toString();b.deleteContents();b.insertNode(document.createTextNode("Í"+g+"Ì"))}}else{var b=document.selection.createRange();if((a==b.parentElement())||$.contains(a,b.parentElement())){var g=document.selection.createRange().text;document.selection.createRange().text="Í"+g+"Ì"}}}if(a.tagName=="TEXTAREA"){var e=a.value;a.value=d}else{var e=a.innerHTML;$(a).html(d)}if(e.indexOf("Ì")<0){e=e+"ÍÌ"}a.setAttribute("data-selection",g);a.setAttribute("data-contenu",e);return g}var boutons='<p class="boutons">  <button class="icon-titres" title="Niveaux de titres"></button>  <button class="icon-par1" title="Paragraphe"></button>  <button class="icon-par2" title="Paragraphe important"></button>  <button class="icon-par3" title="Paragraphe très important"></button>  <button class="icon-retour" title="Retour à la ligne"></button>  <button class="icon-gras" title="Gras"></button>  <button class="icon-italique" title="Italique"></button>  <button class="icon-souligne" title="Souligné"></button>  <button class="icon-omega" title="Insérer une lettre grecque"></button>  <button class="icon-sigma" title="Insérer un signe mathématique"></button>  <button class="icon-exp" title="Exposant"></button>  <button class="icon-ind" title="Indice"></button>  <button class="icon-ol" title="Liste énumérée"></button>  <button class="icon-ul" title="Liste à puces"></button>  <button class="icon-lien1" title="Lien vers un document du site"></button>  <button class="icon-lien2" title="Lien internet"></button>  <button class="icon-tex" title="LATEX!"></button>  <button class="icon-source" title="Voir et éditer le code html"></button>  <button class="icon-nosource" title="Voir et éditer le texte formaté"></button>  <button class="icon-aide" title="Voir et éditer le texte formaté"></button></p>';function insertion_titres(a){popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'un titre</h3>  <p>Choisissez le type du titre ci-dessous. Vous pouvez éventuellement modifier le texte (ou pourrez le faire ultérieurement). Il est conseillé d\'utiliser des titres de niveau 2 pour les titres dans les programmes de colle.</p>  <input type="radio" name="titre" id="t3" value="3" checked><h3><label for="t3">Titre de niveau 1 (pour les I,II...)</label></h3><br>  <input type="radio" name="titre" id="t4" value="4"><h4><label for="t4">Titre de niveau 2 (pour les 1,2...)</label></h4><br>  <input type="radio" name="titre" id="t5" value="5"><h5><label for="t5">Titre de niveau 3 (pour les a,b...)</label></h5><br>  <input type="radio" name="titre" id="t6" value="6"><h6><label for="t6">Titre de niveau 4</label></h6><br>  <p class="ligne"><label for="texte">Texte&nbsp;: </label><input type="text" id="texte" value="'+marqueselection(a)+'" size="80"></p>  <hr><h3>Aperçu</h3><div id="apercu"></div>',true);$("#fenetre input").on("click keyup",function(){var b="h"+$("[name='titre']:checked").val();$("#apercu").html("<"+b+">"+(($("#texte").val().length)?$("#texte").val():"Texte du titre")+"</"+b+">")}).first().keyup();$("#texte").on("keypress",function(b){if(b.which==13){$("#fenetre a.icon-ok").click()}}).focus();$("#fenetre a.icon-ok").on("click",function(){var b="h"+$("[name='titre']:checked").val();insert(a,"<"+b+">","</"+b+">",$("#texte").val());$("#fenetre,#fenetre_fond").remove()});$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(a,true)})}function insertion_omega(a){popup("<h3>Insertion d'une lettre grecque</h3>  <p>Cliquez sur la lettre à insérer&nbsp;:</p>  <button>&alpha;</button> <button>&beta;</button> <button>&gamma;</button> <button>&Delta;</button> <button>&delta;</button> <button>&epsilon;</button> <button>&eta;</button> <button>&Theta;</button> <button>&theta;</button> <button>&Lambda;</button> <button>&lambda;</button> <button>&mu;</button> <button>&nu;</button> <button>&xi;</button> <button>&Pi;</button> <button>&pi;</button> <button>&rho;</button> <button>&Sigma;</button> <button>&sigma;</button> <button>&tau;</button> <button>&upsilon;</button> <button>&Phi;</button> <button>&phi;</button> <button>&Psi;</button> <button>&psi;</button> <button>&Omega;</button> <button>&omega;</button>",true);$("#fenetre button").on("click",function(){insert(a,"","",$(this).text());$("#fenetre,#fenetre_fond").remove()})}function insertion_sigma(a){popup("<h3>Insertion d'un symbole mathématique</h3>  <p>Cliquez sur le symbole à insérer&nbsp;:</p>  <button>&forall;</button> <button>&exist;</button> <button>&part;</button> <button>&nabla;</button> <button>&prod;</button> <button>&sum;</button> <button>&plusmn;</button> <button>&radic;</button> <button>&infin;</button> <button>&int;</button> <button>&prop;</button> <button>&sim;</button> <button>&cong;</button> <button>&asymp;</button> <button>&ne;</button> <button>&equiv;</button> <button>&le;</button> <button>&ge;</button> <button>&sub;</button> <button>&sup;</button> <button>&nsub;</button> <button>&sube;</button> <button>&supe;</button> <button>&isin;</button> <button>&notin;</button> <button>&ni;</button> <button>&oplus;</button> <button>&otimes;</button> <button>&sdot;</button> <button>&and;</button> <button>&or;</button> <button>&cap;</button> <button>&cup;</button> <button>&real;</button> <button>&image;</button> <button>&empty;</button> <button>&deg;</button> <button>&prime;</button> <button>&micro;</button> <button>&larr;</button> <button>&uarr;</button> <button>&rarr;</button> <button>&darr;</button> <button>&harr;</button> <button>&lArr;</button> <button>&uArr;</button> <button>&rArr;</button> <button>&dArr;</button> <button>&hArr;</button>",true);$("#fenetre button").on("click",function(){insert(a,"","",$(this).text());$("#fenetre,#fenetre_fond").remove()})}function insertion_ol(a){popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'une liste numérotée</h3>  <p>Choisissez le type de numérotation et la valeur de départ de la liste ci-dessous. Vous pouvez éventuellement modifier les différents éléments en les écrivant ligne par ligne. Vous pourrez ajouter un élément ultérieurement en l\'encadrant par les balises &lt;li&gt; et &lt;/li&gt;.</p>  <p class="ligne"><label for="t1">Numérotation numérique (1, 2, 3...)</label><input type="radio" name="type" id="t1" value="1" checked></p>  <p class="ligne"><label for="t2">Numérotation alphabétique majuscule (A, B, C...)</label><input type="radio" name="type" id="t2" value="A"></p>  <p class="ligne"><label for="t3">Numérotation alphabétique minuscule (a, b, c...)</label><input type="radio" name="type" id="t3" value="a"></p>  <p class="ligne"><label for="t4">Numérotation romaine majuscule (I, II, III...)</label><input type="radio" name="type" id="t4" value="I"></p>  <p class="ligne"><label for="t5">Numérotation romaine minuscule (i, ii, iii...)</label><input type="radio" name="type" id="t5" value="i"></p>  <p class="ligne"><label for="debut">Valeur de début (numérique)</label><input type="text" id="debut" value="1"></p>  <p class="ligne"><label for="lignes">Textes (chaque ligne correspond à un élément de la liste)&nbsp;: </label></p>  <textarea id="lignes" rows="5">'+marqueselection(a)+'</textarea>  <hr><h3>Aperçu</h3><div id="apercu"></div>',true);$("#fenetre :input").on("click keyup",function(){var b=$("#debut").val();b=(b.length&&(b>1))?' start="'+b+'"':"";$("#apercu").html('<ol type="'+$("[name='type']:checked").val()+'"'+b+"><li>"+(($("#lignes").val().length)?$("#lignes").val().trim("\n").replace(/\n/g,"</li><li>"):"Première ligne</li><li>Deuxième ligne</li><li>...")+"</li></ol>")}).first().keyup();$("#lignes").focus();$("#fenetre a.icon-ok").on("click",function(){var b=$("#debut").val();b=(b.length&&(b>1))?' start="'+b+'"':"";var e=$("#lignes").val().trim("\n");var c=e.lastIndexOf("\n");if(c>0){var d=e.substring(c+1);e=e.substring(0,c)}else{var d=""}insert(a,'<ol type="'+$("[name='type']:checked").val()+'"'+b+"><li>"+e.replace(/\n/g,"</li><li>")+"</li><li>","</li></ol>",d);$("#fenetre,#fenetre_fond").remove()});$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(a,true)})}function insertion_ul(a){popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'une liste à puces</h3>  <p>Vous pouvez éventuellement modifier les différents éléments en les écrivant ligne par ligne (chaque ligne correspond à un élément de la la liste). Vous pourrez ajouter un élément ultérieurement en l\'encadrant par les balises &lt;li&gt; et &lt;/li&gt;.</p>  <textarea id="lignes" rows="5">'+marqueselection(a)+'</textarea>  <hr><h3>Aperçu</h3><div id="apercu"></div>',true);$("#lignes").on("click keyup",function(){$("#apercu").html("<ul><li>"+(($("#lignes").val().length)?$("#lignes").val().trim("\n").replace(/\n/g,"</li><li>"):"Première ligne</li><li>Deuxième ligne</li><li>...")+"</li></ul>")}).keyup().focus();$("#fenetre a.icon-ok").on("click",function(){var d=$("#lignes").val().trim("\n");var b=d.lastIndexOf("\n");if(b>0){var c=d.substring(b+1);d=d.substring(0,b)}else{var c=""}insert(a,"<ul><li>"+d.replace(/\n/g,"</li><li>")+"</li><li>","</li></ul>",c);$("#fenetre,#fenetre_fond").remove()});$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(a,true)})}function insertion_lien1(a){var b=marqueselection(a);popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'un lien vers un document de Cahier de Prépa</h3>  <div><p style="text-align:center; margin: 2em 0;">[Récupération des listes de documents]</p></div>  <div style="display:none;"><hr><h3>Aperçu</h3><div id="apercu" style="text-align:center;">[Veuillez choisir un document]</div></div>',true);$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(a,true)});$.ajax({url:"ajax.php",method:"post",data:{recupdoc:""},dataType:"json"}).success(function(d){var e=function(){var g=$("#apercu");var i=$("#doc").val();var h=$("#doc option:selected").text();if(i==0){g.html(h)}else{if($("#vue").is(":checked")){var f=$("#largeur").val();if(h.slice(-4,-1)=="pdf"){if(g.children(".pdf").length==0){g.html('<div><object data="download?id='+i+'" type="application/pdf" height="100%" width="100%"> <a href="download?id='+i+'">'+h+"</a> </object></div>")}else{if(g.find("object").attr("data").substr(12)!=i){g.find("object").attr("data","download?id="+i).html('<a href="download?id='+i+'">'+h+"</a>")}}g.children().attr("class","pdf "+$("#format").val());if(f){if(f==100){g.children().removeAttr("style").children().attr("width","100%").removeAttr("style")}else{g.children().css("padding-bottom",($('<div class="'+$("#format").val()+'"></div>').css("padding-bottom").slice(0,-1)*f/100)+"%");g.find("object").attr("width",f+"%").css("left",(100-f)/2+"%")}}}else{if("jpgpegpng".indexOf(h.slice(-4,-1))>-1){if(g.children("img").length==0){g.css("text-align","").html('<img src="download?id='+i+'">')}else{if(g.children().attr("src").substr(12)!=i){g.children().attr("src","download?id="+i)}}if(f){if(f==100){g.children().removeAttr("style")}else{g.children().css("width",f+"%").css("margin-left",(100-f)/2+"%")}}}}}else{$("#apercu").css("text-align","center").html('<a onclick="return false;" href="download?id='+this.value+'">'+$("#texte").val()+"</a>")}}};var c=function(f){$("#fenetre > div:first").html('  <p>Choisissez ci-dessous le répertoire puis le document à insérer. Vous pouvez aussi modifier le texte visible. Cela reste modifiable ultérieurement&nbsp;: le texte est situé entre les deux balises &lt;a...&gt; et &lt;/a&gt;.</p>  <p class="ligne"><label for="mat">Matière&nbsp;:</label><select id="mat">'+f.mats+'</select></p>  <p class="ligne"><label for="rep">Répertoire&nbsp;:</label><select id="rep"></select></p>  <p class="ligne"><label for="doc">Document&nbsp;:</label><select id="doc"></select></p>  <p class="ligne"><label for="texte">Texte visible&nbsp;:</label><input type="text" id="texte" value="'+b+'" size="80" data-auto="1"></p>  <p class="ligne"><label for="vue">Afficher dans la page (PDF et image uniquement)</label><input type="checkbox" id="vue">  <p class="ligne"><label for="largeur">Largeur en %&nbsp;:</label><input type="text" id="largeur" value="100" size="3"></p>  <p class="ligne"><label for="format">Format (PDF uniquement)</label><select id="format">    <option value="portrait">A4 vertical</option><option value="paysage">A4 horizontal</option><option value="hauteur50">Hauteur 50%</option>  </select>');$("#fenetre > div:last").show();if($("#texte").val().length){$("#texte").attr("data-auto",0)}$("#doc").on("change keyup",function(g){if(g.which==13){$("#fenetre a.icon-ok").click()}var h=$("#doc option:selected").text();if($("#texte").attr("data-auto")==1){$("#texte").val((this.value>0)?h.substr(0,h.lastIndexOf("(")-1):"---")}if("pdfjpgpegpng".indexOf(h.slice(-4,-1))>-1){$("#vue").change().parent().show()}else{$("#vue, #largeur, #format").parent().hide()}e()});$("#texte").on("change keypress",function(g){if(g.which==0){return}if(g.which==13){$("#fenetre a.icon-ok").click()}if(this.value.length==0){this.setAttribute("data-auto",1);$("#doc").change()}else{this.setAttribute("data-auto",0);e()}});$("#vue").on("change",function(){if($("#vue").is(":checked")){if($("#doc option:selected").text().slice(-4,-1)=="pdf"){$("#largeur, #format").parent().show();$("#texte").parent().hide()}else{if("jpgpegpng".indexOf($("#doc option:selected").text().slice(-4,-1))>-1){$("#largeur").parent().show();$("#format, #texte").parent().hide()}}}else{$("#texte").parent().show();$("#largeur, #format").parent().hide()}e()});$("#format").on("change keyup",function(g){if(g.which==13){$("#fenetre a.icon-ok").click()}e()});$("#largeur").on("keydown",function(g){if(g.which==38){++this.value}else{if(g.which==40){--this.value}}}).on("change keyup",function(g){if(g.which==0){return}if(g.which==13){$("#fenetre a.icon-ok").click()}if(this.value!=this.getAttribute("data-valeur")){this.setAttribute("data-valeur",this.value);e()}}).attr("data-valeur",100);$("#rep").on("change",function(){$("#doc").html(f.docs[this.value]).change()});$("#mat").on("change",function(){$("#rep").html(f.reps[this.value]).change()}).focus().change();$("#fenetre a.icon-ok").on("click",function(){if($("#doc").val()){if($("#vue").is(":checked")&&("pdfjpgpegpng".indexOf($("#doc option:selected").text().slice(-4,-1))>-1)){insert(a,$("#apercu").html(),"","")}else{insert(a,'<a href="download?id='+$("#doc").val()+'">',"</a>",$("#texte").val())}$("#fenetre,#fenetre_fond").remove()}});$("#mat option").each(function(){if($("body").attr("data-matiere")==this.value){$("#mat").val(this.value).change()}})};if(d.etat=="login_"){$("#fenetre > div:first").html('<p>Vous n\'êtes actuellement plus connecté. Vous devez vous identifier à nouveau pour récupérer la liste des répertoires et documents disponibles.</p>        <form>        <p class="ligne"><label for="login">Identifiant&nbsp;: </label><input type="text" name="login" id="login"></p>        <p class="ligne"><label for="motdepasse">Mot de passe&nbsp;: </label><input type="password" name="motdepasse" id="motdepasse"></p>        </form>');$("#fenetre input").on("keypress",function(f){if(f.which==13){$("#fenetre a.icon-ok").click()}});$("#fenetre a.icon-ok").on("click",function(){$.ajax({url:"ajax.php",method:"post",data:{login:$("#login").val(),motdepasse:$("#motdepasse").val(),recupdoc:""},dataType:"json"}).success(function(f){if(f.etat=="login_nok"){$("#fenetre > div:first > p:first").html(f.message).addClass("warning")}else{if(f.etat=="ok_"){c(f)}}})})}else{if(d.etat=="ok_"){c(d)}}})}function insertion_lien2(a){popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'un lien</h3>  <p class="ligne"><label for="texte">Texte visible&nbsp;: </label><input type="text" id="texte" value="'+marqueselection(a)+'" size="80"></p>  <p class="ligne"><label for="url">Adresse&nbsp;: </label><input type="text" id="url" value="http://" size="80"></p>  <hr><h3>Aperçu</h3><div id="apercu" style="text-align:center;"></div>',true);$("#fenetre input").on("click keyup",function(){$("#apercu").html(($("#texte").val().length)?'<a onclick="return false;" href="'+$("#url").val()+'">'+$("#texte").val()+"</a>":"[Écrivez un texte visible]")}).on("keypress",function(b){if(b.which==13){$("#fenetre a.icon-ok").click()}}).first().keyup().focus();$("#fenetre a.icon-ok").on("click",function(){insert(a,'<a href="'+$("#url").val()+'">',"</a>",$("#texte").val());$("#fenetre,#fenetre_fond").remove()});$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(a,true)})}function insertion_tex(b){var d=(typeof MathJax=="undefined")?'<script type="text/javascript" src="/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"><\/script><script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax:{inlineMath:[["$","$"],["\\\\(","\\\\)"]]}});<\/script>':"";var c=marqueselection(b);var a="t1";if(c.length){switch(c.substring(0,2)){case"\\[":case"$$":a="t2";case"\\(":c=c.substring(2,c.length-2);break;default:c=c.trim("$")}}popup(d+'<a class="icon-montre" title="Mettre à jour l\'aperçu"></a><a class="icon-ok" title="Valider"></a><h3>Insertion de formules LaTeX</h3>  <p>Vous pouvez ci-dessous entrer et modifier une formule LaTeX. L\'aperçu présent en bas sera mis à jour uniquement lorsque vous cliquez sur l\'icône <span class="icon-montre"></span>.</p>  <p class="ligne"><label for="t1">La formule est en ligne (pas de retour)</label><input type="radio" name="type" id="t1" value="1"></p>  <p class="ligne"><label for="t2">La formule est hors ligne (formule centrée)</label><input type="radio" name="type" id="t2" value="2"></p>  <textarea id="formule" rows="3">'+c+'</textarea>  <hr><h3>Aperçu</h3><div id="apercu" style="text-align:center;">[Demandez l\'aperçu en cliquant sur l\'icône <span class="icon-montre"></span>]</div>',true);$("#"+a).prop("checked",true);$("#formule").focus();$("#fenetre a.icon-montre").on("click",function(){if($("#formule").val().length){$("#apercu").html(($("#t1").is(":checked"))?"$"+$("#formule").val()+"$":"\\["+$("#formule").val()+"\\]").css("text-align","left");MathJax.Hub.Queue(["Typeset",MathJax.Hub,"apercu"])}else{$("#apercu").html("[Écrivez une formule]").css("text-align","center")}});$("#fenetre a.icon-ok").on("click",function(){if($("#t1").is(":checked")){insert(b,"$","$",$("#formule").val())}else{insert(b,"\\[","\\]",$("#formule").val())}$("#fenetre,#fenetre_fond").remove()});$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(b,true)})}function insertion_par1(a){insert(a,"<p>","</p>")}function insertion_par2(a){insert(a,"<div class='note'>","</div>")}function insertion_par3(a){insert(a,"<div class='annonce'>","</div>")}function insertion_retour(a){insert(a,"<br>","")}function insertion_gras(a){insert(a,"<strong>","</strong>")}function insertion_italique(a){insert(a,"<em>","</em>")}function insertion_souligne(a){insert(a,"<u>","</u>")}function insertion_exp(a){insert(a,"<sup>","</sup>")}function insertion_ind(a){insert(a,"<sub>","</sub>")}function aidetexte(){popup('<h3>Aide et explications</h3>  <p>Il y a deux modes d\'éditions possibles pour éditer un texte&nbsp;: le mode «&nbsp;balises visibles&nbsp;» et le mode «&nbsp;balises invisibles&nbsp;». Il est possible de passer de l\'un à l\'autre&nbsp;:</p>  <ul>    <li><span class="icon-source"></span> permet de passer en mode «&nbsp;balises visibles&nbsp;» (par défaut), où le texte à taper est le code HTML de l\'article. Ce mode est plus précis. Les boutons aux dessus aident à utiliser les bonnes balises.</li>    <li><span class="icon-nosource"></span> permet de passer en mode «&nbsp;balises invisibles&nbsp;», où le texte est tel qu\'il sera affiché sur la partie publique, et modifiable. Ce mode est moins précis, mais permet le copié-collé depuis une page web ou un document Word/LibreOffice.  </ul>  <p>Une fonction de nettoyage du code HTML, permettant d\'assurer une homogénéité et une qualité d\'affichage optimales, est lancée à chaque commutation entre les deux modes, à chaque clic sur un des boutons disponibles, à chaque copie/coupe de texte et à chaque passage à la ligne.</p>  <p>En HTML, toutes les mises en formes sont réalisées par un encadrement de texte entre deux balises&nbsp;: &lt;h3&gt; et &lt;/h3&gt; pour un gros titre, &lt;p&gt; et &lt;/p&gt; pour un paragraphe. Le retour à la ligne simple, qui ne doit exister que très rarement, est une balise simple &lt;br&gt;. Mais les boutons disponibles sont là pour vous permettre de réaliser le formattage que vous souhaitez&nbsp;:</p>  <ul>    <li><span class="icon-titres"></span>&nbsp;: différentes tailles de titres (fenêtre supplémentaire pour choisir)</li>    <li><span class="icon-par1"></span>&nbsp;: paragraphe classique, qui doit obligatoirement encadrer au minimum chaque ligne de texte. Apparaît automatiquement au passage à la ligne si on l\'oublie.</li>    <li><span class="icon-par2"></span>&nbsp;: paragraphe important, écrit en rouge</li>    <li><span class="icon-par3"></span>&nbsp;: paragraphe très important, écrit en rouge et encadré</li>    <li><span class="icon-retour"></span>&nbsp;: retour à la ligne. Identique à un appui sur Entrée, et souvent inutile.</li>    <li><span class="icon-gras"></span>&nbsp;: mise en gras du texte entre les balises</li>    <li><span class="icon-italique"></span>&nbsp;: mise en italique du texte entre les balises</li>    <li><span class="icon-souligne"></span>&nbsp;: soulignement du texte entre les balises</li>    <li><span class="icon-omega"></span>&nbsp;: lettres grecques (fenêtre supplémentaire pour choisir)</li>    <li><span class="icon-sigma"></span>&nbsp;: symboles mathématiques (fenêtre supplémentaire pour choisir)</li>    <li><span class="icon-exp"></span>&nbsp;: mise en exposant du texte entre les balises</li>    <li><span class="icon-ind"></span>&nbsp;: mise en indice du texte entre les balises</li>    <li><span class="icon-ol"></span>&nbsp;: liste numérotée. Une fenêtre supplémentaire permet de choisir le type (1,A,a,I,i) et la première valeur. Les différentes lignes de la liste sont constituées par les balises &lt;li&gt; et &lt;/li&gt;</li>    <li><span class="icon-ul"></span>&nbsp;: liste à puces. Les différentes lignes de la liste sont constituées par les balises &lt;li&gt; et &lt;/li&gt;</li>    <li><span class="icon-lien1"></span>&nbsp;: lien d\'un document disponible ici (fenêtre supplémentaire pour choisir)</li>    <li><span class="icon-lien2"></span>&nbsp;: lien vers un autre site web (fenêtre supplémentaire pour entre l\'adresse)</li>    <li><span class="icon-tex"></span>&nbsp;: insertion de code LaTeX (fenêtre supplémentaire pour le taper)</li>  </ul>  <p class="tex2jax_ignore">Il est possible d\'insérer du code en LaTeX, sur une ligne séparée (balises \\[...\\] ou balises $$...$$) ou au sein d\'une phrase (balises $...$ ou balises \\(...\\)). Il faut ensuite taper du code en LaTeX à l\'intérieur. La prévisualisation est réalisée en direct.</p>',false)}function echange(b,a){if(b.length&&a.length){$("article").css("position","relative");b.css("opacity",0.3);a.css("opacity",0.3);a.animate({top:b.position().top-a.position().top},1000);b.animate({top:(a.outerHeight(true)+a.outerHeight())/2},1000,function(){b.css("opacity",1);a.css("opacity",1);b.insertAfter(a);b.css({position:"static",top:0});a.css({position:"static",top:0})})}}function cache(a){var b=a.parent().attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{cache:1,table:b[0],id:b[1]},dataType:"json",el:a,fonction:function(c){c.parent().addClass("cache");c.removeClass("icon-cache").addClass("icon-montre").off("click").on("click",function(){montre($(this))}).attr("title","Montrer à nouveau")}})}function montre(a){var b=a.parent().attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{montre:1,table:b[0],id:b[1]},dataType:"json",el:a,fonction:function(c){c.parent().removeClass("cache");c.removeClass("icon-montre").addClass("icon-cache").off("click").on("click",function(){cache($(this))}).attr("title","Cacher à nouveau")}})}function monte(b){var a=b.parent();var c=a.attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{monte:1,table:c[0],id:c[1]},dataType:"json",el:a,fonction:function(d){if(!(d.prev().prev().is("article"))){d.children(".icon-monte").hide(1000);d.prev().children(".icon-monte").show(1000)}if(!(d.next().is("article"))){d.children(".icon-descend").show(1000);d.prev().children(".icon-descend").hide(1000)}echange(d.prev(),d)}})}function descend(b){var a=b.parent();var c=a.attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{descend:1,table:c[0],id:c[1]},dataType:"json",el:a,fonction:function(d){if(!(d.prev().is("article"))){d.children(".icon-monte").show(1000);d.next().children(".icon-monte").hide(1000)}if(!(d.next().next().is("article"))){d.children(".icon-descend").hide(1000);d.next().children(".icon-descend").show(1000)}echange(d,d.next())}})}function supprime(b){var a=b.parent();popup('<h3>Confirmer la demande de suppression</h3><p class="suppression"><button class="icon-ok" title="Confirmer la suppression"></button>&nbsp;&nbsp;&nbsp;<button class="icon-annule" title="Sortir sans supprimer"></button></p>',true);$("#fenetre .icon-ok").on("click",function(){$("#fenetre,#fenetre_fond").remove();var c=a.attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{supprime:1,table:c[0],id:c[1]},dataType:"json",el:a,fonction:function(d){if(c[0]=="colles"){d.removeClass("cache");d.children(".icon-cache,.icon-montre,.icon-supprime").remove();d.children(".icon-ajoute").show();d.children("div.editable").each(function(){this.setAttribute("class",this.getAttribute("class").replace("editable","editable-remplace"))}).html("<p>Le programme de colles de cette semaine n'est pas encore défini.</p>")}else{if(c[0]=="utilisateurs"){location.reload(true)}else{d.remove()}}}})});$("#fenetre .icon-annule").on("click",function(){$("#fenetre,#fenetre_fond").remove()})}function formulaire(a){var c=a.getAttribute("data-id");if(!c){$.ajax({url:"ajax.php",method:"post",data:{table:"utilisateurs",id:$(a).parent().attr("data-id").split("|")[1]},dataType:"json",el:a,fonction:function(e){location.reload(true)}});return true}if(a.hasAttribute("data-remplace")){var d=$("article#"+a.getAttribute("data-remplace"));d.children(".icon-ajoute").after('<a class="icon-annule" title="Annuler"></a><a class="icon-ok" title="Valider"></a>');d.children('[class*="-remplace"],.icon-ajoute').hide();var b=$("<form></form>").appendTo(d).html($("#form-"+c).html());b.children('[name="id"]').val(a.getAttribute("data-remplace"))}else{$("#epingle").remove();var d=$('<article id="epingle"><a class="icon-ferme" title="Fermer"></a>  <a class="icon-aide" title="Aide pour ce formulaire"></a>  <a class="icon-ok" title="Valider"></a></article>').insertBefore("article:first");var b=$("<form></form>").appendTo(d).html($("#form-"+c).html())}b.find(".edithtml").textareahtml();b.find("[data-placeholder]").placeholder();if(b.children('[name="table"]').val()=="cdt"){b.boutonscdt()}else{if(b.children('[name="table"]').val()=="cdt-seances"){b.affichechamps()}else{if($("table#notes").length){notes(a)}}}b.find(".usergrp > .icon-edite").on("click",function(){utilisateursgroupe(this)});d.children(".icon-ferme").on("click",function(){$("#epingle").remove()});d.children(".icon-annule").on("click",function(){d.children("form,.icon-annule,.icon-ok").remove();d.children('[class*="-remplace"],.icon-ajoute').show()});d.children("a.icon-aide").on("click",function(){popup($("#aide-"+c).html(),false)});d.children("a.icon-ok").on("click",function(){b.children(".edithtml").each(function(){this.value=nettoie(($(this).is(":visible"))?this.value:$(this).next().html())});if(b.children('[name="table"]').val()=="notes"){$("#epingle select:not(:visible)").val("x")}$.ajax({url:"ajax.php",method:"post",data:b.serialize(),dataType:"json",el:d,fonction:function(e){if(e.attr("id")=="epingle"){if(!$("#epingle #autoriser").length){location.reload(true)}}else{e.children(".icon-supprime").show();if(e.find('[name="cache"]').is(":checked")){e.children(".icon-montre").show();e.addClass("cache")}else{e.children(".icon-cache").show()}e.children('[class*="-remplace"]').show().each(function(){this.setAttribute("class",this.getAttribute("class").replace("-remplace",""));var f=this.getAttribute("data-id");$(this).html(d.find('[name="'+f.slice(f.indexOf("|")+1,f.lastIndexOf("|"))+'"]').val())});e.children(".editable").editinplace();e.children(".icon-annule,.icon-ok,form").remove()}}})});b.find("input,select").on("keypress",function(f){if(f.which==13){f.preventDefault();d.children("a.icon-ok").click()}})}function valide(a){var c="";if($("#mail").length){if($(".editabledest").children("span").text()=="[Personne]"){affiche("Il faut au moins un destinataire pour envoyer le courriel.","nok")}else{if(!$('[name="sujet"]').val().length){affiche("Il faut un sujet non vide pour envoyer le courriel.","nok")}else{c=$("#mail").serialize()}}}else{if($("#planning").length){c=$("form").serialize()}else{var b=$(a).parent();var d=b.parent().attr("data-id").split("|");c="table="+d[0]+"&id="+d[1]+"&"+b.serialize()}}if(c.length){$.ajax({url:"ajax.php",method:"post",data:c,dataType:"json",el:a,fonction:function(e){if(!$(e).is("[data-noreload]")){location.reload(true)}}})}}function suppressionmultiple(a){popup('<h3>Confirmer la demande de suppression</h3><p class="suppression"><button class="icon-ok" title="Confirmer la suppression"></button>&nbsp;&nbsp;&nbsp;<button class="icon-annule" title="Sortir sans supprimer"></button></p>',true);$("#fenetre .icon-ok").on("click",function(){var b=a.getAttribute("data-id").split("|");$("#fenetre,#fenetre_fond").remove();$.ajax({url:"ajax.php",method:"post",data:"table="+b[0]+"&id="+b[1]+"&supprime_"+b[2]+"=1",dataType:"json",el:$(a),fonction:function(c){c.remove()}})});$("#fenetre .icon-annule").on("click",function(){$("#fenetre,#fenetre_fond").remove()})}function utilisateursmatiere(a){var d=a;var c=d.getAttribute("data-matiere").split("|");popup($("#form-utilisateurs").html(),true);$("#fenetre").addClass("usermat").children("h3").append(c[0]);$("#fenetre :checkbox").attr("id",function(){return this.name}).on("change",function(){var e=this;var f=e.id.substr(1);$.ajax({url:"ajax.php",method:"post",data:{table:"utilisateurs",id:f,matiere:c[1],ok:(e.checked?1:0)},dataType:"json",el:e,fonction:function(i){if(i.checked){b=b+","+f;$(e).prev().addClass("labelchecked")}else{b=(","+b+",").replace(","+f+",",",").slice(1,-1);$(e).prev().removeClass("labelchecked")}d.setAttribute("data-uid",b);var k=$("#fenetre .a4:checked").length;var m=$("#fenetre .a3:checked").length;var j=$("#fenetre .a2:checked").length;var h=$("#fenetre .a1:checked").length;var l=k+m+j+h;if(l){var g="";if(k){g+=", "+k+" professeur"+(k>1?"s":"")}if(m){g+=", "+m+" colleur"+(m>1?"s":"")}if(j){g+=", "+j+" élève"+(j>1?"s":"")}if(h){g+=", "+h+" invité"+(h>1?"s":"")}$(d).parent().children("span").text("Cette matière concerne "+l+" utilisateur"+(l>1?"s":"")+" dont "+g.substr(1)+".")}else{$(d).parent().children("span").text("Cette matière ne concerne aucun utilisateur.")}}}).success(function(g){if(g.etat!="ok"){e.checked=!e.checked}})});var b=d.getAttribute("data-uid");$("#u"+b.replace(/,/g,",#u")).prop("checked",true);$("#fenetre :checked").prev().addClass("labelchecked")}function utilisateursgroupe(a){var d=a;var c=$(a).parent().parent();popup($("#form-utilisateurs").html(),true);$("#fenetre").addClass("usergrp").children("h3").append(c.find("span.editable").text()||c.find("input").val());$("#fenetre :checkbox").attr("id",function(){return this.name});if(c.is("div")){$("#fenetre :checkbox").on("change",function(){$(this).prev().toggleClass("labelchecked",a.checked)});$('<a class="icon-ok" title="Valider"></a>').insertAfter("#fenetre .icon-ferme").on("click",function(){var e=$("#fenetre input:checked").map(function(){return this.id.replace("u","")}).get().join();d.setAttribute("data-uid",e);$(d).parent().next().val(e);$(d).parent().children("span").text($("#fenetre input:checked").parent().map(function(){return $(this).text().replace(" (identifiant)","").trim()}).get().join(", "));$("#fenetre, #fenetre_fond").remove()})}else{$("#fenetre :checkbox").on("change",function(){var f=this;var e=f.id.substr(1);$.ajax({url:"ajax.php",method:"post",data:{table:"groupes",id:c.attr("data-id").split("|")[1],eleve:e,ok:(f.checked?1:0)},dataType:"json",el:f,fonction:function(g){if(g.checked){b=b+","+e;$(f).prev().addClass("labelchecked")}else{b=(","+b+",").replace(","+e+",",",").slice(1,-1);$(f).prev().removeClass("labelchecked")}d.setAttribute("data-uid",b);$(d).parent().children("span").text($("#fenetre input:checked").parent().map(function(){return $(this).text().replace(" (identifiant)","").trim()}).get().join(", "))}}).success(function(g){if(g.etat!="ok"){f.checked=!f.checked}})})}var b=d.getAttribute("data-uid");$("#u"+b.replace(/,/g,",#u")).prop("checked",true);$("#fenetre :checked").prev().addClass("labelchecked")}function utilisateursmail(c){popup($("#form-utilisateurs").html(),true);$('#fenetre [name="dest[]"]').each(function(){$(this).attr("id","u"+this.value)});var b=$('[name="id-copie"]').val().split(",");for(var a=0;a<b.length;a++){$('#fenetre [name="dest[]"][value="'+b[a]+'"]').prop("checked",true)}b=$('[name="id-bcc"]').val().split(",");for(var a=0;a<b.length;a++){$('#fenetre [name="dest_bcc[]"][value="'+b[a]+'"]').prop("checked",true)}$("#fenetre .icon-cocher").on("click keyup",function(){var d=this.getAttribute("data-classe");$("#fenetre ."+d+":not(:disabled)").prop("checked",true);$(this).hide();$(this).next().show();d=(d.indexOf("bcc")>0)?d.replace("bcc","c"):d.replace("c","bcc");$("#fenetre ."+d+":not(:disabled)").prop("checked",false);$('#fenetre .icon-cocher[data-classe="'+d+'"]').show();$('#fenetre .icon-decocher[data-classe="'+d+'"]').hide()});$("#fenetre .icon-decocher").on("click keyup",function(){$("#fenetre ."+this.getAttribute("data-classe")+":not(:disabled)").prop("checked",false);$(this).hide();$(this).prev().show()}).hide();$("#fenetre :checkbox[name]").on("change",function(){if($(this).is(":checked")){$('#fenetre :checkbox[name][value="'+this.value+'"][name!="'+this.name+'"]').prop("checked",false)}});$("#fenetre :checkbox:not([name])").on("click",function(){var e=this.value.split(",");for(var d=0;d<e.length;d++){$('#fenetre :checkbox[name="'+this.className+'[]"][value="'+e[d]+'"]').prop("checked",$(this).prop("checked")).change()}if($(this).is(":checked")){$('#fenetre :checkbox[class="'+((this.className=="dest")?"dest_bcc":"dest")+'"][value="'+this.value+'"]').prop("checked",false)}});$("#fenetre .icon-ok").on("click",function(){$('[name="id-copie"]').val($('#fenetre [name="dest[]"]:checked').map(function(){return this.value}).get().join(","));$('[name="id-bcc"]').val($('#fenetre [name="dest_bcc[]"]:checked').map(function(){return this.value}).get().join(","));$(c).prev().text($('#fenetre [name="dest[]"]:checked').parent().prev().map(function(){return $(this).text().replace(" (identifiant)","")}).get().concat($('#fenetre [name="dest_bcc[]"]:checked').parent().prev().prev().map(function(){return $(this).text().replace(" (identifiant)","")+" (CC)"}).get()).join(", "));if(!$(c).prev().text().length){$(c).prev().text("[Personne]")}$("#fenetre, #fenetre_fond").remove()})}function notes(e){$("#epingle :checkbox").on("click",function(){var g=$("#epingle .grpnote:checked").map(function(){return this.value.split(",")}).get().concat();$("#epingle tr[data-id]:not([data-orig])").hide();for(var f=0;f<g.length;f++){$('#epingle tr[data-id="'+g[f]+'"]').show()}});$("#epingle tr[data-id]").each(function(){$(this).children("td:last").html($("#epingle div").html());$(this).find("select").attr("name","e"+$(this).attr("data-id"))});$("#epingle div").remove();if($("#epingle :checkbox").length){$("#epingle tr[data-id]").hide()}if(e.getAttribute("data-eleves")){$("#epingle h4").text($(e).parent().children("h3").text());$('#epingle [name="id"]').val($(e).parent().attr("data-id").split("|")[1]);var b=e.getAttribute("data-eleves").split("|");var d=e.getAttribute("data-notes").split("|");for(var c=0;c<b.length;c++){$('#epingle tr[data-id="'+b[c]+'"]').attr("data-orig",true).show().find("select").val(d[c]).on("change",function(){$(this).parent().parent().removeAttr("data-orig")})}var a=dejanotes[$('#epingle [name="id"]').val().split("-")[0]].split(",");for(c=0;c<a.length;c++){$('#epingle tr[data-id="'+a[c]+'"]:not(:visible)').addClass("dejanote").find("select").prop("disabled",true)}$(".dejanote td:first-child").each(function(){$(this).text($(this).text()+" (noté par un autre colleur)")})}else{$("#epingle #semaine").on("change keyup",function(){var f=$(this).val().split("-")[0];$(".dejanote td:first-child").each(function(){$(this).text($(this).text().replace(" (noté par un autre colleur)",""))});$(".dejanote").removeClass("dejanote").find("select").prop("disabled",false);if(f>0){var g=dejanotes[f].split(",");for(var h=0;h<g.length;h++){$('#epingle tr[data-id="'+g[h]+'"]').addClass("dejanote").find("select").prop("disabled",true)}$(".dejanote td:first-child").each(function(){$(this).text($(this).text()+" (noté par un autre colleur)")})}})}}function envoimail(a){if($(".editabledest").children("span").text()=="[Personne]"){affiche("Il faut au moins un destinataire pour envoyer le courriel.","nok")}else{$.ajax({url:"ajax.php",method:"post",data:$("#mail").serialize(),dataType:"json",el:"",fonction:function(b){location.reload(true)}})}}function modifierepertoire(b){var d=(b.className=="icon-edite")?"repertoire":"ajouterep";$("#epingle").remove();var e=$('<article id="epingle"><a class="icon-ferme" title="Fermer"></a>  <a class="icon-aide" title="Aide pour ce formulaire"></a>  <a class="icon-ok" title="Valider"></a></article>').insertAfter("#parentsdoc");var c=$('<form onsubmit="return false;"></form>').appendTo(e).html($("#form-"+d).html());if(d=="repertoire"){var g=$(b).parent().attr("data-id").split("|")[1];var f=$(b).parent().attr("data-donnees").split("|");var a=$(b).parent().children(".nom").text().split(/\/\s/).pop()||$(b).parent().find("input").val();c.find("em").text(a);if(f[0]==0){c.find("#nom,#parent,#menu").parent().remove()}else{c.find("#nom").val(a);c.find('[data-parents*=",'+g+',"]').prop("disabled",true);if(f[1]=="1"){c.find("#menu").prop("checked",true)}}$('#protection option[value="'+f[2]+'"]').prop("selected",true);c.find('[name="id"]').val(g)}e.children(".icon-ferme").on("click",function(){$("#epingle").remove()});e.children("a.icon-aide").on("click",function(){popup($("#aide-"+d).html(),false)});e.children("a.icon-ok").on("click",function(){$.ajax({url:"ajax.php",method:"post",data:c.serialize(),dataType:"json",el:e,fonction:function(h){location.reload(true)}})});c.find("input,select").on("keypress",function(h){if(h.which==13){e.children("a.icon-ok").click()}})}function modifiedocument(b){var c=(b.className=="icon-edite")?"document":"ajoutedoc";$("#epingle").remove();var d=$('<article id="epingle"><a class="icon-ferme" title="Fermer"></a>  <a class="icon-aide" title="Aide pour ce formulaire"></a>  <a class="icon-ok" title="Valider"></a></article>').insertAfter("#parentsdoc");form=$('<form onsubmit="return false;"></form>').appendTo(d).html($("#form-"+c).html());var a=$(b).parent().children(".nom").text()||$(b).parent().find("input").val();form.find("em").text(a);if(c=="document"){form.find("#nom").val(a);$('#protection option[value="'+$(b).parent().attr("data-protection")+'"]').prop("selected",true);form.find('[name="id"]').val($(b).parent().attr("data-id").split("|")[1])}else{$('#protection option[value="'+$(b).parent().attr("data-donnees").split("|")[2]+'"]').prop("selected",true);form.find('[name="parent"]').val($(b).parent().attr("data-id").split("|")[1]);form.find("#fichier").on("change",function(){if(!form.find("#nom").val().length){var e=this.value}form.find("#nom").val(e.substring(e.lastIndexOf("\\")+1,e.lastIndexOf("."))||e)})}d.children(".icon-ferme").on("click",function(){$("#epingle").remove()});d.children("a.icon-aide").on("click",function(){popup($("#aide-"+c).html(),false)});d.children("a.icon-ok").on("click",function(){var e=new FormData(form[0]);$.ajax({url:"ajax.php",method:"post",data:e,dataType:"json",contentType:false,processData:false,el:d,fonction:function(f){location.reload(true)}})});form.find("input,select").on("keypress",function(f){if(f.which==13){d.children("a.icon-ok").click()}})}$(document).ajaxSend(function(b,c,a){$("body").css("cursor","wait");if(a.data.append){a.data.append("csrf-token",$("body").attr("data-csrf-token"))}else{a.data="csrf-token="+$("body").attr("data-csrf-token")+"&"+a.data}}).ajaxStop(function(){$("body").css("cursor","auto")}).ajaxSuccess(function(b,d,a){var c=d.responseJSON;switch(c.etat){case"ok":affiche(c.message,"ok");a.fonction(a.el);break;case"nok":affiche(c.message,"nok");break;case"login":afficher_login(a)}});$(function(){$(".editable").editinplace();$(".titrecdt").editinplacecdt();$(".cdt-raccourcis").affichechamps();$(".supprmultiple").on("click",function(){suppressionmultiple(this)});$(".usermat .icon-edite").on("click",function(){utilisateursmatiere(this)});$(".editabledest .icon-edite").on("click",function(){utilisateursmail(this)});$('[name="copie"]').on("change",function(){$.ajax({url:"ajax.php",method:"post",data:{table:"mailprefs",champ:"mailcopy",id:0,val:$(this).prop("checked")?1:0},dataType:"json",el:"",fonction:function(a){return true}})});$("#parentsdoc .icon-edite, .rep > .icon-edite, .icon-ajouterep").on("click",function(){modifierepertoire(this)});$(".doc > .icon-edite, .icon-ajoutedoc").on("click",function(){modifiedocument(this)});$('[name="mailnotes"]').on("change",function(){$.ajax({url:"ajax.php",method:"post",data:{table:"groupes",champ:"mailnotes",id:$(this).attr("id").substr(9),val:$(this).find("option:selected").val()},dataType:"json",el:"",fonction:function(a){return true}})});$(".usergrp .icon-edite").on("click",function(){utilisateursgroupe(this)});$("#log").hide().on("click",function(){$(this).hide()});$("a.icon-cache,a.icon-montre,a.icon-monte,a.icon-descend,a.icon-supprime").on("click",function(){window[this.className.substring(5)]($(this))});$("a.icon-aide").on("click",function(){popup($("#aide-"+this.getAttribute("data-id")).html(),false)});$("a.icon-prefs.general,a.icon-ajoute").on("click",function(){formulaire(this)});$("a.icon-ok").on("click",function(){valide(this)});$("a.icon-deconnexion").on("click",function(a){$.ajax({url:"ajax.php",method:"post",data:{deconnexion:1},dataType:"json",el:"",fonction:function(b){location.reload(true)}})});$(".icon-lock1").attr("title","Visible uniquement par les utilisateurs connectés");$(".icon-lock2").attr("title","Visible uniquement par les élèves/colleurs/professeurs connectés");$(".icon-lock3").attr("title","Visible uniquement par les colleurs/professeurs connectés");$(".icon-lock4").attr("title","Visible uniquement par les professeurs connectés");$(".icon-lock5").attr("title","Complètement invisible (hors professeurs de cette matière)");$(".icon-menu").on("click",function(){$("#colonne,nav").toggleClass("visible")})});
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/js/edition.min.js cahier-de-prepa6.0.0/js/edition.min.js
--- cahier-de-prepa5.1.0/js/edition.min.js	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/js/edition.min.js	2016-08-30 18:09:47.802139046 +0200
@@ -0,0 +1,23 @@
+/*//////////////////////////////////////////////////////////////////////////////
+Éléments JavaScript pour l'administration de Cahier de Prépa
+
+* Les éléments de classe "editable" peuvent être transformés en mode édition par
+la fonction transforme, automatiquement exécutée. L'attribut data-id est alors
+nécessaire, et doit être de la forme table|champ|id.
+* Les éléments de classe "edithtml" sont considérés comme contenant des
+informations présentées en html : la fonction textareahtml crée alors un élément
+de type textarea, un élément de type div éditable (contenteditable=true), et
+ajoute des boutons facilitant les modifications. La textarea et la div éditable
+sont alternativement visibles, à la demande.
+* Les éléments possédant un attribut data-placeholder ont droit, par la fonction
+placeholder, à une valeur affichée lorsque l'élément (en mode édition) est vide.
+* Les liens de classe icon-aide lancent automatiquement une aide par la fonction
+popup. Le contenu est récupéré dans les div de classe aide-xxx où xxx est la
+valeur de l'attribut data-id du lien (ces div sont automatiquement non affichées
+en css).
+//////////////////////////////////////////////////////////////////////////////*////////////////
+// Affichage //
+///////////////
+// Notification de résultat de requête AJAX
+function affiche(e,t){$("#log").removeClass().addClass(t).html(e).append('<span class="icon-ferme"></span>').show().off("click").on("click",function(){window.clearTimeout(n),$(this).hide(500)});var n=window.setTimeout(function(){$("#log").hide(500)},1e4)}function afficher_login(e){$("#fenetre,#fenetre_fond").remove(),popup('<a class="icon-ok" title="Valider"></a><h3>Connexion nécessaire</h3>  <p>Vous avez été automatiquement déconnecté. Vous devez vous connecter à nouveau pour valider vos modifications.</p>  <form>  <p class="ligne"><label for="login">Identifiant&nbsp;: </label><input type="text" name="login" id="login"></p>  <p class="ligne"><label for="motdepasse">Mot de passe&nbsp;: </label><input type="password" name="motdepasse" id="motdepasse"></p>  </form>',!0),$("#login").focus(),$("#fenetre a.icon-ok").on("click",function(){$.ajax({url:"ajax.php",method:"post",data:$("#fenetre form").serialize()+"&"+e.data,dataType:"json",el:"",fonction:function(){return!0}}).done(function(t){t["etat"]=="login_nok"?$("#fenetre > p").html(t.message).addClass("warning"):($("#fenetre,#fenetre_fond").remove(),t["etat"]=="ok"&&e.fonction(e.el))})}),$("#fenetre a.icon-ferme").on("click",function(){affiche("Modification non effectuée, connexion nécessaire","nok")}),$("#fenetre input").on("keypress",function(e){e.which==13&&$("#fenetre a.icon-ok").click()})}function popup(e,t){$("#fenetre,#fenetre_fond").remove();var n=$('<div id="fenetre"></div>').appendTo("body").html(e).focus();t?$('<div id="fenetre_fond"></div>').appendTo("body").click(function(){$("#fenetre,#fenetre_fond").remove()}):$('<a class="icon-epingle" title="Épingler à la page"></a>').prependTo(n).on("click",function(){$("#fenetre_fond").remove(),$(this).remove(),$("section").children("div,article").first().before(n.removeAttr("id"))}),$('<a class="icon-ferme" title="Fermer"></a>').prependTo(n).on("click",function(){n.remove(),$("#fenetre_fond").remove()})}function transforme(){var e=$(this).parent().addClass("avecform");e.is("div")?e.html('<form><textarea name="val" rows="'+(e.attr("data-original").split(/\r\n|\r|\n/).length+3)+'"></textarea></form>'):e.html('<form class="edition" onsubmit="$(this).children(\'a.icon-ok\').click(); return false;"><input type="text" name="val" value=""></form>');var t=e.find('[name="val"]').val(e.attr("data-original"));e.attr("data-placeholder")&&(t.attr("data-placeholder",e.attr("data-placeholder")),e.hasClass("edithtml")&&(t.textareahtml(),t.next().placeholder()),t.placeholder()),$('<a class="icon-ok" title="Valider"></a>').appendTo(e.children()).on("click",function(){var n=e.attr("data-id").split("|");e.hasClass("edithtml")&&t.val(nettoie(t.is(":visible")?t.val():t.next().html())),$.ajax({url:"ajax.php",method:"post",data:{table:n[0],champ:n[1],id:n[2],val:t.val()},dataType:"json",el:e,fonction:function(e){var t=e.find('[name="val"]').val();e.removeClass("avecform").html(t).attr("data-original",t),$('<a class="icon-edite" title="Modifier"></a>').appendTo(e).on("click",transforme)}})}),$('<a class="icon-annule" title="Annuler"></a>').appendTo(e.children()).on("click",function(){e.removeClass("avecform").html(e.attr("data-original")),$('<a class="icon-edite" title="Modifier"></a>').appendTo(e).on("click",transforme)}),t.focus().val(e.hasClass("edithtml")?nettoie(t.val()):t.val())}function transformecdt(){var e=$(this).parent();e.children(".icon-edite").remove();var t=$('<form class="titrecdt"></form>').insertBefore(e.parent().children("div")).html($("#form-cdt").html()),n=JSON.parse(e.attr("data-donnees"));for(var r in n)t.find('[name="'+r+'"]').val(n[r]);t.init_cdt_boutons(),t.find('input,[name="demigroupe"]').on("change keyup",function(){var n=new Date(t.find('[name="jour"]').val().replace(/(.{2})\/(.{2})\/(.{4})/,function(e,t,n,r){return r+"-"+n+"-"+t})),r=t.find('[name="demigroupe"]').val()==1?" (en demi-groupe)":"";switch(parseInt(seances[t.find('[name="tid"]').val()])){case 0:var i=jours[n.getDay()]+" "+t.find('[name="jour"]').val()+" à "+t.find('[name="h_debut"]').val()+" : "+t.find('[name="tid"] option:selected').text()+r;break;case 1:var i=jours[n.getDay()]+" "+t.find('[name="jour"]').val()+" de "+t.find('[name="h_debut"]').val()+" à "+t.find('[name="h_fin"]').val()+" : "+t.find('[name="tid"] option:selected').text()+r;break;case 2:var i=jours[n.getDay()]+" "+t.find('[name="jour"]').val()+" : "+t.find('[name="tid"] option:selected').text()+" pour le "+t.find('[name="pour"]').val()+r;break;case 3:var i=jours[n.getDay()]+" "+t.find('[name="jour"]').val()+" : "+t.find('[name="tid"] option:selected').text()+r;break;case 4:var i=jours[n.getDay()]+" "+t.find('[name="jour"]').val();break;case 5:var i="[Entrée hebdomadaire]"}e.children("span").text(i)}),$('<a class="icon-ok" title="Valider"></a>').appendTo(e).on("click",function(){var n=e.parent().attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:"table=cdt&id="+n[1]+"&"+t.serialize(),dataType:"json",el:e,fonction:function(e){var t=e.siblings("form");e.attr("data-original",e.children("span").text()).attr("data-donnees",'{"tid":'+t.find('[name="tid"]').val()+',"jour":"'+t.find('[name="jour"]').val()+'","h_debut":"'+t.find('[name="h_debut"]').val()+'","h_fin":"'+t.find('[name="h_fin"]').val()+'","pour":"'+t.find('[name="pour"]').val()+'","demigroupe":'+t.find('[name="demigroupe"]').val()+"}"),t.remove(),e.children("a").remove(),$('<a class="icon-edite" title="Modifier"></a>').appendTo(e).on("click",transformecdt)}}).done(function(e){e["etat"]=="ok"&&e["reload"]=="oui"&&location.reload(!0)})}),$('<a class="icon-annule" title="Annuler"></a>').appendTo(e).on("click",function(){t.remove(),e.children("span").html(e.attr("data-original")),e.children("a").remove(),$('<a class="icon-edite" title="Modifier"></a>').appendTo(e).on("click",transformecdt)})}function nettoie(e){if(e.indexOf("cdptmp")>0){var t=$("<div>"+e+"</div>");t.find(".cdptmp").contents().unwrap(),e=t.html(),e.indexOf("cdptmp")>0&&(e=e.replace(/<span class="cdptmp"><\/span>/g,""))}return e.replace(/(<\/?[A-Z]+)([^>]*>)/g,function(e,t,n){return t.toLowerCase()+n}).replace(/[\r\n ]+/g," ").replace(/(<br>)+[ ]?<\/(p|div|li|h)/g,function(e,t,n){return"</"+n}).replace(/<br>/g,"<br>\n").replace(/<(p|div|li|h)/g,function(e){return"\n"+e}).replace(/<\/(p|div|li|h.)>/g,function(e){return e+"\n"}).replace(/<\/?(ul|ol)[^>]*>/g,function(e){return"\n"+e+"\n"}).replace(/^(?!(<p|<div|<ul|<ol|<li|<h))(.+)<br>$/gm,function(e,t,n){return"<p>"+n+"</p>"}).replace(/^(?!(<(p|div|ul|ol|li)))[ ]?(.+)[ ]?$/gm,function(e,t,n,r){return r.match(/.*(p|div|ul|ol|li|h.)>$/)?r:"<p>"+r+"</p>"}).replace(/^[ ]?(<\/?(br|p|div|h.)>){0,2}[ ]?(<\/(p|div|h.)>)?[ ]?$/gm,"").replace(/^\n/gm,"").replace(/<li/g,"  <li")}function insert(e,t,n,r){var i=e.parent().siblings("textarea,[contenteditable]").filter(":visible")[0];i.hasAttribute("data-selection")||marqueselection(e);var s=r===undefined?t+"Í"+i.getAttribute("data-selection")+"Ì"+n:t+"Í"+r+"Ì"+n,o=nettoie(i.getAttribute("data-contenu").replace(/Í.*Ì/,s));i.tagName=="TEXTAREA"?i.value=o.replace(/[ÍÌ]/g,""):i.innerHTML=o.replace(/[ÍÌ]/g,""),marqueselection(e,!0),$(i).change(),i.tagName=="TEXTAREA"&&i.selectionStart!==undefined?(i.selectionStart=o.indexOf("Í"),i.selectionEnd=o.indexOf("Ì")-1,i.focus()):document.selection?(i.tagName!="TEXTAREA"&&(o=o.replace(/(<([^>]+)>)[\n]*/g,"")),range=document.body.createTextRange(),range.moveToElementText(i),range.collapse(!0),range.moveEnd("character",o.indexOf("Ì")-1),range.moveStart("character",o.indexOf("Í")),range.select()):window.getSelection&&(i.innerHTML=o.replace("Í",'<span class="cdptmp">').replace("Ì","</span>")+"<br>",selection=window.getSelection(),range=document.createRange(),range.selectNodeContents($(i).find(".cdptmp")[0]),selection.removeAllRanges(),selection.addRange(range),i.focus())}function marqueselection(e,t){var n=e.parent().siblings("textarea,[contenteditable]").filter(":visible")[0];if(t)return n.removeAttribute("data-selection"),n.removeAttribute("data-contenu"),!0;var r=n.tagName=="TEXTAREA"?n.value:n.innerHTML,i="";if(n.tagName=="TEXTAREA"&&n.selectionStart!==undefined)n.focus(),i=n.value.substring(n.selectionStart,n.selectionEnd),n.value=n.value.substr(0,n.selectionStart)+"Í"+i+"Ì"+n.value.substring(n.selectionEnd);else if(window.getSelection){var s=window.getSelection().getRangeAt(0);if(n==s.commonAncestorContainer||$.contains(n,s.commonAncestorContainer)){var i=window.getSelection().toString();s.deleteContents(),s.insertNode(document.createTextNode("Í"+i+"Ì"))}}else{var s=document.selection.createRange();if(n==s.parentElement()||$.contains(n,s.parentElement())){var i=document.selection.createRange().text;document.selection.createRange().text="Í"+i+"Ì"}}if(n.tagName=="TEXTAREA"){var o=n.value;n.value=r}else{var o=n.innerHTML;$(n).html(r)}return o.indexOf("Ì")<0&&(o+="ÍÌ"),n.setAttribute("data-selection",i),n.setAttribute("data-contenu",o),i}function insertion_titres(e){popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'un titre</h3>  <p>Choisissez le type du titre ci-dessous. Vous pouvez éventuellement modifier le texte (ou pourrez le faire ultérieurement). Il est conseillé d\'utiliser des titres de niveau 2 pour les titres dans les programmes de colle.</p>  <input type="radio" name="titre" id="t3" value="3" checked><h3><label for="t3">Titre de niveau 1 (pour les I,II...)</label></h3><br>  <input type="radio" name="titre" id="t4" value="4"><h4><label for="t4">Titre de niveau 2 (pour les 1,2...)</label></h4><br>  <input type="radio" name="titre" id="t5" value="5"><h5><label for="t5">Titre de niveau 3 (pour les a,b...)</label></h5><br>  <input type="radio" name="titre" id="t6" value="6"><h6><label for="t6">Titre de niveau 4</label></h6><br>  <p class="ligne"><label for="texte">Texte&nbsp;: </label><input type="text" id="texte" value="'+marqueselection(e)+'" size="80"></p>  <hr><h3>Aperçu</h3><div id="apercu"></div>',!0),$("#fenetre input").on("click keyup",function(){var e="h"+$("[name='titre']:checked").val();$("#apercu").html("<"+e+">"+($("#texte").val().length?$("#texte").val():"Texte du titre")+"</"+e+">")}).first().keyup(),$("#texte").on("keypress",function(e){e.which==13&&$("#fenetre a.icon-ok").click()}).focus(),$("#fenetre a.icon-ok").on("click",function(){var t="h"+$("[name='titre']:checked").val();insert(e,"<"+t+">","</"+t+">",$("#texte").val()),$("#fenetre,#fenetre_fond").remove()}),$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(e,!0)})}function insertion_omega(e){popup("<h3>Insertion d'une lettre grecque</h3>  <p>Cliquez sur la lettre à insérer&nbsp;:</p>  <button>&alpha;</button> <button>&beta;</button> <button>&gamma;</button> <button>&Delta;</button> <button>&delta;</button> <button>&epsilon;</button> <button>&eta;</button> <button>&Theta;</button> <button>&theta;</button> <button>&Lambda;</button> <button>&lambda;</button> <button>&mu;</button> <button>&nu;</button> <button>&xi;</button> <button>&Pi;</button> <button>&pi;</button> <button>&rho;</button> <button>&Sigma;</button> <button>&sigma;</button> <button>&tau;</button> <button>&upsilon;</button> <button>&Phi;</button> <button>&phi;</button> <button>&Psi;</button> <button>&psi;</button> <button>&Omega;</button> <button>&omega;</button>",!0),$("#fenetre button").on("click",function(){insert(e,"","",$(this).text()),$("#fenetre,#fenetre_fond").remove()})}function insertion_sigma(e){popup("<h3>Insertion d'un symbole mathématique</h3>  <p>Cliquez sur le symbole à insérer&nbsp;:</p>  <button>&forall;</button> <button>&exist;</button> <button>&part;</button> <button>&nabla;</button> <button>&prod;</button> <button>&sum;</button> <button>&plusmn;</button> <button>&radic;</button> <button>&infin;</button> <button>&int;</button> <button>&prop;</button> <button>&sim;</button> <button>&cong;</button> <button>&asymp;</button> <button>&ne;</button> <button>&equiv;</button> <button>&le;</button> <button>&ge;</button> <button>&sub;</button> <button>&sup;</button> <button>&nsub;</button> <button>&sube;</button> <button>&supe;</button> <button>&isin;</button> <button>&notin;</button> <button>&ni;</button> <button>&oplus;</button> <button>&otimes;</button> <button>&sdot;</button> <button>&and;</button> <button>&or;</button> <button>&cap;</button> <button>&cup;</button> <button>&real;</button> <button>&image;</button> <button>&empty;</button> <button>&deg;</button> <button>&prime;</button> <button>&micro;</button> <button>&larr;</button> <button>&uarr;</button> <button>&rarr;</button> <button>&darr;</button> <button>&harr;</button> <button>&lArr;</button> <button>&uArr;</button> <button>&rArr;</button> <button>&dArr;</button> <button>&hArr;</button>",!0),$("#fenetre button").on("click",function(){insert(e,"","",$(this).text()),$("#fenetre,#fenetre_fond").remove()})}function insertion_ol(e){popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'une liste numérotée</h3>  <p>Choisissez le type de numérotation et la valeur de départ de la liste ci-dessous. Vous pouvez éventuellement modifier les différents éléments en les écrivant ligne par ligne. Vous pourrez ajouter un élément ultérieurement en l\'encadrant par les balises &lt;li&gt; et &lt;/li&gt;.</p>  <p class="ligne"><label for="t1">Numérotation numérique (1, 2, 3...)</label><input type="radio" name="type" id="t1" value="1" checked></p>  <p class="ligne"><label for="t2">Numérotation alphabétique majuscule (A, B, C...)</label><input type="radio" name="type" id="t2" value="A"></p>  <p class="ligne"><label for="t3">Numérotation alphabétique minuscule (a, b, c...)</label><input type="radio" name="type" id="t3" value="a"></p>  <p class="ligne"><label for="t4">Numérotation romaine majuscule (I, II, III...)</label><input type="radio" name="type" id="t4" value="I"></p>  <p class="ligne"><label for="t5">Numérotation romaine minuscule (i, ii, iii...)</label><input type="radio" name="type" id="t5" value="i"></p>  <p class="ligne"><label for="debut">Valeur de début (numérique)</label><input type="text" id="debut" value="1"></p>  <p class="ligne"><label for="lignes">Textes (chaque ligne correspond à un élément de la liste)&nbsp;: </label></p>  <textarea id="lignes" rows="5">'+marqueselection(e)+'</textarea>  <hr><h3>Aperçu</h3><div id="apercu"></div>',!0),$("#fenetre :input").on("click keyup",function(){var e=$("#debut").val();e=e.length&&e>1?' start="'+e+'"':"",$("#apercu").html('<ol type="'+$("[name='type']:checked").val()+'"'+e+"><li>"+($("#lignes").val().length?$("#lignes").val().trim("\n").replace(/\n/g,"</li><li>"):"Première ligne</li><li>Deuxième ligne</li><li>...")+"</li></ol>")}).first().keyup(),$("#lignes").focus(),$("#fenetre a.icon-ok").on("click",function(){var t=$("#debut").val();t=t.length&&t>1?' start="'+t+'"':"";var n=$("#lignes").val().trim("\n"),r=n.lastIndexOf("\n");if(r>0){var i=n.substring(r+1);n=n.substring(0,r)}else var i="";insert(e,'<ol type="'+$("[name='type']:checked").val()+'"'+t+"><li>"+n.replace(/\n/g,"</li><li>")+"</li><li>","</li></ol>",i),$("#fenetre,#fenetre_fond").remove()}),$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(e,!0)})}function insertion_ul(e){popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'une liste à puces</h3>  <p>Vous pouvez éventuellement modifier les différents éléments en les écrivant ligne par ligne (chaque ligne correspond à un élément de la la liste). Vous pourrez ajouter un élément ultérieurement en l\'encadrant par les balises &lt;li&gt; et &lt;/li&gt;.</p>  <textarea id="lignes" rows="5">'+marqueselection(e)+'</textarea>  <hr><h3>Aperçu</h3><div id="apercu"></div>',!0),$("#lignes").on("click keyup",function(){$("#apercu").html("<ul><li>"+($("#lignes").val().length?$("#lignes").val().trim("\n").replace(/\n/g,"</li><li>"):"Première ligne</li><li>Deuxième ligne</li><li>...")+"</li></ul>")}).keyup().focus(),$("#fenetre a.icon-ok").on("click",function(){var t=$("#lignes").val().trim("\n"),n=t.lastIndexOf("\n");if(n>0){var r=t.substring(n+1);t=t.substring(0,n)}else var r="";insert(e,"<ul><li>"+t.replace(/\n/g,"</li><li>")+"</li><li>","</li></ul>",r),$("#fenetre,#fenetre_fond").remove()}),$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(e,!0)})}function insertion_lien1(e){var t=marqueselection(e);popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'un lien vers un document de Cahier de Prépa</h3>  <div><p style="text-align:center; margin: 2em 0;">[Récupération des listes de documents]</p></div>  <div style="display:none;"><hr><h3>Aperçu</h3><div id="apercu" style="text-align:center;">[Veuillez choisir un document]</div></div>',!0),$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(e,!0)}),$.ajax({url:"ajax.php",method:"post",data:{recupdoc:""},dataType:"json"}).done(function(n){var r=function(){var e=$("#apercu"),t=$("#doc").val(),n=$("#doc option:selected").text();if(t==0)e.html(n);else if($("#vue").is(":checked")){var r=$("#largeur").val();n.slice(-4,-1)=="pdf"?(e.children(".pdf").length==0?e.html('<div><object data="download?id='+t+'" type="application/pdf" height="100%" width="100%"> <a href="download?id='+t+'">'+n+"</a> </object></div>"):e.find("object").attr("data").substr(12)!=t&&e.find("object").attr("data","download?id="+t).html('<a href="download?id='+t+'">'+n+"</a>"),e.children().attr("class","pdf "+$("#format").val()),r&&(r==100?e.children().removeAttr("style").children().attr("width","100%").removeAttr("style"):(e.children().css("padding-bottom",$('<div class="'+$("#format").val()+'"></div>').css("padding-bottom").slice(0,-1)*r/100+"%"),e.find("object").attr("width",r+"%").css("left",(100-r)/2+"%")))):"jpgpegpng".indexOf(n.slice(-4,-1))>-1&&(e.children("img").length==0?e.css("text-align","").html('<img src="download?id='+t+'">'):e.children().attr("src").substr(12)!=t&&e.children().attr("src","download?id="+t),r&&(r==100?e.children().removeAttr("style"):e.children().css("width",r+"%").css("margin-left",(100-r)/2+"%")))}else $("#apercu").css("text-align","center").html('<a onclick="return false;" href="download?id='+this.value+'">'+$("#texte").val()+"</a>")},i=function(n){$("#fenetre > div:first").html('  <p>Choisissez ci-dessous le répertoire puis le document à insérer. Vous pouvez aussi modifier le texte visible. Cela reste modifiable ultérieurement&nbsp;: le texte est situé entre les deux balises &lt;a...&gt; et &lt;/a&gt;.</p>  <p class="ligne"><label for="mat">Matière&nbsp;:</label><select id="mat">'+n.mats+'</select></p>  <p class="ligne"><label for="rep">Répertoire&nbsp;:</label><select id="rep"></select></p>  <p class="ligne"><label for="doc">Document&nbsp;:</label><select id="doc"></select></p>  <p class="ligne"><label for="texte">Texte visible&nbsp;:</label><input type="text" id="texte" value="'+t+'" size="80" data-auto="1"></p>  <p class="ligne"><label for="vue">Afficher dans la page (PDF et image uniquement)</label><input type="checkbox" id="vue">  <p class="ligne"><label for="largeur">Largeur en %&nbsp;:</label><input type="text" id="largeur" value="100" size="3"></p>  <p class="ligne"><label for="format">Format (PDF uniquement)</label><select id="format">    <option value="portrait">A4 vertical</option><option value="paysage">A4 horizontal</option><option value="hauteur50">Hauteur 50%</option>  </select>'),$("#fenetre > div:last").show(),$("#texte").val().length&&$("#texte").attr("data-auto",0),$("#doc").on("change keyup",function(e){e.which==13&&$("#fenetre a.icon-ok").click();var t=$("#doc option:selected").text();$("#texte").attr("data-auto")==1&&$("#texte").val(this.value>0?t.substr(0,t.lastIndexOf("(")-1):"---"),"pdfjpgpegpng".indexOf(t.slice(-4,-1))>-1?$("#vue").change().parent().show():$("#vue, #largeur, #format").parent().hide(),r()}),$("#texte").on("change keypress",function(e){if(e.which==0)return;e.which==13&&$("#fenetre a.icon-ok").click(),this.value.length==0?(this.setAttribute("data-auto",1),$("#doc").change()):(this.setAttribute("data-auto",0),r())}),$("#vue").on("change",function(){$("#vue").is(":checked")?$("#doc option:selected").text().slice(-4,-1)=="pdf"?($("#largeur, #format").parent().show(),$("#texte").parent().hide()):"jpgpegpng".indexOf($("#doc option:selected").text().slice(-4,-1))>-1&&($("#largeur").parent().show(),$("#format, #texte").parent().hide()):($("#texte").parent().show(),$("#largeur, #format").parent().hide()),r()}),$("#format").on("change keyup",function(e){e.which==13&&$("#fenetre a.icon-ok").click(),r()}),$("#largeur").on("keydown",function(e){e.which==38?++this.value:e.which==40&&--this.value}).on("change keyup",function(e){if(e.which==0)return;e.which==13&&$("#fenetre a.icon-ok").click(),this.value!=this.getAttribute("data-valeur")&&(this.setAttribute("data-valeur",this.value),r())}).attr("data-valeur",100),$("#rep").on("change",function(){$("#doc").html(n.docs[this.value]).change()}),$("#mat").on("change",function(){$("#rep").html(n.reps[this.value]).change()}).focus().change(),$("#fenetre a.icon-ok").on("click",function(){$("#doc").val()&&($("#vue").is(":checked")&&"pdfjpgpegpng".indexOf($("#doc option:selected").text().slice(-4,-1))>-1?insert(e,$("#apercu").html(),"",""):insert(e,'<a href="download?id='+$("#doc").val()+'">',"</a>",$("#texte").val()),$("#fenetre,#fenetre_fond").remove())}),$("#mat option").each(function(){$("body").attr("data-matiere")==this.value&&$("#mat").val(this.value).change()})};n["etat"]=="login_"?($("#fenetre > div:first").html('<p>Vous n\'êtes actuellement plus connecté. Vous devez vous identifier à nouveau pour récupérer la liste des répertoires et documents disponibles.</p>        <form>        <p class="ligne"><label for="login">Identifiant&nbsp;: </label><input type="text" name="login" id="login"></p>        <p class="ligne"><label for="motdepasse">Mot de passe&nbsp;: </label><input type="password" name="motdepasse" id="motdepasse"></p>        </form>'),$("#fenetre input").on("keypress",function(e){e.which==13&&$("#fenetre a.icon-ok").click()}),$("#fenetre a.icon-ok").on("click",function(){$.ajax({url:"ajax.php",method:"post",data:{login:$("#login").val(),motdepasse:$("#motdepasse").val(),recupdoc:""},dataType:"json"}).done(function(e){e["etat"]=="login_nok"?$("#fenetre > div:first > p:first").html(e.message).addClass("warning"):e["etat"]=="ok_"&&i(e)})})):n["etat"]=="ok_"&&i(n)})}function insertion_lien2(e){popup('<a class="icon-ok" title="Valider"></a><h3>Insertion d\'un lien</h3>  <p class="ligne"><label for="texte">Texte visible&nbsp;: </label><input type="text" id="texte" value="'+marqueselection(e)+'" size="80"></p>  <p class="ligne"><label for="url">Adresse&nbsp;: </label><input type="text" id="url" value="http://" size="80"></p>  <hr><h3>Aperçu</h3><div id="apercu" style="text-align:center;"></div>',!0),$("#fenetre input").on("click keyup",function(){$("#apercu").html($("#texte").val().length?'<a onclick="return false;" href="'+$("#url").val()+'">'+$("#texte").val()+"</a>":"[Écrivez un texte visible]")}).on("keypress",function(e){e.which==13&&$("#fenetre a.icon-ok").click()}).first().keyup().focus(),$("#fenetre a.icon-ok").on("click",function(){insert(e,'<a href="'+$("#url").val()+'">',"</a>",$("#texte").val()),$("#fenetre,#fenetre_fond").remove()}),$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(e,!0)})}function insertion_tex(e){var t=typeof MathJax=="undefined"?'<script type="text/javascript" src="/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax:{inlineMath:[["$","$"],["\\\\(","\\\\)"]]}});</script>':"",n=marqueselection(e),r="t1";if(n.length)switch(n.substring(0,2)){case"\\[":case"$$":r="t2";case"\\(":n=n.substring(2,n.length-2);break;default:n=n.trim("$")}popup(t+'<a class="icon-montre" title="Mettre à jour l\'aperçu"></a><a class="icon-ok" title="Valider"></a><h3>Insertion de formules LaTeX</h3>  <p>Vous pouvez ci-dessous entrer et modifier une formule LaTeX. L\'aperçu présent en bas sera mis à jour uniquement lorsque vous cliquez sur l\'icône <span class="icon-montre"></span>.</p>  <p class="ligne"><label for="t1">La formule est en ligne (pas de retour)</label><input type="radio" name="type" id="t1" value="1"></p>  <p class="ligne"><label for="t2">La formule est hors ligne (formule centrée)</label><input type="radio" name="type" id="t2" value="2"></p>  <textarea id="formule" rows="3">'+n+'</textarea>  <hr><h3>Aperçu</h3><div id="apercu" style="text-align:center;">[Demandez l\'aperçu en cliquant sur l\'icône <span class="icon-montre"></span>]</div>',!0),$("#"+r).prop("checked",!0),$("#formule").focus(),$("#fenetre a.icon-montre").on("click",function(){$("#formule").val().length?($("#apercu").html($("#t1").is(":checked")?"$"+$("#formule").val()+"$":"\\["+$("#formule").val()+"\\]").css("text-align","left"),MathJax.Hub.Queue(["Typeset",MathJax.Hub,"apercu"])):$("#apercu").html("[Écrivez une formule]").css("text-align","center")}),$("#fenetre a.icon-ok").on("click",function(){$("#t1").is(":checked")?insert(e,"$","$",$("#formule").val()):insert(e,"\\[","\\]",$("#formule").val()),$("#fenetre,#fenetre_fond").remove()}),$("#fenetre a.icon-ferme,#fenetre_fond").on("click",function(){marqueselection(e,!0)})}function insertion_par1(e){insert(e,"<p>","</p>")}function insertion_par2(e){insert(e,"<div class='note'>","</div>")}function insertion_par3(e){insert(e,"<div class='annonce'>","</div>")}function insertion_retour(e){insert(e,"<br>","")}function insertion_gras(e){insert(e,"<strong>","</strong>")}function insertion_italique(e){insert(e,"<em>","</em>")}function insertion_souligne(e){insert(e,"<u>","</u>")}function insertion_exp(e){insert(e,"<sup>","</sup>")}function insertion_ind(e){insert(e,"<sub>","</sub>")}function aidetexte(){popup('<h3>Aide et explications</h3>  <p>Il y a deux modes d\'éditions possibles pour éditer un texte&nbsp;: le mode «&nbsp;balises visibles&nbsp;» et le mode «&nbsp;balises invisibles&nbsp;». Il est possible de passer de l\'un à l\'autre&nbsp;:</p>  <ul>    <li><span class="icon-source"></span> permet de passer en mode «&nbsp;balises visibles&nbsp;» (par défaut), où le texte à taper est le code HTML de l\'article. Ce mode est plus précis. Les boutons aux dessus aident à utiliser les bonnes balises.</li>    <li><span class="icon-nosource"></span> permet de passer en mode «&nbsp;balises invisibles&nbsp;», où le texte est tel qu\'il sera affiché sur la partie publique, et modifiable. Ce mode est moins précis, mais permet le copié-collé depuis une page web ou un document Word/LibreOffice.  </ul>  <p>Une fonction de nettoyage du code HTML, permettant d\'assurer une homogénéité et une qualité d\'affichage optimales, est lancée à chaque commutation entre les deux modes, à chaque clic sur un des boutons disponibles, à chaque copie/coupe de texte et à chaque passage à la ligne.</p>  <p>En HTML, toutes les mises en formes sont réalisées par un encadrement de texte entre deux balises&nbsp;: &lt;h3&gt; et &lt;/h3&gt; pour un gros titre, &lt;p&gt; et &lt;/p&gt; pour un paragraphe. Le retour à la ligne simple, qui ne doit exister que très rarement, est une balise simple &lt;br&gt;. Mais les boutons disponibles sont là pour vous permettre de réaliser le formattage que vous souhaitez&nbsp;:</p>  <ul>    <li><span class="icon-titres"></span>&nbsp;: différentes tailles de titres (fenêtre supplémentaire pour choisir)</li>    <li><span class="icon-par1"></span>&nbsp;: paragraphe classique, qui doit obligatoirement encadrer au minimum chaque ligne de texte. Apparaît automatiquement au passage à la ligne si on l\'oublie.</li>    <li><span class="icon-par2"></span>&nbsp;: paragraphe important, écrit en rouge</li>    <li><span class="icon-par3"></span>&nbsp;: paragraphe très important, écrit en rouge et encadré</li>    <li><span class="icon-retour"></span>&nbsp;: retour à la ligne. Identique à un appui sur Entrée, et souvent inutile.</li>    <li><span class="icon-gras"></span>&nbsp;: mise en gras du texte entre les balises</li>    <li><span class="icon-italique"></span>&nbsp;: mise en italique du texte entre les balises</li>    <li><span class="icon-souligne"></span>&nbsp;: soulignement du texte entre les balises</li>    <li><span class="icon-omega"></span>&nbsp;: lettres grecques (fenêtre supplémentaire pour choisir)</li>    <li><span class="icon-sigma"></span>&nbsp;: symboles mathématiques (fenêtre supplémentaire pour choisir)</li>    <li><span class="icon-exp"></span>&nbsp;: mise en exposant du texte entre les balises</li>    <li><span class="icon-ind"></span>&nbsp;: mise en indice du texte entre les balises</li>    <li><span class="icon-ol"></span>&nbsp;: liste numérotée. Une fenêtre supplémentaire permet de choisir le type (1,A,a,I,i) et la première valeur. Les différentes lignes de la liste sont constituées par les balises &lt;li&gt; et &lt;/li&gt;</li>    <li><span class="icon-ul"></span>&nbsp;: liste à puces. Les différentes lignes de la liste sont constituées par les balises &lt;li&gt; et &lt;/li&gt;</li>    <li><span class="icon-lien1"></span>&nbsp;: lien d\'un document disponible ici (fenêtre supplémentaire pour choisir)</li>    <li><span class="icon-lien2"></span>&nbsp;: lien vers un autre site web (fenêtre supplémentaire pour entre l\'adresse)</li>    <li><span class="icon-tex"></span>&nbsp;: insertion de code LaTeX (fenêtre supplémentaire pour le taper)</li>  </ul>  <p class="tex2jax_ignore">Il est possible d\'insérer du code en LaTeX, sur une ligne séparée (balises \\[...\\] ou balises $$...$$) ou au sein d\'une phrase (balises $...$ ou balises \\(...\\)). Il faut ensuite taper du code en LaTeX à l\'intérieur. La prévisualisation est réalisée en direct.</p>',!1)}function echange(e,t){e.length&&t.length&&($("article").css("position","relative"),e.css("opacity",.3),t.css("opacity",.3),t.animate({top:e.position().top-t.position().top},1e3),e.animate({top:(t.outerHeight(!0)+t.outerHeight())/2},1e3,function(){e.css("opacity",1),t.css("opacity",1),e.insertAfter(t),e.css({position:"static",top:0}),t.css({position:"static",top:0})}))}function cache(e){var t=e.parent().attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{cache:1,table:t[0],id:t[1]},dataType:"json",el:e,fonction:function(e){e.parent().addClass("cache"),e.removeClass("icon-cache").addClass("icon-montre").off("click").on("click",function(){montre($(this))}).attr("title","Montrer à nouveau")}})}function montre(e){var t=e.parent().attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{montre:1,table:t[0],id:t[1]},dataType:"json",el:e,fonction:function(e){e.parent().removeClass("cache"),e.removeClass("icon-montre").addClass("icon-cache").off("click").on("click",function(){cache($(this))}).attr("title","Cacher à nouveau")}})}function monte(e){var t=e.parent(),n=t.attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{monte:1,table:n[0],id:n[1]},dataType:"json",el:t,fonction:function(e){e.prev().prev().is("article")||(e.children(".icon-monte").hide(1e3),e.prev().children(".icon-monte").show(1e3)),e.next().is("article")||(e.children(".icon-descend").show(1e3),e.prev().children(".icon-descend").hide(1e3)),echange(e.prev(),e)}})}function descend(e){var t=e.parent(),n=t.attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{descend:1,table:n[0],id:n[1]},dataType:"json",el:t,fonction:function(e){e.prev().is("article")||(e.children(".icon-monte").show(1e3),e.next().children(".icon-monte").hide(1e3)),e.next().next().is("article")||(e.children(".icon-descend"
+).hide(1e3),e.next().children(".icon-descend").show(1e3)),echange(e,e.next())}})}function supprime(e){var t=e.parent();popup('<h3>Confirmer la demande de suppression</h3><p class="suppression"><button class="icon-ok" title="Confirmer la suppression"></button>&nbsp;&nbsp;&nbsp;<button class="icon-annule" title="Sortir sans supprimer"></button></p>',!0),$("#fenetre .icon-ok").on("click",function(){$("#fenetre,#fenetre_fond").remove();var e=t.attr("data-id").split("|");$.ajax({url:"ajax.php",method:"post",data:{supprime:1,table:e[0],id:e[1]},dataType:"json",el:t,fonction:function(t){e[0]=="colles"?(t.removeClass("cache"),t.children(".icon-cache,.icon-montre,.icon-supprime").remove(),t.children(".icon-ajoute").show(),t.children("div.editable").each(function(){this.setAttribute("class",this.getAttribute("class").replace("editable","editable-remplace"))}).html("<p>Le programme de colles de cette semaine n'est pas encore défini.</p>")):e[0]=="utilisateurs"||e[0]=="agenda"?location.reload(!0):t.remove()}})}),$("#fenetre .icon-annule").on("click",function(){$("#fenetre,#fenetre_fond").remove()})}function formulaire(e){var t=e.getAttribute("data-id");if(t=="valide_utilisateur")return $.ajax({url:"ajax.php",method:"post",data:{table:"utilisateurs",id:$(e).parent().attr("data-id").split("|")[1]},dataType:"json",el:e,fonction:function(e){location.reload(!0)}}),!0;if(e.hasAttribute("data-remplace")){var n=$("article#"+e.getAttribute("data-remplace"));n.children(".icon-ajoute").after('<a class="icon-annule" title="Annuler"></a><a class="icon-ok" title="Valider"></a>'),n.children('[class*="-remplace"],.icon-ajoute').hide();var r=$("<form></form>").appendTo(n).html($("#form-"+t).html());r.children('[name="id"]').val(e.getAttribute("data-remplace"))}else{$("#epingle").remove();var n=$('<article id="epingle"><a class="icon-ferme" title="Fermer"></a>  <a class="icon-aide" title="Aide pour ce formulaire"></a>  <a class="icon-ok" title="Valider"></a></article>').prependTo("section"),r=$("<form></form>").appendTo(n).html($("#form-"+t).html())}r.find(".edithtml").textareahtml(),r.find("[data-placeholder]").placeholder(),$.colpick&&r.find('[name="couleur"]').colpick();switch(t){case"ajoute-cdt":r.init_cdt_boutons();break;case"ajoute-cdt-raccourci":r.init_cdt_raccourcis();break;case"notes":case"ajoute-notes":notes(e);break;case"evenement":if(e.id[0]=="e"){var i=e.id.substr(1),s=evenements[i],o=["type","matiere","debut","fin","texte"];for(var u=0;u<6;u++)r.find('[name="'+o[u]+'"]').val(s[o[u]]);r.find('[name="texte"]').change(),r.find('[name="id"]').val(i),r.find('[name="jours"]').prop("checked",s.je),$('<a class="icon-supprime" title="Supprimer cette information"></a>').insertBefore($(".icon-ok")).on("click",function(){supprime($(this))}).parent().attr("data-id","agenda|"+i)}r.find('[name="debut"]').datetimepicker({onShow:function(){this.setOptions({maxDate:r.find('[name="fin"]').val()||!1})},onClose:function(e,t){r.find('[name="fin"]').val(function(e,n){return n||t.val()})}}),r.find('[name="fin"]').datetimepicker({onShow:function(){this.setOptions({minDate:r.find('[name="debut"]').val()||!1})},onClose:function(e,t){r.find('[name="debut"]').val(function(e,n){return n||t.val()})}}),r.find('[name="jours"]').on("change",function(){var e;this.checked?r.find('[name="debut"],[name="fin"]').each(function(){e=this.value.split(" "),$(this).val(e[0]).attr("data-heure",e[1]).datetimepicker({format:"d/m/Y",timepicker:!1})}):r.find('[name="debut"],[name="fin"]').each(function(){this.hasAttribute("data-heure")&&$(this).val(this.value+" "+$(this).attr("data-heure")).removeAttr("data-heure"),$(this).datetimepicker({format:"d/m/Y Ghi",timepicker:!0})})}).change();break;case"deplacement-colle":r.find('[name="ancien"],[name="nouveau"]').each(function(){$(this).datetimepicker(),$(this).next().on("click",function(){$(this).prev().val("").change()})})}r.find(".usergrp > .icon-edite").on("click",function(){utilisateursgroupe(this)}),n.children(".icon-ferme").on("click",function(){$("#epingle").remove()}),n.children(".icon-annule").on("click",function(){n.children("form,.icon-annule,.icon-ok").remove(),n.children('[class*="-remplace"],.icon-ajoute').show()}),n.children("a.icon-aide").on("click",function(){popup($("#aide-"+t).html(),!1)}),n.children("a.icon-ok").on("click",function(){r.children(".edithtml").each(function(){this.value=nettoie($(this).is(":visible")?this.value:$(this).next().html())}),(t=="notes"||t=="ajoute-notes")&&$("#epingle select:not(:visible)").val("x"),$.ajax({url:"ajax.php",method:"post",data:r.serialize(),dataType:"json",el:n,fonction:function(e){e.attr("id")=="epingle"?$("#epingle #noreload").length||location.reload(!0):(e.children(".icon-supprime").show(),e.find('[name="cache"]').is(":checked")?(e.children(".icon-montre").show(),e.addClass("cache")):e.children(".icon-cache").show(),e.children('[class*="-remplace"]').show().each(function(){this.setAttribute("class",this.getAttribute("class").replace("-remplace",""));var e=this.getAttribute("data-id");$(this).html(n.find('[name="'+e.slice(e.indexOf("|")+1,e.lastIndexOf("|"))+'"]').val())}),e.children(".editable").editinplace(),e.children(".icon-annule,.icon-ok,form").remove())}})}),r.find("input,select").on("keypress",function(e){e.which==13&&(e.preventDefault(),n.children("a.icon-ok").click())})}function valide(e){var t="";if($("#mail").length)$(".editabledest").children("span").text()=="[Personne]"?affiche("Il faut au moins un destinataire pour envoyer le courriel.","nok"):$('[name="sujet"]').val().length?t=$("#mail").serialize():affiche("Il faut un sujet non vide pour envoyer le courriel.","nok");else if($("#planning").length)t=$("form").serialize();else{var n=$(e).parent(),r=n.parent().attr("data-id").split("|");t="table="+r[0]+"&id="+r[1]+"&"+n.serialize()}t.length&&$.ajax({url:"ajax.php",method:"post",data:t,dataType:"json",el:e,fonction:function(e){$(e).is("[data-noreload]")||location.reload(!0)}})}function suppressionmultiple(e){popup('<h3>Confirmer la demande de suppression</h3><p class="suppression"><button class="icon-ok" title="Confirmer la suppression"></button>&nbsp;&nbsp;&nbsp;<button class="icon-annule" title="Sortir sans supprimer"></button></p>',!0),$("#fenetre .icon-ok").on("click",function(){var t=e.getAttribute("data-id").split("|");$("#fenetre,#fenetre_fond").remove(),$.ajax({url:"ajax.php",method:"post",data:"table="+t[0]+"&id="+t[1]+"&supprime_"+t[2]+"=1",dataType:"json",el:$(e),fonction:function(e){e.remove()}})}),$("#fenetre .icon-annule").on("click",function(){$("#fenetre,#fenetre_fond").remove()})}function utilisateursmatiere(e){var t=e,n=t.getAttribute("data-matiere").split("|");popup($("#form-utilisateurs").html(),!0),$("#fenetre").addClass("usermat").children("h3").append(n[0]),$("#fenetre :checkbox").attr("id",function(){return this.name}).on("change",function(){var e=this,i=e.id.substr(1);$.ajax({url:"ajax.php",method:"post",data:{table:"utilisateurs",id:i,matiere:n[1],ok:e.checked?1:0},dataType:"json",el:e,fonction:function(n){n.checked?(r=r+","+i,$(e).prev().addClass("labelchecked")):(r=(","+r+",").replace(","+i+",",",").slice(1,-1),$(e).prev().removeClass("labelchecked")),t.setAttribute("data-uid",r);var s=$("#fenetre .a4:checked").length,o=$("#fenetre .a3:checked").length,u=$("#fenetre .a2:checked").length,a=$("#fenetre .a1:checked").length,f=s+o+u+a;if(f){var l="";s&&(l+=", "+s+" professeur"+(s>1?"s":"")),o&&(l+=", "+o+" colleur"+(o>1?"s":"")),u&&(l+=", "+u+" élève"+(u>1?"s":"")),a&&(l+=", "+a+" invité"+(a>1?"s":"")),$(t).parent().children("span").text("Cette matière concerne "+f+" utilisateur"+(f>1?"s":"")+" dont "+l.substr(1)+".")}else $(t).parent().children("span").text("Cette matière ne concerne aucun utilisateur.")}}).done(function(t){t["etat"]!="ok"&&(e.checked=!e.checked)})});var r=t.getAttribute("data-uid");$("#u"+r.replace(/,/g,",#u")).prop("checked",!0),$("#fenetre :checked").prev().addClass("labelchecked")}function utilisateursgroupe(e){var t=e,n=$(e).parent().parent();popup($("#form-utilisateurs").html(),!0),$("#fenetre").addClass("usergrp").children("h3").append(n.find("span.editable").text()||n.find("input").val()),$("#fenetre :checkbox").attr("id",function(){return this.name}),n.is("div")?($("#fenetre :checkbox").on("change",function(){$(this).prev().toggleClass("labelchecked",e.checked)}),$('<a class="icon-ok" title="Valider"></a>').insertAfter("#fenetre .icon-ferme").on("click",function(){var e=$("#fenetre input:checked").map(function(){return this.id.replace("u","")}).get().join();t.setAttribute("data-uid",e),$(t).parent().next().val(e),$(t).parent().children("span").text($("#fenetre input:checked").parent().map(function(){return $(this).text().replace(" (identifiant)","").trim()}).get().join(", ")),$("#fenetre, #fenetre_fond").remove()})):$("#fenetre :checkbox").on("change",function(){var e=this,i=e.id.substr(1);$.ajax({url:"ajax.php",method:"post",data:{table:"groupes",id:n.attr("data-id").split("|")[1],eleve:i,ok:e.checked?1:0},dataType:"json",el:e,fonction:function(n){n.checked?(r=r+","+i,$(e).prev().addClass("labelchecked")):(r=(","+r+",").replace(","+i+",",",").slice(1,-1),$(e).prev().removeClass("labelchecked")),t.setAttribute("data-uid",r),$(t).parent().children("span").text($("#fenetre input:checked").parent().map(function(){return $(this).text().replace(" (identifiant)","").trim()}).get().join(", "))}}).done(function(t){t["etat"]!="ok"&&(e.checked=!e.checked)})});var r=t.getAttribute("data-uid");$("#u"+r.replace(/,/g,",#u")).prop("checked",!0),$("#fenetre :checked").prev().addClass("labelchecked")}function utilisateursmail(e){popup($("#form-utilisateurs").html(),!0),$('#fenetre [name="dest[]"]').each(function(){$(this).attr("id","u"+this.value)});var t=$('[name="id-copie"]').val().split(",");for(var n=0;n<t.length;n++)$('#fenetre [name="dest[]"][value="'+t[n]+'"]').prop("checked",!0);t=$('[name="id-bcc"]').val().split(",");for(var n=0;n<t.length;n++)$('#fenetre [name="dest_bcc[]"][value="'+t[n]+'"]').prop("checked",!0);$("#fenetre .icon-cocher").on("click keyup",function(){var e=this.getAttribute("data-classe");$("#fenetre ."+e+":not(:disabled)").prop("checked",!0),$(this).hide(),$(this).next().show(),e=e.indexOf("bcc")>0?e.replace("bcc","c"):e.replace("c","bcc"),$("#fenetre ."+e+":not(:disabled)").prop("checked",!1),$('#fenetre .icon-cocher[data-classe="'+e+'"]').show(),$('#fenetre .icon-decocher[data-classe="'+e+'"]').hide()}),$("#fenetre .icon-decocher").on("click keyup",function(){$("#fenetre ."+this.getAttribute("data-classe")+":not(:disabled)").prop("checked",!1),$(this).hide(),$(this).prev().show()}).hide(),$("#fenetre :checkbox[name]").on("change",function(){$(this).is(":checked")&&$('#fenetre :checkbox[name][value="'+this.value+'"][name!="'+this.name+'"]').prop("checked",!1)}),$("#fenetre :checkbox:not([name])").on("click",function(){var e=this.value.split(",");for(var t=0;t<e.length;t++)$('#fenetre :checkbox[name="'+this.className+'[]"][value="'+e[t]+'"]').prop("checked",$(this).prop("checked")).change();$(this).is(":checked")&&$('#fenetre :checkbox[class="'+(this.className=="dest"?"dest_bcc":"dest")+'"][value="'+this.value+'"]').prop("checked",!1)}),$("#fenetre .icon-ok").on("click",function(){$('[name="id-copie"]').val($('#fenetre [name="dest[]"]:checked').map(function(){return this.value}).get().join(",")),$('[name="id-bcc"]').val($('#fenetre [name="dest_bcc[]"]:checked').map(function(){return this.value}).get().join(",")),$(e).prev().text($('#fenetre [name="dest[]"]:checked').parent().prev().map(function(){return $(this).text().replace(" (identifiant)","")}).get().concat($('#fenetre [name="dest_bcc[]"]:checked').parent().prev().prev().map(function(){return $(this).text().replace(" (identifiant)","")+" (CC)"}).get()).join(", ")),$(e).prev().text().length||$(e).prev().text("[Personne]"),$("#fenetre, #fenetre_fond").remove()})}function notes(e){$("#epingle :checkbox").on("click",function(){var e=$("#epingle .grpnote:checked").map(function(){return this.value.split(",")}).get().concat();$("#epingle tr[data-id]:not([data-orig])").hide();for(var t=0;t<e.length;t++)$('#epingle tr[data-id="'+e[t]+'"]').show()}),$("#epingle tr[data-id]").each(function(){$(this).children("td:last").html($("#epingle div").html()),$(this).find("select").attr("name","e"+$(this).attr("data-id"))}),$("#epingle div").remove(),$("#epingle :checkbox").length&&$("#epingle tr[data-id]").hide();if(e.getAttribute("data-eleves")){$("#epingle h4").text($(e).parent().children("h3").text()),$('#epingle [name="id"]').val($(e).parent().attr("data-id").split("|")[1]);var t=e.getAttribute("data-eleves").split("|"),n=e.getAttribute("data-notes").split("|");for(var r=0;r<t.length;r++)$('#epingle tr[data-id="'+t[r]+'"]').attr("data-orig",!0).show().find("select").val(n[r]).on("change",function(){$(this).parent().parent().removeAttr("data-orig")});var i=dejanotes[$('#epingle [name="id"]').val().split("-")[0]].split(",");for(r=0;r<i.length;r++)$('#epingle tr[data-id="'+i[r]+'"]:not(:visible)').addClass("dejanote").find("select").prop("disabled",!0);$(".dejanote td:first-child").each(function(){$(this).text($(this).text()+" (noté par un autre colleur)")})}else $("#epingle #semaine").on("change keyup",function(){var e=$(this).val().split("-")[0];$(".dejanote td:first-child").each(function(){$(this).text($(this).text().replace(" (noté par un autre colleur)",""))}),$(".dejanote").removeClass("dejanote").find("select").prop("disabled",!1);if(e>0){var t=dejanotes[e].split(",");for(var n=0;n<t.length;n++)$('#epingle tr[data-id="'+t[n]+'"]').addClass("dejanote").find("select").prop("disabled",!0);$(".dejanote td:first-child").each(function(){$(this).text($(this).text()+" (noté par un autre colleur)")})}})}function envoimail(e){$(".editabledest").children("span").text()=="[Personne]"?affiche("Il faut au moins un destinataire pour envoyer le courriel.","nok"):$.ajax({url:"ajax.php",method:"post",data:$("#mail").serialize(),dataType:"json",el:"",fonction:function(e){location.reload(!0)}})}function modifierepertoire(e){var t=e.className=="icon-edite"?"repertoire":"ajouterep";$("#epingle").remove();var n=$('<article id="epingle"><a class="icon-ferme" title="Fermer"></a>  <a class="icon-aide" title="Aide pour ce formulaire"></a>  <a class="icon-ok" title="Valider"></a></article>').insertAfter("#parentsdoc"),r=$('<form onsubmit="return false;"></form>').appendTo(n).html($("#form-"+t).html());if(t=="repertoire"){var i=$(e).parent().attr("data-id").split("|")[1],s=$(e).parent().attr("data-donnees").split("|"),o=$(e).parent().children(".nom").text().split(/\/\s/).pop()||$(e).parent().find("input").val();r.find("em").text(o),s[0]==0?r.find("#nom,#parent,#menu").parent().remove():(r.find("#nom").val(o),r.find('[data-parents*=",'+i+',"]').prop("disabled",!0),s[1]=="1"&&r.find("#menu").prop("checked",!0)),$('#protection option[value="'+s[2]+'"]').prop("selected",!0),r.find('[name="id"]').val(i)}n.children(".icon-ferme").on("click",function(){$("#epingle").remove()}),n.children("a.icon-aide").on("click",function(){popup($("#aide-"+t).html(),!1)}),n.children("a.icon-ok").on("click",function(){$.ajax({url:"ajax.php",method:"post",data:r.serialize(),dataType:"json",el:n,fonction:function(e){location.reload(!0)}})}),r.find("input,select").on("keypress",function(e){e.which==13&&n.children("a.icon-ok").click()})}function modifiedocument(e){var t=e.className=="icon-edite"?"document":"ajoutedoc";$("#epingle").remove();var n=$('<article id="epingle"><a class="icon-ferme" title="Fermer"></a>  <a class="icon-aide" title="Aide pour ce formulaire"></a>  <a class="icon-ok" title="Valider"></a></article>').insertAfter("#parentsdoc");form=$('<form onsubmit="return false;"></form>').appendTo(n).html($("#form-"+t).html());var r=$(e).parent().children(".nom").text()||$(e).parent().find("input").val();form.find("em").text(r),t=="document"?(form.find("#nom").val(r),$('#protection option[value="'+$(e).parent().attr("data-protection")+'"]').prop("selected",!0),form.find('[name="id"]').val($(e).parent().attr("data-id").split("|")[1])):($('#protection option[value="'+$(e).parent().attr("data-donnees").split("|")[2]+'"]').prop("selected",!0),form.find('[name="parent"]').val($(e).parent().attr("data-id").split("|")[1]),form.find("#fichier").on("change",function(){if(!form.find("#nom").val().length)var e=this.value;form.find("#nom").val(e.substring(e.lastIndexOf("\\")+1,e.lastIndexOf("."))||e)})),n.children(".icon-ferme").on("click",function(){$("#epingle").remove()}),n.children("a.icon-aide").on("click",function(){popup($("#aide-"+t).html(),!1)}),n.children("a.icon-ok").on("click",function(){var e=new FormData(form[0]);$.ajax({url:"ajax.php",method:"post",data:e,dataType:"json",contentType:!1,processData:!1,el:n,fonction:function(e){location.reload(!0)}})}),form.find("input,select").on("keypress",function(e){e.which==13&&n.children("a.icon-ok").click()})}$.fn.placeholder=function(){this.each(function(){var e=$(this);e.is("div")?e.on("change keyup mouseup",function(){$(this).text().length?$(this).removeClass("placeholder"):$(this).addClass("placeholder")}).change():($('<span class="placeholder">'+this.getAttribute("data-placeholder")+"</span>").insertBefore(e).on("click",function(){$(this).next().focus()}).hide(),e.on("change keyup mouseup",function(){this.value!=undefined&&!this.value.length&&$(this).is(":visible")?$(this).prev().css("display","inline"):$(this).prev().hide()}).change())})},$.fn.textareahtml=function(){this.each(function(){var e=$(this),t=this.getAttribute("data-placeholder");this.setAttribute("data-placeholder",t+". Formattage en HTML, balises visibles.");var n=$('<div contenteditable="true" data-placeholder="'+t+'"></div>').insertAfter(e.before(boutons)).hide(),r=e.prev().children(".icon-retour");e.on("keypress",function(e){e.which==13&&(this.value=nettoie(this.value))}).on("paste cut",function(){var e=this;setTimeout(function(){e.value=nettoie(e.value)},100)}),n.on("keypress",function(e){e.which==13&&r.click()}).on("paste cut",function(){var e=this;setTimeout(function(){e.innerHTML=nettoie(e.innerHTML)+"<br>"},100)}),e.prev().children(".icon-nosource").on("click",function(t){t.preventDefault(),e.hide(),e.prev().hide(),n.show().css("min-height",e.outerHeight()),$(this).hide().prev().show(),n.focus().html(nettoie(e.val())).change();if(window.getSelection){var r=document.createRange();r.selectNodeContents(n[0]),r.collapse(!1);var i=window.getSelection();i.removeAllRanges(),i.addRange(r)}else{var r=document.body.createTextRange();r.moveToElementText(n[0]),r.collapse(!1),r.select()}}),e.prev().children(".icon-source").on("click",function(t){t.preventDefault(),n.hide(0),e.show(0).css("height",n.height()),$(this).hide().next().show(),e.focus().val(nettoie(n.html())).change()}).hide(),e.prev().children(".icon-aide").on("click",function(e){e.preventDefault(),aidetexte()}),e.prev().children().not(".icon-nosource,.icon-source,.icon-aide").on("click",function(e){e.preventDefault(),window["insertion_"+this.className.substring(5)]($(this))})})},$.fn.editinplace=function(){this.each(function(){var e=$(this);this.setAttribute("data-original",e.is("h3")?e.text():e.html()),$('<a class="icon-edite" title="Modifier"></a>').appendTo(e).on("click",transforme)})},$.fn.editinplacecdt=function(){this.each(function(){$(this).wrapInner("<span></span>").attr("data-original",$(this).text()),$('<a class="icon-edite" title="Modifier"></a>').appendTo($(this)).on("click",transformecdt)})},$.fn.init_cdt_boutons=function(){var e=this;e.find('[name="jour"],[name="pour"]').datetimepicker({format:"d/m/Y",timepicker:!1}),e.find('[name="h_debut"]').datetimepicker({format:"Ghi",datepicker:!1,onClose:function(t,n){e.find('[name="h_fin"]').val(function(e,t){return t||(n.val().length?parseInt(n.val().slice(0,-3))+2+n.val().slice(-3):"")})}}),e.find('[name="h_fin"]').datetimepicker({format:"Ghi",datepicker:!1});var t=function(e){return String(e).length==1?"0"+e:String(e)};e.find('[name="raccourci"]').on("change keyup",function(){var n=raccourcis[this.value];for(var r in n)if(r=="jour"){var i=new Date,s=parseInt(n.jour);i.setDate(s>i.getDay()?i.getDate()-i.getDay()-7+s:i.getDate()-i.getDay()+s),e.find('[name="jour"]').val(t(i.getDate())+"/"+t(i.getMonth()+1)+"/"+i.getFullYear())}else e.find('[name="'+r+'"]').val(n[r]);this.setAttribute("data-modif",1),e.find('[name="tid"]').change()}).attr("data-modif",0),e.find('[name="tid"]').on("change keyup",function(){switch(parseInt(seances[this.value])){case 0:e.find('[name="h_debut"]').parent().show(),e.find('[name="h_fin"]').parent().hide(),e.find('[name="pour"]').parent().hide(),e.find('[name="demigroupe"]').parent().show();break;case 1:e.find('[name="h_debut"]').parent().show(),e.find('[name="h_fin"]').parent().show(),e.find('[name="pour"]').parent().hide(),e.find('[name="demigroupe"]').parent().show();break;case 2:e.find('[name="h_debut"]').parent().hide(),e.find('[name="h_fin"]').parent().hide(),e.find('[name="pour"]').parent().show(),e.find('[name="demigroupe"]').parent().show();break;case 3:e.find('[name="h_debut"]').parent().hide(),e.find('[name="h_fin"]').parent().hide(),e.find('[name="pour"]').parent().hide(),e.find('[name="demigroupe"]').parent().show();break;default:e.find('[name="h_debut"]').parent().hide(),e.find('[name="h_fin"]').parent().hide(),e.find('[name="pour"]').parent().hide(),e.find('[name="demigroupe"]').parent().hide()}e.find('[name="jour"]').change()}),e.find('input,[name="demigroupe"]').on("change keyup",function(){e.find('[name="raccourci"]').attr("data-modif")==0?e.find('[name="raccourci"]').val(0):e.find('[name="raccourci"]').attr("data-modif",0)}),e.find("input,select").on("keypress",function(e){e.which==13&&el.find("a.icon-ok").click()}),e.find("select:first").focus(),e.find('[name="tid"]').change()},$.fn.init_cdt_raccourcis=function(){this.each(function(){var e=$(this);e.find('[name="h_debut"]').datetimepicker({format:"Ghi",datepicker:!1,onClose:function(t,n){e.find('[name="h_fin"]').val(function(e,t){return t||(n.val().length?parseInt(n.val().slice(0,-3))+2+n.val().slice(-3):"")})}}),e.find('[name="h_fin"]').datetimepicker({format:"Ghi",datepicker:!1}),e.find('[name="type"]').on("change keyup",function(){switch(parseInt(seances[this.value])){case 0:e.find('[name="h_debut"]').parent().show(),e.find('[name="h_fin"]').parent().hide(),e.find('[name="demigroupe"]').parent().show();break;case 1:e.find('[name="h_debut"]').parent().show(),e.find('[name="h_fin"]').parent().show(),e.find('[name="demigroupe"]').parent().show();break;case 2:e.find('[name="h_debut"]').parent().hide(),e.find('[name="h_fin"]').parent().hide(),e.find('[name="demigroupe"]').parent().show();break;case 3:e.find('[name="h_debut"]').parent().hide(),e.find('[name="h_fin"]').parent().hide(),e.find('[name="demigroupe"]').parent().show();break;default:e.find('[name="h_debut"]').parent().hide(),e.find('[name="h_fin"]').parent().hide(),e.find('[name="demigroupe"]').parent().hide()}}).change(),e.find("input,select").on("keypress",function(t){t.which==13&&e.find("a.icon-ok").click()})})};var boutons='<p class="boutons">  <button class="icon-titres" title="Niveaux de titres"></button>  <button class="icon-par1" title="Paragraphe"></button>  <button class="icon-par2" title="Paragraphe important"></button>  <button class="icon-par3" title="Paragraphe très important"></button>  <button class="icon-retour" title="Retour à la ligne"></button>  <button class="icon-gras" title="Gras"></button>  <button class="icon-italique" title="Italique"></button>  <button class="icon-souligne" title="Souligné"></button>  <button class="icon-omega" title="Insérer une lettre grecque"></button>  <button class="icon-sigma" title="Insérer un signe mathématique"></button>  <button class="icon-exp" title="Exposant"></button>  <button class="icon-ind" title="Indice"></button>  <button class="icon-ol" title="Liste énumérée"></button>  <button class="icon-ul" title="Liste à puces"></button>  <button class="icon-lien1" title="Lien vers un document du site"></button>  <button class="icon-lien2" title="Lien internet"></button>  <button class="icon-tex" title="LATEX!"></button>  <button class="icon-source" title="Voir et éditer le code html"></button>  <button class="icon-nosource" title="Voir et éditer le texte formaté"></button>  <button class="icon-aide" title="Voir et éditer le texte formaté"></button></p>';$(document).ajaxSend(function(e,t,n){$("body").css("cursor","wait"),n.data.append?n.data.append("csrf-token",$("body").attr("data-csrf-token")):n.data="csrf-token="+$("body").attr("data-csrf-token")+"&"+n.data}).ajaxStop(function(){$("body").css("cursor","auto")}).ajaxSuccess(function(e,t,n){var r=t.responseJSON;switch(r.etat){case"ok":affiche(r.message,"ok"),n.fonction(n.el);break;case"nok":affiche(r.message,"nok");break;case"login":afficher_login(n)}}),$(function(){$(".editable").editinplace(),$(".titrecdt").editinplacecdt(),$(".cdt-raccourcis").init_cdt_raccourcis(),$(".supprmultiple").on("click",function(){suppressionmultiple(this)}),$(".usermat .icon-edite").on("click",function(){utilisateursmatiere(this)}),$(".editabledest .icon-edite").on("click",function(){utilisateursmail(this)}),$('[name="copie"]').on("change",function(){$.ajax({url:"ajax.php",method:"post",data:{table:"mailprefs",champ:"mailcopy",id:0,val:$(this).prop("checked")?1:0},dataType:"json",el:"",fonction:function(e){return!0}})}),$("#parentsdoc .icon-edite, .rep > .icon-edite, .icon-ajouterep").on("click",function(){modifierepertoire(this)}),$(".doc > .icon-edite, .icon-ajoutedoc").on("click",function(){modifiedocument(this)}),$(".evnmt").on("click",function(){this.setAttribute("data-id","evenement"),formulaire(this)}),$('[name="mailnotes"]').on("change",function(){$.ajax({url:"ajax.php",method:"post",data:{table:"groupes",champ:"mailnotes",id:$(this).attr("id").substr(9),val:$(this).find("option:selected").val()},dataType:"json",el:"",fonction:function(e){return!0}})}),$(".usergrp .icon-edite").on("click",function(){utilisateursgroupe(this)}),$("#log").hide().on("click",function(){$(this).hide()}),$("[data-placeholder]").placeholder(),$.colpick&&$('[name="couleur"]').colpick(),$("a.icon-cache,a.icon-montre,a.icon-monte,a.icon-descend,a.icon-supprime").on("click",function(){window[this.className.substring(5)]($(this))}),$("a.icon-aide").on("click",function(){popup($("#aide-"+this.getAttribute("data-id")).html(),!1)}),$("a.icon-prefs.general,a.icon-ajoute,a.icon-ajout-colle").on("click",function(){formulaire(this)}),$("a.icon-ok").on("click",function(){valide(this)}),$("a.icon-deconnexion").on("click",function(e){$.ajax({url:"ajax.php",method:"post",data:{deconnexion:1},dataType:"json",el:"",fonction:function(e){location.reload(!0)}})}),$(".icon-lock1").attr("title","Visible uniquement par les utilisateurs connectés"),$(".icon-lock2").attr("title","Visible uniquement par les élèves/colleurs/professeurs connectés"),$(".icon-lock3").attr("title","Visible uniquement par les colleurs/professeurs connectés"),$(".icon-lock4").attr("title","Visible uniquement par les professeurs connectés"),$(".icon-lock5").attr("title","Complètement invisible (hors professeurs de cette matière)"),$(".icon-menu").on("click",function(){$("#colonne,nav").toggleClass("visible")})});
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/js/fonctions.js cahier-de-prepa6.0.0/js/fonctions.js
--- cahier-de-prepa5.1.0/js/fonctions.js	2015-09-20 03:26:01.687114589 +0200
+++ cahier-de-prepa6.0.0/js/fonctions.js	2016-08-08 11:18:16.233336341 +0200
@@ -89,7 +89,7 @@
     // Envoi
     $('#fenetre a.icon-ok').on("click",function () {
       $.ajax({url: 'ajax.php', method: "post", data: $('#fenetre form').serialize(), dataType: 'json', el: '', fonction: function(el) { location.reload(true); } })
-      .success( function(data) {
+      .done( function(data) {
         // Si erreur d'identification, on reste bloqué là
         if ( data['etat'] == 'login_nok' )
           $('form p:first').html(data['message']).addClass('warning');
@@ -120,5 +120,18 @@
     $('nav').removeClass();
     $('#colonne').toggleClass('visible',$('#recent').hasClass('visible'));
   });
+
+  // Pop-up pour les événements de l'agenda
+  $('.evnmt').on("click", function() {
+    var donnees = evenements[this.id.substr(1)];
+    var el = $('<div id="fenetre"></div>').appendTo('body').html('<h3>'+donnees.titrebis+'</h3>\n<h3 style="margin-bottom: 1em;">'+donnees.date+'</h3>\n<p>'+donnees.texte+'</p>').focus();
+    $('<div id="fenetre_fond"></div>').appendTo('body').click(function() {
+      $('#fenetre,#fenetre_fond').remove();
+    });
+    $('<a class="icon-ferme" title="Fermer"></a>').prependTo(el).on("click",function() {
+      el.remove();
+      $('#fenetre_fond').remove();
+    });
+  });
   
 });
diff -urN cahier-de-prepa5.1.0/js/fonctions-min.js cahier-de-prepa6.0.0/js/fonctions-min.js
--- cahier-de-prepa5.1.0/js/fonctions-min.js	2015-09-26 01:45:48.013679906 +0200
+++ cahier-de-prepa6.0.0/js/fonctions-min.js	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-function affiche(b,a){$("#log").removeClass().addClass(a).html(b).show().delay(5000).hide(500)}$.fn.placeholder=function(){this.each(function(){var a=$(this);$('<span class="placeholder">'+this.getAttribute("data-placeholder")+"</span>").insertBefore(a).on("click",function(){$(this).next().focus()}).hide();a.on("change keyup mouseup",function(){if(!(this.value.length)&&($(this).is(":visible"))){$(this).prev().show()}else{$(this).prev().hide()}}).change()})};$(document).ajaxSend(function(b,c,a){$("body").css("cursor","wait")}).ajaxStop(function(){$("body").css("cursor","auto")}).ajaxSuccess(function(b,d,a){var c=d.responseJSON;switch(c.etat){case"ok":affiche(c.message,"ok");a.fonction(a.el);break;case"nok":affiche(c.message,"nok");break}});$(function(){$("a.icon-connexion").on("click",function(b){if(!$("#log").length){$('<div id="log"></div>').appendTo("body").hide().on("click",function(){$(this).hide()})}$("#colonne,nav").removeClass("visible");var a=$('<div id="fenetre"></div>').appendTo("body").html('<a class="icon-ferme" title="Fermer"></a><a class="icon-ok" title="Valider"></a><h3>Connexion</h3><form>  <p>Veuillez entrer votre identifiant et votre mot de passe&nbsp;:</p>  <input class="ligne" type="text" name="login" data-placeholder="Identifiant">  <input class="ligne" type="password" name="motdepasse" data-placeholder="Mot de passe">  <input class="ligne" type="hidden" name="connexion" value="1">  <p class="oubli"><a href="connexion?oublimdp">Identifiant ou mot de passe oublié&nbsp;?</a></p>  <p class="oubli"><a href="connexion?creationcompte">Créer un compte</a></p></form>').focus();$('<div id="fenetre_fond"></div>').appendTo("body").click(function(){$("#fenetre,#fenetre_fond").remove()});$("#fenetre a.icon-ferme").on("click",function(){$("#fenetre,#fenetre_fond").remove()});$("#fenetre input").placeholder();$("#fenetre a.icon-ok").on("click",function(){$.ajax({url:"ajax.php",method:"post",data:$("#fenetre form").serialize(),dataType:"json",el:"",fonction:function(c){location.reload(true)}}).success(function(c){if(c.etat=="login_nok"){$("form p:first").html(c.message).addClass("warning")}})});$("#fenetre input").on("keypress",function(c){if(c.which==13){$("#fenetre a.icon-ok").click()}});setTimeout(function(){$("#fenetre input:first").focus()},500)});$("a.icon-deconnexion").on("click",function(a){$.ajax({url:"ajax.php",method:"post",data:{deconnexion:1},dataType:"json",el:"",fonction:function(b){location.reload(true)}})});$(".icon-menu").on("click",function(){$("nav").toggleClass("visible");$("#recent").removeClass();$("#colonne").toggleClass("visible",$("nav").hasClass("visible"))});$(".icon-recent").on("click",function(){$("#recent").toggleClass("visible");$("nav").removeClass();$("#colonne").toggleClass("visible",$("#recent").hasClass("visible"))})});
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/js/fonctions.min.js cahier-de-prepa6.0.0/js/fonctions.min.js
--- cahier-de-prepa5.1.0/js/fonctions.min.js	1970-01-01 01:00:00.000000000 +0100
+++ cahier-de-prepa6.0.0/js/fonctions.min.js	2016-08-30 18:10:07.262329604 +0200
@@ -0,0 +1,6 @@
+/*//////////////////////////////////////////////////////////////////////////////
+Éléments JavaScript pour l'utilisation de base de Cahier de Prépa
+
+Copie partielle de edition.js
+//////////////////////////////////////////////////////////////////////////////*/// Notification de résultat de requête AJAX
+function affiche(e,t){$("#log").removeClass().addClass(t).html(e).show().delay(5e3).hide(500)}$.fn.placeholder=function(){this.each(function(){var e=$(this);$('<span class="placeholder">'+this.getAttribute("data-placeholder")+"</span>").insertBefore(e).on("click",function(){$(this).next().focus()}).hide(),e.on("change keyup mouseup",function(){!this.value.length&&$(this).is(":visible")?$(this).prev().show():$(this).prev().hide()}).change()})},$(document).ajaxSend(function(e,t,n){$("body").css("cursor","wait")}).ajaxStop(function(){$("body").css("cursor","auto")}).ajaxSuccess(function(e,t,n){var r=t.responseJSON;switch(r.etat){case"ok":affiche(r.message,"ok"),n.fonction(n.el);break;case"nok":affiche(r.message,"nok")}}),$(function(){$("a.icon-connexion").on("click",function(e){$("#log").length||$('<div id="log"></div>').appendTo("body").hide().on("click",function(){$(this).hide()}),$("#colonne,nav").removeClass("visible");var t=$('<div id="fenetre"></div>').appendTo("body").html('<a class="icon-ferme" title="Fermer"></a><a class="icon-ok" title="Valider"></a><h3>Connexion</h3><form>  <p>Veuillez entrer votre identifiant et votre mot de passe&nbsp;:</p>  <input class="ligne" type="text" name="login" data-placeholder="Identifiant">  <input class="ligne" type="password" name="motdepasse" data-placeholder="Mot de passe">  <input class="ligne" type="hidden" name="connexion" value="1">  <p class="oubli"><a href="connexion?oublimdp">Identifiant ou mot de passe oublié&nbsp;?</a></p>  <p class="oubli"><a href="connexion?creationcompte">Créer un compte</a></p></form>').focus();$('<div id="fenetre_fond"></div>').appendTo("body").click(function(){$("#fenetre,#fenetre_fond").remove()}),$("#fenetre a.icon-ferme").on("click",function(){$("#fenetre,#fenetre_fond").remove()}),$("#fenetre input").placeholder(),$("#fenetre a.icon-ok").on("click",function(){$.ajax({url:"ajax.php",method:"post",data:$("#fenetre form").serialize(),dataType:"json",el:"",fonction:function(e){location.reload(!0)}}).done(function(e){e["etat"]=="login_nok"&&$("form p:first").html(e.message).addClass("warning")})}),$("#fenetre input").on("keypress",function(e){e.which==13&&$("#fenetre a.icon-ok").click()}),setTimeout(function(){$("#fenetre input:first").focus()},500)}),$("a.icon-deconnexion").on("click",function(e){$.ajax({url:"ajax.php",method:"post",data:{deconnexion:1},dataType:"json",el:"",fonction:function(e){location.reload(!0)}})}),$(".icon-menu").on("click",function(){$("nav").toggleClass("visible"),$("#recent").removeClass(),$("#colonne").toggleClass("visible",$("nav").hasClass("visible"))}),$(".icon-recent").on("click",function(){$("#recent").toggleClass("visible"),$("nav").removeClass(),$("#colonne").toggleClass("visible",$("#recent").hasClass("visible"))}),$(".evnmt").on("click",function(){var e=evenements[this.id.substr(1)],t=$('<div id="fenetre"></div>').appendTo("body").html("<h3>"+e.titrebis+'</h3>\n<h3 style="margin-bottom: 1em;">'+e.date+"</h3>\n<p>"+e.texte+"</p>").focus();$('<div id="fenetre_fond"></div>').appendTo("body").click(function(){$("#fenetre,#fenetre_fond").remove()}),$('<a class="icon-ferme" title="Fermer"></a>').prependTo(t).on("click",function(){t.remove(),$("#fenetre_fond").remove()})})});
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/js/jquery.datepick-fr.js cahier-de-prepa6.0.0/js/jquery.datepick-fr.js
--- cahier-de-prepa5.1.0/js/jquery.datepick-fr.js	2015-08-22 03:59:45.192573758 +0200
+++ cahier-de-prepa6.0.0/js/jquery.datepick-fr.js	1970-01-01 01:00:00.000000000 +0100
@@ -1,29 +0,0 @@
-﻿/* http://keith-wood.name/datepick.html
-   French localisation for jQuery Datepicker.
-   Stéphane Nahmani (sholby@sholby.net). */
-(function($) {
-	$.datepick.regionalOptions['fr'] = {
-		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
-		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
-		monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
-		'Jul','Aoû','Sep','Oct','Nov','Déc'],
-		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
-		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
-		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
-		dateFormat: 'dd/mm/yyyy', firstDay: 1,
-		renderer: $.datepick.defaultRenderer,
-		prevText: '&#x3c;Préc', prevStatus: 'Voir le mois précédent',
-		prevJumpText: '&#x3c;&#x3c;', prevJumpStatus: 'Voir l\'année précédent',
-		nextText: 'Suiv&#x3e;', nextStatus: 'Voir le mois suivant',
-		nextJumpText: '&#x3e;&#x3e;', nextJumpStatus: 'Voir l\'année suivant',
-		currentText: 'Courant', currentStatus: 'Voir le mois courant',
-		todayText: 'Aujourd\'hui', todayStatus: 'Voir aujourd\'hui',
-		clearText: 'Effacer', clearStatus: 'Effacer la date sélectionnée',
-		closeText: 'Fermer', closeStatus: 'Fermer sans modifier',
-		yearStatus: 'Voir une autre année', monthStatus: 'Voir un autre mois',
-		weekText: 'Sm', weekStatus: 'Semaine de l\'année',
-		dayStatus: '\'Choisir\' le DD d MM', defaultStatus: 'Choisir la date',
-		isRTL: false
-	};
-	$.datepick.setDefaults($.datepick.regionalOptions['fr']);
-})(jQuery);
diff -urN cahier-de-prepa5.1.0/js/jquery.datepick.js cahier-de-prepa6.0.0/js/jquery.datepick.js
--- cahier-de-prepa5.1.0/js/jquery.datepick.js	2015-08-22 03:59:52.088457086 +0200
+++ cahier-de-prepa6.0.0/js/jquery.datepick.js	1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-﻿/* http://keith-wood.name/datepick.html
-   Date picker for jQuery v5.0.1.
-   Written by Keith Wood (kbwood{at}iinet.com.au) February 2010.
-   Licensed under the MIT (http://keith-wood.name/licence.html) licence. 
-   Please attribute the author if you use it. */
-(function($){var E='datepick';$.JQPlugin.createPlugin({name:E,defaultRenderer:{picker:'<div class="datepick">'+'<div class="datepick-nav">{link:prev}{link:today}{link:next}</div>{months}'+'{popup:start}<div class="datepick-ctrl">{link:clear}{link:close}</div>{popup:end}'+'<div class="datepick-clear-fix"></div></div>',monthRow:'<div class="datepick-month-row">{months}</div>',month:'<div class="datepick-month"><div class="datepick-month-header">{monthHeader}</div>'+'<table><thead>{weekHeader}</thead><tbody>{weeks}</tbody></table></div>',weekHeader:'<tr>{days}</tr>',dayHeader:'<th>{day}</th>',week:'<tr>{days}</tr>',day:'<td>{day}</td>',monthSelector:'.datepick-month',daySelector:'td',rtlClass:'datepick-rtl',multiClass:'datepick-multi',defaultClass:'',selectedClass:'datepick-selected',highlightedClass:'datepick-highlight',todayClass:'datepick-today',otherMonthClass:'datepick-other-month',weekendClass:'datepick-weekend',commandClass:'datepick-cmd',commandButtonClass:'',commandLinkClass:'',disabledClass:'datepick-disabled'},commands:{prev:{text:'prevText',status:'prevStatus',keystroke:{keyCode:33},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),1-a.options.monthsToStep,'m'),a),1),-1,'d').getTime()>=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),-a.options.monthsToStep,'m'),a),1)},action:function(a){F.changeMonth(this,-a.options.monthsToStep)}},prevJump:{text:'prevJumpText',status:'prevJumpStatus',keystroke:{keyCode:33,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),1-a.options.monthsToJump,'m'),a),1),-1,'d').getTime()>=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),-a.options.monthsToJump,'m'),a),1)},action:function(a){F.changeMonth(this,-a.options.monthsToJump)}},next:{text:'nextText',status:'nextStatus',keystroke:{keyCode:34},enabled:function(a){var b=a.get('maxDate');return(!b||F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToStep,'m'),a),1).getTime()<=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToStep,'m'),a),1)},action:function(a){F.changeMonth(this,a.options.monthsToStep)}},nextJump:{text:'nextJumpText',status:'nextJumpStatus',keystroke:{keyCode:34,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToJump,'m'),a),1).getTime()<=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToJump,'m'),a),1)},action:function(a){F.changeMonth(this,a.options.monthsToJump)}},current:{text:'currentText',status:'currentStatus',keystroke:{keyCode:36,ctrlKey:true},enabled:function(a){var b=a.curMinDate();var c=a.get('maxDate');var d=a.selectedDates[0]||F.today();return(!b||d.getTime()>=b.getTime())&&(!c||d.getTime()<=c.getTime())},date:function(a){return a.selectedDates[0]||F.today()},action:function(a){var b=a.selectedDates[0]||F.today();F.showMonth(this,b.getFullYear(),b.getMonth()+1)}},today:{text:'todayText',status:'todayStatus',keystroke:{keyCode:36,ctrlKey:true},enabled:function(a){var b=a.curMinDate();var c=a.get('maxDate');return(!b||F.today().getTime()>=b.getTime())&&(!c||F.today().getTime()<=c.getTime())},date:function(a){return F.today()},action:function(a){F.showMonth(this)}},clear:{text:'clearText',status:'clearStatus',keystroke:{keyCode:35,ctrlKey:true},enabled:function(a){return true},date:function(a){return null},action:function(a){F.clear(this)}},close:{text:'closeText',status:'closeStatus',keystroke:{keyCode:27},enabled:function(a){return true},date:function(a){return null},action:function(a){F.hide(this)}},prevWeek:{text:'prevWeekText',status:'prevWeekStatus',keystroke:{keyCode:38,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.newDate(a.drawDate),-7,'d').getTime()>=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),-7,'d')},action:function(a){F.changeDay(this,-7)}},prevDay:{text:'prevDayText',status:'prevDayStatus',keystroke:{keyCode:37,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.newDate(a.drawDate),-1,'d').getTime()>=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),-1,'d')},action:function(a){F.changeDay(this,-1)}},nextDay:{text:'nextDayText',status:'nextDayStatus',keystroke:{keyCode:39,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.add(F.newDate(a.drawDate),1,'d').getTime()<=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),1,'d')},action:function(a){F.changeDay(this,1)}},nextWeek:{text:'nextWeekText',status:'nextWeekStatus',keystroke:{keyCode:40,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.add(F.newDate(a.drawDate),7,'d').getTime()<=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),7,'d')},action:function(a){F.changeDay(this,7)}}},defaultOptions:{pickerClass:'',showOnFocus:true,showTrigger:null,showAnim:'show',showOptions:{},showSpeed:'normal',popupContainer:null,alignment:'bottom',fixedWeeks:false,firstDay:0,calculateWeek:null,monthsToShow:1,monthsOffset:0,monthsToStep:1,monthsToJump:12,useMouseWheel:true,changeMonth:true,yearRange:'c-10:c+10',shortYearCutoff:'+10',showOtherMonths:false,selectOtherMonths:false,defaultDate:null,selectDefaultDate:false,minDate:null,maxDate:null,dateFormat:'mm/dd/yyyy',autoSize:false,rangeSelect:false,rangeSeparator:' - ',multiSelect:0,multiSeparator:',',onDate:null,onShow:null,onChangeMonthYear:null,onSelect:null,onClose:null,altField:null,altFormat:null,constrainInput:true,commandsAsDateFormat:false,commands:{}},regionalOptions:{'':{monthNames:['January','February','March','April','May','June','July','August','September','October','November','December'],monthNamesShort:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'],dateFormat:'mm/dd/yyyy',firstDay:0,renderer:{},prevText:'&lt;Prev',prevStatus:'Show the previous month',prevJumpText:'&lt;&lt;',prevJumpStatus:'Show the previous year',nextText:'Next&gt;',nextStatus:'Show the next month',nextJumpText:'&gt;&gt;',nextJumpStatus:'Show the next year',currentText:'Current',currentStatus:'Show the current month',todayText:'Today',todayStatus:'Show today\'s month',clearText:'Clear',clearStatus:'Clear all the dates',closeText:'Close',closeStatus:'Close the datepicker',yearStatus:'Change the year',earlierText:'&#160;&#160;▲',laterText:'&#160;&#160;▼',monthStatus:'Change the month',weekText:'Wk',weekStatus:'Week of the year',dayStatus:'Select DD, M d, yyyy',defaultStatus:'Select a date',isRTL:false}},_getters:['getDate','isDisabled','isSelectable','retrieveDate'],_disabled:[],_popupClass:E+'-popup',_triggerClass:E+'-trigger',_disableClass:E+'-disable',_monthYearClass:E+'-month-year',_curMonthClass:E+'-month-',_anyYearClass:E+'-any-year',_curDoWClass:E+'-dow-',_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),_msPerDay:24*60*60*1000,ATOM:'yyyy-mm-dd',COOKIE:'D, dd M yyyy',FULL:'DD, MM d, yyyy',ISO_8601:'yyyy-mm-dd',JULIAN:'J',RFC_822:'D, d M yy',RFC_850:'DD, dd-M-yy',RFC_1036:'D, d M yy',RFC_1123:'D, d M yyyy',RFC_2822:'D, d M yyyy',RSS:'D, d M yy',TICKS:'!',TIMESTAMP:'@',W3C:'yyyy-mm-dd',formatDate:function(f,g,h){if(typeof f!=='string'){h=g;g=f;f=''}if(!g){return''}f=f||this.defaultOptions.dateFormat;h=h||{};var i=h.dayNamesShort||this.defaultOptions.dayNamesShort;var j=h.dayNames||this.defaultOptions.dayNames;var k=h.monthNamesShort||this.defaultOptions.monthNamesShort;var l=h.monthNames||this.defaultOptions.monthNames;var m=h.calculateWeek||this.defaultOptions.calculateWeek;var n=function(a,b){var c=1;while(s+c<f.length&&f.charAt(s+c)===a){c++}s+=c-1;return Math.floor(c/(b||1))>1};var o=function(a,b,c,d){var e=''+b;if(n(a,d)){while(e.length<c){e='0'+e}}return e};var p=function(a,b,c,d){return(n(a)?d[b]:c[b])};var q='';var r=false;for(var s=0;s<f.length;s++){if(r){if(f.charAt(s)==="'"&&!n("'")){r=false}else{q+=f.charAt(s)}}else{switch(f.charAt(s)){case'd':q+=o('d',g.getDate(),2);break;case'D':q+=p('D',g.getDay(),i,j);break;case'o':q+=o('o',this.dayOfYear(g),3);break;case'w':q+=o('w',m(g),2);break;case'm':q+=o('m',g.getMonth()+1,2);break;case'M':q+=p('M',g.getMonth(),k,l);break;case'y':q+=(n('y',2)?g.getFullYear():(g.getFullYear()%100<10?'0':'')+g.getFullYear()%100);break;case'@':q+=Math.floor(g.getTime()/1000);break;case'!':q+=g.getTime()*10000+this._ticksTo1970;break;case"'":if(n("'")){q+="'"}else{r=true}break;default:q+=f.charAt(s)}}}return q},parseDate:function(g,h,j){if(h==null){throw'Invalid arguments';}h=(typeof h==='object'?h.toString():h+'');if(h===''){return null}g=g||this.defaultOptions.dateFormat;j=j||{};var k=j.shortYearCutoff||this.defaultOptions.shortYearCutoff;k=(typeof k!=='string'?k:this.today().getFullYear()%100+parseInt(k,10));var l=j.dayNamesShort||this.defaultOptions.dayNamesShort;var m=j.dayNames||this.defaultOptions.dayNames;var n=j.monthNamesShort||this.defaultOptions.monthNamesShort;var o=j.monthNames||this.defaultOptions.monthNames;var p=-1;var q=-1;var r=-1;var s=-1;var t=false;var u=false;var v=function(a,b){var c=1;while(A+c<g.length&&g.charAt(A+c)===a){c++}A+=c-1;return Math.floor(c/(b||1))>1};var w=function(a,b){var c=v(a,b);var d=[2,3,c?4:2,11,20]['oy@!'.indexOf(a)+1];var e=new RegExp('^-?\\d{1,'+d+'}');var f=h.substring(z).match(e);if(!f){throw'Missing number at position {0}'.replace(/\{0\}/,z);}z+=f[0].length;return parseInt(f[0],10);};var x=function(a,b,c,d){var e=(v(a,d)?c:b);for(var i=0;i<e.length;i++){if(h.substr(z,e[i].length).toLowerCase()===e[i].toLowerCase()){z+=e[i].length;return i+1;}}throw'Unknown name at position {0}'.replace(/\{0\}/,z);};var y=function(){if(h.charAt(z)!==g.charAt(A)){throw'Unexpected literal at position {0}'.replace(/\{0\}/,z);}z++;};var z=0;for(var A=0;A<g.length;A++){if(u){if(g.charAt(A)==="'"&&!v("'")){u=false;}else{y();}}else{switch(g.charAt(A)){case'd':r=w('d');break;case'D':x('D',l,m);break;case'o':s=w('o');break;case'w':w('w');break;case'm':q=w('m');break;case'M':q=x('M',n,o);break;case'y':var B=A;t=!v('y',2);A=B;p=w('y',2);break;case'@':var C=this._normaliseDate(new Date(w('@')*1000));p=C.getFullYear();q=C.getMonth()+1;r=C.getDate();break;case'!':var C=this._normaliseDate(new Date((w('!')-this._ticksTo1970)/10000));p=C.getFullYear();q=C.getMonth()+1;r=C.getDate();break;case'*':z=h.length;break;case"'":if(v("'")){y();}else{u=true;}break;default:y();}}}if(z<h.length){throw'Additional text found at end';}if(p===-1){p=this.today().getFullYear();}else if(p<100&&t){p+=(k===-1?1900:this.today().getFullYear()-this.today().getFullYear()%100-(p<=k?0:100));}if(s>-1){q=1;r=s;for(var D=this.daysInMonth(p,q);r>D;D=this.daysInMonth(p,q)){q++;r-=D;}}var C=this.newDate(p,q,r);if(C.getFullYear()!==p||C.getMonth()+1!==q||C.getDate()!==r){throw'Invalid date';}return C;},determineDate:function(f,g,h,i,j){if(h&&typeof h!=='object'){j=i;i=h;h=null;}if(typeof i!=='string'){j=i;i='';}var k=function(a){try{return F.parseDate(i,a,j);}catch(e){}a=a.toLowerCase();var b=(a.match(/^c/)&&h?F.newDate(h):null)||F.today();var c=/([+-]?[0-9]+)\s*(d|w|m|y)?/g;var d=null;while(d=c.exec(a)){b=F.add(b,parseInt(d[1],10),d[2]||'d');}return b;};g=(g?F.newDate(g):null);f=(f==null?g:(typeof f==='string'?k(f):(typeof f==='number'?(isNaN(f)||f===Infinity||f===-Infinity?g:F.add(F.today(),f,'d')):F.newDate(f))));return f;},daysInMonth:function(a,b){b=(a.getFullYear?a.getMonth()+1:b);a=(a.getFullYear?a.getFullYear():a);return this.newDate(a,b+1,0).getDate();},dayOfYear:function(a,b,c){var d=(a.getFullYear?a:F.newDate(a,b,c));var e=F.newDate(d.getFullYear(),1,1);return Math.floor((d.getTime()-e.getTime())/F._msPerDay)+1;},iso8601Week:function(a,b,c){var d=(a.getFullYear?new Date(a.getTime()):F.newDate(a,b,c));d.setDate(d.getDate()+4-(d.getDay()||7));var e=d.getTime();d.setMonth(0,1);return Math.floor(Math.round((e-d)/F._msPerDay)/7)+1;},today:function(){return this._normaliseDate(new Date());},newDate:function(a,b,c){return(!a?null:(a.getFullYear?this._normaliseDate(new Date(a.getTime())):new Date(a,b-1,c,12)));},_normaliseDate:function(a){if(a){a.setHours(12,0,0,0);}return a;},year:function(a,b){a.setFullYear(b);return this._normaliseDate(a);},month:function(a,b){a.setMonth(b-1);return this._normaliseDate(a);},day:function(a,b){a.setDate(b);return this._normaliseDate(a);},add:function(a,b,c){if(c==='d'||c==='w'){this._normaliseDate(a);a.setDate(a.getDate()+b*(c==='w'?7:1));}else{var d=a.getFullYear()+(c==='y'?b:0);var e=a.getMonth()+(c==='m'?b:0);a.setTime(F.newDate(d,e+1,Math.min(a.getDate(),this.daysInMonth(d,e+1))).getTime());}return a;},_applyMonthsOffset:function(a,b){var c=b.options.monthsOffset;if($.isFunction(c)){c=c.apply(b.elem[0],[a]);}return F.add(a,-c,'m');},_init:function(){this.defaultOptions.commands=this.commands;this.defaultOptions.calculateWeek=this.iso8601Week;this.regionalOptions[''].renderer=this.defaultRenderer;this._super();},_instSettings:function(b,c){return{selectedDates:[],drawDate:null,pickingRange:false,inline:($.inArray(b[0].nodeName.toLowerCase(),['div','span'])>-1),get:function(a){if($.inArray(a,['defaultDate','minDate','maxDate'])>-1){return F.determineDate(this.options[a],null,this.selectedDates[0],this.options.dateFormat,this.getConfig());}return this.options[a];},curMinDate:function(){return(this.pickingRange?this.selectedDates[0]:this.get('minDate'));},getConfig:function(){return{dayNamesShort:this.options.dayNamesShort,dayNames:this.options.dayNames,monthNamesShort:this.options.monthNamesShort,monthNames:this.options.monthNames,calculateWeek:this.options.calculateWeek,shortYearCutoff:this.options.shortYearCutoff};}};},_postAttach:function(a,b){if(b.inline){b.drawDate=F._checkMinMax(F.newDate(b.selectedDates[0]||b.get('defaultDate')||F.today()),b);b.prevDate=F.newDate(b.drawDate);this._update(a[0]);if($.fn.mousewheel){a.mousewheel(this._doMouseWheel);}}else{this._attachments(a,b);a.on('keydown.'+b.name,this._keyDown).on('keypress.'+b.name,this._keyPress).on('keyup.'+b.name,this._keyUp);if(a.attr('disabled')){this.disable(a[0]);}}},_optionsChanged:function(b,c,d){if(d.calendar&&d.calendar!==c.options.calendar){var e=function(a){return(typeof c.options[a]==='object'?null:c.options[a]);};d=$.extend({defaultDate:e('defaultDate'),minDate:e('minDate'),maxDate:e('maxDate')},d);c.selectedDates=[];c.drawDate=null;}var f=c.selectedDates;$.extend(c.options,d);this.setDate(b[0],f,null,false,true);c.pickingRange=false;c.drawDate=F.newDate(this._checkMinMax((c.options.defaultDate?c.get('defaultDate'):c.drawDate)||c.get('defaultDate')||F.today(),c));if(!c.inline){this._attachments(b,c);}if(c.inline||c.div){this._update(b[0]);}},_attachments:function(a,b){a.off('focus.'+b.name);if(b.options.showOnFocus){a.on('focus.'+b.name,this.show);}if(b.trigger){b.trigger.remove();}var c=b.options.showTrigger;b.trigger=(!c?$([]):$(c).clone().removeAttr('id').addClass(this._triggerClass)[b.options.isRTL?'insertBefore':'insertAfter'](a).click(function(){if(!F.isDisabled(a[0])){F[F.curInst===b?'hide':'show'](a[0]);}}));this._autoSize(a,b);var d=this._extractDates(b,a.val());if(d){this.setDate(a[0],d,null,true);}var e=b.get('defaultDate');if(b.options.selectDefaultDate&&e&&b.selectedDates.length===0){this.setDate(a[0],F.newDate(e||F.today()));}},_autoSize:function(d,e){if(e.options.autoSize&&!e.inline){var f=F.newDate(2009,10,20);var g=e.options.dateFormat;if(g.match(/[DM]/)){var h=function(a){var b=0;var c=0;for(var i=0;i<a.length;i++){if(a[i].length>b){b=a[i].length;c=i;}}return c;};f.setMonth(h(e.options[g.match(/MM/)?'monthNames':'monthNamesShort']));f.setDate(h(e.options[g.match(/DD/)?'dayNames':'dayNamesShort'])+20-f.getDay());}e.elem.attr('size',F.formatDate(g,f,e.getConfig()).length);}},_preDestroy:function(a,b){if(b.trigger){b.trigger.remove();}a.empty().off('.'+b.name);if(b.inline&&$.fn.mousewheel){a.unmousewheel();}if(!b.inline&&b.options.autoSize){a.removeAttr('size');}},multipleEvents:function(b){var c=arguments;return function(a){for(var i=0;i<c.length;i++){c[i].apply(this,arguments);}};},enable:function(b){b=$(b);if(!b.hasClass(this._getMarker())){return;}var c=this._getInst(b);if(c.inline){b.children('.'+this._disableClass).remove().end().find('button,select').prop('disabled',false).end().find('a').attr('href','javascript:void(0)');}else{b.prop('disabled',false);c.trigger.filter('button.'+this._triggerClass).prop('disabled',false).end().filter('img.'+this._triggerClass).css({opacity:'1.0',cursor:''});}this._disabled=$.map(this._disabled,function(a){return(a===b[0]?null:a);});},disable:function(b){b=$(b);if(!b.hasClass(this._getMarker())){return;}var c=this._getInst(b);if(c.inline){var d=b.children(':last');var e=d.offset();var f={left:0,top:0};d.parents().each(function(){if($(this).css('position')==='relative'){f=$(this).offset();return false;}});var g=b.css('zIndex');g=(g==='auto'?0:parseInt(g,10))+1;b.prepend('<div class="'+this._disableClass+'" style="'+'width: '+d.outerWidth()+'px; height: '+d.outerHeight()+'px; left: '+(e.left-f.left)+'px; top: '+(e.top-f.top)+'px; z-index: '+g+'"></div>').find('button,select').prop('disabled',true).end().find('a').removeAttr('href');}else{b.prop('disabled',true);c.trigger.filter('button.'+this._triggerClass).prop('disabled',true).end().filter('img.'+this._triggerClass).css({opacity:'0.5',cursor:'default'});}this._disabled=$.map(this._disabled,function(a){return(a===b[0]?null:a);});this._disabled.push(b[0]);},isDisabled:function(a){return(a&&$.inArray(a,this._disabled)>-1);},show:function(a){a=$(a.target||a);var b=F._getInst(a);if(F.curInst===b){return;}if(F.curInst){F.hide(F.curInst,true);}if(!$.isEmptyObject(b)){b.lastVal=null;b.selectedDates=F._extractDates(b,a.val());b.pickingRange=false;b.drawDate=F._checkMinMax(F.newDate(b.selectedDates[0]||b.get('defaultDate')||F.today()),b);b.prevDate=F.newDate(b.drawDate);F.curInst=b;F._update(a[0],true);var c=F._checkOffset(b);b.div.css({left:c.left,top:c.top});var d=b.options.showAnim;var e=b.options.showSpeed;e=(e==='normal'&&$.ui&&parseInt($.ui.version.substring(2))>=8?'_default':e);if($.effects&&($.effects[d]||($.effects.effect&&$.effects.effect[d]))){var f=b.div.data();for(var g in f){if(g.match(/^ec\.storage\./)){f[g]=b._mainDiv.css(g.replace(/ec\.storage\./,''));}}b.div.data(f).show(d,b.options.showOptions,e);}else{b.div[d||'show'](d?e:0);}}},_extractDates:function(a,b){if(b===a.lastVal){return;}a.lastVal=b;b=b.split(a.options.multiSelect?a.options.multiSeparator:(a.options.rangeSelect?a.options.rangeSeparator:'\x00'));var c=[];for(var i=0;i<b.length;i++){try{var d=F.parseDate(a.options.dateFormat,b[i],a.getConfig());if(d){var f=false;for(var j=0;j<c.length;j++){if(c[j].getTime()===d.getTime()){f=true;break;}}if(!f){c.push(d);}}}catch(e){}}c.splice(a.options.multiSelect||(a.options.rangeSelect?2:1),c.length);if(a.options.rangeSelect&&c.length===1){c[1]=c[0];}return c;},_update:function(a,b){a=$(a.target||a);var c=F._getInst(a);if(!$.isEmptyObject(c)){if(c.inline||F.curInst===c){if($.isFunction(c.options.onChangeMonthYear)&&(!c.prevDate||c.prevDate.getFullYear()!==c.drawDate.getFullYear()||c.prevDate.getMonth()!==c.drawDate.getMonth())){c.options.onChangeMonthYear.apply(a[0],[c.drawDate.getFullYear(),c.drawDate.getMonth()+1]);}}if(c.inline){var d=$('a, :input',a).index($(':focus',a));a.html(this._generateContent(a[0],c));var e=a.find('a, :input');e.eq(Math.max(Math.min(d,e.length-1),0)).focus();}else if(F.curInst===c){if(!c.div){c.div=$('<div></div>').addClass(this._popupClass).css({display:(b?'none':'static'),position:'absolute',left:a.offset().left,top:a.offset().top+a.outerHeight()}).appendTo($(c.options.popupContainer||'body'));if($.fn.mousewheel){c.div.mousewheel(this._doMouseWheel);}}c.div.html(this._generateContent(a[0],c));a.focus();}}},_updateInput:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d='';var e='';var f=(c.options.multiSelect?c.options.multiSeparator:c.options.rangeSeparator);var g=c.options.altFormat||c.options.dateFormat;for(var i=0;i<c.selectedDates.length;i++){d+=(b?'':(i>0?f:'')+F.formatDate(c.options.dateFormat,c.selectedDates[i],c.getConfig()));e+=(i>0?f:'')+F.formatDate(g,c.selectedDates[i],c.getConfig());}if(!c.inline&&!b){$(a).val(d);}$(c.options.altField).val(e);if($.isFunction(c.options.onSelect)&&!b&&!c.inSelect){c.inSelect=true;c.options.onSelect.apply(a,[c.selectedDates]);c.inSelect=false;}}},_getBorders:function(b){var c=function(a){return{thin:1,medium:3,thick:5}[a]||a;};return[parseFloat(c(b.css('border-left-width'))),parseFloat(c(b.css('border-top-width')))];},_checkOffset:function(a){var b=(a.elem.is(':hidden')&&a.trigger?a.trigger:a.elem);var c=b.offset();var d=$(window).width();var e=$(window).height();if(d===0){return c;}var f=false;$(a.elem).parents().each(function(){f|=$(this).css('position')==='fixed';return!f;});var g=document.documentElement.scrollLeft||document.body.scrollLeft;var h=document.documentElement.scrollTop||document.body.scrollTop;var i=c.top-(f?h:0)-a.div.outerHeight();var j=c.top-(f?h:0)+b.outerHeight();var k=c.left-(f?g:0);var l=c.left-(f?g:0)+b.outerWidth()-a.div.outerWidth();var m=(c.left-g+a.div.outerWidth())>d;var n=(c.top-h+a.elem.outerHeight()+a.div.outerHeight())>e;a.div.css('position',f?'fixed':'absolute');var o=a.options.alignment;if(o==='topLeft'){c={left:k,top:i};}else if(o==='topRight'){c={left:l,top:i};}else if(o==='bottomLeft'){c={left:k,top:j};}else if(o==='bottomRight'){c={left:l,top:j};}else if(o==='top'){c={left:(a.options.isRTL||m?l:k),top:i};}else{c={left:(a.options.isRTL||m?l:k),top:(n?i:j)};}c.left=Math.max((f?0:g),c.left);c.top=Math.max((f?0:h),c.top);return c;},_checkExternalClick:function(a){if(!F.curInst){return;}var b=$(a.target);if(b.closest('.'+F._popupClass+',.'+F._triggerClass).length===0&&!b.hasClass(F._getMarker())){F.hide(F.curInst);}},hide:function(a,b){if(!a){return;}var c=this._getInst(a);if($.isEmptyObject(c)){c=a;}if(c&&c===F.curInst){var d=(b?'':c.options.showAnim);var e=c.options.showSpeed;e=(e==='normal'&&$.ui&&parseInt($.ui.version.substring(2))>=8?'_default':e);var f=function(){if(!c.div){return;}c.div.remove();c.div=null;F.curInst=null;if($.isFunction(c.options.onClose)){c.options.onClose.apply(a,[c.selectedDates]);}};c.div.stop();if($.effects&&($.effects[d]||($.effects.effect&&$.effects.effect[d]))){c.div.hide(d,c.options.showOptions,e,f);}else{var g=(d==='slideDown'?'slideUp':(d==='fadeIn'?'fadeOut':'hide'));c.div[g]((d?e:''),f);}if(!d){f();}}},_keyDown:function(a){var b=(a.data&&a.data.elem)||a.target;var c=F._getInst(b);var d=false;if(c.inline||c.div){if(a.keyCode===9){F.hide(b);}else if(a.keyCode===13){F.selectDate(b,$('a.'+c.options.renderer.highlightedClass,c.div)[0]);d=true;}else{var e=c.options.commands;for(var f in e){var g=e[f];if(g.keystroke.keyCode===a.keyCode&&!!g.keystroke.ctrlKey===!!(a.ctrlKey||a.metaKey)&&!!g.keystroke.altKey===a.altKey&&!!g.keystroke.shiftKey===a.shiftKey){F.performAction(b,f);d=true;break;}}}}else{var g=c.options.commands.current;if(g.keystroke.keyCode===a.keyCode&&!!g.keystroke.ctrlKey===!!(a.ctrlKey||a.metaKey)&&!!g.keystroke.altKey===a.altKey&&!!g.keystroke.shiftKey===a.shiftKey){F.show(b);d=true;}}c.ctrlKey=((a.keyCode<48&&a.keyCode!==32)||a.ctrlKey||a.metaKey);if(d){a.preventDefault();a.stopPropagation();}return!d;},_keyPress:function(a){var b=F._getInst((a.data&&a.data.elem)||a.target);if(!$.isEmptyObject(b)&&b.options.constrainInput){var c=String.fromCharCode(a.keyCode||a.charCode);var d=F._allowedChars(b);return(a.metaKey||b.ctrlKey||c<' '||!d||d.indexOf(c)>-1);}return true;},_allowedChars:function(a){var b=(a.options.multiSelect?a.options.multiSeparator:(a.options.rangeSelect?a.options.rangeSeparator:''));var c=false;var d=false;var e=a.options.dateFormat;for(var i=0;i<e.length;i++){var f=e.charAt(i);if(c){if(f==="'"&&e.charAt(i+1)!=="'"){c=false;}else{b+=f;}}else{switch(f){case'd':case'm':case'o':case'w':b+=(d?'':'0123456789');d=true;break;case'y':case'@':case'!':b+=(d?'':'0123456789')+'-';d=true;break;case'J':b+=(d?'':'0123456789')+'-.';d=true;break;case'D':case'M':case'Y':return null;case"'":if(e.charAt(i+1)==="'"){b+="'";}else{c=true;}break;default:b+=f;}}}return b;},_keyUp:function(a){var b=(a.data&&a.data.elem)||a.target;var c=F._getInst(b);if(!$.isEmptyObject(c)&&!c.ctrlKey&&c.lastVal!==c.elem.val()){try{var d=F._extractDates(c,c.elem.val());if(d.length>0){F.setDate(b,d,null,true);}}catch(a){}}return true;},_doMouseWheel:function(a,b){var c=(F.curInst&&F.curInst.elem[0])||$(a.target).closest('.'+F._getMarker())[0];if(F.isDisabled(c)){return;}var d=F._getInst(c);if(d.options.useMouseWheel){b=(b<0?-1:+1);F.changeMonth(c,-d.options[a.ctrlKey?'monthsToJump':'monthsToStep']*b);}a.preventDefault();},clear:function(a){var b=this._getInst(a);if(!$.isEmptyObject(b)){b.selectedDates=[];this.hide(a);var c=b.get('defaultDate');if(b.options.selectDefaultDate&&c){this.setDate(a,F.newDate(c||F.today()));}else{this._updateInput(a);}}},getDate:function(a){var b=this._getInst(a);return(!$.isEmptyObject(b)?b.selectedDates:[]);},setDate:function(a,b,c,d,e){var f=this._getInst(a);if(!$.isEmptyObject(f)){if(!$.isArray(b)){b=[b];if(c){b.push(c);}}var g=f.get('minDate');var h=f.get('maxDate');var k=f.selectedDates[0];f.selectedDates=[];for(var i=0;i<b.length;i++){var l=F.determineDate(b[i],null,k,f.options.dateFormat,f.getConfig());if(l){if((!g||l.getTime()>=g.getTime())&&(!h||l.getTime()<=h.getTime())){var m=false;for(var j=0;j<f.selectedDates.length;j++){if(f.selectedDates[j].getTime()===l.getTime()){m=true;break;}}if(!m){f.selectedDates.push(l);}}}}f.selectedDates.splice(f.options.multiSelect||(f.options.rangeSelect?2:1),f.selectedDates.length);if(f.options.rangeSelect){switch(f.selectedDates.length){case 1:f.selectedDates[1]=f.selectedDates[0];break;case 2:f.selectedDates[1]=(f.selectedDates[0].getTime()>f.selectedDates[1].getTime()?f.selectedDates[0]:f.selectedDates[1]);break;}f.pickingRange=false;}f.prevDate=(f.drawDate?F.newDate(f.drawDate):null);f.drawDate=this._checkMinMax(F.newDate(f.selectedDates[0]||f.get('defaultDate')||F.today()),f);if(!e){this._update(a);this._updateInput(a,d);}}},isSelectable:function(a,b){var c=this._getInst(a);if($.isEmptyObject(c)){return false;}b=F.determineDate(b,c.selectedDates[0]||this.today(),null,c.options.dateFormat,c.getConfig());return this._isSelectable(a,b,c.options.onDate,c.get('minDate'),c.get('maxDate'));},_isSelectable:function(a,b,c,d,e){var f=(typeof c==='boolean'?{selectable:c}:(!$.isFunction(c)?{}:c.apply(a,[b,true])));return(f.selectable!==false)&&(!d||b.getTime()>=d.getTime())&&(!e||b.getTime()<=e.getTime());},performAction:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)&&!this.isDisabled(a)){var d=c.options.commands;if(d[b]&&d[b].enabled.apply(a,[c])){d[b].action.apply(a,[c]);}}},showMonth:function(a,b,c,d){var e=this._getInst(a);if(!$.isEmptyObject(e)&&(d!=null||(e.drawDate.getFullYear()!==b||e.drawDate.getMonth()+1!==c))){e.prevDate=F.newDate(e.drawDate);var f=this._checkMinMax((b!=null?F.newDate(b,c,1):F.today()),e);e.drawDate=F.newDate(f.getFullYear(),f.getMonth()+1,(d!=null?d:Math.min(e.drawDate.getDate(),F.daysInMonth(f.getFullYear(),f.getMonth()+1))));this._update(a);}},changeMonth:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d=F.add(F.newDate(c.drawDate),b,'m');this.showMonth(a,d.getFullYear(),d.getMonth()+1);}},changeDay:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d=F.add(F.newDate(c.drawDate),b,'d');this.showMonth(a,d.getFullYear(),d.getMonth()+1,d.getDate());}},_checkMinMax:function(a,b){var c=b.get('minDate');var d=b.get('maxDate');a=(c&&a.getTime()<c.getTime()?F.newDate(c):a);a=(d&&a.getTime()>d.getTime()?F.newDate(d):a);return a;},retrieveDate:function(a,b){var c=this._getInst(a);return($.isEmptyObject(c)?null:this._normaliseDate(new Date(parseInt(b.className.replace(/^.*dp(-?\d+).*$/,'$1'),10))));},selectDate:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)&&!this.isDisabled(a)){var d=this.retrieveDate(a,b);if(c.options.multiSelect){var e=false;for(var i=0;i<c.selectedDates.length;i++){if(d.getTime()===c.selectedDates[i].getTime()){c.selectedDates.splice(i,1);e=true;break;}}if(!e&&c.selectedDates.length<c.options.multiSelect){c.selectedDates.push(d);}}else if(c.options.rangeSelect){if(c.pickingRange){c.selectedDates[1]=d;}else{c.selectedDates=[d,d];}c.pickingRange=!c.pickingRange;}else{c.selectedDates=[d];}c.prevDate=c.drawDate=F.newDate(d);this._updateInput(a);if(c.inline||c.pickingRange||c.selectedDates.length<(c.options.multiSelect||(c.options.rangeSelect?2:1))){this._update(a);}else{this.hide(a);}}},_generateContent:function(h,i){var j=i.options.monthsToShow;j=($.isArray(j)?j:[1,j]);i.drawDate=this._checkMinMax(i.drawDate||i.get('defaultDate')||F.today(),i);var k=F._applyMonthsOffset(F.newDate(i.drawDate),i);var l='';for(var m=0;m<j[0];m++){var n='';for(var o=0;o<j[1];o++){n+=this._generateMonth(h,i,k.getFullYear(),k.getMonth()+1,i.options.renderer,(m===0&&o===0));F.add(k,1,'m');}l+=this._prepare(i.options.renderer.monthRow,i).replace(/\{months\}/,n);}var p=this._prepare(i.options.renderer.picker,i).replace(/\{months\}/,l).replace(/\{weekHeader\}/g,this._generateDayHeaders(i,i.options.renderer));var q=function(a,b,c,d,e){if(p.indexOf('{'+a+':'+d+'}')===-1){return;}var f=i.options.commands[d];var g=(i.options.commandsAsDateFormat?f.date.apply(h,[i]):null);p=p.replace(new RegExp('\\{'+a+':'+d+'\\}','g'),'<'+b+(f.status?' title="'+i.options[f.status]+'"':'')+' class="'+i.options.renderer.commandClass+' '+i.options.renderer.commandClass+'-'+d+' '+e+(f.enabled(i)?'':' '+i.options.renderer.disabledClass)+'">'+(g?F.formatDate(i.options[f.text],g,i.getConfig()):i.options[f.text])+'</'+c+'>');};for(var r in i.options.commands){q('button','button type="button"','button',r,i.options.renderer.commandButtonClass);q('link','a href="javascript:void(0)"','a',r,i.options.renderer.commandLinkClass);}p=$(p);if(j[1]>1){var s=0;$(i.options.renderer.monthSelector,p).each(function(){var a=++s%j[1];$(this).addClass(a===1?'first':(a===0?'last':''));});}var t=this;function removeHighlight(){(i.inline?$(this).closest('.'+t._getMarker()):i.div).find(i.options.renderer.daySelector+' a').removeClass(i.options.renderer.highlightedClass);}p.find(i.options.renderer.daySelector+' a').hover(function(){removeHighlight.apply(this);$(this).addClass(i.options.renderer.highlightedClass);},removeHighlight).click(function(){t.selectDate(h,this);}).end().find('select.'+this._monthYearClass+':not(.'+this._anyYearClass+')').change(function(){var a=$(this).val().split('/');t.showMonth(h,parseInt(a[1],10),parseInt(a[0],10));}).end().find('select.'+this._anyYearClass).click(function(){$(this).css('visibility','hidden').next('input').css({left:this.offsetLeft,top:this.offsetTop,width:this.offsetWidth,height:this.offsetHeight}).show().focus();}).end().find('input.'+t._monthYearClass).change(function(){try{var a=parseInt($(this).val(),10);a=(isNaN(a)?i.drawDate.getFullYear():a);t.showMonth(h,a,i.drawDate.getMonth()+1,i.drawDate.getDate());}catch(e){alert(e);}}).keydown(function(a){if(a.keyCode===13){$(a.elem).change();}else if(a.keyCode===27){$(a.elem).hide().prev('select').css('visibility','visible');i.elem.focus();}});var u={elem:i.elem[0]};p.keydown(u,this._keyDown).keypress(u,this._keyPress).keyup(u,this._keyUp);p.find('.'+i.options.renderer.commandClass).click(function(){if(!$(this).hasClass(i.options.renderer.disabledClass)){var a=this.className.replace(new RegExp('^.*'+i.options.renderer.commandClass+'-([^ ]+).*$'),'$1');F.performAction(h,a);}});if(i.options.isRTL){p.addClass(i.options.renderer.rtlClass);}if(j[0]*j[1]>1){p.addClass(i.options.renderer.multiClass);}if(i.options.pickerClass){p.addClass(i.options.pickerClass);}$('body').append(p);var v=0;p.find(i.options.renderer.monthSelector).each(function(){v+=$(this).outerWidth();});p.width(v/j[0]);if($.isFunction(i.options.onShow)){i.options.onShow.apply(h,[p,i]);}return p;},_generateMonth:function(a,b,c,d,e,f){var g=F.daysInMonth(c,d);var h=b.options.monthsToShow;h=($.isArray(h)?h:[1,h]);var j=b.options.fixedWeeks||(h[0]*h[1]>1);var k=b.options.firstDay;var l=(F.newDate(c,d,1).getDay()-k+7)%7;var m=(j?6:Math.ceil((l+g)/7));var n=b.options.selectOtherMonths&&b.options.showOtherMonths;var o=(b.pickingRange?b.selectedDates[0]:b.get('minDate'));var p=b.get('maxDate');var q=e.week.indexOf('{weekOfYear}')>-1;var r=F.today();var s=F.newDate(c,d,1);F.add(s,-l-(j&&(s.getDay()===k)?7:0),'d');var t=s.getTime();var u='';for(var v=0;v<m;v++){var w=(!q?'':'<span class="dp'+t+'">'+($.isFunction(b.options.calculateWeek)?b.options.calculateWeek(s):0)+'</span>');var x='';for(var y=0;y<7;y++){var z=false;if(b.options.rangeSelect&&b.selectedDates.length>0){z=(s.getTime()>=b.selectedDates[0]&&s.getTime()<=b.selectedDates[1]);}else{for(var i=0;i<b.selectedDates.length;i++){if(b.selectedDates[i].getTime()===s.getTime()){z=true;break;}}}var A=(!$.isFunction(b.options.onDate)?{}:b.options.onDate.apply(a,[s,s.getMonth()+1===d]));var B=(n||s.getMonth()+1===d)&&this._isSelectable(a,s,A.selectable,o,p);x+=this._prepare(e.day,b).replace(/\{day\}/g,(B?'<a href="javascript:void(0)"':'<span')+' class="dp'+t+' '+(A.dateClass||'')+(z&&(n||s.getMonth()+1===d)?' '+e.selectedClass:'')+(B?' '+e.defaultClass:'')+((s.getDay()||7)<6?'':' '+e.weekendClass)+(s.getMonth()+1===d?'':' '+e.otherMonthClass)+(s.getTime()===r.getTime()&&(s.getMonth()+1)===d?' '+e.todayClass:'')+(s.getTime()===b.drawDate.getTime()&&(s.getMonth()+1)===d?' '+e.highlightedClass:'')+'"'+(A.title||(b.options.dayStatus&&B)?' title="'+(A.title||F.formatDate(b.options.dayStatus,s,b.getConfig()))+'"':'')+'>'+(b.options.showOtherMonths||(s.getMonth()+1)===d?A.content||s.getDate():'&#160;')+(B?'</a>':'</span>'));F.add(s,1,'d');t=s.getTime();}u+=this._prepare(e.week,b).replace(/\{days\}/g,x).replace(/\{weekOfYear\}/g,w);}var C=this._prepare(e.month,b).match(/\{monthHeader(:[^\}]+)?\}/);C=(C[0].length<=13?'MM yyyy':C[0].substring(13,C[0].length-1));C=(f?this._generateMonthSelection(b,c,d,o,p,C,e):F.formatDate(C,F.newDate(c,d,1),b.getConfig()));var D=this._prepare(e.weekHeader,b).replace(/\{days\}/g,this._generateDayHeaders(b,e));return this._prepare(e.month,b).replace(/\{monthHeader(:[^\}]+)?\}/g,C).replace(/\{weekHeader\}/g,D).replace(/\{weeks\}/g,u);},_generateDayHeaders:function(a,b){var c='';for(var d=0;d<7;d++){var e=(d+a.options.firstDay)%7;c+=this._prepare(b.dayHeader,a).replace(/\{day\}/g,'<span class="'+this._curDoWClass+e+'" title="'+a.options.dayNames[e]+'">'+a.options.dayNamesMin[e]+'</span>');}return c;},_generateMonthSelection:function(b,c,d,e,f,g){if(!b.options.changeMonth){return F.formatDate(g,F.newDate(c,d,1),b.getConfig());}var h=b.options['monthNames'+(g.match(/mm/i)?'':'Short')];var i=g.replace(/m+/i,'\\x2E').replace(/y+/i,'\\x2F');var j='<select class="'+this._monthYearClass+'" title="'+b.options.monthStatus+'">';for(var m=1;m<=12;m++){if((!e||F.newDate(c,m,F.daysInMonth(c,m)).getTime()>=e.getTime())&&(!f||F.newDate(c,m,1).getTime()<=f.getTime())){j+='<option value="'+m+'/'+c+'"'+(d===m?' selected="selected"':'')+'>'+h[m-1]+'</option>';}}j+='</select>';i=i.replace(/\\x2E/,j);var k=b.options.yearRange;if(k==='any'){j='<select class="'+this._monthYearClass+' '+this._anyYearClass+'" title="'+b.options.yearStatus+'">'+'<option>'+c+'</option></select>'+'<input class="'+this._monthYearClass+' '+this._curMonthClass+d+'" value="'+c+'">';}else{k=k.split(':');var l=F.today().getFullYear();var n=(k[0].match('c[+-].*')?c+parseInt(k[0].substring(1),10):((k[0].match('[+-].*')?l:0)+parseInt(k[0],10)));var o=(k[1].match('c[+-].*')?c+parseInt(k[1].substring(1),10):((k[1].match('[+-].*')?l:0)+parseInt(k[1],10)));j='<select class="'+this._monthYearClass+'" title="'+b.options.yearStatus+'">';n=F.add(F.newDate(n+1,1,1),-1,'d');o=F.newDate(o,1,1);var p=function(y,a){if(y!==0){j+='<option value="'+d+'/'+y+'"'+(c===y?' selected="selected"':'')+'>'+(a||y)+'</option>';}};if(n.getTime()<o.getTime()){n=(e&&e.getTime()>n.getTime()?e:n).getFullYear();o=(f&&f.getTime()<o.getTime()?f:o).getFullYear();var q=Math.floor((o-n)/2);if(!e||e.getFullYear()<n){p(n-q,b.options.earlierText);}for(var y=n;y<=o;y++){p(y);}if(!f||f.getFullYear()>o){p(o+q,b.options.laterText);}}else{n=(f&&f.getTime()<n.getTime()?f:n).getFullYear();o=(e&&e.getTime()>o.getTime()?e:o).getFullYear();var q=Math.floor((n-o)/2);if(!f||f.getFullYear()>n){p(n+q,b.options.earlierText);}for(var y=n;y>=o;y--){p(y);}if(!e||e.getFullYear()<o){p(o-q,b.options.laterText);}}j+='</select>';}i=i.replace(/\\x2F/,j);return i;},_prepare:function(e,f){var g=function(a,b){while(true){var c=e.indexOf('{'+a+':start}');if(c===-1){return;}var d=e.substring(c).indexOf('{'+a+':end}');if(d>-1){e=e.substring(0,c)+(b?e.substr(c+a.length+8,d-a.length-8):'')+e.substring(c+d+a.length+6);}}};g('inline',f.inline);g('popup',!f.inline);var h=/\{l10n:([^\}]+)\}/;var i=null;while(i=h.exec(e)){e=e.replace(i[0],f.options[i[1]]);}return e;}});var F=$.datepick;$(function(){$(document).on('mousedown.'+E,F._checkExternalClick).on('resize.'+E,function(){F.hide(F.curInst)})})})(jQuery);
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/js/jquery.min.js cahier-de-prepa6.0.0/js/jquery.min.js
--- cahier-de-prepa5.1.0/js/jquery.min.js	2015-07-15 00:41:18.463612974 +0200
+++ cahier-de-prepa6.0.0/js/jquery.min.js	2016-07-21 11:28:38.874197523 +0200
@@ -1,5 +1,4 @@
-/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
-
-return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){
-return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
+/*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */
+!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?a<0?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e)}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,
+r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:X.test(c)?JSON.parse(c):c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),Z(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=Z(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,_=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),aa=["Top","Right","Bottom","Left"],ba=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ca=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function da(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&_.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ea={};function fa(a){var b,c=a.ownerDocument,d=a.nodeName,e=ea[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ea[d]=e,e)}function ga(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ba(d)&&(e[f]=fa(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ga(this,!0)},hide:function(){return ga(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ba(this)?r(this).show():r(this).hide()})}});var ha=/^(?:checkbox|radio)$/i,ia=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var na=/<|&#?\w+;/;function oa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(na.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ia.exec(f)||["",""])[1].toLowerCase(),i=ka[h]||ka._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;c<h;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?r(e,this).index(i)>-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==va()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===va()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ta:ua,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:ua,isPropagationStopped:ua,isImmediatePropagationStopped:ua,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ta,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ta,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ta,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&qa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ra.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return wa(this,a,b,c,d)},one:function(a,b,c,d){return wa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ua),this.each(function(){r.event.remove(this,a,c,b)})}});var xa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/<script|<style|<link/i,za=/checked\s*(?:[^=]|=\s*.checked.)/i,Aa=/^true\/(.*)/,Ba=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ga(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ha.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ha(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,la(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ea),l=0;l<i;l++)j=h[l],ja.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ba,""),k))}return a}function Ia(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(la(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&ma(la(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(xa,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);if(b)if(c)for(f=f||la(a),g=g||la(h),d=0,e=f.length;d<e;d++)Fa(f[d],g[d]);else Fa(a,h);return g=la(h,"script"),g.length>0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(la(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(la(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ja=/^margin/,Ka=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),La=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",pa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,pa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Ma(a,b,c){var d,e,f,g,h=a.style;return c=c||La(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ka.test(g)&&Ja.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Na(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Oa=/^(none|table(?!-c[ea]).+)/,Pa={position:"absolute",visibility:"hidden",display:"block"},Qa={letterSpacing:"0",fontWeight:"400"},Ra=["Webkit","Moz","ms"],Sa=d.createElement("div").style;function Ta(a){if(a in Sa)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ra.length;while(c--)if(a=Ra[c]+b,a in Sa)return a}function Ua(a,b,c){var d=_.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Va(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+aa[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+aa[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+aa[f]+"Width",!0,e))):(g+=r.css(a,"padding"+aa[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+aa[f]+"Width",!0,e)));return g}function Wa(a,b,c){var d,e=!0,f=La(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Ma(a,b,f),(d<0||null==d)&&(d=a.style[b]),Ka.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Va(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ma(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=_.exec(c))&&e[1]&&(c=da(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Ma(a,b,d)),"normal"===e&&b in Qa&&(e=Qa[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Oa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Wa(a,b,d):ca(a,Pa,function(){return Wa(a,b,d)})},set:function(a,c,d){var e,f=d&&La(a),g=d&&Va(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=_.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ua(a,c,g)}}}),r.cssHooks.marginLeft=Na(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Ma(a,"marginLeft"))||a.getBoundingClientRect().left-ca(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+aa[d]+b]=f[d]||f[d-2]||f[0];return e}},Ja.test(a)||(r.cssHooks[a+b].set=Ua)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=La(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function eb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ba(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],$a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ga([a],!0),j=a.style.display||j,k=r.css(a,"display"),ga([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ga([a],!0),m.done(function(){p||ga([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=db(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function fb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function gb(a,b,c){var d,e,f=0,g=gb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||bb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Ya||bb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(fb(k,j.opts.specialEasing);f<g;f++)if(d=gb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,db,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(gb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return da(c.elem,a,_.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],gb.tweeners[c]=gb.tweeners[c]||[],gb.tweeners[c].unshift(b)},prefilters:[eb],prefilter:function(a,b){b?gb.prefilters.unshift(a):gb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:e.duration="number"==typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default,null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ba).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=gb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(cb(b,!0),a,d,e)}}),r.each({slideDown:cb("show"),slideUp:cb("hide"),slideToggle:cb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Ya=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Ya=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){Za||(Za=a.requestAnimationFrame?a.requestAnimationFrame(ab):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame(Za):a.clearInterval(Za),Za=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var hb,ib=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);
+if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i<h;i++)if(c=d[i],(c.selected||i===e)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=oa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=r.trim(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||pa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Na(o.pixelPosition,function(a,c){if(c)return c=Ma(a,b),Ka.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r});
diff -urN cahier-de-prepa5.1.0/js/jquery.plugin.js cahier-de-prepa6.0.0/js/jquery.plugin.js
--- cahier-de-prepa5.1.0/js/jquery.plugin.js	2015-08-22 03:59:45.648566064 +0200
+++ cahier-de-prepa6.0.0/js/jquery.plugin.js	1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-﻿/** Abstract base class for collection plugins v1.0.1.
-	Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
-	Licensed under the MIT (http://keith-wood.name/licence.html) license. */
-(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery);
\ No newline at end of file
diff -urN cahier-de-prepa5.1.0/js/jquery.timeentry-fr.js cahier-de-prepa6.0.0/js/jquery.timeentry-fr.js
--- cahier-de-prepa5.1.0/js/jquery.timeentry-fr.js	2015-08-22 03:33:26.583353116 +0200
+++ cahier-de-prepa6.0.0/js/jquery.timeentry-fr.js	1970-01-01 01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-﻿/* http://keith-wood.name/timeEntry.html
-   French initialisation for the jQuery time entry extension
-   Written by Keith Wood (kbwood@iprimus.com.au) June 2007. */
-(function($) {
-	$.timeEntry.regionalOptions['fr'] = {show24Hours: true, separator: ':',
-		ampmPrefix: '', ampmNames: ['AM', 'PM'],
-		spinnerTexts: ['Maintenant', 'Précédent', 'Suivant', 'Augmenter', 'Diminuer']};
-	$.timeEntry.setDefaults($.timeEntry.regionalOptions['fr']);
-})(jQuery);
diff -urN cahier-de-prepa5.1.0/js/jquery.timeentry.js cahier-de-prepa6.0.0/js/jquery.timeentry.js
--- cahier-de-prepa5.1.0/js/jquery.timeentry.js	2015-08-22 03:33:25.759367173 +0200
+++ cahier-de-prepa6.0.0/js/jquery.timeentry.js	1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-/* http://keith-wood.name/timeEntry.html
-   Time entry for jQuery v2.0.1.
-   Written by Keith Wood (kbwood{at}iinet.com.au) June 2007.
-   Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
-   Please attribute the author if you use it. */
-(function($){var n='timeEntry';$.JQPlugin.createPlugin({name:n,defaultOptions:{appendText:'',showSeconds:false,unlimitedHours:false,timeSteps:[1,1,1],initialField:null,noSeparatorEntry:false,tabToExit:false,useMouseWheel:true,defaultTime:null,minTime:null,maxTime:null,spinnerImage:'spinnerDefault.png',spinnerSize:[20,20,8],spinnerBigImage:'',spinnerBigSize:[40,40,16],spinnerIncDecOnly:false,spinnerRepeat:[500,250],beforeShow:null,beforeSetTime:null},regionalOptions:{'':{show24Hours:false,separator:':',ampmPrefix:'',ampmNames:['AM','PM'],spinnerTexts:['Now','Previous field','Next field','Increment','Decrement']}},_getters:['getOffset','getTime','isDisabled'],_appendClass:n+'-append',_controlClass:n+'-control',_expandClass:n+'-expand',_disabledInputs:[],_instSettings:function(a,b){return{_field:0,_selectedHour:0,_selectedMinute:0,_selectedSecond:0}},_postAttach:function(b,c){b.on('focus.'+c.name,this._doFocus).on('blur.'+c.name,this._doBlur).on('click.'+c.name,this._doClick).on('keydown.'+c.name,this._doKeyDown).on('keypress.'+c.name,this._doKeyPress).on('paste.'+c.name,function(a){setTimeout(function(){o._parseTime(c)},1)})},_optionsChanged:function(a,b,c){var d=this._extractTime(b);$.extend(b.options,c);b.options.show24Hours=b.options.show24Hours||b.options.unlimitedHours;b._field=0;if(d){this._setTime(b,new Date(0,0,0,d[0],d[1],d[2]))}a.next('span.'+this._appendClass).remove();a.parent().find('span.'+this._controlClass).remove();if($.fn.mousewheel){a.unmousewheel()}var e=(!b.options.spinnerImage?null:$('<span class="'+this._controlClass+'" style="display: inline-block; '+'background: url(\''+b.options.spinnerImage+'\') 0 0 no-repeat; width: '+b.options.spinnerSize[0]+'px; height: '+b.options.spinnerSize[1]+'px;"></span>'));a.after(b.options.appendText?'<span class="'+this._appendClass+'">'+b.options.appendText+'</span>':'').after(e||'');if(b.options.useMouseWheel&&$.fn.mousewheel){a.mousewheel(this._doMouseWheel)}if(e){e.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseover(this._expandSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner)}},enable:function(a){this._enableDisable(a,false)},disable:function(a){this._enableDisable(a,true)},_enableDisable:function(b,c){var d=this._getInst(b);if(!d){return}b.disabled=c;if(b.nextSibling&&b.nextSibling.nodeName.toLowerCase()==='span'){this._changeSpinner(d,b.nextSibling,(c?5:-1))}this._disabledInputs=$.map(this._disabledInputs,function(a){return(a===b?null:a)});if(c){this._disabledInputs.push(b)}},isDisabled:function(a){return $.inArray(a,this._disabledInputs)>-1},_preDestroy:function(b,c){b=$(b).off('.'+n);if($.fn.mousewheel){b.unmousewheel()}this._disabledInputs=$.map(this._disabledInputs,function(a){return(a===b[0]?null:a)});b.siblings('.'+this._appendClass+',.'+this._controlClass).remove()},setTime:function(a,b){var c=this._getInst(a);if(c){if(b===null||b===''){$(a).val('')}else{this._setTime(c,b?($.isArray(b)?b:(typeof b==='object'?new Date(b.getTime()):b)):null)}}},getTime:function(a){var b=this._getInst(a);var c=(b?this._extractTime(b):null);return(!c?null:new Date(0,0,0,c[0],c[1],c[2]))},getOffset:function(a){var b=this._getInst(a);var c=(b?this._extractTime(b):null);return(!c?0:(c[0]*3600+c[1]*60+c[2])*1000)},_doFocus:function(a){var b=(a.nodeName&&a.nodeName.toLowerCase()==='input'?a:this);if(o._lastInput===b||o.isDisabled(b)){o._focussed=false;return}var c=o._getInst(b);o._focussed=true;o._lastInput=b;o._blurredInput=null;$.extend(c.options,($.isFunction(c.options.beforeShow)?c.options.beforeShow.apply(b,[b]):{}));o._parseTime(c,a.nodeName?null:a);setTimeout(function(){o._showField(c)},10)},_doBlur:function(a){o._blurredInput=o._lastInput;o._lastInput=null},_doClick:function(a){var b=a.target;var c=o._getInst(b);var d=c._field;if(!o._focussed){c._field=o._getSelection(c,b,a)}if(d!==c._field){c._lastChr=''}o._showField(c);o._focussed=false},_getSelection:function(b,c,d){var e=0;var f=[b.elem.val().split(b.options.separator)[0].length,2,2];if(c.selectionStart!==null){var g=0;for(var h=0;h<=Math.max(1,b._secondField,b._ampmField);h++){g+=(h!==b._ampmField?f[h]+b.options.separator.length:b.options.ampmPrefix.length+b.options.ampmNames[0].length);e=h;if(c.selectionStart<g){break}}}else if(c.createTextRange&&d!=null){var i=$(d.srcElement);var j=c.createTextRange();var k=function(a){return{thin:2,medium:4,thick:6}[a]||a};var l=d.clientX+document.documentElement.scrollLeft-(i.offset().left+parseInt(k(i.css('border-left-width')),10))-j.offsetLeft;for(var h=0;h<=Math.max(1,b._secondField,b._ampmField);h++){var g=(h!==b._ampmField?(h*fieldSize)+2:(b._ampmField*fieldSize)+b.options.ampmPrefix.length+b.options.ampmNames[0].length);j.collapse();j.moveEnd('character',g);e=h;if(l<j.boundingWidth){break}}}return e},_doKeyDown:function(a){if(a.keyCode>=48){return true}var b=o._getInst(a.target);switch(a.keyCode){case 9:return(b.options.tabToExit?true:(a.shiftKey?o._changeField(b,-1,true):o._changeField(b,+1,true)));case 35:if(a.ctrlKey){o._setValue(b,'')}else{b._field=Math.max(1,b._secondField,b._ampmField);o._adjustField(b,0)}break;case 36:if(a.ctrlKey){o._setTime(b)}else{b._field=0;o._adjustField(b,0)}break;case 37:o._changeField(b,-1,false);break;case 38:o._adjustField(b,+1);break;case 39:o._changeField(b,+1,false);break;case 40:o._adjustField(b,-1);break;case 46:o._setValue(b,'');break;case 8:b._lastChr='';default:return true}return false},_doKeyPress:function(a){var b=String.fromCharCode(a.charCode===undefined?a.keyCode:a.charCode);if(b<' '){return true}var c=o._getInst(a.target);o._handleKeyPress(c,b);return false},_handleKeyPress:function(a,b){if(b===a.options.separator){this._changeField(a,+1,false)}else if(b>='0'&&b<='9'){var c=parseInt(b,10);var d=parseInt(a._lastChr+b,10);var e=(a._field!==0?a._selectedHour:(a.options.unlimitedHours?d:(a.options.show24Hours?(d<24?d:c):(d>=1&&d<=12?d:(c>0?c:a._selectedHour))%12+(a._selectedHour>=12?12:0))));var f=(a._field!==1?a._selectedMinute:(d<60?d:c));var g=(a._field!==a._secondField?a._selectedSecond:(d<60?d:c));var h=this._constrainTime(a,[e,f,g]);this._setTime(a,(a.options.unlimitedHours?h:new Date(0,0,0,h[0],h[1],h[2])));if(a.options.noSeparatorEntry&&a._lastChr){this._changeField(a,+1,false)}else{a._lastChr=(a.options.unlimitedHours&&a._field===0?a._lastChr+b:b)}}else if(!a.options.show24Hours){b=b.toLowerCase();if((b===a.options.ampmNames[0].substring(0,1).toLowerCase()&&a._selectedHour>=12)||(b===a.options.ampmNames[1].substring(0,1).toLowerCase()&&a._selectedHour<12)){var i=a._field;a._field=a._ampmField;this._adjustField(a,+1);a._field=i;this._showField(a)}}},_doMouseWheel:function(a,b){if(o.isDisabled(a.target)){return}var c=o._getInst(a.target);c.elem.focus();if(!c.elem.val()){o._parseTime(c)}o._adjustField(c,b);a.preventDefault()},_expandSpinner:function(b){var c=o._getSpinnerTarget(b);var d=o._getInst(o._getInput(c));if(o.isDisabled(d.elem[0])){return}if(d.options.spinnerBigImage){d._expanded=true;var e=$(c).offset();var f=null;$(c).parents().each(function(){var a=$(this);if(a.css('position')==='relative'||a.css('position')==='absolute'){f=a.offset()}return!f});$('<div class="'+o._expandClass+'" style="position: absolute; left: '+(e.left-(d.options.spinnerBigSize[0]-d.options.spinnerSize[0])/2-(f?f.left:0))+'px; top: '+(e.top-(d.options.spinnerBigSize[1]-d.options.spinnerSize[1])/2-(f?f.top:0))+'px; width: '+d.options.spinnerBigSize[0]+'px; height: '+d.options.spinnerBigSize[1]+'px; background: transparent url('+d.options.spinnerBigImage+') no-repeat 0px 0px; z-index: 10;"></div>').mousedown(o._handleSpinner).mouseup(o._endSpinner).mouseout(o._endExpand).mousemove(o._describeSpinner).insertAfter(c)}},_getInput:function(a){return $(a).siblings('.'+this._getMarker())[0]},_describeSpinner:function(a){var b=o._getSpinnerTarget(a);var c=o._getInst(o._getInput(b));b.title=c.options.spinnerTexts[o._getSpinnerRegion(c,a)]},_handleSpinner:function(a){var b=o._getSpinnerTarget(a);var c=o._getInput(b);if(o.isDisabled(c)){return}if(c===o._blurredInput){o._lastInput=c;o._blurredInput=null}var d=o._getInst(c);o._doFocus(c);var e=o._getSpinnerRegion(d,a);o._changeSpinner(d,b,e);o._actionSpinner(d,e);o._timer=null;o._handlingSpinner=true;if(e>=3&&d.options.spinnerRepeat[0]){o._timer=setTimeout(function(){o._repeatSpinner(d,e)},d.options.spinnerRepeat[0]);$(b).one('mouseout',o._releaseSpinner).one('mouseup',o._releaseSpinner)}},_actionSpinner:function(a,b){if(!a.elem.val()){o._parseTime(a)}switch(b){case 0:this._setTime(a);break;case 1:this._changeField(a,-1,false);break;case 2:this._changeField(a,+1,false);break;case 3:this._adjustField(a,+1);break;case 4:this._adjustField(a,-1);break}},_repeatSpinner:function(a,b){if(!o._timer){return}o._lastInput=o._blurredInput;this._actionSpinner(a,b);this._timer=setTimeout(function(){o._repeatSpinner(a,b)},a.options.spinnerRepeat[1])},_releaseSpinner:function(a){clearTimeout(o._timer);o._timer=null},_endExpand:function(a){o._timer=null;var b=o._getSpinnerTarget(a);var c=o._getInput(b);var d=o._getInst(c);$(b).remove();d._expanded=false},_endSpinner:function(a){o._timer=null;var b=o._getSpinnerTarget(a);var c=o._getInput(b);var d=o._getInst(c);if(!o.isDisabled(c)){o._changeSpinner(d,b,-1)}if(o._handlingSpinner){o._lastInput=o._blurredInput}if(o._lastInput&&o._handlingSpinner){o._showField(d)}o._handlingSpinner=false},_getSpinnerTarget:function(a){return a.target||a.srcElement},_getSpinnerRegion:function(a,b){var c=this._getSpinnerTarget(b);var d=$(c).offset();var e=[document.documentElement.scrollLeft||document.body.scrollLeft,document.documentElement.scrollTop||document.body.scrollTop];var f=(a.options.spinnerIncDecOnly?99:b.clientX+e[0]-d.left);var g=b.clientY+e[1]-d.top;var h=a.options[a._expanded?'spinnerBigSize':'spinnerSize'];var i=(a.options.spinnerIncDecOnly?99:h[0]-1-f);var j=h[1]-1-g;if(h[2]>0&&Math.abs(f-i)<=h[2]&&Math.abs(g-j)<=h[2]){return 0}var k=Math.min(f,g,i,j);return(k===f?1:(k===i?2:(k===g?3:4)))},_changeSpinner:function(a,b,c){$(b).css('background-position','-'+((c+1)*a.options[a._expanded?'spinnerBigSize':'spinnerSize'][0])+'px 0px')},_parseTime:function(a,b){var c=this._extractTime(a);if(c){a._selectedHour=c[0];a._selectedMinute=c[1];a._selectedSecond=c[2]}else{var d=this._constrainTime(a);a._selectedHour=d[0];a._selectedMinute=d[1];a._selectedSecond=(a.options.showSeconds?d[2]:0)}a._secondField=(a.options.showSeconds?2:-1);a._ampmField=(a.options.show24Hours?-1:(a.options.showSeconds?3:2));a._lastChr='';var e=function(){if(a.elem.val()!==''){o._showTime(a)}};if(typeof a.options.initialField==='number'){a._field=Math.max(0,Math.min(Math.max(1,a._secondField,a._ampmField),a.options.initialField));e()}else{setTimeout(function(){a._field=o._getSelection(a,a.elem[0],b);e()},0)}},_extractTime:function(a,b){b=b||a.elem.val();var c=b.split(a.options.separator);if(a.options.separator===''&&b!==''){c[0]=b.substring(0,2);c[1]=b.substring(2,4);c[2]=b.substring(4,6)}if(c.length>=2){var d=!a.options.show24Hours&&(b.indexOf(a.options.ampmNames[0])>-1);var e=!a.options.show24Hours&&(b.indexOf(a.options.ampmNames[1])>-1);var f=parseInt(c[0],10);f=(isNaN(f)?0:f);f=((d||e)&&f===12?0:f)+(e?12:0);var g=parseInt(c[1],10);g=(isNaN(g)?0:g);var h=(c.length>=3?parseInt(c[2],10):0);h=(isNaN(h)||!a.options.showSeconds?0:h);return this._constrainTime(a,[f,g,h])}return null},_constrainTime:function(a,b){var c=(b!==null&&b!==undefined);if(!c){var d=this._determineTime(a.options.defaultTime,a)||new Date();b=[d.getHours(),d.getMinutes(),d.getSeconds()]}var e=false;for(var i=0;i<a.options.timeSteps.length;i++){if(e){b[i]=0}else if(a.options.timeSteps[i]>1){b[i]=Math.round(b[i]/a.options.timeSteps[i])*a.options.timeSteps[i];e=true}}return b},_showTime:function(a){var b=(a.options.unlimitedHours?a._selectedHour:this._formatNumber(a.options.show24Hours?a._selectedHour:((a._selectedHour+11)%12)+1))+a.options.separator+this._formatNumber(a._selectedMinute)+(a.options.showSeconds?a.options.separator+this._formatNumber(a._selectedSecond):'')+(a.options.show24Hours?'':a.options.ampmPrefix+a.options.ampmNames[(a._selectedHour<12?0:1)]);this._setValue(a,b);this._showField(a)},_showField:function(a){var b=a.elem[0];if(a.elem.is(':hidden')||o._lastInput!==b){return}var c=[a.elem.val().split(a.options.separator)[0].length,2,2];var d=0;var e=0;while(e<a._field){d+=c[e]+(e===Math.max(1,a._secondField)?0:a.options.separator.length);e++}var f=d+(a._field!==a._ampmField?c[e]:a.options.ampmPrefix.length+a.options.ampmNames[0].length);if(b.setSelectionRange){b.setSelectionRange(d,f)}else if(b.createTextRange){var g=b.createTextRange();g.moveStart('character',d);g.moveEnd('character',f-a.elem.val().length);g.select()}if(!b.disabled){b.focus()}},_formatNumber:function(a){return(a<10?'0':'')+a},_setValue:function(a,b){if(b!==a.elem.val()){a.elem.val(b).trigger('change')}},_changeField:function(a,b,c){var d=(a.elem.val()===''||a._field===(b===-1?0:Math.max(1,a._secondField,a._ampmField)));if(!d){a._field+=b}this._showField(a);a._lastChr='';return(d&&c)},_adjustField:function(a,b){if(a.elem.val()===''){b=0}if(a.options.unlimitedHours){this._setTime(a,[a._selectedHour+(a._field===0?b*a.options.timeSteps[0]:0),a._selectedMinute+(a._field===1?b*a.options.timeSteps[1]:0),a._selectedSecond+(a._field===a._secondField?b*a.options.timeSteps[2]:0)])}else{this._setTime(a,new Date(0,0,0,a._selectedHour+(a._field===0?b*a.options.timeSteps[0]:0)+(a._field===a._ampmField?b*12:0),a._selectedMinute+(a._field===1?b*a.options.timeSteps[1]:0),a._selectedSecond+(a._field===a._secondField?b*a.options.timeSteps[2]:0)))}},_setTime:function(a,b){if(a.options.unlimitedHours&&$.isArray(b)){var c=b}else{b=this._determineTime(b,a);var c=(b?[b.getHours(),b.getMinutes(),b.getSeconds()]:null)}c=this._constrainTime(a,c);b=new Date(0,0,0,c[0],c[1],c[2]);var b=this._normaliseTime(b);var d=this._normaliseTime(this._determineTime(a.options.minTime,a));var e=this._normaliseTime(this._determineTime(a.options.maxTime,a));if(a.options.unlimitedHours){while(c[2]<0){c[2]+=60;c[1]--}while(c[2]>59){c[2]-=60;c[1]++}while(c[1]<0){c[1]+=60;c[0]--}while(c[1]>59){c[1]-=60;c[0]++}d=(a.options.minTime!=null&&$.isArray(a.options.minTime))?a.options.minTime:[0,0,0];if(c[0]<d[0]){c=d.slice(0,3)}else if(c[0]===d[0]){if(c[1]<d[1]){c[1]=d[1];c[2]=d[2]}else if(c[1]===d[1]){if(c[2]<d[2]){c[2]=d[2]}}}if(a.options.maxTime!=null&&$.isArray(a.options.maxTime)){if(c[0]>a.options.maxTime[0]){c=a.options.maxTime.slice(0,3)}else if(c[0]===a.options.maxTime[0]){if(c[1]>a.options.maxTime[1]){c[1]=a.options.maxTime[1];c[2]=a.options.maxTime[2]}else if(c[1]===a.options.maxTime[1]){if(c[2]>a.options.maxTime[2]){c[2]=a.options.maxTime[2]}}}}}else{if(d&&e&&d>e){if(b<d&&b>e){b=(Math.abs(b-d)<Math.abs(b-e)?d:e)}}else{b=(d&&b<d?d:(e&&b>e?e:b))}c[0]=b.getHours();c[1]=b.getMinutes();c[2]=b.getSeconds()}if($.isFunction(a.options.beforeSetTime)){b=a.options.beforeSetTime.apply(a.elem[0],[this.getTime(a.elem[0]),b,d,e]);c[0]=b.getHours();c[1]=b.getMinutes();c[2]=b.getSeconds()}a._selectedHour=c[0];a._selectedMinute=c[1];a._selectedSecond=c[2];this._showTime(a)},_determineTime:function(i,j){var k=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var l=function(a){var b=o._extractTime(j,a);var c=new Date();var d=(b?b[0]:c.getHours());var e=(b?b[1]:c.getMinutes());var f=(b?b[2]:c.getSeconds());if(!b){var g=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var h=g.exec(a);while(h){switch(h[2]||'s'){case's':case'S':f+=parseInt(h[1],10);break;case'm':case'M':e+=parseInt(h[1],10);break;case'h':case'H':d+=parseInt(h[1],10);break}h=g.exec(a)}}c=new Date(0,0,10,d,e,f,0);if(/^!/.test(a)){if(c.getDate()>10){c=new Date(0,0,10,23,59,59)}else if(c.getDate()<10){c=new Date(0,0,10,0,0,0)}}return c};var m=function(a){return new Date(0,0,0,a[0],a[1]||0,a[2]||0,0)};return(i?(typeof i==='string'?l(i):(typeof i==='number'?k(i):($.isArray(i)?m(i):i))):null)},_normaliseTime:function(a){if(!a){return null}a.setFullYear(1900);a.setMonth(0);a.setDate(0);return a}});var o=$.timeEntry})(jQuery);
\ No newline at end of file
Binary files cahier-de-prepa5.1.0/js/spinnerDefault.png and cahier-de-prepa6.0.0/js/spinnerDefault.png differ
diff -urN cahier-de-prepa5.1.0/login.php cahier-de-prepa6.0.0/login.php
--- cahier-de-prepa5.1.0/login.php	2015-09-13 20:28:48.145298451 +0200
+++ cahier-de-prepa6.0.0/login.php	2016-07-21 23:09:57.483370561 +0200
@@ -32,7 +32,7 @@
   // Envoi
   $('#login a.icon-ok').on("click",function () {
     $.ajax({url: 'ajax.php', method: "post", data: $('form').serialize(), dataType: 'json', el: '', fonction: function(el) { location.reload(true); } })
-    .success( function(data) {
+    .done( function(data) {
       // Si erreur d'identification, on reste bloqué là
       if ( data['etat'] == 'login_nok' )
         $('form p:first').html(data['message']).addClass('warning');
diff -urN cahier-de-prepa5.1.0/mail.php cahier-de-prepa6.0.0/mail.php
--- cahier-de-prepa5.1.0/mail.php	2015-10-26 00:09:19.318564620 +0100
+++ cahier-de-prepa6.0.0/mail.php	2016-08-12 10:59:35.138775138 +0200
@@ -46,7 +46,7 @@
     <form id="mail">
       <input class="ligne" name="sujet"></input>
       <p><strong>Texte du message&nbsp;:</strong></p>
-      <textarea id="texte" name="texte" rows="20" cols="100">\n\n\n\n-- \n${u['mailexp']}\nhttps://$site/</textarea>
+      <textarea name="texte" rows="20" cols="100">\n\n\n\n-- \n${u['mailexp']}\nhttps://$site/</textarea>
       <p class="ligne"><label for="copie">Recevoir le courriel en copie&nbsp;: </label>
         <input type="checkbox" id="copie" name="copie" value="1"${u['mailcopy']}>
       </p>
diff -urN cahier-de-prepa5.1.0/MAJSQL.sql cahier-de-prepa6.0.0/MAJSQL.sql
--- cahier-de-prepa5.1.0/MAJSQL.sql	2015-09-24 01:41:31.017579603 +0200
+++ cahier-de-prepa6.0.0/MAJSQL.sql	2016-08-30 14:43:33.019727265 +0200
@@ -218,6 +218,7 @@
   ('2016-04-04'),('2016-04-11'),('2016-04-18'),('2016-04-25'),('2016-05-02'),('2016-05-09'),('2016-05-17'),('2016-05-23'),('2016-05-30'),
   ('2016-06-06'),('2016-06-13'),('2016-06-20'),('2016-06-27'),('2016-07-04');
 UPDATE semaines SET colle = 1;
+-- Autres modifications
 ALTER TABLE utilisateurs
   MODIFY mdp VARCHAR(41),
   DROP genre,
@@ -246,3 +247,88 @@
 UPDATE recents SET titre = CONCAT('<span class="icon-doc-zip"></span> ',SUBSTRING(titre,LOCATE('>',titre)+2)) WHERE titre LIKE '%zip.png%';
 UPDATE recents SET titre = CONCAT('<span class="icon-infos"></span> ',SUBSTRING(titre,LOCATE('>',titre)+2)) WHERE titre LIKE '%info.png%';
 UPDATE recents SET titre = CONCAT('<span class="icon-colles"></span> ',SUBSTRING(titre,LOCATE('>',titre)+2)) WHERE titre LIKE '%colle.png%';
+
+--
+-- Voilà les modifications à effectuer sur chaque base pour passer de Cahier de
+-- Prépa 5.1.0 à Cahier de Prépa 6.0.0
+--
+
+-- Semaines 2016-2017 -> Suppression des cahiers de texte et programmes de colles
+TRUNCATE TABLE cdt;
+TRUNCATE TABLE colles;
+TRUNCATE TABLE notes;
+UPDATE matieres SET colles = 0, cdt = 0;
+TRUNCATE TABLE semaines;
+INSERT INTO semaines (debut) VALUES ('2016-09-01'),('2016-09-04'),('2016-09-11'),('2016-09-18'),('2016-09-25'),
+  ('2016-10-03'),('2016-10-10'),('2016-10-17'),('2016-10-20'),('2016-11-03'),('2016-11-07'),('2016-11-14'),('2016-11-21'),('2016-11-28'),
+  ('2016-12-05'),('2016-12-12'),('2016-12-19'),('2016-12-26'),('2017-01-03'),('2017-01-09'),('2017-01-16'),('2017-01-23'),
+  ('2017-01-30'),('2017-02-06'),('2017-02-13'),('2017-02-20'),('2017-02-27'),('2017-03-06'),('2017-03-13'),('2017-03-20'),('2017-03-27'),
+  ('2017-04-03'),('2017-04-10'),('2017-04-18'),('2017-04-24'),('2017-05-02'),('2017-05-09'),('2017-05-15'),('2017-05-22'),('2017-05-29'),
+  ('2017-06-05'),('2017-06-12'),('2017-06-19'),('2017-06-26'),('2017-07-03');
+UPDATE semaines SET colle = 1;
+-- Nouvelles tables
+CREATE TABLE `prefs` (
+  `nom` varchar(50) NOT NULL,
+  `val` tinyint(2) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE `agenda` (
+  `id` smallint(3) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  `matiere` tinyint(2) unsigned NOT NULL,
+  `type` tinyint(2) unsigned NOT NULL,
+  `debut` datetime NOT NULL,
+  `fin` datetime NOT NULL,
+  `texte` text NOT NULL,
+  KEY `matiere` (`matiere`),
+  KEY `type` (`type`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE `agenda-types` (
+  `id` tinyint(2) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  `nom` varchar(50) NOT NULL,
+  `ordre` tinyint(2) unsigned NOT NULL,
+  `cle` varchar(20) NOT NULL,
+  `couleur` varchar(6) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+-- Remplissage des nouvelles tables
+INSERT INTO prefs (nom,val)
+  VALUES ('creation_compte',1),
+         ('nb_agenda_index',10),
+         ('protection_globale',0),
+         ('protection_agenda',0);
+INSERT INTO `agenda-types` (id,ordre,nom,cle,couleur)
+  VALUES (3, 1, 'Cours', 'cours', 'CC6633'),
+         (4, 2, 'Pas de cours', 'pascours', 'CC9933'),
+         (5, 3, 'Devoir surveillé', 'DS', '6633CC'),
+         (6, 4, 'Devoir maison', 'DM', '99CC33'),
+         (9, 5, 'Divers','div', 'CCCC33'),
+         (1, 6, 'Déplacement de colle', 'depl_colle', '33CCCC'),
+         (2, 7, 'Rattrapage de colle', 'ratt_colle', '3399CC'),
+         (7, 8, 'Jour férié', 'fer', 'CC3333'),
+         (8, 9, 'Vacances', 'vac', '66CC33');
+INSERT INTO agenda (id,matiere,debut,fin,type,texte)
+  VALUES (1, 0, '2016-08-15 00:00:00', '2016-08-15 00:00:00', 7, '<p>Assomption</p>'),
+         (2, 0, '2016-11-01 00:00:00', '2016-11-01 00:00:00', 7, '<p>Toussaint</p>'),
+         (3, 0, '2016-11-11 00:00:00', '2016-11-11 00:00:00', 7, '<p>Armistice 1918</p>'),
+         (4, 0, '2016-12-25 00:00:00', '2016-12-25 00:00:00', 7, '<p>Noël</p>'),
+         (5, 0, '2017-01-01 00:00:00', '2017-01-01 00:00:00', 7, '<p>Jour de l''an</p>'),
+         (6, 0, '2017-04-17 00:00:00', '2017-04-17 00:00:00', 7, '<p>Pâques</p>'),
+         (7, 0, '2017-05-01 00:00:00', '2017-05-01 00:00:00', 7, '<p>Fête du travail</p>'),
+         (8, 0, '2017-05-08 00:00:00', '2017-05-08 00:00:00', 7, '<p>Armistice 1945</p>'),
+         (9, 0, '2017-05-25 00:00:00', '2017-05-25 00:00:00', 7, '<p>Ascension</p>'),
+         (10, 0, '2017-06-05 00:00:00', '2017-06-05 00:00:00', 7, '<p>Pentecôte</p>'),
+         (11, 0, '2017-07-14 00:00:00', '2017-07-14 00:00:00', 7, '<p>Fête Nationale</p>'),
+         (12, 0, '2016-07-06 00:00:00', '2016-08-31 00:00:00', 8, '<p>Vacances d''été</p>'),
+         (13, 0, '2016-10-20 00:00:00', '2016-11-02 00:00:00', 8, '<p>Vacances de la Toussaint</p>'),
+         (14, 0, '2016-12-18 00:00:00', '2017-01-02 00:00:00', 8, '<p>Vacances de Noël</p>'),
+         (15, 0, '2017-02-19 00:00:00', '2017-03-05 00:00:00', 8, '<p>Vacances d''hiver, zone A</p>'),
+         (16, 0, '2017-02-10 00:00:00', '2017-02-26 00:00:00', 8, '<p>Vacances d''hiver, zone B</p>'),
+         (17, 0, '2017-02-03 00:00:00', '2017-02-19 00:00:00', 8, '<p>Vacances d''hiver, zone C</p>'),
+         (18, 0, '2017-04-16 00:00:00', '2017-05-01 00:00:00', 8, '<p>Vacances de printemps, zone A</p>'),
+         (19, 0, '2017-04-09 00:00:00', '2017-04-23 00:00:00', 8, '<p>Vacances de printemps, zone B</p>'),
+         (20, 0, '2017-04-02 00:00:00', '2017-04-17 00:00:00', 8, '<p>Vacances de printemps, zone C</p>'),
+         (21, 0, '2017-07-09 00:00:00', '2017-08-31 00:00:00', 8, '<p>Vacances d''été</p>'),
+         (22, 0, '2016-09-01 00:00:00', '2016-09-01 00:00:00', 1, '<div class="annonce">C''est la rentrée ! Bon courage pour cette nouvelle année&nbsp;!</div>');
+-- Autres modifications
+ALTER TABLE groupes CHANGE eleves eleves VARCHAR( 250 ) NOT NULL;
+
+
+
diff -urN cahier-de-prepa5.1.0/matieres.php cahier-de-prepa6.0.0/matieres.php
--- cahier-de-prepa5.1.0/matieres.php	2015-10-27 14:32:34.908106120 +0100
+++ cahier-de-prepa6.0.0/matieres.php	2016-08-11 00:35:28.274946646 +0200
@@ -56,7 +56,7 @@
   $disabled = $boutons = '';
   if ( $r['modifiable'] )  {
     $suppr = "\n    <a class=\"icon-supprime\" title=\"Supprimer cette matière\"></a>";
-    $ok = "\n      <a class=\"icon-ok\" title=\"Valider les modifications\"></a>";
+    $ok = "\n      <a class=\"icon-ok\" title=\"Valider les modifications\" data-noreload=\"\"></a>";
     $indication = '';
     if ( $r['colles'] )
       $boutons .= "\n    <input type=\"button\" class=\"ligne supprmultiple\" data-id=\"matieres|$id|colles\" value=\"Supprimer tous les programmes de colles\">";
@@ -95,8 +95,8 @@
     <a class="icon-descend"$descend title="Déplacer cette matière vers le bas"></a>$suppr
     <form>$ok
       <h3 class="edition">${r['nom']}</h3>$indication
-      <p class="ligne"><label for="nom$id">Nom complet&nbsp;: </label><input type="text" id="nom$id" name="nom" value="${r['nom']}" size="50"$disabled></p>
-      <p class="ligne"><label for="cle$id">Clé dans l'adresse&nbsp;: </label><input type="text" id="cle$id" name="cle" value="${r['cle']}" size="30"$disabled></p>
+      <p class="ligne"><label for="nom$id">Nom complet&nbsp;: </label><input type="text" id="nom$id" name="nom" data-placeholder="Commence par une majuscule : Mathématiques, Physique..." value="${r['nom']}" size="50"$disabled></p>
+      <p class="ligne"><label for="cle$id">Clé dans l'adresse&nbsp;: </label><input type="text" id="cle$id" name="cle" data-placeholder="Diminutif en minuscules : maths, phys..." value="${r['cle']}" size="30"$disabled></p>
       <p class="ligne"><label for="colles_protection$id">Accès aux programmes de colles&nbsp;: </label>
         <select id="colles_protection$id" name="colles_protection"$disabled>$sel_colles
         </select>
@@ -151,7 +151,7 @@
   <form id="form-ajoute">
     <h3 class="edition">Ajouter une nouvelle matière</h3>
     <div>
-      <input type="input" class="ligne" name="nom" value="" size="50" data-placeholder="Nom pour l'affichage (Commence par majuscule : Mathématiques, Physique...)">
+      <input type="input" class="ligne" name="nom" value="" size="50" data-placeholder="Nom pour l'affichage (Commence par une majuscule : Mathématiques, Physique...)">
       <input type="input" class="ligne" name="cle" value="" size="50" data-placeholder="Clé pour les adresses web (Diminutif en minuscules : maths, phys...)">
       <p class="ligne"><label for="colles_protection0">Accès aux programmes de colles&nbsp;: </label>
         <select id="colles_protection0" name="colles_protection"><?php echo $select_protection; ?>
diff -urN cahier-de-prepa5.1.0/notes.php cahier-de-prepa6.0.0/notes.php
--- cahier-de-prepa5.1.0/notes.php	2015-10-27 14:14:55.801515995 +0100
+++ cahier-de-prepa6.0.0/notes.php	2016-08-25 01:15:52.973595536 +0200
@@ -137,8 +137,8 @@
   
   <a class="icon-aide general" data-id="page" title="Aide pour les modifications des programmes de colles"></a>
   <a class="icon-voirtout general" href="?${matiere['cle']}&amp;tableau" title="Voir le tableau de notes"></a>
-  <a class="icon-download general" href="?${matiere['cle']}&amp;xls"></a>
-  <a class="icon-ajoute general" data-id="ajoute" title="Ajouter des notes de colles"></a>
+  <a class="icon-download general" href="?${matiere['cle']}&amp;xls" title="Télécharger le tableau de notes en xls"></a>
+  <a class="icon-ajoute general" data-id="ajoute-notes" title="Ajouter des notes de colles"></a>
 
 FIN;
 
@@ -191,7 +191,7 @@
     echo <<<FIN
   
   <a class="icon-aide general" data-id="page" title="Aide pour les modifications des programmes de colles"></a>
-  <a class="icon-ajoute general" data-id="ajoute" title="Ajouter des notes de colles"></a>
+  <a class="icon-ajoute general" data-id="ajoute-notes" title="Ajouter des notes de colles"></a>
 
 FIN;
 
@@ -290,7 +290,7 @@
 ?>
 
   <script type="text/javascript">
-    dejanotes = $.parseJSON('<?php echo json_encode($semaines_notes); ?>');
+    dejanotes = <?php echo json_encode($semaines_notes); ?>;
   </script>
 
   <form id="form-notes">
@@ -306,7 +306,7 @@
     <input type="hidden" name="notes" value="">
   </form>
 
-  <form id="form-ajoute">
+  <form id="form-ajoute-notes">
     <h3 class="edition">Ajouter des notes de colles</h3>
     <p class="ligne"><label for="semaine">Semaine</label>
       <select id="semaine" name="id"><?php echo $select_semaines; ?>
diff -urN cahier-de-prepa5.1.0/pages.php cahier-de-prepa6.0.0/pages.php
--- cahier-de-prepa5.1.0/pages.php	2015-10-27 14:21:36.778876621 +0100
+++ cahier-de-prepa6.0.0/pages.php	2016-08-11 01:01:33.740896926 +0200
@@ -89,7 +89,7 @@
     <a class="icon-monte"$monte title="Déplacer cette matière vers le haut"></a>
     <a class="icon-descend"$descend title="Déplacer cette matière vers le bas"></a>$suppr
     <form>
-      <a class="icon-ok" title="Valider les modifications"></a>
+      <a class="icon-ok" title="Valider les modifications" data-noreload=""></a>
       <h3 class="edition">$nom</h3>
       <p class="ligne"><label for="titre$id">Titre&nbsp;: </label><input type="text" id="titre$id" name="titre" value="${r['titre']}" size="50" data-placeholder="Ex: «&nbsp;Informations en [matière]&nbsp;», «&nbsp;À propos du TIPE&nbsp;»"></p>
       <p class="ligne"><label for="nom$id">Nom dans le menu&nbsp;: </label><input type="text" id="nom$id" name="nom" value="${r['nom']}" size="50" data-placeholder="Pas trop long. Ex: «&nbsp;Informations&nbsp;», «&nbsp;Informations TIPE&nbsp;»"></p>
@@ -116,7 +116,7 @@
     <h3 class="edition">Ajouter une nouvelle page</h3>
     <div>
       <input type="text" class="ligne"  id="nom" name="nom" value="" size="50" data-placeholder="Nom pour le menu. Pas trop long. Ex: «&nbsp;Informations&nbsp;», «&nbsp;Informations TIPE&nbsp;»">
-      <input type="text" class="ligne" id="cle" name="cle" value="" size="30" data-placeholder="Clé pour l''adresse web. En minuscules et sans espace. Ex: «&nbsp;infos&nbsp;», «&nbsp;tipe&nbsp;»">
+      <input type="text" class="ligne" id="cle" name="cle" value="" size="30" data-placeholder="Clé pour l'adresse web. En minuscules et sans espace. Ex: «&nbsp;infos&nbsp;», «&nbsp;tipe&nbsp;»">
       <input type="text" class="ligne" id="titre" name="titre" value="" size="50" data-placeholder="Titre. Ex: «&nbsp;Informations en [matière]&nbsp;», «&nbsp;À propos du TIPE&nbsp;»">
       <p class="ligne"><label for="matiere$id">Matière&nbsp;: </label>
         <select id="matiere" name="matiere">
diff -urN cahier-de-prepa5.1.0/rss.php cahier-de-prepa6.0.0/rss.php
--- cahier-de-prepa5.1.0/rss.php	2015-10-27 12:08:02.251942203 +0100
+++ cahier-de-prepa6.0.0/rss.php	2016-08-29 22:42:42.461399848 +0200
@@ -11,15 +11,44 @@
 //////////////
 //// HTML ////
 //////////////
-debut($mysqli,'Flux RSS',$message,$autorisation," ");
+debut($mysqli,'Flux RSS',$message,$autorisation,'rss');
+?>
+  <article>
+    <p>Un flux RSS est une page web dont le contenu est mis à jour de façon permanente. Il permet de récupérer le contenu d'un fil d'actualité à l'aide d'un logiciel prévu pour lire ce genre de page. Firefox les prend en charge nativement, et un certain nombre d'applications existent sur Android et iOS (tapez simplement «&nbsp;RSS&nbsp;» dans la zone de recherche du magasin d'applications).</p>
+  </article>
+
+<?php
+if ( !$autorisation )  {
+  // On vérifie que les flux RSS que l'utilisateur peut souhaiter voir existent.
+  if ( !is_dir($rep = 'documents/rss/'.sha1("?!${base}0|toutes")) )
+    rss($mysqli,array(0));
+?>
+
+  <article>
+    <h3>Le flux RSS public est disponible à l'adresse</h3>
+    <p><a href="<?php echo $rep; ?>/rss.xml">http://<?php echo "$site/$rep"; ?>/rss.xml</a></p>
+    <p>Ce flux contient uniquement les éléments visibles sans identification sur ce Cahier de Prépa.</p>
+    <p>Si vous avez un compte ici, vous avez intérêt à vous connecter pour obtenir le flux correspondant à tout ce à quoi vous pouvez accéder normalement.</p>
+  </article>
+
+<?php
+}
+else  {
+  // On vérifie que les flux RSS que l'utilisateur peut souhaiter voir existent.
+  if ( !is_dir($rep = 'documents/rss/'.sha1("?!$base$autorisation|${_SESSION['matieres']}")) )
+    rss($mysqli,array(explode(',',$_SESSION['matieres'])[0]));
 ?>
 
   <article>
-    <h3>Le flux RSS est disponible à l'adresse</h3>
-    <p><a href="documents/rss/<?php echo sha1($base.'00'); ?>/rss.xml">http://<?php echo "$site/documents/rss/".sha1($base).'/rss.xml'; ?></a></p>
+    <h3>Le flux RSS spécifique à votre compte est disponible à l'adresse</h3>
+    <p><a href="<?php echo $rep; ?>/rss.xml">http://<?php echo "$site/$rep"; ?>/rss.xml</a></p>
+    <p>Ce flux liste l'ensemble des éléments que vous pouvez voir sur ce Cahier de Prépa.</p>
+    <p>Cette adresse donne directement accès aux informations sur le site&nbsp;: merci de ne pas la divulguer à des personnes n'ayant pas d'accès au site.</p>
   </article>
 
 <?php
+}
+
 $mysqli->close();
 fin(false,false);
 ?>
diff -urN cahier-de-prepa5.1.0/utilisateurs.php cahier-de-prepa6.0.0/utilisateurs.php
--- cahier-de-prepa5.1.0/utilisateurs.php	2015-10-27 14:24:28.576067636 +0100
+++ cahier-de-prepa6.0.0/utilisateurs.php	2016-08-30 15:12:53.057498780 +0200
@@ -28,6 +28,50 @@
   fin();
 }
 
+//////////////////////////////////
+// Exportation des notes en xls //
+//////////////////////////////////
+// Exportation uniquement si aucun header déjà envoyé
+if ( isset($_REQUEST['xls']) && !headers_sent() )  {
+  // Recherche des utilisateurs concernés : comptes validés hors comptes invités
+  // et hors comptes sans nom et sans mail (identifiant seul)
+  $resultat = $mysqli->query('SELECT nom, prenom, IF(LENGTH(mail),mail,"Pas d\'adresse") AS mail, autorisation
+                              FROM utilisateurs WHERE LENGTH(mdp)=40 AND autorisation > 1 AND LENGTH(CONCAT(nom,prenom,mail))
+                              ORDER BY autorisation DESC, IF(LENGTH(nom),CONCAT(nom,prenom),login)');
+  if ( $resultat->num_rows )  {
+    // Fonction de saisie
+    function saisie_chaine($l, $c, $v)  {
+      echo pack("ssssss", 0x204, 8 + strlen($v), $l, $c, 0, strlen($v)).$v;
+      return;
+    }
+    // Correspondance autorisation-type de compte
+    $categories = array(2=>'Élève',3=>'Colleur',4=>'Professeur');
+    // Envoi des headers
+    header("Content-Type: application/vnd.ms-excel");
+    header("Content-Disposition: attachment; filename=utilisateurs.xls");
+    header("Content-Transfer-Encoding: binary");
+    // Début du fichier xls
+    echo pack("sssss", 0x809, 6, 0, 0x10, 0);
+    // Remplissage
+    saisie_chaine(0, 0, 'Nom');
+    saisie_chaine(0, 1, utf8_decode('Prénom'));
+    saisie_chaine(0, 2, 'Mail');
+    saisie_chaine(0, 3, utf8_decode('Catégorie'));
+    $i = 0;
+    while ( $r = $resultat->fetch_assoc() )  {
+      saisie_chaine(++$i, 0, utf8_decode($r['nom']));
+      saisie_chaine($i, 1, utf8_decode($r['prenom']));
+      saisie_chaine($i, 2, utf8_decode($r['mail']));
+      saisie_chaine($i, 3, utf8_decode($categories[$r['autorisation']]));
+    }
+    // Fin du fichier xls
+    echo pack("ss", 0x0A, 0x00);
+    $resultat->free();
+    $mysqli->close();
+    exit();
+  }
+}
+
 //////////////
 //// HTML ////
 //////////////
@@ -36,11 +80,12 @@
 
   <a class="icon-aide general" data-id="page" title="Aide pour les modifications des utilisateurs"></a>
   <a class="icon-prefs general" data-id="prefs" title="Modifier les réglages de la gestion des comptes"></a>
+  <a class="icon-download general" href="?xls" title="Télécharger la liste des mails en xls"></a>
   <a class="icon-ajoute general" data-id="ajoute" title="Ajouter de nouveaux utilisateurs"></a>
 
   <article>
     <h3>Liste des utilisateurs</h3>
-    <table>
+    <table id="utilisateurs">
       <tbody>
 
 FIN;
@@ -54,7 +99,7 @@
   $n = ( $n > 1 ) ? "$n comptes" : "1 compte";
   echo "        <tr><th colspan=\"5\">En attente de validation ($n)</th></tr>\n";
   while ( $r = $resultat->fetch_assoc() )
-    echo "        <tr><td colspan=\"4\">${r['nom']} - ${r['mail']} - ".$autorisations[$r['autorisation']]."</td><td data-id=\"utilisateurs|${r['id']}\"><a class=\"icon-supprime\" title=\"Supprimer ce compte\"> <a class=\"icon-ajoute\" title=\"Valider ce compte\"></a></td></tr>\n";
+    echo "        <tr><td colspan=\"4\">${r['nom']} - ${r['mail']} - ".$autorisations[$r['autorisation']]."</td><td data-id=\"utilisateurs|${r['id']}\"><a class=\"icon-supprime\" title=\"Supprimer ce compte\"> <a class=\"icon-ajoute\" data-id=\"valide_utilisateur\" title=\"Valider ce compte\"></a></td></tr>\n";
   $resultat->free();
 }
 
@@ -162,15 +207,17 @@
     <input type="hidden" name="creation" value="1">
     <input type="hidden" name="table" value="utilisateurs">
     <p class="ligne">Pour modifier les associations entre utilisateurs et matières, il faut vous rendre sur la page de <a href="matieres">gestion des matières</a>.</p>
+    <span id="noreload"></span>
   </form>
   
   <div id="aide-page">
     <h3>Aide et explications</h3>
     <p>Il est possible ici d'ajouter, de modifier et de supprimer des utilisateurs pouvant se connecter à ce Cahier de Prépa.</p>
     <p>Les associations entre les utilisateurs et les matières sont à régler dans la page de <a href="matieres">gestion des matières</a>.</p>
-    <p>Les deux boutons généraux permettent de&nbsp;:</p>
+    <p>Les trois boutons généraux permettent de&nbsp;:</p>
     <ul>
       <li><span class="icon-ajoute"></span>&nbsp;: ouvrir un formulaire pour ajouter de nouveaux utilisateurs.</li>
+      <li><span class="icon-download"></span>&nbsp;: récupérer l'ensemble des noms et adresses électroniques de tous les utilisateurs en fichier de type <code>xls</code>, éditable par un logiciel tableur (Excel, LibreOffice Calc...).</li>
       <li><span class="icon-prefs"></span>&nbsp;: ouvrir un formulaire pour autoriser ou interdire les demandes de création de compte.</li>
     </ul>
     <h4>Tableau récapitulatif</h4>
