Передавайте в функцию текущий объект
<div onMouseOver="*!*selobj(this)*/!*" onMouseOut="*!*outobj(this)*/!*" id="first">
<div onClick="summ(220,1)">
<span class="name"> Товар1 </span><br>
<img src="images/stul1.jpg" name="stul1">
</div>
<form onChange="summ1(220)" name="count">
Ед. <input type="text" name="col1" size="3">
</form>
</div>
<div onMouseOver="*!*selobj(this)*/!*" onMouseOut="*!*outobj(this)*/!*" id="second">
<div onClick="summ(400,2);">
<span class="name">Товар2 </span> <br>
<img src="images/stul2.jpg" name="stul2">
</div>
<form onChange="summ1(400)" name="count2">
Ед. <input type="text" name="col2" size="3">
</form>
</div>
<div onMouseOver="*!*selobj(this)*/!*" onMouseOut="*!*outobj(this)*/!*" id="third">
<div onClick="summ(300,3)">
<span class="name"> Товар3 </span><br>
<img src="images/stul1.jpg" name="stul1">
</div>
<form onChange="summ1(300)" name="count3">
Ед. <input type="text" name="col3" size="3">
</form>
</div>
<div onMouseOver="*!*selobj(this)*/!*" onMouseOut="*!*outobj(this)*/!*" id="fourth">
<div onClick="summ(400,4);">
<span class="name">Товар2 </span> <br>
<img src="images/stul2.jpg" name="stul2">
</div>
<form onChange="summ1(400)" name="count4">
Ед. <input type="text" name="col4" size="3">
</form>
</div>
function selobj(obj) {
$(obj).css("border", "2px solid red");
}
function outobj(obj) {
$(obj).css("border", "0px solid red");
}