Could somone please explain to me(possibly in detail) possibly write a function that would have if statements inside that would only run depending on which event has occured. Example,

function test() {
if(Element.clicked) {
// executed code
}
if(Element.mouseOver) {
// executed code
}
if(Element.mouseout) {
// executed code
}
}

I know this isnt proper, I was just trying to get the point across. Hope you understand what I am trying to accomplish here.
If you cant use multiple "event captures" in one funtion then how would I capture ANY event in an if statement, in a function? Also, with just javascript, no JQuery. Thanks for the help