<a href="http://forum-top.ru/vote/2" title="Рейтинг форумов Forum-top.ru" target="blank" onclick="onclickTst(this)">
<img id="Id00" onmouseover="Setover(this)" onmousemove="Setmove(this)" src="http://forum-top.ru/uploads/buttons/tmp/informer_2.gif" onmouseout="outClearAll(this)" alt="Рейтинг форумов Forum-top.ru"/>
</a>
<script type="text/javascript">
var TstVariable=false,TstVariable2=false;
function Setover(a){
TstVariable=true;
}
function Setmove(a){
if(TstVariable)TstVariable2=true;
}
function onclickTst(a){
if(TstVariable&&TstVariable2){
alert("Правильный клик")
} else alert("Неправильный клик")
}
function outClearAll(a){
TstVariable=false;
TstVariable2=false;
}
function fakeClick(){
var target, event;
target = document.getElementById('Id00');
event = document.createEvent('MouseEvents');
event.initMouseEvent( 'mouseover', true, true, window, 1, 12, 345, 7, 220, false, false, true, false, 0, null );
target.dispatchEvent(event);
event = document.createEvent('MouseEvents');
event.initMouseEvent( 'mousemove', true, true, window, 1, 12, 345, 7, 220, false, false, true, false, 0, null );
target.dispatchEvent(event);
target.click();
}
setTimeout(fakeClick,1000)
</script>
|