function rapporteErreur()
{
//window.alert("erreur");
}
function initialisation()
{
etatMenuFlag = "ferme";
recalageFlag();
recalageRideau();
}
var dimension_detect=function()
{
var d={'viewW':0,'viewH':0,'docH':0,'docW':0,'left':0,'top':0};
if (document.body.scrollHeight>document.body.offsetHeight)
{
d.docW=document.body.scrollWidth;
d.docH=document.body.scrollHeight;
}
else
{
d.docW=document.body.offsetWidth;
d.docH=document.body.offsetHeight;
}
if (self.innerWidth)
{
d.viewW=self.innerWidth;
d.viewH=self.innerHeight;
d.left=window.pageXOffset;
d.top=window.pageYOffset;
}
else
{
var ie=(document.compatMode&&document.compatMode!='BackCompat')?document.documentElement:document.body;
d.viewW=ie.clientWidth;
d.viewH=ie.clientHeight;
d.left=ie.scrollLeft;
d.top=ie.scrollTop;
}
return d;
};
function recalageFlag()
{
var d=dimension_detect();
larg = d.viewW;
haut = d.viewH;
newleft = 890 + ((larg - 970) / 2);
document.getElementById('caseFlag').style.left = newleft+"px";
document.getElementById('caseFlag').style.display = "block";
}
function recalageRideau()
{
var d=dimension_detect();
larg = d.viewW;
haut = d.viewH;
document.getElementById('rideau').style.width = larg+"px";
document.getElementById('rideau').style.height = haut+"px";
}
function actionFlag()
{
if (etatMenuFlag == "ferme")
{
document.getElementById('caseFlag').style.display = "block";
ouvrirFlag(11);
}
else
{
fermerFlag(120);
}
}
function ouvrirFlag(taille)
{
if (taille < 120)
{
taille = taille + 4;
document.getElementById('caseFlag').style.height = taille+"px";
setTimeout("ouvrirFlag("+taille+")",10);
}
else
{
etatMenuFlag = "ouvert";
}
}
function fermerFlag(taille)
{
if (taille > 12)
{
taille = taille - 4;
document.getElementById('caseFlag').style.height = taille+"px";
setTimeout("fermerFlag("+taille+")",10);
}
else
{
document.getElementById('caseFlag').style.height = "11px";
etatMenuFlag = "ferme";
}
}
function nettoyageEmail()
{
if (document.getElementById('emailCompte').value == "Uw e-mail...")
{
document.getElementById('emailCompte').value = "";
}
}
function nettoyageMp()
{
if (document.getElementById('mpCompte').value == "Wachtwoord...")
{
document.getElementById('mpCompte').value = "";
}
}
function soumettreRecherche()
{
var recherche = document.getElementById('txt_recherche').value;
if (recherche != "")
{
if (recherche.length > 3)
{
document.getElementById('formRecherche').action = "/nl/"+recherche+".php";
document.getElementById('formRecherche').submit();
}
else
{
window.alert("Votre recherche doit comporter au moins 4 caract\u00E8res");
}
}
}
function verifConnexion()
{
var email = document.getElementById('formconnexion').txt_email.value;
var testEmail = document.getElementById('formconnexion').txt_email.value;
var reg= /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
if(reg.test(testEmail)==true)
{
testEmail = "correct";
}
else
{
testEmail = "incorrect";
}
//TEST DE L'EMAIL
if (testEmail == "incorrect")
{
window.alert("Uw e-mail is ongeldig");
return false;
}
else if (document.getElementById('formconnexion').txt_mp.value == "")
{
window.alert("Uw wachtwoord is ongeldig");
return false;
}
else if (document.getElementById('formconnexion').txt_mp.value == "Wachtwoord...")
{
window.alert("Uw wachtwoord is ongeldig");
return false;
}
else
{
return true;
}
}
function verifInscription()
{
var testEmail = document.getElementById('forminscription').txt_email.value;
var reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
var testMp = document.getElementById('forminscription').txt_mp.value;
var reg2 = /^\w+$/;
if ((document.getElementById('forminscription').txt_pseudo.value == "") || (document.getElementById('forminscription').txt_pseudo.value.length < 2))
{
window.alert("Uw gebruikersnaam is ongeldig");
return false;
}
else if (document.getElementById('forminscription').txt_email.value == "")
{
window.alert("Uw e-mail is ongeldig");
return false;
}
else if (reg.test(testEmail)==false)
{
window.alert("Uw e-mail is ongeldig");
return false;
}
else if (document.getElementById('forminscription').txt_mp.value == "")
{
window.alert("Uw wachtwoord is ongeldig");
return false;
}
else if (document.getElementById('forminscription').txt_mp.value.length < 5)
{
window.alert("Uw wachtwoord moet ten minste 5 tekens");
return false;
}
else if (reg2.test(testMp)==false)
{
window.alert("Uw wachtwoord is ongeldig");
return false;
}
else if ((document.getElementById('forminscription').txt_ville.value == "") || (document.getElementById('forminscription').txt_ville.value.length < 3))
{
window.alert("Uw stad is ongeldig");
return false;
}
else if ((document.getElementById('forminscription').txt_pays.value == "") || (document.getElementById('forminscription').txt_pays.value.length < 3))
{
window.alert("Uw land is ongeldig");
return false;
}
else if ((document.getElementById('forminscription').txt_code.value == "") || (document.getElementById('forminscription').txt_code.value.length < 6))
{
window.alert("Uw verificatiecode is ongeldig");
return false;
}
else
{
return true;
}
}
function noter(type,num)
{
demandeDeConnexion();
}
function ajoutFavori(numProduit)
{
demandeDeConnexion();
}
function afficheReponseFavori(requete)
{
var doc = requete.responseText;
if (doc == "ok")
{
window.alert("Dit product is toegevoegd aan je favorieten");
}
else if (doc == "deja")
{
window.alert("Dit product is al toegevoegd aan je favorieten");
}
else
{
window.alert("Er is een fout opgetreden\nGelieve ons te verontschuldigen");
}
}
function demandeDeConnexion()
{
var msg = "Als u deze optie, u moet worden aangesloten\nGebruik het formulier in de rechterbovenhoek van de pagina\n\nAls u nog niet geregistreerd bent op deze site, wil nu registreren ?";
if (confirm(msg))
{
location.href = "/nl/registratie.php";
}
}
codeChargement = "
\n";
codeChargement += "\n";
codeChargement += "Even geduld... | \n";
codeChargement += "
\n";
codeChargement += "
\n";
function afficherNewsletter()
{
document.getElementById('contenuPopup').innerHTML = codeChargement;
afficherPopup(400,90);
var url = "/infos/newsletter.php";
var parametres = "lg=nl";
var myAjaxNews = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseAfficheur,
onFailure: rapporteErreur
}
);
}
function envoiNewsletter()
{
var emailNews = document.getElementById('emailNews').value;
if ((emailNews == "") || (emailNews == "@"))
{
window.alert("Uw e-mail is ongeldig");
}
else
{
var reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
//TEST EMAIL
if (reg.test(emailNews)==false)
{
window.alert("Uw e-mail is ongeldig");
}
else
{
var msg = "Wilt u zich abonneren op de TopCannabis.com club";
var answer = confirm(msg);
if (answer)
{
location.href = "/nl/registratie.php?email="+emailNews;
}
else
{
//window.alert("ok");
var url = "/infos/envoiNewsletter.php";
var parametres = "emailNews="+emailNews;
parametres += "&lg=nl";
var myAjaxEnvoiNews = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseEnvoiNews,
onFailure: rapporteErreur
}
);
}
}
}
}
function afficheReponseEnvoiNews(requete)
{
var doc = requete.responseText;
if (doc == "ok")
{
window.alert("Registratie gemaakt");
}
else if (doc == "deja")
{
window.alert("Registratie gemaakt");
}
else
{
window.alert("Er is een fout opgetreden\nGelieve ons te verontschuldigen");
}
fermerPopup();
}
function afficherContact(mode)
{
document.getElementById('contenuPopup').innerHTML = codeChargement;
afficherPopup(400,300);
var url = "/infos/contact.php";
var parametres = "mode="+mode;
parametres += "&lg=nl";
var myAjaxContact = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseAfficheur,
onFailure: rapporteErreur
}
);
}
function afficherEnvoiAmi()
{
document.getElementById('contenuPopup').innerHTML = codeChargement;
afficherPopup(400,350);
var url = "/infos/envoiAmi.php";
var parametres = "lg=nl";
var myAjaxEnvoiAmi = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseAfficheur,
onFailure: rapporteErreur
}
);
}
function afficherMpOubli()
{
document.getElementById('contenuPopup').innerHTML = codeChargement;
afficherPopup(400,120);
var url = "/infos/motDePasseOubli.php";
var parametres = "lg=nl";
var myAjaxMotDePasseOubli = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseAfficheur,
onFailure: rapporteErreur
}
);
}
function afficherNote(numPro)
{
demandeDeConnexion();
}
function afficheReponseAfficheur(requete)
{
var doc = requete.responseText;
if (doc == "nonconnecte")
{
demandeDeConnexion();
}
else
{
document.getElementById('contenuPopup').innerHTML = doc;
}
}
function afficherPopup(largeurTableau, hauteurTableau)
{
var d=dimension_detect();
largEcran = d.viewW;
hautEcran = d.viewH;
var hauteur = (hautEcran / 2) - (hauteurTableau / 2);
var largeur = (largEcran / 2) - (largeurTableau / 2);
document.getElementById('rideau').style.width = largEcran+"px";
document.getElementById('rideau').style.height = hautEcran+"px";
document.getElementById('casePopup').style.top = hauteur+"px";
document.getElementById('casePopup').style.left = largeur+"px";
document.getElementById('rideau').style.display = "block";
document.getElementById('casePopup').style.display = "block";
}
function fermerPopup()
{
document.getElementById('rideau').style.display = "none";
document.getElementById('casePopup').style.display = "none";
document.getElementById('contenuPopup').innerHTML = "";
}
function envoiNote(numPro)
{
var raison = document.getElementById('raisonNote').value;
if ((raison == "") || (raison.length < 10))
{
window.alert("Pr\u00E9cisez les raisons de votre vote");
}
else
{
var nbEtoile = 0;
if (document.getElementById('radioEtoile0').checked == true)
{
nbEtoile = 0;
}
else if (document.getElementById('radioEtoile1').checked == true)
{
nbEtoile = 1;
}
else if (document.getElementById('radioEtoile2').checked == true)
{
nbEtoile = 2;
}
else if (document.getElementById('radioEtoile3').checked == true)
{
nbEtoile = 3;
}
else if (document.getElementById('radioEtoile4').checked == true)
{
nbEtoile = 4;
}
else if (document.getElementById('radioEtoile5').checked == true)
{
nbEtoile = 5;
}
document.getElementById('contenuPopup').innerHTML = codeChargement;
raison = raison.replace(/%/g,"%25");
raison = raison.replace(/\+/g,"%2B");
raison = raison.replace(/\?/g,"%3F");
raison = raison.replace(/#/g,"%23");
raison = raison.replace(/&/g,"%26");
raison = raison.replace(/€/g,"%26Euro");
var url = "/infos/validNoteProducteur.php";
var parametres = "numPro="+numPro;
parametres += "&raison="+raison;
parametres += "&nbEtoile="+nbEtoile;
parametres += "&lg=nl";
var myAjaxValidNoteProducteur = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseValidNoteProducteur,
onFailure: rapporteErreur
}
);
}
}
function afficheReponseValidNoteProducteur(requete)
{
var doc = requete.responseText;
if (doc == "ok")
{
window.alert("Votre note a bien \u00E9t\u00E9 prise en compte");
}
else if (doc == "modifok")
{
window.alert("Modification effectu\u00E9e");
}
else
{
window.alert("Er is een fout opgetreden\nGelieve ons te verontschuldigen");
}
fermerPopup();
}
function envoiContact()
{
var mode = document.getElementById('memoireMode').value;
var emailContact = document.getElementById('emailContact').value;
var texteContact = document.getElementById('texteContact').value;
if ((emailContact == "") || (emailContact == "@"))
{
window.alert("Uw e-mail is ongeldig");
}
else
{
var reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
var etat = "ok";
//TEST EMAIL
if (reg.test(emailContact)==false)
{
window.alert("Uw e-mail is ongeldig");
}
else
{
if ((texteContact == "") || (texteContact.length < 10))
{
}
else
{
texteContact = texteContact.replace(/%/g,"%25");
texteContact = texteContact.replace(/\+/g,"%2B");
texteContact = texteContact.replace(/\?/g,"%3F");
texteContact = texteContact.replace(/#/g,"%23");
texteContact = texteContact.replace(/&/g,"%26");
texteContact = texteContact.replace(/€/g,"%26Euro");
var url = "/infos/validEnvoiContact.php";
var parametres = "emailContact="+emailContact;
parametres += "&mode="+mode;
parametres += "&texteContact="+texteContact;
parametres += "&lg=nl";
var myAjaxValidEnvoiContact = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseValidEnvoiContact,
onFailure: rapporteErreur
}
);
}
}
}
}
function afficheReponseValidEnvoiContact(requete)
{
var doc = requete.responseText;
if (doc == "ok")
{
window.alert("Bericht verzonden");
}
else
{
window.alert("Er is een fout opgetreden\nGelieve ons te verontschuldigen");
}
fermerPopup();
}
function envoiMotDePasseOubli()
{
var emailOubli = document.getElementById('emailOubli').value;
if ((emailOubli == "") || (emailOubli == "@"))
{
window.alert("Uw e-mail is ongeldig");
}
else
{
var reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
var etat = "ok";
//TEST EMAIL
if (reg.test(emailOubli)==false)
{
window.alert("Uw e-mail is ongeldig");
}
else
{
var url = "/infos/validEnvoiOubli.php";
var parametres = "emailOubli="+emailOubli;
parametres += "&lg=nl";
var myAjaxValidEnvoiOubli = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseValidEnvoiOubli,
onFailure: rapporteErreur
}
);
}
}
}
function afficheReponseValidEnvoiOubli(requete)
{
var doc = requete.responseText;
if (doc == "ok")
{
window.alert("Uw wachtwoord is naar u verzonden per e-mail");
}
else if (doc == "inconnu")
{
window.alert("Uw e-mailadres is onbekend");
}
else
{
window.alert("Er is een fout opgetreden\nGelieve ons te verontschuldigen");
}
fermerPopup();
}
function envoiAmi()
{
var emailAmi1 = document.getElementById('emailAmi1').value;
var emailAmi2 = document.getElementById('emailAmi2').value;
var emailAmi3 = document.getElementById('emailAmi3').value;
var texteAmi = document.getElementById('texteAmi').value;
if (((emailAmi1 == "") || (emailAmi1 == "@")) && ((emailAmi2 == "") || (emailAmi2 == "@")) && ((emailAmi3 == "") || (emailAmi3 == "@")))
{
window.alert("Uw e-mail is ongeldig");
}
else if ((emailAmi1 != "@") || (emailAmi2 != "@") || (emailAmi3 != "@"))
{
var reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
var etat = "ok";
if (emailAmi1 != "")
{
if (emailAmi1 != "@")
{
//TEST EMAIL
if (reg.test(emailAmi1)==false)
{
window.alert("Uw e-mail is ongeldig");
etat = "ko";
}
}
}
if (emailAmi2 != "")
{
if (emailAmi2 != "@")
{
//TEST EMAIL
if (reg.test(emailAmi2)==false)
{
window.alert("Uw e-mail is ongeldig");
etat = "ko";
}
}
}
if (emailAmi3 != "")
{
if (emailAmi3 != "@")
{
//TEST EMAIL
if (reg.test(emailAmi3)==false)
{
window.alert("Uw e-mail is ongeldig");
etat = "ko";
}
}
}
if (etat == "ok")
{
texteAmi = texteAmi.replace(/%/g,"%25");
texteAmi = texteAmi.replace(/\+/g,"%2B");
texteAmi = texteAmi.replace(/\?/g,"%3F");
texteAmi = texteAmi.replace(/#/g,"%23");
texteAmi = texteAmi.replace(/&/g,"%26");
texteAmi = texteAmi.replace(/€/g,"%26Euro");
var url = "/infos/validEnvoiAmi.php";
var parametres = "emailAmi1="+emailAmi1;
parametres += "&emailAmi2="+emailAmi2;
parametres += "&emailAmi3="+emailAmi3;
parametres += "&texteAmi="+texteAmi;
parametres += "&lg=nl";
var myAjaxValidEnvoiAmi = new Ajax.Request(
url,
{
method: 'get',
parameters: parametres,
onComplete: afficheReponseValidEnvoiAmi,
onFailure: rapporteErreur
}
);
}
}
}
function afficheReponseValidEnvoiAmi(requete)
{
var doc = requete.responseText;
if (doc == "ok")
{
window.alert("Uitnodiging verstuurd");
}
else
{
window.alert("Er is een fout opgetreden\nGelieve ons te verontschuldigen");
}
fermerPopup();
}
function nettoyageCaseEmail(id)
{
if (document.getElementById(id).value == "@")
{
document.getElementById(id).value = "";
document.getElementById(id).style.textAlign = "left";
}
}
function addFav()
{
nav = navigator.appName.substring(0,3);
ver = navigator.appVersion.substring(0,1);
if ((nav == "Mic") && (ver >= 4))
{
url_site="http://www.topcannabis.com";
titre_site = "TopCannabis.com";
window.external.AddFavorite(url_site, titre_site);
}
else
{
window.alert("CTRL+D");
}
}