Basically I want a right and down arrow to appear depending on whether a div appears.
If the header div is clicked, the subdiv's display toggles block or none.
At the same time id like the arror img to change accordingly.

This is my current function, it works fine

function toggle_visibility(cat'.$categoryId.') {
var e'.$categoryId.' = document.getElementById(cat'.$categoryId.');
if(e'.$categoryId.'.style.display == \'block\' || e'.$categoryId.'.style.display == \'\')
e'.$categoryId.'.style.display = \'none\';
e'.$categoryId.'.style.display = \'block\';

I've tried many times to add a script that'll change the src but no luck at all ..

The image name is simply arror$categoryId...
By the way, the reason for the '. .' etc is because this is printed via php .

This should be easy.. but I've never done it before and the posts ive found so far on the web haven't been helpful.

Thanks for any help guys!!!