Hello and welcome Wiki,
First, just so you know, this:
digitalWrite (LED1, on ? HIGH : LOW);
Could be changed to this:
digitalWrite (LED1, on);
It's the same thing (but then I suggest renaming "int on" to "bool LED1_state" or something like that
Then, to solve your problem, study this code: https://github.com/shirriff/Arduino-IRremote/blob/master/examples/IRrelay/IRrelay.ino
And next time, start your own topic