//add a DOM 0 event listener  

document.onclick = handleClick;  

   
   

//act on the event  

 function handleClick(e){  

    if(!e) var e = window.event;  

    var target = e.target || e.srcElement;    

    if(target.className == 'accord-title'){  

        var activeInit = document.getElementsByTagName('img');  

        for(var i = 0; i < activeInit.length; i++){  

          if(activeInit[i].className == 'accord-content active'){  

                activeInit[i].className = 'accord-content';  

            }  

            if(target.nextSibling.nextSibling == activeInit[i]){  

                activeInit[i].className = 'accord-content active';  

            }  

        }  

           

}  

} 

