document.write("

My selection of images


"); var masel_encours = 0; function action_ma_selection(action, id){ if(masel_encours==0){ masel_encours = 1; new Ajax.Request('/_includes/bloc_colonne/que_faire.php', { parameters: '&id='+id+'&action='+action, method: 'get', onFailure : function(transport) { masel_encours = 0; }, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var ret = json[0]; switch(ret.action){ case 'add': add_ma_selection(ret.id, ret.response); break; case 'cocher': case 'add_album': ret.tab_coche.each(function(e){add_ma_selection(e.id, e.response);}); break; case 'add_favoris': alert("Images have been added to your favorite !"); break; case 'del': del_ma_selection(ret.id, ret.nb); break; case 'decocher': ret.tab_coche.each(function(e){del_ma_selection(e.id, ret.nb);}); break; case 'vider': vider_ma_selection('del'); break; case 'del_img': vider_ma_selection('del_img'); break; } masel_encours = 0; } }); } else{ if($('image'+id)) { if($('image'+id).checked) $('image'+id).checked = false; else $('image'+id).checked = true; } } } function add_ma_selection(id, contenu){ $('maselvide').hide(); $('maselpleine').show(); Element.insert($('list_li_ma_selection'), contenu); try{ $('li_img_'+id).addClassName('on'); $('image'+id).checked = true; }catch(e){} } function del_ma_selection(id, nb){ $('li_ma_selection'+id).remove(); try{ $('li_img_'+id).removeClassName('on'); $('image'+id).checked = false; }catch(e){} if(nb==0){ $('maselvide').show(); $('maselpleine').hide(); } } function vider_ma_selection(del_mode){ $$('li.mesimgliste').each(function(e){ try{ var id_s = e.id.substring(7); if(del_mode=='del_img' && $('image'+id_s).checked) e.remove(); else{ e.removeClassName('on'); $('image'+id_s).checked = false; } }catch(e){} }); $('list_li_ma_selection').update(''); $('maselvide').show(); $('maselpleine').hide(); } function action_cocher_ma_selection(classe, action, div_couleur, class_couleur){ var tab = document.getElementsByTagName("input"); var liste_id = new Array(); for(i=0;i 0) { liste_id.push(tab_e.value); } else if(action=='decocher' && tab_e.hasClassName(classe) && tab_e.checked==true && tab_e.value.length > 0) { liste_id.push(tab_e.value); } } action_ma_selection(action, liste_id.join(',')); } function commander_tirage_ma_selection(){ var ids = ""; $$('#list_li_ma_selection li').each(function(e){ ids += e.id.substring(15)+'|'; }); document.location.href = '/go/photo-printing?add_panier='+ids; }