// JavaScript Document function showSearchBasicSubmit() { var cat = $("#categories").val(); var cri = $("#critere").val(); if (cri=='') { $("#critere").css("border", "2px solid #ff0000").css("background-color", "#ff7e7e").focus(); return false; } else { if (cat=='velos') { window.location = 'velos_category_luc.php?category=velos&critereTexte='+cri; } if (cat=='pieces') { window.location = 'produits_luc.php?category=pieces&critereTexte='+cri; } if (cat=='accessoires') { window.location = 'produits_luc.php?category=accessoires&critereTexte='+cri; } if (cat=='vetements') { window.location = 'produits_luc.php?category=vetements&critereTexte='+cri; } if (cat=='liquidations') { window.location = 'liquidations_luc.php?category=liquidations&critereTexte='+cri; } return false; } } function subcat(catID) { new Ajax.Updater({ success: 'subCat' }, 'http://www.mathieuperformance.com/admin/ajax.php', { method: 'post', parameters: {CATID : catID, ACTION : "subcat_dropdown", STYLE : "width:230px;", SHOWEMPTY: '1', JS : " onChange=\"updateContent('subcat',this.value,0);\" "} }); } function resetPrice() { document.getElementById( "price" ).selectedIndex = 0; } function resetCat() { document.getElementById( "categoryID" ).selectedIndex = 0; document.getElementById( "subcategoryID" ).selectedIndex = 0; } function resetSubcat() { document.getElementById( "subcategoryID" ).selectedIndex = 0; } function resetBrand() { new Ajax.Updater({ success: 'brandID' }, 'http://www.mathieuperformance.com/admin/ajax_luc.php', { method: 'post', parameters: { TYPE: '0', ACTION : "updateBrands" } }); } function valbutton() { myOption = -1; for (i=document.recherche.critere.length-1; i > -1; i--) { if (document.recherche.critere[i].checked) { myOption = i; i = -1; } } return document.recherche.critere[myOption].value; } function updateContent(successDiv) { var critere = valbutton(); var categoryIndex = document.getElementById( "categoryID" ).selectedIndex; var categoryID = document.getElementById( "categoryID" ).options[categoryIndex].value; var subcategoryIndex = document.getElementById( "subcategoryID" ).selectedIndex; var subcategoryID = document.getElementById( "subcategoryID" ).options[subcategoryIndex].value; var brandIndex = document.getElementById( "brandID" ).selectedIndex; var brandID = document.getElementById( "brandID" ).options[brandIndex].value; var priceRangeIndex = document.getElementById( "price" ).selectedIndex; var priceRange = document.getElementById( "price" ).options[priceRangeIndex].value; var nbParPageIndex = document.getElementById( "nbParPage" ).selectedIndex; var nbParPage = document.getElementById( "nbParPage" ).options[nbParPageIndex].value; var ordreTriIndex = document.getElementById( "ordreTri" ).selectedIndex; var ordreTri = document.getElementById( "ordreTri" ).options[ordreTriIndex].value; var termes = document.getElementById( "termes" ).value; new Ajax.Updater({ success: successDiv }, 'http://www.mathieuperformance.com/admin/ajax_luc.php', { method: 'post', // ajouter argument parameters: {NBPARPAGE : nbParPage, CRITERE : critere, ORDRETRI : ordreTri, TERMES : termes, PRICERANGE : priceRange, SUBCATEGORYID : subcategoryID, CATEGORYID : categoryID, BRANDID : brandID, ACTION : "update_bike_content" } }); } function picture_update(div,picture,calling_div) { new Ajax.Updater({ success: div }, 'http://www.mathieuperformance.com/admin/ajax.php', { method: 'post', parameters: {DIV : div, PICTURE : picture, ACTION : "picture_update" } }); } function page_change(page) { new Ajax.Updater({ success: 'page_shifter' }, 'http://www.mathieuperformance.com/admin/ajax.php', { method: 'post', parameters: {PAGE : page, ACTION : "page_change" } }); updateContent('','',1); } function page_shifter(page) { new Ajax.Updater({ success: 'page_shifter' }, 'http://www.mathieuperformance.com/admin/ajax.php', { method: 'post', parameters: {PAGE : page, ACTION : "page_shifter" } }); } function calculate_page() { new Ajax.Updater({ success: 'page_shifter' }, 'http://www.mathieuperformance.com/admin/ajax.php', { method: 'post', parameters: { ACTION : "page_shifter" } }); } function toggleX(t) { if (document.getElementById('toggleDesc_' + t).style.display == 'none') { document.getElementById('toggleDesc_' + t).style.display = 'block'; document.getElementById('toggleImage_' + t).innerHTML = ''; } else { document.getElementById('toggleDesc_' + t).style.display = 'none'; document.getElementById('toggleImage_' + t).innerHTML = ''; } } function updateSubcat(categoryID) { new Ajax.Updater({ success: 'subcategoryID' }, 'http://www.mathieuperformance.com/admin/ajax_luc.php', { method: 'post', parameters: { ACTION : "updateSubcat", CATEGORYID: categoryID } }); } function updateBrands(subcategoryID, type) { var categoryIndex = document.getElementById( "categoryID" ).selectedIndex; var categoryID = document.getElementById( "categoryID" ).options[categoryIndex].value; new Ajax.Updater({ success: 'brandID' }, 'http://www.mathieuperformance.com/admin/ajax_luc.php', { method: 'post', parameters: { TYPE: categoryID, ACTION : "updateBrands", SUBCATEGORYID: subcategoryID } }); }