// JavaScript Document
var imagesPath = "/skins/default/images/";
var rootDir = "/";
var lang = "fr";
var PLang = (lang=='fr')?'/':'/'+lang+'/';
// Appends Get Vars into js Vars
var url = String(self.location);
tmp = url.split("?");
if (tmp[1]) {
var queryString = tmp[1];
vars = queryString.split('#');
vars = vars[0].split('&');
var _GET = new Array();
for (var i = 0 ; i < vars.length; ++i ) {
tmp = vars[i].split('=');
_GET[tmp[0]] = tmp[1];
}
}
// on va cacher les images du menu & more
var imgs = new Array();
var imgsIds = new Array();
for (idd in imgsIds) {
imgs[imgsIds[idd]] = { on: new Image(), off:new Image() };
imgs[imgsIds[idd]].on.src = 'imgs/menu'+imgsIds[idd]+'on.gif';
imgs[imgsIds[idd]].off.src = 'imgs/menu'+imgsIds[idd]+'off.gif';
}
function Traduction(id) {
if (textes[lang] && textes[lang][id]) return textes[lang][id];
else textes['fr'][id];
}
var textes = new Array();
textes['fr'] = {
panierOK: 'Le produit a été ajouter à votre panier.',
panierCookie: 'Vous devez activer les «cookies» dans les préférences de votre navigateur pour pouvoir demander un devis.
Cliquez ici pour savoir comment activer les cookies.',
nbProduct: 'produit dans votre panier',
nbProducts: 'produits dans votre panier',
panierVider: 'Vider votre panier',
panierVide: 'Votre panier est vide',
panierValider: 'Valider votre commande',
panier: 'panier'
};
textes['en'] = {
panierOK: 'This product has been succefuly added to your cart.',
panierCookie: 'Vous devez activer les «cookies» dans les préférences de votre navigateur pour pouvoir demander un devis.
Cliquez ici pour savoir comment activer les cookies.',
nbProduct: 'product in your cart',
nbProducts: 'products in your cart',
panierVider: 'Empty your cart',
panierVide: 'Your cart is empty',
panierValider: 'Checkout Now',
panier: 'cart'
};
function linkify (text) {
text = text.replace(/[é;è;ê;ë]/g,'e');
text = text.replace(/à/g,'a');
text = text.replace(/ç/g,'c');
text = text.replace(/[,; ;';"]/g,'+');
text = text.replace(/[?;&]/g,'');
return text;
}
function rechercheRapide(){
if (_Elem('mot_clef').value.length > 0) {
self.location = '/recherche/'+linkify(_Elem('mot_clef').value)+'/';
}
}
var dx = -1;
var pas = 10;
var x = -145;
var Xmin = -145;
var Xmax = 555;
function moveCoup2coeur() {
if (dx == 1) {
// montre
x = x + dx*pas ;
_Elem('coup2coeur').style.left = x+'px';
if (x <= Xmax-dx*pas) setTimeout("moveCoup2coeur()",10);
else _Elem('coup2coeurPannelI').src = _Elem('coup2coeurPannelI').src.replace(/open/,'close');
} else if (dx == -1 ) {
// cache
x = x + dx*pas ;
_Elem('coup2coeur').style.left = x+'px';
if (x >= Xmin - dx*pas) setTimeout("moveCoup2coeur()",10);
else _Elem('coup2coeurPannelI').src = _Elem('coup2coeurPannelI').src.replace(/close/,'open');
} else {
// fini
}
}
function showCoup2coeur() {
Xmax = (parseInt(document.body.clientWidth) - 1000) / 2;
if (dx==-1) {
if ( (x >= Xmin) && (x < Xmax) ) {
dx = 0 - dx ;
setTimeout("moveCoup2coeur()",10);
}
} else {
if ( (x <= Xmax) && (x > Xmin) ){
dx = 0 - dx ;
setTimeout("moveCoup2coeur()",10);
}
}
}
function hideCoup2coeur() {
Xmax = (parseInt(document.body.clientWidth) - 155 ) / 2;
if ( (x <= Xmax) && (x > Xmin) ){
dx = -1;
setTimeout("moveCoup2coeur()",10);
}
}
// JavaScript Document
var sAgent = navigator.userAgent.toLowerCase() ;
if (sAgent.indexOf("msie") == -1) {
var IE = 0;
} else { var IE = 1; }
var mouseX = 0;
var mouseY = 0;
function getMouseXY() {
if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
} else { // grab the x-y pos.s if browser is NS
tempX = e.pageX
tempY = e.pageY
}
// catch possible negative values in NS4
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
// show the position values in the form named Show
// in the text fields named MouseX and MouseY
/*mouseX = tempX;
mouseY = tempY;*/
return {x:tempX, y:tempY};
//alert(mouseX+'x'+mouseY);
}
var mousePos;
if (!IE) { document.onmousemove = mouseMove; }
function mouseMove(ev){
ev = ev || window.event;
mousePos = mouseCoords(ev);
}
function mouseCoords(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
// surcharge de la fonction getElementById pour simplifer le codage
function _Elem(id) {
return document.getElementById(id);
}
function Show() {
for (var i = 0; i < arguments.length; ++i) {
_Elem(arguments[i]).style.display = 'block';
_Elem(arguments[i]).style.visibility = 'visible';
}
}
function Hide() {
for (var i = 0; i < arguments.length; ++i) {
_Elem(arguments[i]).style.display = 'none';
_Elem(arguments[i]).style.visibility = 'hidden';
}
}
function showHide(id) {
if (_Elem(id).style.display != 'none')
Hide(id);
else
Show(id);
}
function ucFirst(str) {
return str.substr(0,1).toUpperCase() + str.substr(1,str.length);
}
function checkMail(adresse){
var regEx = /([a-z0-9]+([-_]?[a-z0-9]+)*.)*[a-z0-9]+([-_]?[a-z0-9]+)*@([a-z0-9]+([-_]?[a-z0-9]+)*.)+[a-z]{1,4}/gi;
if (adresse.match(regEx) != adresse ) {
return false;
} else {
return true;
}
}
var cp = '';
var old_cp = '';
var villePrx = '';
function doVilles(prx) {
var remoteVilles = new villes(villesCallBack);
cp = _Elem(prx+'code_postal').value;
if (cp != old_cp){
if (cp) { remoteVilles.getvilles(cp); }
old_cp = cp ;
villePrx = prx;
}
}
var villesCallBack = {
getvilles: function (aryVilles) {
var sel = _Elem(villePrx+'ville_id');
sel.length=0;
if (!aryVilles) {
var res = document.createElement('option');
res.value=0;
res.innerHTML='Pas de villes pour ce Code postal';
sel.appendChild(res);
}
else {
for (var i = 0; i < aryVilles.length; ++i) {
var res = document.createElement('option');
res.value=aryVilles[i]['ville_id'];
res.innerHTML=aryVilles[i]['commune'];
sel.appendChild(res);
}
}
}
}
function checkMaquette() {
nbErr = 0;
fieldToFocus = 'none';
aryReq = new Array('nom','telephone','email','delais');
for (i=0; i 0) _Elem(fieldToFocus).focus();
else return true;
return false;
}
function checkContact() {
nbErr = 0;
fieldToFocus = 'none';
aryReq = new Array('nom','email','message');
for (i=0; i 0) _Elem(fieldToFocus).focus();
else return true;
return false;
}
function checkMdp() {
nbErr = 0;
fieldToFocus = 'none';
aryReq = new Array('mdp1','mdp2');
for (i=0; i 0) _Elem(fieldToFocus).focus();
else return true;
return false;
}
function checkCoordonnee(isCrea) {
nbErr = 0;
fieldToFocus = 'none';
if (isCrea) aryReq = new Array('email','pwd1','pwd2','nom','adresse1','code_postal','telephone');
else aryReq = new Array('email','nom','adresse1','code_postal','telephone');
for (i=0; i 0) _Elem(fieldToFocus).focus();
else return true;
return false;
}
function _Validate(id) {
_Elem(id).style.borderColor = "#cecece";
_Elem(id).style.backgroundColor = "#ffffff";
}
function _Error(id) {
_Elem(id).style.borderColor = "#ff0000";
_Elem(id).style.backgroundColor = "#EACEB5";
}
function checkBdc() {
nbErr = 0;
fieldToFocus = 'none';
aryReq = new Array('bdc_nom', 'bdc_prenom', 'bdc_adresse', 'bdc_code_postal', 'bdc_ville',
'bdc_telephone', 'bdc_email', 'bdc_destination', 'bdc_date_depart', 'bdc_date_retour', 'bdc_frais_consulaires', 'bdc_frais_retour');
for (i=0; i 0) { _Elem(fieldToFocus).focus(); return false; }
else return true;
}
function imgOpacity(obj,alpha) {
if (obj.firstChild.className == 'offreLienOff') {
obj.firstChild.style.opacity = alpha;
obj.firstChild.style.MozOpacity = alpha;
obj.firstChild.style.filter = "alpha(opacity="+(alpha*100)+")";
}
}
function changeFraisRetour(val) {
tmp = val.split(':');
if (tmp[1] *1 > 0) {
_Elem('bdc_mode_expedition').value = tmp[0];
_Elem('bdc_frais_retour').value = tmp[1];
} else {
_Elem('bdc_mode_expedition').value = tmp[0];
_Elem('bdc_frais_retour').value = 'nous consulter';
}
}
function Move(id, X, Y) {
_Elem(id).style.left = X;
_Elem(id).style.top = Y;
}
function createAkisiBulle() {
tmp = document.createElement('div');
tmp.id = 'AkisiBulleDiv';
tmp.style.position = 'absolute';
tmp.style.zIndex = '1000';
document.body.appendChild(tmp);
if (IE) {
tmp2 = document.createElement('iframe');
tmp2.id = 'AkisiBulleIframe';
tmp2.style.position = 'absolute';
tmp2.style.height = '25px';
tmp2.style.zIndex = '999';
document.body.appendChild(tmp2);
}
}
function HideAkisiBulle() {_Elem('AkisiBulleDiv').innerHTML = ''; Hide('AkisiBulleDiv'); if (IE) Hide('AkisiBulleIframe'); }
function AkisiBulleFollowMouse() {
if (IE) mousePos = getMouseXY();
Move('AkisiBulleDiv',mousePos.x+5, mousePos.y+5);
if (IE) {
_Elem('AkisiBulleIframe').style.width = _Elem('AkisiBulleDiv').clientWidth;
_Elem('AkisiBulleIframe').style.height = _Elem('AkisiBulleDiv').clientHeight;
Move('AkisiBulleIframe',mousePos.x+5, mousePos.y+5);
}
}
function AkisiBulle(obj, texte) {
if (!_Elem('AkisiBulleDiv')) { createAkisiBulle() ;}
Show('AkisiBulleDiv')
if (IE) Show('AkisiBulleIframe');
if (IE) {
document.onmousemove = AkisiBulleFollowMouse;
obj.onmouseout = HideAkisiBulle;
} else {
document.addEventListener('mousemove', AkisiBulleFollowMouse, true);
obj.addEventListener('mouseout', HideAkisiBulle, true);
}
_Elem('AkisiBulleDiv').innerHTML = texte;
}
var cp = '';
var old_cp = '';
var villePrx = '';
function doVilles(prx) {
//var remoteVilles = new villes(villesCallBack);
cp = _Elem(prx+'code_postal').value;
if (cp != old_cp){
//if (cp) { remoteVilles.getvilles(cp); }
if (cp) { AkisiJax('ville.php?cp='+cp); }
old_cp = cp ;
villePrx = prx;
}
}
var villesCallBack = {
getvilles: function (aryVilles) {
var sel = _Elem(villePrx+'ville_id');
sel.length=0;
if (!aryVilles) {
var res = document.createElement('option');
res.value=0;
res.innerHTML='Pas de villes pour ce Code postal';
sel.appendChild(res);
}
else {
for (var i = 0; i < aryVilles.length; ++i) {
var res = document.createElement('option');
res.value=aryVilles[i]['ville_id'];
res.innerHTML=aryVilles[i]['commune'];
sel.appendChild(res);
}
}
}
}
function _Alpha(id,val) {
_Elem(id).style.opacity = val/100;
_Elem(id).style.MozOpacity = val/100;
_Elem(id).style.filter = "alpha(opacity="+val+")";
}
var Texte = new Array();
Texte['date'] = 'Entrez une date au format: jj/mm/aaaa';
Texte['frais_consulaires'] = 'Indiquez ici le montnant des frais consulaires pour votre visa. Vous le trouverez dans la partie Tarifs de notre site.';
Texte['frais_retour'] = 'Indiquez ici le montnant des frais de retour qui varient suivant le mode de livraison de votre visa. Vous le trouverez dans la partie Tarifs de notre site.';
function AkisiJax(what) {
var xjs=document.createElement('script');
xjs.src=what;
xjs.id = 'AkisiJax';
document.getElementsByTagName('head')[0].appendChild(xjs);
}
function removeAkisiJaxScript() {
document.getElementsByTagName("head").item(0).removeChild(_Elem('AkisiJax'));
}
function villesSelect(aryVilles) {
var sel = _Elem(villePrx+'ville_id');
sel.length=0;
if (!aryVilles) {
var res = document.createElement('option');
res.value=0;
res.innerHTML='Pas de villes pour ce Code postal';
sel.appendChild(res);
}
else {
for (var i = 0; i < aryVilles.length; ++i) {
var res = document.createElement('option');
res.value=aryVilles[i]['ville_id'];
res.innerHTML=aryVilles[i]['commune'];
sel.appendChild(res);
}
}
removeAkisiJaxScript();
}
function initFond() {
_Elem('fond2').style.backgroundImage = 'url('+imagesPath+'fond2.gif)';
}
function courriel() { document.write('akinofutons@neuf.fr');}// cookies
var CookieEnabled = (document.cookie.length>0);
function EcrireCookie(nom, valeur) {
var argv=EcrireCookie.arguments;
var argc=EcrireCookie.arguments.length;
var expires=(argc > 2) ? argv[2] : null;
var path=(argc > 3) ? argv[3] : null;
var domain=(argc > 4) ? argv[4] : null;
var secure=(argc > 5) ? argv[5] : false;
//alert(path);
document.cookie=nom+"="+escape(valeur)+
((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
((path==null) ? "" : ("; path="+path))+
((domain==null) ? "" : ("; domain="+domain))+
((secure==true) ? "; secure" : "");
}
function getCookieVal(offset) {
var endstr=document.cookie.indexOf (";", offset);
if (endstr==-1) endstr=document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function LireCookie(nom) {
var arg=nom+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i=0) {
if (coul) this.aryEntry[idx].couleur = coul;
if (prix) this.aryEntry[idx].prix = prix;
if (quant) this.aryEntry[idx].quantite = quant;
if (designation) this.aryEntry[idx].designation = designation;
} else {
this.aryEntry[this.aryEntry.length] = {id:produit_id, couleur:coul, prix:prix, designation:designation, quantite:quant};
this.nbElem = this.aryEntry.length;
}
this.sauver();
this.afficher();
if (alerter == true) {
if (CookieEnabled)
Alerte('Message', ' '+Traduction('panierOK')+'