can you give me full js code? not just functions but I need see how you are calling functions
–
HiralOct 19 '13 at 12:37

actually I have a very big file in which I am implementing it. Let me tell you how my flow works? First of all I call hideBulbImages() in document.ready. Then I have a button say LightBulb on the click of which I call showBulbImages. Thats it. I have become successful in showing the bulb in sequential order after every second. The code I have posted and works fine. Now only I have to make it random. Also your var a = (parseInt(Math.random() * 4)); statement does not produce unique numbers and also produces 0 which I don't need. I need only from 1 to 4.
–
user1556433Oct 19 '13 at 12:43

no it produces random number. use this var a = (parseInt(Math.random() * 4))+1; to avoid 0.
–
HiralOct 19 '13 at 12:46

yes it produces random numbers from 1 to 4. But those are not unique. It produces 3 two times. Sometimes 1 three times. If one number is generated, that should not again be generated.
–
user1556433Oct 19 '13 at 13:08