/*--------------------------*/ /* Category */ /*--------------------------*/ /** * toggle section defined by its id */ function toggleSection(id_section) { $(id_section).toggle(); } /** * toggle all sections except price and general */ function toggleAllSection() { var elements = $$('.presta_tree dd'); for( i=0; i < elements.length ; i++ ) { toggleSection( elements[i].id ); } } /*------------------------------*/ /* ChangeWorkingCultureHelper */ /*------------------------------*/ /** * Close all the WorkingCulture selector * * @param id_zone string the current workingCulture selector * @param culture the new selected culture * @return */ function toggleAllWorkingCulture(culture) { selectors = $$(".presta_workingCultureSelector dt a"); for(var i = 0; i < selectors.length ; i++) { selectors[i].innerHTML = culture; } $$("dd.working_culture_list").invoke("hide"); } /** * Default function for the helper who change the display in function of the working culture * * @param a_culture array all authorized culture * @param newCulture string the new selected culture * @return */ function changeWorkingCulture( a_culture, newCulture ) { for (var j = 0; j < a_culture.length; j++) { $$(".presta_pageContentByCulture[culture="+a_culture[j]+"]").each(function(el){ if (a_culture[j] != newCulture) { el.hide(); } else { el.show(); } }); } } /*--------------------------*/ /* Page */ /*--------------------------*/ //Switch content between truncat_text and complet_text function switchPageContentDisplay(id_zone) { $('truncate_text_'+id_zone).toggle(); $('complet_text_'+id_zone).toggle(); }