function changePic(subPic){ document.picture.src = subPic; } function clickPic(subPic){ window.open(subPic); } $(function(){ $("#subPic img").hover(function(){ $(this).css("border-color", "blue"); },function(){ $(this).css("border-color", "transparent"); }); });