// 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]; } } 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 rechercheSimple(){ if (_Elem('mot_clef').value.length > 0) { self.location = 'objets-publicitaires-'+linkify(_Elem('mot_clef').value)+'.html'; } else { self.location = 'objets-publicitaires.html'; } } function getCats(id) { if (id > 0) { prod = new produit(ajaxCallBack); prod.ajaxGetCatsSite(id); } else { _Elem('categorie_id').options.length = 1; } } var ajaxCallBack = { ajaxGetCatsSite: function(ary) { _Elem('categorie_id').options.length = 1; if (ary['aryCats']) for (i = 0; i < ary['aryCats'].length; i++) selectAddOption('categorie_id', ary['aryCats'][i]['libelle'], ary['aryCats'][i]['categorie_id']); } } 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; 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 = 0; this.nextDivIdx = 1; 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 = 3000; 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 = 3000; 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 = 3000; 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 = 3000; 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);'); } function checkContact() { nbErr = 0; fieldToFocus = 'none'; aryChk = new Array('raison_sociale','nom', 'telephone','email','code_postal'); for (i=0;i