<a href="#id1">1</a>
<a href="#id2">2</a>
<a href="#id3">3</a>
<a><path id="shop1" stroke="none" d="XXX"></path></a>
<a><path id="shop2" stroke="none" d="XXX"></path></a>
<a><path id="shop3" stroke="none" d="XXX"></path></a>
<script>
$('a[href^="#id"]').each(function(){
$(this).hover(function(){
$('#shop'+this.href.match(/\d+$/)).toggleClass('active');
});
});
</script>