// JavaScript Document var imagesPath = "/skins/default/images/"; // 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]; } } var sAgent = navigator.userAgent.toLowerCase() ; if (sAgent.indexOf("msie") == -1) { var IE = 0; } else { var IE = 1; } /* 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 = ''; _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','telephone','email','message'); for (i=0; i 0) _Elem(fieldToFocus).focus(); else return true; return false; } 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 favoris() { if ( navigator.appName != 'Microsoft Internet Explorer' ){ window.sidebar.addPanel("Akisiweb","http://www.akisiweb.com/",""); alert ('Un favori va être créé, il risque de s\'ouvrir dans le panneau latéral de votre navigateur. Pour y remédier faites un clique droit sur le marque-page Akisiweb puis choisissez et décochez . Merci') _Elem('imgFavoris').src = '/entete-ajouter-favoris-ok.php'; } else { window.external.AddFavorite("http://www.akisiweb.com/","Akisiweb"); _Elem('imgFavoris').src = '/entete-ajouter-favoris-ok.php'; } } function Scroller(id, animation, speed) { this.id = id; this.aryDiv= new Array(); this.nbDiv= 0; this.currDivIdx= 0; this.nextDivIdx= 0; this.width=180; this.height=250; if (speed) this.speed=-speed; else this.speed = -10; this.timer=0; this.run=true; this.alpha = 100; this.displayTime = 15000; if (animation) this.animation=animation; else this.animation = 'Diapo'; this.Init = function () { tmp = _Elem(this.id).childNodes; j=0; for (i=0; i 0) { this.nbDiv = this.aryDiv.length; this.currDivIdx = this.nbDiv-1; this.nextDivIdx = 0; if (this.nextDivIdx>=this.nbDiv) this.nextDivIdx = 0; } }; this.Swap = function() { this.timer = 10; eval ('this.'+this.animation+'()'); if (this.run) eval ('this.TimeOut = setTimeout("s'+this.id+'.Swap()",this.timer);'); } this.Change = function() { Hide(this.aryDiv[this.currDivIdx].id); Show(this.aryDiv[this.nextDivIdx].id); this.currDivIdx++; this.nextDivIdx++; if (this.currDivIdx>=this.nbDiv) this.currDivIdx = 0; if (this.nextDivIdx>=this.nbDiv) this.nextDivIdx = 0; } this.DiapoH = function() { this.width += this.speed; _Elem(this.id).style.width = this.width; if (this.width == 0) { this.speed = -this.speed; this.Change(); } if (this.width == 180) { this.speed = -this.speed; this.timer = this.displayTime ; clearTimeout(this.TimeOut); } if (this.width == 180 && this.nbDiv == 1) this.run = false; } this.DiapoVH = function() { _Elem(this.id).parentNode.style.verticalAlign = 'middle'; this.height += this.speed; this.width += this.speed; _Elem(this.id).style.height = this.height; _Elem(this.id).style.width = this.width; if (this.width == 0) { this.speed = -this.speed; this.Change(); } if (this.width == 180) { this.speed = -this.speed; this.timer = this.displayTime ; clearTimeout(this.TimeOut); } if (this.width == 180 && this.nbDiv == 1) this.run = false; } this.DiapoV = function() { this.height += this.speed; _Elem(this.id).style.height = this.height; if (this.height == 0) { this.speed = -this.speed; _Elem(this.id).style.height = "1px"; this.Change(); } if (this.height == 250) { this.speed = -this.speed; this.timer = this.displayTime ; clearTimeout(this.TimeOut); } if (this.height == 250 && this.nbDiv == 1) this.run = false; } this.Fade = function () { this.alpha+=this.speed; _Elem(this.id).style.opacity = this.alpha/100; _Elem(this.id).style.MozOpacity = this.alpha/100; _Elem(this.id).style.filter = "alpha(opacity="+this.alpha+")"; if (this.alpha == 0) { this.speed = -this.speed; this.Change(); } if (this.alpha == 100) { this.speed = -this.speed; this.timer = this.displayTime; clearTimeout(this.TimeOut); } if (this.alpha == 100 && this.nbDiv == 1) this.run = false; } } function scrollInit(id, anim, speed) { eval('s'+id +'= new Scroller("'+id+'","'+anim+'","'+speed+'");'); eval('s'+id +'.Init();'); if (eval('s'+id +'.nbDiv') > 0) eval ('setTimeout("s'+id+'.Swap()",s'+id+'.timer);'); } /* les realisations */ var aryImgs = Array(); idx = 0; for (idx=0; idx<=16;idx++) { aryImgs[idx] = new Image() ; aryImgs[idx].src = '/images/slider_images_'+(idx+1)+'.jpg'; } var cur = 0; var dx = 0; function imagesDance() { cur++; _Elem('slider').removeChild(_Elem('slider').firstChild); tmp = document.createElement('img'); tmp.width="128"; tmp.height="96"; /*tmp.hspace="5";*/ tmp.src=aryImgs[(cur+4)%aryImgs.length].src; _Elem('slider').appendChild(tmp); } function decalImages() { pas = 1; _Elem('slider').style.left = dx+'px'; dx -= pas; if (dx == (-138-pas)) { /*swapImages();*/ imagesDance(); _Elem('slider').style.left = '0px'; dx = 0; } setTimeout('decalImages()',30); }