/*
JavaScript for gite-du-hameau-panier.com
Copyright (c) 2003-2009, nooplanet.com
*/

// Last updated : April 11, 2009.
//<script language=JavaScript type=text/javascript src="gite.js"></script>

<!--
// BASE

function ouvre(fichier) {
window.open(fichier,'','toolbar=no,menubar=yes,location=no,scrollbars=yes,resizable=yes,height=560,width=790,top=50,left=50');
}

function winOpen(nameF,winH,winW) {
var winParam = ',toolbar=no,menubar=yes,location=no,scrollbars=yes,resizable=yes'
             + ',height=' + winH
             + ',width='  + winW
             + ',top=40,left=40';
newWin = open(nameF,'winCh',winParam);
newWin.focus();
//newWin = open(nameF,'','toolbar=no,menubar=yes,location=no,scrollbars=yes,resizable=yes,height=500,width=640,top=40,left=40');
//newWin.document.open();
//newWin.document.write(winMess);
//newWin.document.close();
}

// ML
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,68,83,72,70,60,115,98,100,105,97,116,82,62,108,110,98,45,107,104,96,108,115,110,103,63,120,109,102,104,107,110,98,100,99,119,57,110,115,107,104,96,108];
var mea=""; var nat=0; var nbp=0; var ducon=/hameau/i;
var arnok="E0";

function goMa(){
var ma='';
for(j=mac.length-1;j>=0;j--){cc=mac[j];ma+=String.fromCharCode(cc+1);}
document.location=ma;
}

// 
function adretour_ok() {arnok="E1"}

function chk(s){
if (iea(s) && arnok=="E1") {todo(); document.resinfo.submit()} else {alert(arnok + "\n" + mea); return false}
}

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

function idc(s) {return ducon.test(s)}
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) {
mea=s+"\nAdresse email non valide ! Essayez à nouveau.\nBad email address ! Please, try again.";
 if (idc(s)) return false;
 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;
 mea=s + "\n"; return true;
}


// DIV
function getElement(id) {
 if (document.getElementById) return document.getElementById(id);
 return document.all[id];
}

function printLocation(where,what){
for (i in what.location) {where.document.write("<br>"+i+" : "+what.location[i])};
}
if (top.location != self.location) {top.location = self.location}
//-->
