﻿function prepareLinkButtonClicks()  
{  
    $$('a.linkButton').each(function(tag) {  
        if (tag && typeof(tag.click == 'undefined')) {  
            tag.click = function() {   
                var result = true;  
                if (tag.onclick) result = tag.onclick();  
                if (typeof(result) == 'undefined' || result) {  
                    eval(tag.href);  
                }  
            }  
        }  
    });  
}  
window.addEvent( 'load', prepareLinkButtonClicks ); /* Use mootools instead of prototype version which is: Event.observe(window, 'load', prepareLinkButtonClicks); */

//to use this, simply add the class 'linkButton' to the link