var affiche_prd = 0; if ( document.all ){ function blink_show() { blink_tags = document.all.tags('blink'); blink_count = blink_tags.length; for ( i = 0; i < blink_count; i++ ) { blink_tags[i].style.visibility = 'visible'; } window.setTimeout( 'blink_hide()', 700 ); } function blink_hide() { blink_tags = document.all.tags('blink'); blink_count = blink_tags.length; for ( i = 0; i < blink_count; i++ ) { blink_tags[i].style.visibility = 'hidden'; } window.setTimeout( 'blink_show()', 250 ); } //window.onload = blink_show; } function compteur_js() { cpt_tags = document.getElementsByTagName('compteur'); cpt_count = cpt_tags.length; for ( i = 0; i < cpt_count; i++ ) { temps_restant = cpt_tags[i].getAttribute('tmp'); if(temps_restant){ div = cpt_tags[i].getAttribute('idc'); document.getElementById(div).innerHTML = ''+GetDateFormat(temps_restant)+''; //cpt_tags[i].innerHTML = GetDateFormat(temps_restant); cpt_tags[i].setAttribute('tmp',temps_restant-1); } } window.setTimeout( 'compteur_js()', 1000 ); } function GetDateFormat(tmprestant){ DiffSec = tmprestant;//Math.floor((TempFuture-TempMaintenant)/1000); DiffMin = Math.floor(DiffSec/60); Diffheure = Math.floor(DiffMin/60); DiffJour = Math.floor(Diffheure/24); while (DiffMin>=60){ DiffMin = DiffMin-60; } while (Diffheure>=24){ Diffheure = Diffheure-24; } while (DiffSec>=60){ DiffSec = DiffSec-60; } text_rtn = ' '; if(DiffJour>0) text_rtn=text_rtn + DiffJour + 'j '; if(DiffJour!=0 || Diffheure>0) text_rtn=text_rtn + Diffheure + 'h '; return text_rtn + DiffMin + 'min ' + DiffSec + 's '; } /* fonction affichage masquage */ function ShowEditRes(id){ var elm_l = document.getElementById('res_'+id); var elm_e = document.getElementById('res_edit_'+id); elm_l.style.display = 'none'; elm_e.style.display = ''; } function hideId(id){ var elm = document.getElementById(id); elm.style.visibility="hidden"; elm.style.display="none"; } function showEditEnchr(id){ hideId('ench_norm_'+id); showId('ench_mod_'+id); } function showId(id){ var elm = document.getElementById(id); elm.style.visibility="visible"; elm.style.display=""; } var position_img = 1; var nb_img = 0; function loadDataDI(pi,ni){ position_img=pi; nb_img=ni; } var img_is_changing=false; function deplaceImage(num){ if(img_is_changing){ return false; } if(position_img == 1 && num == -1){ }else if(position_img == nb_img && num == 1){ }else{ img_is_changing=true; var img_div = document.getElementById('img_div_'+position_img); Effect.Fade(img_div, { duration:0.1, afterFinish: function(){ position_img = num + position_img; var img_div2 = document.getElementById('img_div_'+position_img); Effect.Appear(img_div2); //img_div2.show(); if(position_img == 1){ $('last_img').hide(); }else{ $('last_img').show(); } if(position_img == nb_img){ $('next_img').hide(); }else{ $('next_img').show(); } img_is_changing=false; } }); } } var last_id = ''; var last_id2 = ''; function echangeVisibleCacheAncien(inv_id,vis_id){ if(last_id==''){ echangeVisible(inv_id,vis_id); last_id = inv_id; last_id2 = vis_id; }else{ echangeVisible(last_id2,last_id); echangeVisible(inv_id,vis_id); last_id = inv_id; last_id2 = vis_id; } } function AfficheAvecEffet(vis_id){ Effect.SlideDown (vis_id); } var l_id_evi = ''; function EchangeVisibleInv(id){ var vis_id = document.getElementById(id); if(l_id_evi != id){ Effect.SlideDown (vis_id); l_id_evi = id; }else{ Effect.SlideUp (vis_id); l_id_evi = ''; } } function echangeVisible(inv_id,vis_id){ Effect.SlideUp(inv_id, { afterFinish: function(){ Effect.SlideDown (vis_id); } }); } /*apres l'ajout d'un produit*/ var id_produit = -1; function produit_ajoute(ifrm){ if(id_produit!=-1){ var add_p = document.getElementById('addtocart_'+id_produit); var add_td_p = document.getElementById('addtocart_td_'+id_produit); add_p.innerHTML='Produit ajouté'; add_p.className = 'ProduitDansPanier'; add_td_p.className = 'ProduitDansPanier'; add_td_p.vAlign = 'middle'; add_td_p.align = 'center'; } } var compatible_ajax = true; function UpdateBox(bx){ if(compatible_ajax){ /* Effect.Puff('box_'+bx, { afterFinish: function(){ */ new Ajax.Request('ajax.php', { method: 'post', parameters: {box: bx} , onSuccess: function(transport){ var response = transport.responseText; $('box_'+bx).innerHTML = response; //Effect.Grow('box_'+bx); } }); /*} } );*/ } } function AddEnchere(id){ $('addtocart_form_'+id).action.value='addenchajax'; if(compatible_ajax) new Ajax.Request('enchere.html', { method:'post', parameters: $('addtocart_form_'+id).serialize(true), onSuccess: function(transport){ var response = transport.responseText; if($('addtocart2_td_'+id)) $('addtocart2_'+id).innerHTML = response; //if($('addtocart_td_'+id)) $('addtocart_'+id).innerHTML = response; if($('addtocart2_td_'+id)) new Effect.Shake('addtocart2_'+id); else new Effect.Shake('addtocart_'+id); }, onFailure: function(){ compatible_ajax = false; $('addtocart_form_'+id).submit(); } }); if(compatible_ajax) return false; else return true; } function AddEnchereToCart(id){ new Effect.Shake('addtocart_'+id); return true; } function AddToCart(id){ $('addtocart_form_'+id).action.value='addcartajax'; if(compatible_ajax) new Ajax.Request('ajax.php', { method:'post', parameters: $('addtocart_form_'+id).serialize(true), onSuccess: function(transport){ var response = transport.responseText; switch(response.substr(0,1)){ case '0': if($('addtocart_td_'+id)){ $('addtocart_td_'+id).className = "ProduitDansPanier"; $('addtocart_td_'+id).vAlign = "top"; $('addtocart_td_'+id).align = "center"; } if($('addtocart2_td_'+id)){ $('addtocart2_td_'+id).className = "ProduitDansPanier"; $('addtocart2_td_'+id).vAlign = "middle"; $('addtocart2_td_'+id).align = "center"; } break; case '1': if($('addtocart_td_'+id)){ $('addtocart_td_'+id).className = "ProduitEnRupture"; $('addtocart_td_'+id).vAlign = "middle"; $('addtocart_td_'+id).align = "center"; } if($('addtocart2_td_'+id)){ $('addtocart2_td_'+id).className = "ProduitEnRupture"; $('addtocart2_td_'+id).vAlign = "middle"; $('addtocart2_td_'+id).align = "center"; } break; } if($('addtocart2_td_'+id)) $('addtocart2_'+id).innerHTML = response.substr(1,response.length-1); if($('addtocart_td_'+id)) $('addtocart_'+id).innerHTML = response.substr(1,response.length-1); if($('addtocart2_td_'+id)) new Effect.Shake('addtocart2_'+id); else new Effect.Shake('addtocart_'+id); //box_panier UpdateBox('panier'); }, onFailure: function(){ compatible_ajax = false; $('addtocart_form_'+id).submit(); } }); if(compatible_ajax) return false; else return true; } function AddToRes(id){ if(compatible_ajax){ $('addtocart_form_'+id).ajax.value='1'; new Ajax.Request('reservation.html', { method:'post', parameters: $('addtocart_form_'+id).serialize(true), onSuccess: function(transport){ var response = transport.responseText; if($('addtocart_td_'+id)){ $('addtocart_td_'+id).className = "ProduitaReserve"; $('addtocart_td_'+id).vAlign = "top"; $('addtocart_td_'+id).align = "center"; } if($('addtocart2_td_'+id)){ $('addtocart2_td_'+id).className = "ProduitaReserve"; $('addtocart2_td_'+id).vAlign = "top"; $('addtocart2_td_'+id).align = "center"; } if($('addtocart2_td_'+id)) $('addtocart2_'+id).innerHTML = response; if($('addtocart_td_'+id)) $('addtocart_'+id).innerHTML = response; if($('addtocart2_td_'+id)) new Effect.Shake('addtocart2_'+id); else new Effect.Shake('addtocart_'+id); //box_panier //UpdateBox('panier'); }, onFailure: function(){ compatible_ajax = false; $('addtocart_form_'+id).submit(); } }); } if(compatible_ajax) return false; else return true; } function DivisePrix(id){ if(compatible_ajax){ new Ajax.Request('ajax.php', { method:'get', parameters:{divise: id}, onSuccess: function(transport){ var response = transport.responseText; if($('divise_prix_'+id)){ $('divise_prix_'+id).innerHTML = response; new Effect.SlideUp('divise_'+id); new Effect.Shake('divise_prix_'+id); } }, onFailure: function(){ compatible_ajax = false; } }); } if(compatible_ajax) return false; else return true; } function AddGiftToCart(id) { $('addtocart_form_'+id).action.value = 'addgiftajax'; if(compatible_ajax) new Ajax.Request('ajax.php', { method:'post', parameters: $('addtocart_form_'+id).serialize(true), onSuccess: function(transport){ var response = transport.responseText; switch(response.substr(0, 1)){ case '0': if($('addtocart_td_'+id)){ $('addtocart_td_'+id).className = "ProduitDansPanier"; $('addtocart_td_'+id).vAlign = "top"; $('addtocart_td_'+id).align = "center"; } if($('addtocart2_td_'+id)){ $('addtocart2_td_'+id).className = "ProduitDansPanier"; $('addtocart2_td_'+id).vAlign = "middle"; $('addtocart2_td_'+id).align = "center"; } break; case '1': if($('addtocart_td_'+id)){ $('addtocart_td_'+id).className = "bgdarkgrey middle center size12 white"; $('addtocart_td_'+id).vAlign = "middle"; $('addtocart_td_'+id).align = "center"; } if($('addtocart2_td_'+id)){ $('addtocart2_td_'+id).className = "bgdarkgrey middle center size12 white"; $('addtocart2_td_'+id).vAlign = "middle"; $('addtocart2_td_'+id).align = "center"; } break; } if($('addtocart2_td_'+id)) $('addtocart2_'+id).innerHTML = response.substr(1,response.length-1); if($('addtocart_td_'+id)) $('addtocart_'+id).innerHTML = response.substr(1,response.length-1); if($('addtocart2_td_'+id)) new Effect.Shake('addtocart2_'+id); else new Effect.Shake('addtocart_'+id); //box_panier //UpdateBox('panier'); }, onFailure: function(){ compatible_ajax = false; $('addtocart_form_'+id).submit(); } }); if(compatible_ajax) return false; else return true; } /* fonctions qui verifie les input */ function check_input(elm,formulaire){ switch(formulaire){ case 0: //inscription var elm_msg = document.getElementById('check_'+elm.id); var animate = false; switch(elm.id){ case 'code': var elm_vcode = document.getElementById('vcode'); var elm_msgv = document.getElementById('check_v'+elm.id); if(elm_vcode.value != '' && (elm.value != elm_vcode.value || elm.value.length < 6) ){ elm_msgv.innerHTML = ''; animate = true; }else if(elm_vcode.value != ''){ animate = true; elm_msgv.innerHTML = ''; } if(elm.value.length<6){ animate = true; elm_msg.innerHTML = ''; }else{ animate = true; elm_msg.innerHTML = ''; } break; case 'vcode': var elm_code = document.getElementById('code'); var elm_vcode = document.getElementById('vcode'); //alert(elm_vcode.value+' ;;; '+elm_code.value); if(elm_vcode.value.length<6 || elm_vcode.value != elm_code.value){ animate = false; //elm_msg.innerHTML = ''; }else{ animate = true; elm_msg.innerHTML = ''; } break; case 'email': var at_ = elm.value.indexOf("@",1); var dot_ = elm.value.indexOf(".",at_ + 2); if(elm.value.length <= 6 || at_ == -1 || dot_ < 2 || dot_ == elm.value.length - 1){ animate = true; elm_msg.innerHTML = ''; }else{ animate = true; elm_msg.innerHTML = ''; } break; case 'f_complement': case 'tel': case 'complement': break; default: if(elm.value==''){ animate = true; elm_msg.innerHTML = ''; }else{ animate = true; elm_msg.innerHTML = ''; } break; } if(animate){ var myEffect = new Effect.Opacity(elm_msg, { duration: 2.0, transition: Effect.Transitions.pulse, from: 0, to: 1 }); } break; } } /* fonction d'effacement */ function effaceSi(obj,texte_origine){ if(obj.value == texte_origine) obj.value = ''; } /* fonction d'ajout */ function ajouteSi(obj,texte_origine){ if(obj.value == '') obj.value = texte_origine; } /* fonction a lancer apres le chargement */ function chargement_fini(){ if ( document.all ){ blink_show(); } compteur_js(); if(affiche_prd!=0){ Modalbox.show('produit-p-'+affiche_prd+'.html?MB', {title: 'Votre sélection', width: mb_width, height: mb_height}); } } function show_hide(element) { if(document.getElementById(element).style.display=='none') { $(element).appear(); return false; }else { $(element).fade(); return false; } } /* rend invisible un element par son id */ function AfficheId(id){ var elm = document.getElementById(id); elm.style.visibility = "visible"; elm.style.display = ""; } Position.GetWindowSize = function(w) { var width, height; w = w ? w : window; this.width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth); this.height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight); return this; } var dim = Position.GetWindowSize(); var mb_width; var mb_height; var mb_height_cnt; function resizetheMb(){ dim = Position.GetWindowSize(); mb_width = dim.width-30; if(mb_width>1050) mb_width=1050; mb_height = dim.height-10; mb_height_cnt = mb_height-100; } resizetheMb(); /** * Fonctions affichage manga et dvd * */ var url = "ajax_md.php"; function afficheRechGenre(idCat) { // recherche par genre o_options = new Object(); o_options = {method:'get', parameters:{genre: 1, idCat: idCat, params: Form.serialize($('formRechMD'))}, onComplete:afficherHTML}; var laRequete = new Ajax.Request(url, o_options); function afficherHTML(requete) { document.getElementById('contenu').innerHTML = requete.responseText; } } function progress() { document.getElementById('contenu').innerHTML = '
Chargement en cours...
'; } function showtip(e,message) { var x=0;var y=0;var m;var h;if(!e) var e=window.event;if(e.pageX||e.pageY){x=e.pageX;y=e.pageY;} else if(e.clientX||e.clientY){x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;} m=document.getElementById('mktipmsg'); if((y>10)&&(y<450)){m.style.top=y-4+"px";} else{m.style.top=y+4+"px";} var messageHeigth=(message.length/20)*10+25; if((e.clientY+messageHeigth)>screen.availHeight){m.style.top=y-messageHeigth+"px";} if(x