var ohnon=new Array("p"+"u"+"t"+"e","s"+"a"+"l"+"o"+"p","e"+"n"+"c"+"u"+"l","c"+"u"+"l","b"+"a"+"t"+"a"+"r","b"+"a"+"i"+"s"+"e","b"+"i"+"t"+"e","s"+"u"+"c"+"e","s"+"e"+"x"+"e","v"+"a"+"g"+"i"+"n","p"+"é"+"n"+"i"+"s","c"+"l"+"i"+"t"+"or"+"i"+"s","s"+"o"+"d"+"o"+"mie","fl"+"i"+"rt","gi"+"rl","gi"+"rls","se"+"x"+"y","f"+"e"+"ss"+"e", "f"+"e"+"s"+"s"+"e"+"s", "s"+"e"+"x"+"uel","b"+"r"+"a"+"nl","n"+"i"+"que","c"+"h"+"a"+"tte","p"+"é"+"d"+"é","g"+"a"+"y","le"+"sb"+"i"+"a"+"n","les"+"bi"+"en"+"n"+"e","le"+"v"+"r"+"et"+"te","c"+"ou"+"i"+"l"+"le","m"+"e"+"r"+"d"+"e","bo"+"r"+"de"+"l","p"+"u"+"t"+"a"+"i"+"n","f"+"u"+"c"+"k","p"+"é"+"t"+"a"+"s"+"s"+"e","a"+"n"+"u"+"s","f"+"o"+"u"+"t"+"r"+"e","p"+"o"+"rn"+"o","b"+"a"+"i"+"s"+"e","v"+"i"+"a"+"g"+"r"+"a");
var i,n,DoIt=0,currentShow=null,currentHide=null,upscroll=null,downscroll=null;
n = ohnon.length;
for(i=0;i<n;i++) ohnon[i]=ethy(ohnon[i]).toLowerCase();
function reformat(str){
 var i,j,n,m,pc,w,sep=",.;:!()[]'{}@ ",c,cc,res="";
 cc = trim(str)+"£";
 n = cc.length;pc="";w="";
 for(i=0;i<n;i++){ 
  c = cc.charAt(i); if(pc==".") c=c.toUpperCase();
  uc = c.toLowerCase();
  if(((uc<'a')||(uc>'z'))&&(uc!='é')&&(uc!='è')&&(uc!='ê')&&(uc!='à')&&(uc!='ç')&&(uc!='ô')&&(uc!='û')){
   if(w!=""){
      if((suspect(w)==1)||(pmot(w)==0)){w="<b><font color=#CC0066>"+w+"</font></b>"; DoIt=0;}
   }
   w +=c;
   res+=w; w="";
  }else{if((pc==".")||(pc==",")||(pc==";")||(pc==":")) w+=" "; w+=c;}
  if(c!=" ")pc = c;
 }
 if(res.length>0) res=trim(res.substr(0,res.length-1));
 return res;
}
function trim(str) {
   var v;
   v = str;
   if(!v) v='';
   return v.replace(/^[\s]+/,'').replace(/[\s]+$/,'');
}
function ethy(str){
 var n,i,i,j,cc,c,r;
 cc = trim(str)+"£";
 n = cc.length; r="";c="";
 for(i=0;i<n;i++){
  while((cc.charAt(i).toLowerCase()==c.toLowerCase())&&(i<n-1)) i+=1;
  c = cc.charAt(i);
  if(c=='é') c='e';else{if(c=='è') c='e';else{if(c=='ê') c='e';else{if(c=='â') c='a';else{if(c=='ü') c='u';else{if(c=='ù') c='u';else{if(c=='ç') c='c';else{if(c=='ô') c='o';else{if(c=='û') c='u';}}}}}}}}
  r += c;
 }
 if(r.length>0) r = trim(r.substr(0,r.length-1));
 return r;
}
function suspect(str){
 var c1,c2,c,i,j,n,r;
 r = 0;
 c1 = ethy(str).toLowerCase(); 
 n = ohnon.length;
 for(i=0;i<n;i++){
   c2 = ohnon[i];
   if(c1==c2){i=n;r=1;}
   else{
     if(c1.length>c2.length){
       j = c1.indexOf(c2);
       if((j>-1)&&(c1.length-c2.length<=2))r=1;
     }
   }
 }
 return r;
}
function okpseudo(str){
 var cc,c,r,i,j,n,m,res;
 r=1; res=str;
 cc = trim(str).toLowerCase();
 n = cc.length;
 for(i=0;i<n;i++)
  for(j=i+2;j<n;j++)
    if(suspect(cc.substr(i,(j-i)+1))==1){r=0; res=cc.substr(0,i)+"<font color=red>"+cc.substr(i,(j-i)+1)+"</font>"+cc.substr(j+1);  j=n;i=n;}
 if((r==1)&&(cc.length>2)) r = pmot(cc);
 if(r==0) document.getElementById('check_pseudo').innerHTML="<font size=2>This name <b><font color=#CC0066>"+trim(str)+"</font></b> is not acceptable!</font>";
else document.getElementById('check_pseudo').innerHTML="";
 return r;
}
function submit_reaction(){
 var c1,c2,msg="";
 DoIt=1;
 c1 = trim(document.user_reaction.user_pseudo.value);
 c2 = trim(document.user_reaction.user_comment.value);
 if(c1==""){msg="Any name provided!";DoIt=0;document.user_reaction.user_pseudo.focus();}
 if((DoIt==1)&&(c2=="")) {msg="Any comment provided!";DoIt=0;document.user_reaction.user_comment.focus();}
 document.getElementById('check_pseudo').innerHTML="<font color=red size=2>"+msg+"</font>";
 if(DoIt==1){
   DoIt=okpseudo(trim(document.user_reaction.user_pseudo.value));
   if(DoIt==1){
     document.getElementById('check_comment').innerHTML = reformat(document.user_reaction.user_comment.value);
     document.getElementById('check_comment').style.display='';
     if(DoIt==0) document.getElementById('check_comment').innerHTML ="<b><font color=purple>Please, check and  correct highlighted items.</font></b><br>"+document.getElementById('check_comment').innerHTML;
     else{
       document.user_reaction.user_file.value= window.location;
       document.user_reaction.user_comment.value = document.getElementById('check_comment').innerHTML;
       document.user_reaction.submit();
     } 
   }
 }
}
function pmot(str){
 var cc,c,vy="aeuioyéèêàâüïû";
 var i,n,nv,nr,cr,res=1;
 nv = 0;
 nr = 1;
 cr = 1;
 cc=trim(str);c="";n=cc.length;
 if(n>1){
  for(i=0;i<n;i++){
   if(cc.charAt(i)==c) cr+=1; else {{if(nr<cr) nr=cr;}cr=0;}
   c = cc.charAt(i).toLowerCase();
   if(vy.indexOf(c)>-1) nv += 1; 
  }
  if(nr>2) res=0;
  if(nv==0) res=0;
 }
 return res;
}
function StepShow(e,h){
  currentShow=e;
  if(e){
    e.style.marginTop = '-'+Math.abs(h)+'px';
    e.style.display='';
    try{window.clearTimeout(upscroll);}catch(err){}
    upscroll = setTimeout('scrolShow()',0);
  }
}
function scrolShow(){
 var e,t;
 e = currentShow;
 if(e){
   t=parseInt(e.style.marginTop);
   if(t<0){
     t += 10;
     e.style.marginTop = t+'px';
     upscroll = setTimeout('scrolShow()',25);
   }else {e.style.marginTop = '0px'; try{document.user_reaction.user_pseudo.focus();window.clearTimeout(upscroll);}catch(err){} }
 }
}
function gopage(str){
 var i,cc,c;
 cc = trim(str);
 i = cc.indexOf("#"); if(i>-1) cc="semaines/"+cc.substr(0,i)+"/sujet"+cc.substr(i+1);
 cc=cc+".htm";
 document.location=cc;
}
function init(){
  //if(document.referrer!=document.location) document.location.reload(true);
}