/* ####################################################
   ####### JavaScript ¦ By Jean-Philippe Sirois #######
   #################################################### */

   function dateTime(){
      now = new Date();
      annee      = now.getFullYear();
      jour       = now.getDate();
      mois       = now.getMonth();
      heures     = now.getHours();
      minutes    = now.getMinutes();
      secondes   = now.getSeconds();

      if (jour < 10){jour="0"+jour;}
      if (mois < 10){mois="0"+mois;}
      if (heures < 10){heures="0"+heures;}
      if (minutes < 10){minutes="0"+minutes;}
      if (secondes < 10){secondes="0"+secondes;}

      return annee+"-"+mois+"-"+jour+"<strong>&nbsp;à&nbsp;</strong>"+heures+":"+minutes+":"+secondes;
   }

   username="";

   function previewComment(){

      if(username==""){
         username = commto("./_get_username.php");
      }
      title=$F('com_title').replace(/</, "&lt;")
      title=title.replace(/>/, "&gt;")
      title.replace(/\n/g, "<br/>")
      comment=$F('com_content').replace(/</, "&lt;")
      comment=comment.replace(/>/, "&gt;")
      comment.replace(/\n/g, "<br/>")

      $('preview_comment').innerHTML = '<h4>'+title+' - <span class="orange">(Aperçu de votre commentaire)</span></h4><p>'+comment+'</p><span class="info"><strong>Par :</strong> <a href="fiche.php?un='+username+'" title="Accéder au profil de '+username+'">'+username+'</a><strong> le </strong>'+dateTime()

      if(($F('com_title')=="") && ($F('com_content')=="")){
         $('preview_comment').innerHTML ="";
      }

   }

   function validComment(){
      $('error').innerHTML = "";
      if($F('com_title') == ""){
         $('error').innerHTML = "Veuillez vous assurer d'avoir entré un titre pour votre commentaire";
         window.location='#step1_1';
         return false;
      }
      if($F('com_content') == ""){
         $('error').innerHTML = "Veuillez vous assurer d'avoir entré un commentaire";
         window.location='#step1_1';
         return false;
      }
   }



/* ####################################################
   #### © Copyrights 2007 ¦ By Jean-Philippe Sirois ###
   #################################################### */
