function myFunction(e) {
if (!e) var e = window.object;//legacy event object
if (e.preventDefault) e.preventDefault();//prevent firing in W3C model
return false; //exit event, no firing, listener must registered to anchor tag
}
var x = document.getElementsByTagName("A");
if (x.item(0).addEventListener) {
for (var i = 0, l = x.length; i < l; i++) {
x.item(i).addEventListener("click",myFunction,false);
}
}//W3C model
else if (x.item(0).attachEvent) {
for (var i = 0, l = x.length; i < l; i++) {
x.item(i).attachEvent("onclick",myFunction);
}
}// legacy browsers