/* Fonction ajax pour vérifier que le peudo n'existe pas déjà */
function verifPseudo(pseudo)
     {
     if(pseudo != '')
               {
               if(pseudo.length<2)
                         writediv('<span style="color:#cc0000"><b>'+pseudo+' :</b> ce pseudo est trop court</span>');
               else if(pseudo.length>30)
                         writediv('<span style="color:#cc0000"><b>'+pseudo+' :</b> ce pseudo est trop long</span>');
               else if(texte = file('verifpseudo.php?pseudo='+escape(pseudo)))
                         {
          if(texte == 1)
               writediv('<span style="color:#cc0000"><b>'+pseudo+' :</b> ce pseudo est deja pris</span>');
          else if(texte == 2)
               writediv('<span style="color:#1A7917"><b>'+pseudo+' :</b> ce pseudo est libre</span>');
          else
               writediv(texte);
                         }
               }

     }

function OuvrirPopup(page,nom,option)
{
    window.open(page,nom,option);
}

/* Fonction ouverture pop up tchat avec POST */
function pop_it(the_form) 
{
   my_form = eval(the_form)
   window.open("./wait.php", "popup", "height=600,width=700,menubar='no',toolbar='no',location='no',status='no',scrollbars='no'");
   my_form.target = "popup";
   my_form.submit();
}

/* Fonction ouverture pop up achat points avec POST */
function pop_buy(the_form) 
{
   my_form = eval(the_form)
   window.open("./wait.php", "popup", "height=460,width=600,menubar='no',toolbar='no',location='no',status='no',scrollbars='no'");
   my_form.target = "popup";
   my_form.submit();
}


/* Live Box */

function livebox(id)
{
if(id == "rappelavatar") { file = "include/livebox/rappelavatar.php" }
if(id == "bienvenue") { file = "include/livebox/bienvenue.php" }
else { file = "toto.html" }
jQuery.facebox({ ajax: file })
}

/* Update nav_bar */
function updatenavbar () {
new Ajax.Updater('infos', 'http://www.ados-live.fr/include/navbar.php')
}

function imcheck(id)
{
new Ajax.Updater('im_content','check.php?id='+id);
}

function imsend(idsrc,iddest)
{
message = $('im_txt').value;
new Ajax.Request('post.php', { method: 'post', parameters: 'message='+escape(message)+'&idsrc='+idsrc+'&iddest='+iddest, onSuccess: function(reponse) { }});
}