f0rzik,
<script type="text/javascript">
var i = 0, arr = ["btn7", "btn7", "btn8"];
function Img(but) {
if (but == arr[i]) {
i++;
if (i == arr.length) { return alert("клик"); }
}
else { i = 0; }
}
window.onload = function () {
var com1=document.getElementById('btn7');
var com2=document.getElementById('btn8');
com1.onclick=com2.onclick = function() {
Img(this.id);
}
}
</script>
<input type="button" value="1" id=btn7>
<input type="button" value="2" id=btn8>