We're not going to write all your code for you. We will help you if you have questions, but so far all you seem to be doing is posting your requirements over and over. I posted some code that will help with what you want if you tweak it just a little, and traq and I have both offered bits of advice.
Your last post is still not a question, and I'm still unsure exactly what it is that you are asking for. If English is not easy for you, you could maybe try Google Translate to attempt to translate from your native language? It won't be perfect, but it might be better.