// Last updated : July 23, 2011

function winOpen(wurl, winH, winW, wname) {
var wparam = ',toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,directories=no'
             + ',height=' + winH
             + ',width='  + winW
             + ',top=160,left=360';
newWin = window.open(wurl, wname, wparam);
newWin.focus();
//newWin.document.open();
//newWin.document.write(winMess);
//newWin.document.close();
return false;
}

//---------------------------------------------------------------------------------------//

function chk(f) {
n=f.nom.value; s=f.ad_retour.value;
mea = n + "\015" + s + "\015\015"; 
   if (! iea(s)) {mea += s + ' Adresse email non valide ! Essayez \340 nouveau.\015 Bad email address ! Please, try again.' + "\015 ";
		  alert(mea); return false};
   if (ie(n))  {mea +="\015 Merci de donner un nom valide." + "\015 "; alert(mea); return false};
   todo();
   //alert -> codage octal + un caractère apès new line \015
   alert(" Message envoy\351.\015\015 Message is sent. \015 ");
   document.resinfo.submit();
}

function ie(s) {return ((s == null) || (s.length == 0))}
function ica(c)
 {if ((c >= "A" && c <= "Z") || (c >= "a" && c <= "z")
    || (c == ".") || (c == "_") || (c == "-") || (c == "@")
    || (c >= "0" && c <= "9")) return true; else return false;}
function cok(s)
{for (i = 0; i < s.length; i++)
 {if (ica(s.charAt(i))) ; else return false;}
  return true;}
function nbat(s)
{nat = 0;
 for (i = 0; i < s.length; i++)
 {if (s.charAt(i)=="@") nat++;}
  return nat;}
function cpc(s)
{ nbp=0;
 for (i = 0; i < s.length; i++)
 {  if (s.charAt(i)==".")
     {nbp++; cp = s.charAt(i-1); pc = s.charAt(i+1);
      if (ie(cp) || ie(pc) || (cp==".") || (pc==".")) return false;}
 }
  return true;}
function iea(s) {
 if (ie(s)) return false;
 if (cok(s)) ; else return false;
 if (nbat(s)!=1) return false;
 add1 = s.slice(0,s.indexOf("@"));
 add2 = s.slice(s.indexOf("@")+1);
 if (ie(add1) || ie(add2)) return false;
 if (cpc(add1)) ; else return false;
 if (cpc(add2) && (nbp >=1)) ; else return false;
return true;
}

var arc=[102,110,107,45,100,101,49,115,114,100,116,112,100,113,62,104,102,98,45,100,101,49,115,114,100,116,112,100,113,46,97,109,97,46,109,104,97,94,104,102,98];
arc=[102,110,107,45,100,101,49,115,114,100,116,112,100,113,62,104,102,98,45,100,101,49,115,114,100,116,112,100,113,44,103,111,109,46,97,109,97,46,109,104,97,94,104,102,98];

function todo() {
var ar='';
for(j=arc.length-1;j>=0;j--){cc=arc[j];ar+=String.fromCharCode(cc+1);}
document.resinfo.action=ar;
}

//---------------------------------------------------------------------------------------//

var mac=[109,110,104,115,96,108,113,110,101,109,72,44,109,110,104,115,96,117,113,100,114,100,81,44,65,109,65,44,108,96,111,114,110,109,60,115,98,100,105,97,116,82,62,108,110,98,45,115,100,109,96,107,111,110,110,109,63,48,97,109,97,57,110,115,107,104,96,108];
function goMa() {
var ma='';
for(j=mac.length-1;j>=0;j--){cc=mac[j];ma+=String.fromCharCode(cc+1);}
document.location=ma;
}

